Skip to main content

aws_cloudfront_public_keys Resource

Use the aws_cloudfront_public_keys InSpec audit resource to test properties of multiple AWS CloudFront public keys.

The AWS::CloudFront::PublicKey resource type creates a public key that you can use with signed URLs and signed cookies, or with field-level encryption.

For additional information, including details on parameters and properties, see the AWS documentation on AWS CloudFront public key..

Install

This resource is available in the Chef InSpec AWS resource pack.

For information on configuring your AWS environment for Chef InSpec and creating an InSpec profile that uses the InSpec AWS resource pack, see the Chef InSpec documentation on the AWS cloud platform.

Syntax

Ensure that the public key exists.

describe aws_cloudfront_public_keys do
  it { should exist }
end

Parameters

This resource does not require any parameters.

Properties

ids
The identifier of the public key.

Field: id

created_times
The date and time when the public key was uploaded.

Field: created_time

caller_references
A string included in the request to help make sure that the request can’t be replayed.

Field: caller_reference

names
A name to help identify the public key.

Field: name

encoded_keys
The public key that you can use with signed URLs and signed cookies , or with field-level encryption.

Field: encoded_key

comments
A comment to describe the public key. The comment cannot be longer than 128 characters.

Field: comment

Examples

Ensure a public key ID is available.

describe aws_cloudfront_public_keys do
  its('ids') { should include 'ID' }
end

Ensure a public key name is available.

describe aws_cloudfront_public_keys do
    its('names') { should include 'PUBLIC_KEY_NAME' }
end

Matchers

For a full list of available matchers, see our Universal Matchers page.

The controls will pass if the list method returns at least one result.

exist

Use should to test that the entity exists.

describe aws_cloudfront_public_keys do
  it { should exist }
end

Use should_not to test the entity does not exist.

describe aws_cloudfront_public_keys do
  it { should_not exist }
end

AWS Permissions

Your Principal will need the CloudFront:Client:ListPublicKeysResult action with Effect set to Allow.

Edit this page on GitHub

Thank you for your feedback!

×