aws_cloudfront_origin_access_identities Resource
Use the aws_cloudfront_origin_access_identities
InSpec audit resource to test properties of multiple AWS CloudFront origin access identities.
An origin access identity is a special CloudFront user that you can associate with Amazon S3 origins, so that you can secure all or just some of your Amazon S3 content.
For additional information, including details on parameters and properties, see the AWS documentation on AWS CloudFront CloudFrontOriginAccessIdentity..
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 identity exists.
describe aws_cloudfront_origin_access_identities do
it { should exist }
end
Parameters
This resource does not require any parameters.
Properties
ids
- The ID for the origin access identity.
Field:
id
s3_canonical_user_ids
- The Amazon S3 canonical user ID for the origin access identity, used when giving the origin access identity read permission to an object in Amazon S3.
Field:
s3_canonical_user_id
caller_references
- A unique value (for example, a date-time stamp) that ensures that the request can’t be replayed.
Field:
caller_reference
comments
- A comment to describe the origin access identity.
Field:
comment
Examples
Test that an ID is available.
describe aws_cloudfront_origin_access_identities do
its('ids') { should include 'ID' }
end
Test that an s3 canonical user ID is available.
describe aws_cloudfront_origin_access_identities do
its('s3_canonical_user_ids') { should include 'S3_CANONICAL_USER_ID' }
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_origin_access_identities do
it { should exist }
end
Use should_not
to test the entity does not exist.
describe aws_cloudfront_origin_access_identities do
it { should_not exist }
end
AWS Permissions
Your Principal will need the CloudFront:Client:ListCloudFrontOriginAccessIdentitiesResult
action with Effect
set to Allow
.