Class: RDSInstanceMasterUsernameRule
- Defined in:
- lib/cfn-nag/custom_rules/RDSInstanceMasterUsernameRule.rb
Overview
cfn_nag rules related to RDS Instance master username
Instance Method Summary collapse
-
#audit_impl(cfn_model) ⇒ Object
Warning: if somebody applies parameter values via JSON, this will compare that.…
- #rule_id ⇒ Object
- #rule_text ⇒ Object
- #rule_type ⇒ Object
Methods inherited from BaseRule
Instance Method Details
#audit_impl(cfn_model) ⇒ Object
Warning: if somebody applies parameter values via JSON, this will compare that.… probably shouldn’t be doing that though - if it’s NoEcho there’s a good reason bother checking synthesized_value? that would be the indicator.….
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/cfn-nag/custom_rules/RDSInstanceMasterUsernameRule.rb', line 24 def audit_impl(cfn_model) violating_rdsinstances = cfn_model.resources_by_type('AWS::RDS::DBInstance') .select do |instance| if instance.masterUsername.nil? false else !references_no_echo_parameter_without_default?(cfn_model, instance.masterUsername) end end violating_rdsinstances.map(&:logical_resource_id) end |
#rule_id ⇒ Object
15 16 17 |
# File 'lib/cfn-nag/custom_rules/RDSInstanceMasterUsernameRule.rb', line 15 def rule_id 'F24' end |
#rule_text ⇒ Object
6 7 8 9 |
# File 'lib/cfn-nag/custom_rules/RDSInstanceMasterUsernameRule.rb', line 6 def rule_text 'RDS instance master username must be Ref to NoEcho Parameter. ' \ 'Default credentials are not recommended' end |
#rule_type ⇒ Object
11 12 13 |
# File 'lib/cfn-nag/custom_rules/RDSInstanceMasterUsernameRule.rb', line 11 def rule_type Violation::FAILING_VIOLATION end |