graylog-labs / graylog-plugin-pagerduty

A Graylog plugin that triggers PagerDuty events

Home Page:https://www.graylog.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

graylog2.conf setting http_proxy_uri ignored

traviscosgrave opened this issue · comments

It seems like the pagerduty alert plugin is not respecting the http_proxy_uri setting from graylog2.conf.

When I try to send a DummyAlert using the web interface or the REST browser, the request hangs with no response. This is the same behaviour when I try to download a file from the public internet. (These servers require a proxy to make any http connections beyond our walls.)

I can replicate this behaviour on the command line using curl to send an alert to pagerduty. Before executing export http_proxy=http://my.proxy.com:8080/, the request will hang forever. After setting the proxy, the request successfully creates an alert in pagerduty.

Due to the nature of information logged to our servers it is important that we control how these machines access the internet. If application level proxying is available, it is much preferred to setting the proxy server globally.

I'm not a Java developer, but it looks like the http_proxy_uri setting is accessible through the graylog2.BaseConfiguration class, and a quick check for existence would allow it to be used when the URL is made here.

A presumably relevant SO post can be found here: How do I make HttpUrlConnection use a Proxy?

We found a workaround for this issue by setting the proxy settings with Java parameters on the graylog server. We're using :
-Dhttp.proxyHost=* -Dhttp.proxyPort=* -Dhttps.proxyHost=* -Dhttps.proxyPort=* -Dhttp.nonProxyHosts=*
On the non proxy hosts we've included the hosts on our network that graylog communicates with in order to make sure they won't be passed to the proxy. Seems to be working this way.

Thanks for your input! Support for HTTP proxies has been implemented in version 1.3.0 of this plugin.