Class: SubPropertyWithListPasswordBaseRule

Inherits:
BaseRule show all
Defined in:
lib/cfn-nag/custom_rules/sub_property_with_list_password_base_rule.rb

Instance Method Summary collapse

Methods inherited from BaseRule

#audit

Instance Method Details

#audit_impl(cfn_model) ⇒ Object


19
20
21
22
23
24
25
26
27
28
29
# File 'lib/cfn-nag/custom_rules/sub_property_with_list_password_base_rule.rb', line 19

def audit_impl(cfn_model)
  resources = cfn_model.resources_by_type(resource_type)

  violating_resources = resources.select do |resource|
    resource_with_insecure_subproperty_within_list_property?(
      cfn_model, resource, password_property, sub_property_name
    )
  end

  violating_resources.map(&:logical_resource_id)
end

#password_propertyObject


13
14
15
# File 'lib/cfn-nag/custom_rules/sub_property_with_list_password_base_rule.rb', line 13

def password_property
  raise 'must implement in subclass'
end

#resource_typeObject


9
10
11
# File 'lib/cfn-nag/custom_rules/sub_property_with_list_password_base_rule.rb', line 9

def resource_type
  raise 'must implement in subclass'
end

#sub_property_nameObject


17
# File 'lib/cfn-nag/custom_rules/sub_property_with_list_password_base_rule.rb', line 17

def sub_property_name; end