Skip to content

fix: skip parse_document when policy fetch fails in iam__enum_permissions#504

Open
raajheshkannaa wants to merge 1 commit intoRhinoSecurityLabs:masterfrom
raajheshkannaa:fix/iam-enum-permissions-unbound-document
Open

fix: skip parse_document when policy fetch fails in iam__enum_permissions#504
raajheshkannaa wants to merge 1 commit intoRhinoSecurityLabs:masterfrom
raajheshkannaa:fix/iam-enum-permissions-unbound-document

Conversation

@raajheshkannaa
Copy link

Summary

  • Fixes UnboundLocalError: cannot access local variable 'document' when get_role_policy, get_group_policy, or get_user_policy fails with ClientError
  • The error handlers catch the exception and set PermissionsConfirmed = False, but execution falls through to parse_document(document, ...) where document was never assigned
  • Adds continue in three error handlers so the loop skips to the next policy instead of crashing

Fixes #445

…tch fails

When get_role_policy, get_group_policy, or get_user_policy throws
ClientError, the document variable is never assigned but parse_document
is still called with it, causing an UnboundLocalError. Add continue to
skip parsing when the API call fails.

Fixes RhinoSecurityLabs#445
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.

Bug: run iam__enum_permissions fails with UnboundLocalError

1 participant