0 points

What is a good firewall that can also block ports published with docker? I’d need it to run on the same host.

permalink
report
reply
0 points
*

You want a virtual firewall. Is this for profit or just your science project because that’s going to change the answer. You might hate me, but I’m still gonna say it, Cisco…

permalink
report
parent
reply
0 points

For my homelab, and I’ll only host OSS

permalink
report
parent
reply
0 points

Ufw should work, jus ufw block/limit/allow port number

permalink
report
parent
reply
0 points

I remember trying with ufw and the docker ports were still open. Iirc I’ve read somewhere that docker and ufw both use the same underlying software, so ufw cannot block docker (IP tables?)

permalink
report
parent
reply
0 points

Hmm, not sure. I know with docker you can “mock” ports for the container, where the port the container sees is different than the port on the system. Maybe you can do something with that?

permalink
report
parent
reply
0 points

Are your Docker containers connecting to the network (eg using ipvlan or macvlan)? The default bridge network driver doesn’t expose the container publicly unless you explicitly expose a port. If you don’t expose a port, the Docker container is only accessible from the host, not from any other system on the network.

permalink
report
parent
reply
0 points

They are Only in my docker bridge networks and have a few published ports

permalink
report
parent
reply
0 points

If you don’t want the Docker container to be accessible from other systems then just don’t publish the port.

permalink
report
parent
reply
0 points

UFW does work with Docker, but requires some tweaking. IIRC you have to disallow Docker to modify IPTables and then add a rule to forward all traffic to the Docker network of your choice. It’s a little finicky but works.

permalink
report
parent
reply
0 points

Interesting, I might have to read up on that next time. Thanks

permalink
report
parent
reply
0 points

This literally happened to me yesterday. Fortunately ufw enable did not configure it as persistent across reboots 🤠

permalink
report
reply

Programmer Humor

!programmerhumor@lemmy.ml

Create post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.

Community stats

  • 6.7K

    Monthly active users

  • 796

    Posts

  • 7.3K

    Comments

Community moderators