aws_waf_rules resource
Use the aws_waf_rules
Chef InSpec audit resource to test the properties of multiple AWS WAF (web application firewall) rules.
For additional information, including details on parameters and properties, see the AWS documentation on the AWS::WAF::Rule
resource type.
Syntax
Ensure that a WAF rule exists.
describe aws_waf_rules do
it { should exist }
end
Parameters
No required parameters.
Properties
rule_ids
- The unique identifier for the rule.
Field:
rule_id
names
- A friendly name or description of the rule.
Field:
name
Examples
Ensure a rule is available by rule ID:
describe aws_waf_rules do
its('rule_ids') { should include 'RULE_ID' }
end
Ensure a rule is available by name:
describe aws_waf_rules do
its('names') { should include 'RULE_NAMES' }
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_waf_rules do
it { should exist }
end
Use should_not
to test the entity does not exist.
describe aws_waf_rules do
it { should_not exist }
end
be_available
Use should
to check if the entity is available.
describe aws_waf_rules do
it { should be_available }
end
AWS Permissions
Your AWS principal will need the WAF:Client:ListRulesResponse
action with Effect
set to Allow
.