aws_ssm_patch_baselines Resource
Use the aws_ssm_patch_baseline
InSpec audit resource to test properties of multiple AWS Systems Manager (SSM) patch baselines.
The AWS::SSM::PatchBaseline
resource defines the basic information for an AWS Systems Manager patch baseline. A patch baseline defines which patches are approved for installation on your instances.
For additional information, including details on parameters and properties, see the AWS documentation on AWS SSM patch baseline.
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 baseline exists:
describe aws_ssm_patch_baselines do
it { should exist }
end
Parameters
This resource does not expect any required parameters.
Properties
baseline_ids
- The ID of the patch baseline.
Field:
baseline_id
names
- The name of the patch baseline.
Field:
name
operating_systems
- Returns the operating system specified for the patch baseline.
Field:
operating_system
baseline_descriptions
- A description of the patch baseline.
Field:
baseline_description
default_baselines
- Whether this is the default baseline.
Field:
default_baseline
Examples
Ensure a baseline ID is available.
describe aws_ssm_patch_baselines do
its('baseline_ids') { should include 'BASELINE_ID' }
end
Ensure a baseline name is present.
describe aws_ssm_patch_baselines do
its('baseline_names') { should include 'BASELINE_NAME' }
end
Ensure a patch baseline has the WINDOWS
operating system.
describe aws_ssm_patch_baselines do
its('operating_systems') { should include 'WINDOWS' }
end
Ensure a baseline description is present.
describe aws_ssm_patch_baselines do
its('baseline_descriptions') { should include 'BASELINE_DESCRIPTION' }
end
Matchers
For a full list of available matchers, see our Universal Matchers page.The controls will pass if the describe
method returns at least one result.
exist
Use should
to test that the entity exists.
describe aws_ssm_patch_baselines do
it { should exist }
end
Use should_not
to test the entity does not exist.
describe aws_ssm_patch_baselines do
it { should_not exist }
end
be_available
Use should
to check if the entity is available.
describe aws_ssm_patch_baselines do
it { should be_available }
end
AWS Permissions
Your Principal will need the SSM:Client:DescribePatchBaselinesResult
action with Effect
set to Allow
.