Skip to content
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

Merged
5 commits merged into from
Oct 15, 2019
Merged

Conversation

mcahill7
Copy link
Contributor

PR for Look for AdministratorAccess managed policy in IAM Role #75
#75

@mcahill7 mcahill7 assigned ghost Oct 15, 2019
end

def rule_id
'W25'
Copy link

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|
Copy link

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" ]
Copy link

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.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nits

@mcahill7 mcahill7 requested a review from a user October 15, 2019 17:40
@ghost ghost merged commit 02e487c into master Oct 15, 2019
@mcahill7 mcahill7 deleted the iam_administrator_access_role branch October 15, 2019 18:01
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant