nccgroup / PMapper

A tool for quickly evaluating IAM permissions in AWS.
GNU Affero General Public License v3.0
1.37k stars 169 forks source link

iam:ListAccessKeys denied exception in gathering.py #132

Open j0eblow opened 1 year ago

j0eblow commented 1 year ago

Describe the bug gathering.py does not handle AccessDenied (e.g. iam:ListAccessKeys is explicitly denied). Here is my quick fix for it (I ran black on it as well).

To Reproduce Steps to reproduce the behavior, please include information on suspected users/roles that are the source of the issue when possible:

  1. Create an IAM role with iam:ListAccessKeys denied (or have an SCP that explicitly denies it).
  2. Run pmapper graph create.
  3. See error

Expected behavior The function should handle exceptions. Unless it breaks something.