Splunk Dev

How to pass Splunk Cloud verification for my Python script using the HTTP requests module?

guarisma
Contributor

My script works great On-Premise, but Splunk Cloud rejects it

I use the requests module to do HTTPS requests like this one

response = requests.post(url, auth=(user, pwd), headers=headers ,data=data)

In Splunk Cloud it gets rejected because it thinks it might be insecure, when passing parameters to the requests module, I must do parameter=

Possible insecure HTTP Connection. Match: requests.post Positional arguments, ["?"]; Keyword arguments, {"auth": "?", "headers": "?", "data": "?"} File: bin/alert_event.py Line Number: 46

I don't know how to fix this.

Anyone knows how to pass this test?

Labels (1)
0 Karma

lpuentes
New Member

Hello,

were you able to solve the problem? The same is happening to me.

Thanks. 

0 Karma

livehybrid
Builder

Before calling requests.post, add something like:

if not url.startswith("https"):
    logger.critical("URL must be HTTPS")
    exit(1)

This way when they vet your app they can see that a non-https url couldnt be used.  

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...