Restricting access to exposed ports for only a specific container #194
Replies: 6 comments
-
|
Hi there.
|
Beta Was this translation helpful? Give feedback.
-
|
Hi Bret, Regards, |
Beta Was this translation helpful? Give feedback.
-
|
Yea I don't have an answer for you other than above. In datacenters I work in, they control that at the VLAN level the hosts are placed on. |
Beta Was this translation helpful? Give feedback.
-
|
I would think messing with iptables would get overwritten on next docker run. If you figure out a way to solve your issue please update us here to benefit others! |
Beta Was this translation helpful? Give feedback.
-
|
I have figured out a solution and tested to be working. This is what i have tried
3 - To enable access for specific IPs, new rule with ACCEPT target needs to be inserted before the 4 - Every time docker daemon restarts, it is required to keep ISE_RABBITMQ_FW_CHAIN at the top of I'm not a linux/docker expert, somehow tried some solution. Please let me know if anyone of you find any flaw in this approach. Feedback is much appreciated. |
Beta Was this translation helpful? Give feedback.
-
|
Another option i have tried is updating the NAT rules added by Docker by specifying the source for the IPs allowed to connect. This works but when container restarts, the rules will be again over written by docker. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Bret,
I was great Docker tutorial and i enjoyed all your lectures. I have a problem i'm not able to solve, appreciate if you can help me.
In my product i have introduced a RabbitMQ container and we have already few more different containers are running on the same docker runtime. For RabbitMQ i have exposed few ports. Now the issue is how to restrict the access to these ports from outside as docker allows access to all exposed ports through iptables configuration.
I have thought of adding a new rule to drop all connections from any source in DOCKER or DOCKER-USER chain and then allowing only IPs which are supposed to access. However this will restrict the access to Docker which will impact all other containers also.
Need help on how to restrict ports exposed for my container only and then selectively allowing the access to known IPs.
Regards,
Nihar
Beta Was this translation helpful? Give feedback.
All reactions