aws_iam_server_certificates Resource
Use the aws_iam_server_certificates
InSpec audit resource to test the properties of all IAM server certificates.
This resource retrieves information about the server certificate, including the server certificate’s path, GUID, ARN, and role.
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 a server certificate name exists.
describe aws_iam_server_certificates do
it { should exist }
end
For additional information, see the AWS documentation on IAM Instance Profile.
Properties
paths
- The path to the server certificate.
server_certificate_names
- The name that identifies the server certificate.
server_certificate_ids
- The stable and unique string identifying the server certificate.
arns
- The Amazon Resource Name (ARN) specifying the server certificate.
upload_date
- The date when the server certificate is uploaded.
expiration_date
- The date on which the certificate is set to expire.
Examples
Ensure a server certificate name is available.
describe aws_iam_server_certificates do
its('server_certificate_name') { should include 'PROFILE_NAME' }
end
Ensure that an arn is available.
describe aws_iam_server_certificates do
its('arn') { should include 'INSTANCE_PROFILE_NAME_ARN' }
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_iam_server_certificates do
it { should exist }
end
Use should_not
to test the entity does not exist.
describe aws_iam_server_certificates do
it { should_not exist }
end
be_available
Use should
to check if the server certificate is available.
describe aws_iam_server_certificates do
it { should be_available }
end
AWS Permissions
Your Principal will need the IAM:Client:ListServerCertificateResponse
action with Effect
set to Allow
.