All Apps and Add-ons

Haveibeenpwned Checker stopped working - requests are blocked

MaverickT
Communicator

We had been using Haveibeenpwned Checker for last couple of months to check if authenticated users were on Haveibeenpwned list. The API started returning 403 error each time when we requested it. We did a little bit of research and figured out that API requires proper request header.

0 Karma
1 Solution

MaverickT
Communicator

We solved this issue by adding following lines to hipb-query.py - line 55:

        # Get a copy of the default headers that requests would use
        headers = requests.utils.default_headers()
        headers.update(
            {
                'User-Agent': 'Splunk haveIBeenPwned checker 1.0',
            }
        )

And on line 62 we changed request to:

r = requests.get(url,headers=headers,proxies=proxyDict,timeout=50)

Case closed. Happy Splunking! 🙂

View solution in original post

0 Karma

MaverickT
Communicator

We solved this issue by adding following lines to hipb-query.py - line 55:

        # Get a copy of the default headers that requests would use
        headers = requests.utils.default_headers()
        headers.update(
            {
                'User-Agent': 'Splunk haveIBeenPwned checker 1.0',
            }
        )

And on line 62 we changed request to:

r = requests.get(url,headers=headers,proxies=proxyDict,timeout=50)

Case closed. Happy Splunking! 🙂

0 Karma

Anam
Community Manager
Community Manager

Hi @MaverickT

Thank you for posting the solution to your question. Can you please go ahead and post the solution as an actual answer in the "write an answer" box below. After you post the answer please go ahead and accept the answer so it is searchable for others.

Thanks

Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...