You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A clear and concise description of what the bug is.
I am using the latest SDK in the Mothership app (available on Splunkbase). I received an error when running a SAST scan flagging the use of ssl._create_unverified_context in splunklib/binding.py on line 1447. The scan gave this error and feedback: "Unverified SSL context detected. This will permit insecure connections without verifying SSL certificates. Use ssl.create_default_context() instead." Is this a valid security concern and if so, can the team implement the fix suggested in the comment above?
To Reproduce
Steps to reproduce the behavior:
Download latest version of SDK
Run SAST scan
See results on semgrep.dev
Logs or Screenshots
If applicable, add logs or screenshots to help explain your problem.
Splunk (please complete the following information):
Version: 9.1.0.2
OS: Ubuntu
Deployment: Single instance
SDK (please complete the following information):
Version: 1.7.4
Language Runtime Version: Python3
OS: Ubuntu
The text was updated successfully, but these errors were encountered:
Hi @ahoang-splunk ,
We replaced the ssl._create_unverified_context() using ssl.create_default_context() as suggested in the security warning along with some other parameters needed to connect successfully with the Splunk server when SSL verification is not enabled. These changes did not raise any warning when we ran the security scan locally.
To ensure that it resolves the security warning, we request you to execute the security scan on your end using the modified code listed below and let us know if it still raises the security warning.
ifnotverify:
kwargs['context'] =ssl._create_unverified_context()
elifcontext:
# verify is True in elif branch and context is not Nonekwargs['context'] =context
new code:
ifnotverify:
ssl_ctx=ssl.create_default_context()
ssl_ctx.check_hostname=Falsessl_ctx.verify_mode=ssl.CERT_NONEkwargs['context'] =ssl_ctxelifcontext:
# verify is True in elif branch and context is not Nonekwargs['context'] =context
Describe the bug
A clear and concise description of what the bug is.
I am using the latest SDK in the Mothership app (available on Splunkbase). I received an error when running a SAST scan flagging the use of ssl._create_unverified_context in splunklib/binding.py on line 1447. The scan gave this error and feedback: "Unverified SSL context detected. This will permit insecure connections without verifying SSL certificates. Use ssl.create_default_context() instead." Is this a valid security concern and if so, can the team implement the fix suggested in the comment above?
To Reproduce
Steps to reproduce the behavior:
Logs or Screenshots
If applicable, add logs or screenshots to help explain your problem.
Splunk (please complete the following information):
SDK (please complete the following information):
The text was updated successfully, but these errors were encountered: