Class: UserMissingGroupRule

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

Instance Method Summary collapse

Methods inherited from BaseRule

#audit

Instance Method Details

#audit_impl(cfn_model) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/cfn-nag/custom_rules/UserMissingGroupRule.rb', line 17

def audit_impl(cfn_model)
  logical_resource_ids = []
  cfn_model.iam_users.each do |iam_user|
    logical_resource_ids << iam_user.logical_resource_id if iam_user.group_names.empty?
  end

  logical_resource_ids
end

#rule_idObject



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

def rule_id
  'F2000'
end

#rule_textObject



5
6
7
# File 'lib/cfn-nag/custom_rules/UserMissingGroupRule.rb', line 5

def rule_text
  'User is not assigned to a group'
end

#rule_typeObject



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

def rule_type
  Violation::FAILING_VIOLATION
end