Nagios Server is running in a docker container. It's reaching out for host checks through NRPE running on various hosts within the network.
The docker host is 10.10.100.100
Iptables ONLY allows inbound on tcp 5666 from 10.10.100.100 for inbound NRPE checks
The nrpe check coming from Nagios succesfully makes it past the firewall. This would prove that the packet source address is indeed 10.10.100.100
The NRPE config has:
server_port=5666
allowed_hosts=10.10.100.100
When making an nrpe call, the NRPE syslog states:
Oct 20 18:42:32 dockerz01 nrpe[13382]: Allowing connections from: 10.10.100.100
Oct 20 18:42:59 dockerz01 nrpe[13411]: Host 172.20.0.2 is not allowed to talk to us!
This means that the packet sent to NRPE would have a source address of 172.20.0.2 (which is the Docker container IP, within the docker bridge network). If so, how would it make it through the firewall?!
This doesn't quite make sense, and I'm a bit stumped
Of course, by setting allowed_hosts=172.20.0.2
in the NRPE config gets around the issue, but that's not persistent and doesn't truly solve the issue here.
Does Nagios send what it 'thinks' is the "source" IP in the NRPE packet, and that's what NRPE judges the "source" address from? If so, how can that be altered? What am I missing here? My goal is to put the Docker host as the allowed_host as I know that's static and won't change.