cloudmapper icon indicating copy to clipboard operation
cloudmapper copied to clipboard

Weboftrust fails if there are no SAML providerws

Open gad-imageinsight opened this issue 2 years ago • 0 comments

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 avatar Mar 24 '22 20:03 gad-imageinsight