I run Graylog on a Debian VM within a DMZ behind a firewall.
Internally everything worked and I could access the GUI etc.
Now I would like to expose the graylog machine using a public IP.
The 1:1 NAT is setup and working, but I can’t seem to get the configuration for graylog correct.
So far I was able to find similar problems, but they were all for 2.x
Now my question is, what is the right combination to use in the config?
172.16.99.204 is the (internal) IP of the VM
xxx.yyy.237.107 would be the public IP
So far I’ve tried most (?) combinations of different IPs for http_bind_address / http_publish_uri and http_external_uri
The external url graylog.example.com is known both in and outside of my network
Depending on the config (which, unfortunately I have discarded and can’t reproduce it) I can either access the GUI internally, but not externally, or I get net::ERR_CONNECTION_REFUSED for the GUI assets (CSS, JS etc)
you have two options to make this happen, the important setting is the http_external_uri as this tells the client where it can reach the Graylog API - by client I mean your browser.
have a DNS entry that resolve internal to the internal IP and external to the external ip (e.g graylog.company.tld resolves different. http_external_uri set to graylog.company.tld
having a proxy (like nginx) with two vhosts.
As you can overwrite the http_external_uri on a proxy ( see docs ) have one vhost for internal and one for external access
This sounds a bit complicated I fear.
Would I need to install nginx on top of graylog? Or change the existing ngnix that came with the deb repository (I am afraid I don’t know what graylog uses as http server)
But can you explain to me, why my 1:1 NAT is not working? Or why I would need to be able to tell graylog the existence of both of my IPs? I thought this setup is not so uncommon?
You have the Graylog server that is providing a REST-API and a browser based application that is communicating with that API.
So as the browser based application needs to know how to access the API you have multiple options. My first suggested would work without a problem. But you need to have control over your DNS and know how to configure that.
The second would include a Proxy (NGINX) that is available on both networks internal and external and can reach Graylog to proxy the request.
You are right the setup is very common - but not really complicated if you know the above.
http_bind_interface can be wildcard (read 0.0.0.0) that Graylog is listening on all devices that are available on the server Graylog is running on
http_publish_uri needs to be a specific adress where Graylog can reach itself - in multi Graylog hosts environments that publish uri of each host needs to be reachable by all other Graylog server that the Graylog nodes can communicate over that.
http_external_uri is where the application in your browser can reach Graylog (API) to get the data.
Thank you!
Sorry to be so complicated, but it does not seem to be working
server.log
(...)
2019-07-26T13:13:57.209+02:00 INFO [connection] Opened connection [connectionId{localValue:8, serverValue:34}] to localhost:27017
2019-07-26T13:13:58.277+02:00 INFO [JerseyService] Enabling CORS for HTTP endpoint
2019-07-26T13:14:39.133+02:00 INFO [NetworkListener] Started listener bound to [0.0.0.0:9000]
2019-07-26T13:14:39.135+02:00 INFO [HttpServer] [HttpServer] Started.
2019-07-26T13:14:39.135+02:00 INFO [JerseyService] Started REST API at <0.0.0.0:9000>
2019-07-26T13:14:39.138+02:00 INFO [ServerBootstrap] Services started, startup times in ms: {OutputSetupService [RUNNING]=254, BufferSynchronizerService [RUNNING]=270, GracefulShutdownService [RUNNING]=299, KafkaJournal [RUNNING]=314, PeriodicalsService [RUNNING]=432, InputSetupService [RUNNING]=463, ConfigurationEtagService [RUNNING]=517, EtagService [RUNNING]=517, StreamCacheService [RUNNING]=544, LookupTableService [RUNNING]=551, JournalReader [RUNNING]=562, JerseyService [RUNNING]=42386}
2019-07-26T13:14:39.146+02:00 INFO [ServerBootstrap] Graylog server up and running.
2019-07-26T13:14:39.147+02:00 INFO [ServiceManagerListener] Services are healthy
2019-07-26T13:14:39.148+02:00 INFO [InputSetupService] Triggering launching persisted inputs, node transitioned from Uninitialized [LB:DEAD] to Running [LB:ALIVE]
2019-07-26T13:14:39.173+02:00 INFO [InputStateListener] Input [Syslog UDP/5d31c5cbf7f6e633974301d4] is now STARTING
2019-07-26T13:14:39.184+02:00 INFO [InputStateListener] Input [Syslog UDP/5d31c6b8f7f6e633974302d9] is now STARTING
2019-07-26T13:14:39.307+02:00 INFO [InputStateListener] Input [Syslog UDP/5d31c6b8f7f6e633974302d9] is now RUNNING
2019-07-26T13:14:39.321+02:00 INFO [InputStateListener] Input [Syslog UDP/5d31c5cbf7f6e633974301d4] is now RUNNING
2019-07-26T13:14:39.355+02:00 WARN [UdpTransport] receiveBufferSize (SO_RCVBUF) for input SyslogUDPInput{title=elk.company.tld, type=org.graylog2.inputs.syslog.udp.SyslogUDPInput, nodeId=dff27e32-9166-4e32-a425-0345cf2eef2a} (channel [id: 0xe6ac1fdb, L:/172.16.99.204:5140]) should be 262144 but is 425984.
2019-07-26T13:14:39.358+02:00 WARN [UdpTransport] receiveBufferSize (SO_RCVBUF) for input SyslogUDPInput{title=MacPro, type=org.graylog2.inputs.syslog.udp.SyslogUDPInput, nodeId=dff27e32-9166-4e32-a425-0345cf2eef2a} (channel [id: 0x3ddceeaa, L:/0:0:0:0:0:0:0:0%0:5140]) should be 262144 but is 425984.