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.
Installation
This resource is available in the Chef InSpec AWS resource pack.
See the Chef InSpec documentation on cloud platforms for information on configuring your AWS environment for InSpec and creating an InSpec profile that uses the InSpec AWS resource pack.
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
This InSpec audit resource has the following special matchers. For a full list of available matchers, please visit 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
.
Was this page helpful?