Replies: 2 comments 6 replies
-
OK - stand down. Doesn't really answer if it's expected behavior or not - it's more it's been observed happening with no indication of whether it's supposed to be like that or not. |
Beta Was this translation helpful? Give feedback.
-
@mheon WDYT? How does your firewalld work in netavark effect this? |
Beta Was this translation helpful? Give feedback.
-
Hi all, I hope you're all well.
I hope somebody can either confirm this is by design or I'm doing something wrong - I don't mind either way, but my search for clarification is failing.
I am using Podman on Rocky Linux with FirewallD - all working well and I have this set up in a few different places for different services.
However, I noticed yesterday that on a rootful container, ports exposed on the container are also automatically exposed on the host machine as well - whether firewalld has them open explicitly or not.
For example, say I run a web server container and expose an alternate port (i.e. -p 8080:80) and run haproxy on the host machine proxying into that container via port 443. I then open port 443 with firewalld and it all works perfectly. However, from an external machine I can still access the web server on port 8080 even though firewalld doesn't have an explicit rule for port 8080.
Of course, if I do this via a rootless container it doesn't happen as rootless containers handle the network differently.
Yes, I should probably look into using rootless containers anyway, and I have migrated most over to rootless where I have been able to.
Is this right? Logically I would expect only ports open in firewalld to be accessible externally - even if it is a rootfull container.
I expect it's something to do with the "trusted" zone that the containers become part of - accepting all traffic, and if anyone knows of any config I can do to help firewalld out it would be much appreciated.
Of course, if this is expected behavior then I'm happy, I'll continue moving to rootless containers as I should be doing anyway!
Thanks
Beta Was this translation helpful? Give feedback.
All reactions