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

report command - auditing accounts - ARN KeyError #622

Closed
maestretti opened this issue Dec 6, 2019 · 2 comments
Closed

report command - auditing accounts - ARN KeyError #622

maestretti opened this issue Dec 6, 2019 · 2 comments

Comments

@maestretti
Copy link
Contributor

maestretti commented Dec 6, 2019

When I ran report I got a few dozen of these errors:

* Auditing accounts
WARNING:policyuniverse:ARN Could not parse [AID*******************CS].
WARNING:policyuniverse:Auditor could not parse ARN AID********************CS.

Then the report had a critical finding for audit error which detailed as:

"exception": "'Arn'",
    "traceback": "Traceback (most recent call last):\n  File \"/cloudmapper/shared/audit.py\", line 1076, in audit\n    audit_iam(findings, region)\n  File \"/cloudmapper/shared/audit.py\", line 210, in audit_iam\n    find_admins_in_account(region, findings)\n  File \"/cloudmapper/shared/iam_audit.py\", line 276, in find_admins_in_account\n    policy[\"Arn\"],\nKeyError: 'Arn'\n"

Which flags this line:

policy["Arn"],

I think the error is that the ARN is at the next level of JSON up. When policy is defined here:

for policy in role["RolePolicyList"]:

So line 276 should be role['Arn'] and I think the errors are related but not sure.

@mdavis332
Copy link

Nice, thanks @maestretti . If I change

policy["Arn"],
from policy to role

and do the same for

policy["Arn"],

Then things like find_admins start working.

@kbroughton
Copy link
Contributor

I can confirm the two changes of mdavi332 fixes the find_admins error.

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

No branches or pull requests

3 participants