Comments (3)
For the moment, I'm working around the issue. In principalmapper/graphing/gathering.py
, I replaced
for p in u['AttachedManagedPolicies']:
user_policies.append(_get_policy_by_arn_or_raise(p['PolicyArn'], result['policies']))
with
for p in u['AttachedManagedPolicies']:
try:
user_policies.append(_get_policy_by_arn_or_raise(p['PolicyArn'], result['policies']))
except ValueError as e:
logger.warning('Unable to retrieve attached Policy {} for User {}.'.format(p['PolicyArn'], u['Arn']))
and
for p in r['AttachedManagedPolicies']:
role_policies.append(_get_policy_by_arn_or_raise(p['PolicyArn'], result['policies']))
with
for p in r['AttachedManagedPolicies']:
try:
role_policies.append(_get_policy_by_arn_or_raise(p['PolicyArn'], result['policies']))
except ValueError as e:
logger.warning('Unable to retrieve attached Policy {} for Role {}.'.format(p['PolicyArn'], r['Arn']))
from pmapper.
The same issue is present for the deprecated policy arn:aws:iam::aws:policy/service-role/AWSConfigRole
.
https://aws.amazon.com/blogs/mt/service-notice-upcoming-changes-required-for-aws-config/
2023-10-05 16:47:12-0400 | Sorting users, roles, groups, policies, and their relationships.
Traceback (most recent call last):
File "/home/k25044/pmapper/bin/pmapper", line 8, in <module>
sys.exit(main())
File "/home/k25044/pmapper/lib/python3.10/site-packages/principalmapper/__main__.py", line 145, in main
return graph_cli.process_arguments(parsed_args)
File "/home/k25044/pmapper/lib/python3.10/site-packages/principalmapper/graphing/graph_cli.py", line 179, in process_arguments
graph = graph_actions.create_new_graph(session, service_list, parsed_args.include_regions,
File "/home/k25044/pmapper/lib/python3.10/site-packages/principalmapper/graphing/graph_actions.py", line 39, in create_new_graph
return gathering.create_graph(session, service_list, region_allow_list, region_deny_list, scps, client_args_map)
File "/home/k25044/pmapper/lib/python3.10/site-packages/principalmapper/graphing/gathering.py", line 75, in create_graph
results = get_nodes_groups_and_policies(iamclient)
File "/home/k25044/pmapper/lib/python3.10/site-packages/principalmapper/graphing/gathering.py", line 226, in get_nodes_groups_and_policies
role_policies.append(_get_policy_by_arn_or_raise(p['PolicyArn'], result['policies']))
File "/home/k25044/pmapper/lib/python3.10/site-packages/principalmapper/graphing/gathering.py", line 1005, in _get_policy_by_arn_or_raise
raise ValueError('Could not locate policy {}.'.format(arn))
ValueError: Could not locate policy arn:aws:iam::aws:policy/service-role/AWSConfigRole.
from pmapper.
Related: nccgroup/ScoutSuite#1573
from pmapper.
Related Issues (20)
- PMapper 1.1.5 builds edges that include role/AWSServiceRoleForSupport when performing authorization checks HOT 10
- Terraform Plans HOT 2
- Graph Deletion HOT 1
- Local user who can assume an admin role not in graph HOT 6
- Stuck at Generating Edges based on lambda data HOT 2
- MFA requirements in roles can lead to misleading results
- can_privesc() method only returns one edge_list ?
- Traceback when doing connected query for role that does not exist
- FileNotFoundError in graph_cli
- Exception When Policy is Only Used as Permission Boundary HOT 1
- Permission boundaries not considered when querying
- Python 3.10 fails to run HOT 1
- Does not run in 3.11 due to mapping import error HOT 1
- iam:ListAccessKeys denied exception in gathering.py
- Stack trace on incorrect PMAPPER_STORAGE environment variable
- Stack trace on missing credentials
- Performance issues scanning large accounts HOT 8
- AWS Policy with minimal permissions
- Collections Module issue in Python 3.10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pmapper.