Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception raised using MISP feature (proxy support) #6

Open
Tux-Panik opened this issue Sep 11, 2018 · 4 comments
Open

Exception raised using MISP feature (proxy support) #6

Tux-Panik opened this issue Sep 11, 2018 · 4 comments

Comments

@Tux-Panik
Copy link

Dear,
After pulling the latest version, I'm not able to run properly the MISP module:
cd /opt/munin/
sudo git pull
sudo vi /opt/munin/munin.ini (to add/change my own API keys)
sudo python3 -m pip install -r /opt/munin/requirements.txt
sudo python3 /opt/munin/munin.py --debug -i /opt/munin/munin.ini -f <input>

However, I reached the following exception:

[D] Querying MISP: 'https://misppriv.circl.lu'
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/pymisp/api.py", line 98, in init
response = self.get_recommended_api_version()
File "/usr/local/lib/python3.6/dist-packages/pymisp/api.py", line 1340, in get_recommended_api_version
response = self._prepare_request('GET', url)
File "/usr/local/lib/python3.6/dist-packages/pymisp/api.py", line 177, in _prepare_request
return s.send(prepped, verify=self.ssl, proxies=self.proxies, cert=self.cert)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 612, in send
adapter = self.get_adapter(url=request.url)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 703, in get_adapter
raise InvalidSchema("No connection adapters were found for '%s'" % url)
requests.exceptions.InvalidSchema: No connection adapters were found for ''https:/servers/getPyMISPVersion.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/munin/munin.py", line 503, in getMISPInfo
misp = PyMISP(MISP_URL, MISP_API_KEY, args.verifycert, 'json')
File "/usr/local/lib/python3.6/dist-packages/pymisp/api.py", line 112, in init
raise PyMISPError('Unable to connect to MISP ({}). Please make sure the API key and the URL are correct (http/https is required): {}'.format(self.root_url, e))
pymisp.exceptions.PyMISPError: Unable to connect to MISP ('https://misppriv.circl.lu'). Please make sure the API key and the URL are correct (http/https is required): No connection adapters were found for ''https:/servers/getPyMISPVersion.json'

I double checked the API key and it is good.

Any idea?
Thanks in advance,
Regards,
Julien

@Neo23x0
Copy link
Owner

Neo23x0 commented Sep 11, 2018

It seems like a connection error.

What is the output of

curl -o /dev/null --silent --head --write-out '%{http_code}\n' https://misppriv.circl.lu

@Tux-Panik
Copy link
Author

Thanks Florian,
Below the command line output:
curl -o /dev/null --silent --head --write-out '%{http_code}\n' https://misppriv.circl.lu
302
I use a proxy but it is specified in my environment "$http_proxy" and "$https_proxy" and it allows connection to this subdomain.
The same with VT:
curl -o /dev/null --silent --head --write-out '%{http_code}\n' https://www.virustotal.com
200
So it is a proxy issue... strange!

Regards

@Neo23x0
Copy link
Owner

Neo23x0 commented Sep 11, 2018

PyMISP requires a manual proxy definition.
https://github.com/CIRCL/PyMISP/blob/644e1b065afd6f87f480a4bafa45ec908882cab7/pymisp/api.py#L65

I don't have that yet in my program.

@Neo23x0
Copy link
Owner

Neo23x0 commented Sep 11, 2018

I would keep this open as a missing feature in munin

@Neo23x0 Neo23x0 reopened this Sep 11, 2018
@Neo23x0 Neo23x0 changed the title Exception raised using MISP feature Exception raised using MISP feature (proxy support) Sep 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants