twistlock / sample-code

Sample code for Prisma Cloud Compute (formerly Twistlock)
https://www.paloaltonetworks.com/prisma/cloud
MIT License
93 stars 94 forks source link

UnboundLocalError: local variable 'conf_values' referenced before assignment #146

Open kitbeepan opened 3 years ago

kitbeepan commented 3 years ago

twistlock.conf contents are properly updated -- [default] [pcc] console_addr = https://twistlock-ctools.ews.int:8083 username = ewssvcsplunk

Screenshot of the setup page is also attached. But the integration fails due to this error: 10-27-2021 13:20:00.000 -0500 INFO ExecProcessor - setting reschedule_ms=300000, for command=/opt/splunk/bin/python3.7 /opt/splunk/etc/apps/twistlock/bin/poll_incidents.py 10-27-2021 13:20:00.208 -0500 INFO ExecProcessor - message from "/opt/splunk/bin/python3.7 /opt/splunk/etc/apps/twistlock/bin/poll_incidents.py" Prisma Cloud Compute poll_incidents script started. 10-27-2021 13:20:00.388 -0500 ERROR ExecProcessor - message from "/opt/splunk/bin/python3.7 /opt/splunk/etc/apps/twistlock/bin/poll_incidents.py" Failed getting configuration from Splunk: ResourceNotFound('https://127.0.0.1:8089/servicesNS/nobody/twistlock/configs/conf-twistlock/None') 10-27-2021 13:20:00.390 -0500 ERROR ExecProcessor - message from "/opt/splunk/bin/python3.7 /opt/splunk/etc/apps/twistlock/bin/poll_incidents.py" Traceback (most recent call last): 10-27-2021 13:20:00.390 -0500 ERROR ExecProcessor - message from "/opt/splunk/bin/python3.7 /opt/splunk/etc/apps/twistlock/bin/poll_incidents.py" File "/opt/splunk/etc/apps/twistlock/bin/poll_incidents.py", line 229, in 10-27-2021 13:20:00.390 -0500 ERROR ExecProcessor - message from "/opt/splunk/bin/python3.7 /opt/splunk/etc/apps/twistlock/bin/poll_incidents.py" main() 10-27-2021 13:20:00.390 -0500 ERROR ExecProcessor - message from "/opt/splunk/bin/python3.7 /opt/splunk/etc/apps/twistlock/bin/poll_incidents.py" File "/opt/splunk/etc/apps/twistlock/bin/poll_incidents.py", line 194, in main 10-27-2021 13:20:00.390 -0500 ERROR ExecProcessor - message from "/opt/splunk/bin/python3.7 /opt/splunk/etc/apps () /twistlock/bin/poll_incidents.py" configs = generate_configs(session_key) 10-27-2021 13:20:00.390 -0500 ERROR ExecProcessor - message from "/opt/splunk/bin/python3.7 /opt/splunk/etc/apps/twistlock/bin/poll_incidents.py" File "/opt/splunk/etc/apps/twistlock/bin/utils/splunk.py", line 59, in generate_configs 10-27-2021 13:20:00.390 -0500 ERROR ExecProcessor - message from "/opt/splunk/bin/python3.7 /opt/splunk/etc/apps/twistlock/bin/poll_incidents.py" stanza = get_config_stanza(credential["realm"], session_key) 10-27-2021 13:20:00.390 -0500 ERROR ExecProcessor - message from "/opt/splunk/bin/python3.7 /opt/splunk/etc/apps/twistlock/bin/poll_incidents.py" File "/opt/splunk/etc/apps/twistlock/bin/utils/splunk.py", line 43, in get_config_stanza 10-27-2021 13:20:00.390 -0500 ERROR ExecProcessor - message from "/opt/splunk/bin/python3.7 /opt/splunk/etc/apps/twistlock/bin/poll_incidents.py" "console_addr": conf_values["console_addr"], 10-27-2021 13:20:00.390 -0500 ERROR ExecProcessor - message from "/opt/splunk/bin/python3.7 /opt/splunk/etc/apps/twistlock/bin/poll_incidents.py" UnboundLocalError: local variable 'conf_values' referenced before assignmen ![Uploading prisma-setup-screen.PNG…]() t

kitbeepan commented 3 years ago

https://drive.google.com/drive/folders/14qG7zKH7ti_fukLgabgJt-_shSyK-N1O?usp=sharing

Could not make the upload to work, sharing the folder with the files instead

kitbeejill commented 2 years ago

adding the scrubbed out contents of $SPLUNK_HOME/etc/apps/twistlock/local/passwords.conf as requested:

[credential:pcc:ews\\svcsplunk:]
password = $7$kHssdfagBasdfasdfasdfasdfasdfadsfasdf==