-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Iam AdministratorAccess managed policy rule #293
Conversation
end | ||
|
||
def rule_id | ||
'W25' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W25 used to be something i forgot... probably something with security groups that got collapsed. can you bump this to something higher? W38 maybe?
|
||
def audit_impl(cfn_model) | ||
violating_roles = cfn_model.resources_by_type('AWS::IAM::Role').select do |role| | ||
violating_policies = role.managedPolicyArns.select do |policy| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is fine, but you could just do a "find" instead - quit after the first one since it only takes one to violate
"Action": ["sts:AssumeRole"] | ||
} ] | ||
}, | ||
"ManagedPolicyArns" : [ "arn:aws:iam::aws:policy/AdministratorAccess" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is likely good enough given how much other testing there is against IAM roles, but generally i would suggest also including a "positive" test whereby your prove the rule/violation won't be triggered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nits
PR for Look for AdministratorAccess managed policy in IAM Role #75
#75