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

Weboftrust fails if there are no SAML providerws #918

Open
gad-imageinsight opened this issue Mar 24, 2022 · 0 comments
Open

Weboftrust fails if there are no SAML providerws #918

gad-imageinsight opened this issue Mar 24, 2022 · 0 comments

Comments

@gad-imageinsight
Copy link

Note the Network Visualization functionality (command prepare) is no longer maintained.

Please mention the following:

  • What command was run?
    python3 cloudmapper.py weboftrust --accounts account
  • Are you working out of a virtualenv environment, Docker, or something else?
    In a virtual env. Using release 2.10.0

Command crashed with the following report:

(venv) 16:03 75> python3 cloudmapper.py weboftrust --accounts i-i-i
Traceback (most recent call last):
  File "/Users/gad/ImageInsight/Code/cloudmapper/cloudmapper.py", line 72, in <module>
    main()
  File "/Users/gad/ImageInsight/Code/cloudmapper/cloudmapper.py", line 66, in main
    commands[command].run(arguments)
  File "/Users/gad/ImageInsight/Code/cloudmapper/commands/weboftrust.py", line 568, in run
    cytoscape_json = weboftrust(args, accounts, config)
  File "/Users/gad/ImageInsight/Code/cloudmapper/commands/weboftrust.py", line 449, in weboftrust
    get_nodes_and_connections(account, nodes, connections, args)
  File "/Users/gad/ImageInsight/Code/cloudmapper/commands/weboftrust.py", line 430, in get_nodes_and_connections
    get_iam_trusts(account, nodes, connections, connections_to_get)
  File "/Users/gad/ImageInsight/Code/cloudmapper/commands/weboftrust.py", line 204, in get_iam_trusts
    if 'saml-provider/okta' in saml_provider_arn.lower():
UnboundLocalError: local variable 'saml_provider_arn' referenced before assignment

Issue is that the code is assuming that the line for saml in saml_providers will be a non-null loop. In my case, this fails, so saml_provider_arn does not exist to be tested in the subsequent block of if statements.

@gad-imageinsight gad-imageinsight changed the title Weboftrust fails if there are now SAML providerws Weboftrust fails if there are no SAML providerws Mar 24, 2022
jtyers added a commit to jtyers/cloudmapper that referenced this issue Aug 26, 2022
set saml_provider_arn even when no SAML providers present to avoid error
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

No branches or pull requests

1 participant