Class: WafWebAclDefaultActionRule

Inherits:
BaseRule
  • Object
show all
Defined in:
lib/cfn-nag/custom_rules/WafWebAclDefaultActionRule.rb

Instance Method Summary collapse

Methods inherited from BaseRule

#audit

Instance Method Details

#audit_impl(cfn_model) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/cfn-nag/custom_rules/WafWebAclDefaultActionRule.rb', line 28

def audit_impl(cfn_model)
  violating_web_acls = cfn_model.resources_by_type('AWS::WAF::WebACL').select do |web_acl|
    web_acl.defaultAction['Type'] == 'ALLOW'
  end

  violating_web_acls.map(&:logical_resource_id)
end

#rule_idObject



24
25
26
# File 'lib/cfn-nag/custom_rules/WafWebAclDefaultActionRule.rb', line 24

def rule_id
  'F665'
end

#rule_textObject



16
17
18
# File 'lib/cfn-nag/custom_rules/WafWebAclDefaultActionRule.rb', line 16

def rule_text
  'WebAcl DefaultAction should not be ALLOW'
end

#rule_typeObject



20
21
22
# File 'lib/cfn-nag/custom_rules/WafWebAclDefaultActionRule.rb', line 20

def rule_type
  Violation::FAILING_VIOLATION
end