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

Traceback when doing connected query for role that does not exist #118

Open
sethsec opened this issue Jul 26, 2022 · 0 comments
Open

Traceback when doing connected query for role that does not exist #118

sethsec opened this issue Jul 26, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@sethsec
Copy link

sethsec commented Jul 26, 2022

Describe the bug
Traceback when doing connected query for role that does not exist

To Reproduce
Steps to reproduce the behavior, please include information on suspected users/roles that are the source of the issue when possible:
❯ pmapper --profile test-terraform query 'preset connected role/does-not-exist *'

Traceback:

Traceback (most recent call last):
  File "/opt/homebrew/bin/pmapper", line 8, in <module>
    sys.exit(main())
  File "/opt/homebrew/lib/python3.9/site-packages/principalmapper/__main__.py", line 149, in main
    return query_cli.process_arguments(parsed_args)
  File "/opt/homebrew/lib/python3.9/site-packages/principalmapper/querying/query_cli.py", line 123, in process_arguments
    query_actions.query_response(
  File "/opt/homebrew/lib/python3.9/site-packages/principalmapper/querying/query_actions.py", line 137, in query_response
    handle_preset(graph, query, skip_admins)
  File "/opt/homebrew/lib/python3.9/site-packages/principalmapper/querying/query_actions.py", line 193, in handle_preset
    connected.handle_preset_query(graph, tokens, skip_admins)
  File "/opt/homebrew/lib/python3.9/site-packages/principalmapper/querying/presets/connected.py", line 43, in handle_preset_query
    print_connected_results(graph, source_nodes, dest_nodes, skip_admins)
  File "/opt/homebrew/lib/python3.9/site-packages/principalmapper/querying/presets/connected.py", line 53, in print_connected_results
    connection_result, path = is_connected(graph, snode, dnode)
  File "/opt/homebrew/lib/python3.9/site-packages/principalmapper/querying/presets/connected.py", line 82, in is_connected
    edge_lists = get_search_list(graph, source_node)
  File "/opt/homebrew/lib/python3.9/site-packages/principalmapper/querying/query_utils.py", line 40, in get_search_list
    if node.is_admin:
AttributeError: 'NoneType' object has no attribute 'is_admin'

Expected behavior
Should handle error gracefully. maybe telling me the user does not exist?

Version: principalmapper: stable 1.1.5 (bottled) (brew)

@sethsec sethsec added the bug Something isn't working label Jul 26, 2022
wdahlenburg pushed a commit to wdahlenburg/PMapper that referenced this issue Sep 5, 2022
…soler

Revert: Removed permissions needed for AWS Consoler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant