Hi there,
My (home)server is running OpenMediaVault 7.7.1-3 (Sandworm) as its host OS. I have several dockers running, one of them is a ngingxpm docker. The host machine is on IP 10.5.1.240. The web-interface for proxy manager i put on Port 8803. This works as expected and i can reach it.
I would now like to create a firewall rule that will block all access (0.0.0.0\0) to port 8803 to be DROPPED. Next to that I want to add a rule to only ALLOW access to port 8803 when the request is coming from 10.5.1.2 (my local administrator PC).
I set up similar rules for SSH on the OMV firewall and this works flawlessly. For docker containers however…it seems like the rules stored in the iptables firewall are skipped/circumvented because Docker also runs a few iptables in parallel (Docker, Docker-User etc).
Now i am using a custom created bridge network inside my Docker to make it easier for all the running dockers to refer/talk to each other.
But in my case i would really like my default firewall in OMV (INPUT chain) to handle all incoming connections first. In short i like the idea of having 1/2 web-interfaces when i can manage everything remotely rather than reverting back to terminal. And so far this seems to be the only situation where i am lacking to do so.
Currently i have tried setting up iptables rules in both Docker-user and NAT PREROUTING chain and still the requests are coming through. I can access the nginxpm docker interface on address 10.5.1.240:8803 from both my own machine (10.5.1.2) but also from any other machine in my network (eg. 10.5.1.6). But i only want to be able to reach it from 10.5.1.2.
These are the current iptable rules i have set up:
Chain DOCKER-USER (2 references)
target prot opt source destination
ACCEPT tcp -- 10.5.1.2 anywhere tcp dpts:8800:8899
DROP tcp -- anywhere anywhere tcp dpts:8800:8899
RETURN all -- anywhere anywhere
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
ACCEPT 6 -- 10.5.1.2 0.0.0.0/0 tcp dpts:8800:8899
DROP 6 -- 0.0.0.0/0 0.0.0.0/0 tcp dpts:8800:8899
Anyone have an idea how i could solve this? Or could i solve it with an approach thst is better practise?