-
Notifications
You must be signed in to change notification settings - Fork 179
Optimization: GetAccountAuthorizationDetails #26
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
Comments
I hadn't noticed this API before. It definitely would knock out a bunch of the work that goes into the graphing portion. The only concern I have is scaling, but the API hints that pagination is available. |
Yeah, I had just been using the CLI before. Trying it with the API it really was 13 pages. Still not bad for 600 roles and associated policies. Not the most elegant, but easy to reason about. All these accumulate independently over the pages. def do_pull():
# temporary accumulator variables
UserDetailList = []
GroupDetailList = []
RoleDetailList = []
Policies = []
for res in iam.get_paginator('get_account_authorization_details').paginate():
UserDetailList.extend(res['UserDetailList'])
GroupDetailList.extend(res['GroupDetailList'])
RoleDetailList.extend(res['RoleDetailList'])
Policies.extend(res['Policies'])
return {
'UserDetailList': UserDetailList,
'GroupDetailList': GroupDetailList,
'RoleDetailList': RoleDetailList,
'Policies': Policies,
} |
Aiming to fix this with #36 and deploy the change in the next micro version. |
Looping back around here, I think I'm gonna aim to implement this now in v1.1.0 to address #41 since the |
Completed in 5828a87 for eventual release of v1.1.0. |
…ser_role Added article on unauthenticated iam enumeration
From AWS blog:
Somehow I missed this for a long time, but it has made my code much easier. I don't have to paginate through getting roles and connected inline policies, just do a single 10 second API call that returns 3MB of JSON. I wonder if it would streamline things enough such that maybe enhancements like #25 would be less necessary.
It even includes instance profiles so a straight listing of ec2 describe-instances could be linked up without api call pivots. A similar situation would work for Lambda with list-functions.
The text was updated successfully, but these errors were encountered: