Giter VIP home page Giter VIP logo

Comments (5)

mlollo avatar mlollo commented on August 11, 2024

It appears that with --net=host we just need to do some regular ufw allow from commands instead of ufw route allow from. What remains to assert is how to retrieve ports used by the container and how to delete those ufw rules when the container is deleted.

Maybe using container.attrs['Config']['ExposedPorts'] when EXPOSE is specified in the dockerfile.

from ufw-docker-automated.

mlollo avatar mlollo commented on August 11, 2024

I worked on that on net-host branch, I think for now in host network mode we can only handle incoming traffic (ufw-from label).
For outgoing traffic (ufw-to label), it's a bit more tricky. Maybe we need to do something like this :

ufw allow out to any port 53
ufw allow out to 192.168.1.0/24 port 80 proto tcp
ufw deny out to any

from ufw-docker-automated.

shinebayar-g avatar shinebayar-g commented on August 11, 2024

Maybe we shouldn't do host network mode, because there is no IPtables involved and users can simply create normal ufw rules. What do you think? 🤔

from ufw-docker-automated.

mlollo avatar mlollo commented on August 11, 2024

I agree, this could get confusing because we are touching rules that the user maybe want to manage.
It's doable but it requires that the user understands what it does.
I'll leave the idea in the branch net-host, but as you can see the hack is not pretty when I need to remove rules (line 125).

from ufw-docker-automated.

shinebayar-g avatar shinebayar-g commented on August 11, 2024

Indeed, Let's say doable, but not required. As it would make things over complex.

from ufw-docker-automated.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.