Class: EC2NetworkAclEntryOverlappingPortsRule
- Defined in:
- lib/cfn-nag/custom_rules/EC2NetworkAclEntryOverlappingPortsRule.rb
Instance Method Summary collapse
Methods inherited from BaseRule
Instance Method Details
#audit_impl(cfn_model) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/cfn-nag/custom_rules/EC2NetworkAclEntryOverlappingPortsRule.rb', line 20 def audit_impl(cfn_model) nacl_entries = cfn_model.resources_by_type('AWS::EC2::NetworkAclEntry') # Select nacl entries that can be evaluated nacl_entries.select! do |nacl_entry| tcp_or_udp_protocol?(nacl_entry) && valid_ports?(nacl_entry) end violating_nacl_entries = [] # Group entries by nacl id, ip type, and egress/ingress grouped_nacl_entries = group_nacl_entries(nacl_entries) grouped_nacl_entries.each do |grouping| violating_nacl_entries += overlapping_port_entries(grouping) end violating_nacl_entries.map(&:logical_resource_id) end |
#rule_id ⇒ Object
16 17 18 |
# File 'lib/cfn-nag/custom_rules/EC2NetworkAclEntryOverlappingPortsRule.rb', line 16 def rule_id 'W72' end |
#rule_text ⇒ Object
8 9 10 |
# File 'lib/cfn-nag/custom_rules/EC2NetworkAclEntryOverlappingPortsRule.rb', line 8 def rule_text 'NetworkACL Entries are reusing or overlapping ports which may create ineffective rules.' end |