8000 handle users grouped into paths by buzzdeee · Pull Request #37 · nccgroup/PMapper · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

handle users grouped into paths #37

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions principalmapper/graphing/gathering.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ def get_unfilled_nodes(iamclient, output: io.StringIO = os.devnull, debug=False)
if arns.get_resource(node.arn).startswith('user/'):
# Grab access-key count and update node
user_name = arns.get_resource(node.arn)[5:]
if '/' in user_name:
user_name = user_name.split('/')[-1]
dprint(debug, 'removed path from username {}'.format(user_name))
access_keys_data = iamclient.list_access_keys(UserName=user_name)
node.access_keys = len(access_keys_data['AccessKeyMetadata'])
dprint(debug, 'Access Key Count for {}: {}'.format(user_name, len(access_keys_data['AccessKeyMetadata'])))
Expand Down Expand Up @@ -162,6 +165,9 @@ def get_unfilled_groups(iamclient, nodes: List[Node], output: io.StringIO = os.d
continue # skip when not an IAM user
dprint(debug, 'finding groups for user {}'.format(node.arn))
user_name = arns.get_resource(node.arn)[5:]
if '/' in user_name:
user_name = user_name.split('/')[-1]
dprint(debug, 'removed path from username {}'.format(user_name))
group_list = iamclient.list_groups_for_user(UserName=user_name)
for group in group_list['Groups']:
for group_obj in result:
Expand Down
0