You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a function where I loop through users, groups, roles, and policies, and run the analyze_policy_string(policy_document, filepath=arn). I pass it the arn of the policy being assessed. In maybe 20% of the policies, the findings returned appear all to be valid, but in some of the findings of a given policy, it will reports some findings with the ARN I passed as filepath, while other findings for same policy, it reports a different ARN for filepath. For now, in my script, I'm doing a check and if filepath returned in finding is not the same as ARN I passed in as filepath, I use the ARN. Please take a look at the code to determine where is filepath being set incorrectly the ARN of a different role/policy for some findings, while actually using the ARN I passed as filepath correctly in other findings.
The text was updated successfully, but these errors were encountered:
to test loop through user, group, role, and policies in account, using the analyze_policy_string function. Then run code similar to below, and you should see the inconsistencies, and maybe it helps you find where in the code something is going wrong.
if finding.location.get("filepath") == arn:
filepath = finding.location.get("filepath")
if not location.get("filepath") == arn:
print(f"WRONG FILEPATH: {finding.location.get('filepath')}")
filepath = arn
print(f"FIXED FILEPATH: {filepath}")
I have a function where I loop through users, groups, roles, and policies, and run the analyze_policy_string(policy_document, filepath=arn). I pass it the arn of the policy being assessed. In maybe 20% of the policies, the findings returned appear all to be valid, but in some of the findings of a given policy, it will reports some findings with the ARN I passed as filepath, while other findings for same policy, it reports a different ARN for filepath. For now, in my script, I'm doing a check and if filepath returned in finding is not the same as ARN I passed in as filepath, I use the ARN. Please take a look at the code to determine where is filepath being set incorrectly the ARN of a different role/policy for some findings, while actually using the ARN I passed as filepath correctly in other findings.
The text was updated successfully, but these errors were encountered: