Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

agnos.is Forums

  1. Home
  2. Programmer Humor
  3. Context: Docker bypasses all UFW firewall rules

Context: Docker bypasses all UFW firewall rules

Scheduled Pinned Locked Moved Programmer Humor
programmerhumor
105 Posts 58 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q [email protected]

    Docker docs:

    Docker routes container traffic in the nat table, which means that packets are diverted before it reaches the INPUT and OUTPUT chains that ufw uses. Packets are routed before the firewall rules can be applied, effectively ignoring your firewall configuration.

    L This user is from outside of this forum
    L This user is from outside of this forum
    [email protected]
    wrote last edited by
    #20

    Wait, that's illegal

    1 Reply Last reply
    1
    • Q [email protected]

      Docker docs:

      Docker routes container traffic in the nat table, which means that packets are diverted before it reaches the INPUT and OUTPUT chains that ufw uses. Packets are routed before the firewall rules can be applied, effectively ignoring your firewall configuration.

      M This user is from outside of this forum
      M This user is from outside of this forum
      [email protected]
      wrote last edited by
      #21

      I mean if you're hosting anything publicly, you really should have a dedicated firewall

      Q ohshit604@sh.itjust.worksO 2 Replies Last reply
      3
      • Q [email protected]

        Docker docs:

        Docker routes container traffic in the nat table, which means that packets are diverted before it reaches the INPUT and OUTPUT chains that ufw uses. Packets are routed before the firewall rules can be applied, effectively ignoring your firewall configuration.

        S This user is from outside of this forum
        S This user is from outside of this forum
        [email protected]
        wrote last edited by
        #22

        My impression from a recent crash course on Docker is that it got popular because it allows script kiddies to spin up services very fast without knowing how they work.

        OWASP was like "you can follow these thirty steps to make Docker secure, or just run Podman instead." https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html

        mangopenguin@lemmy.blahaj.zoneM D N L appoxo@lemmy.dbzer0.comA 5 Replies Last reply
        19
        • Q [email protected]

          Docker docs:

          Docker routes container traffic in the nat table, which means that packets are diverted before it reaches the INPUT and OUTPUT chains that ufw uses. Packets are routed before the firewall rules can be applied, effectively ignoring your firewall configuration.

          J This user is from outside of this forum
          J This user is from outside of this forum
          [email protected]
          wrote last edited by
          #23

          Somehow I think that's on ufw not docker. A firewall shouldn't depend on applications playing by their rules.

          Q isokiero@sopuli.xyzI 2 Replies Last reply
          7
          • J [email protected]

            Somehow I think that's on ufw not docker. A firewall shouldn't depend on applications playing by their rules.

            Q This user is from outside of this forum
            Q This user is from outside of this forum
            [email protected]
            wrote last edited by
            #24

            ufw just manages iptables rules, if docker overrides those it's on them IMO

            J N P 3 Replies Last reply
            12
            • J [email protected]

              Somehow I think that's on ufw not docker. A firewall shouldn't depend on applications playing by their rules.

              isokiero@sopuli.xyzI This user is from outside of this forum
              isokiero@sopuli.xyzI This user is from outside of this forum
              [email protected]
              wrote last edited by
              #25

              Docker spesifically creates rules for itself which are by default open to everyone. UFW (and underlying eftables/iptables) just does as it's told by the system root (via docker). I can't really blame the system when it does what it's told to do and it's been administrators job to manage that in a reasonable way since forever.

              And (not related to linux or docker in any way) there's still big commercial software which highly paid consultants install and the very first thing they do is to turn the firewall off....

              1 Reply Last reply
              1
              • Q [email protected]

                ufw just manages iptables rules, if docker overrides those it's on them IMO

                J This user is from outside of this forum
                J This user is from outside of this forum
                [email protected]
                wrote last edited by
                #26

                Feels weird that an application is allowed to override iptables though. I get that when it's installed with root everything's off the table, but still....

                N mangopenguin@lemmy.blahaj.zoneM 2 Replies Last reply
                6
                • G [email protected]

                  cockpit has a podman/container extension you might like.

                  Q This user is from outside of this forum
                  Q This user is from outside of this forum
                  [email protected]
                  wrote last edited by [email protected]
                  #27

                  It's okay for simple things, but too simple for anything beyond that, IMO. One important issue is that unlike with Portainer you can't edit the container in any way without deleting it and configuring it again, which is quite annoying if you just want to change 1 environment variable (GH Issue). Perhaps they will add a quadlet config tool to cockpit sometime in the future.

                  G 1 Reply Last reply
                  2
                  • J [email protected]

                    Feels weird that an application is allowed to override iptables though. I get that when it's installed with root everything's off the table, but still....

                    N This user is from outside of this forum
                    N This user is from outside of this forum
                    [email protected]
                    wrote last edited by
                    #28

                    It is decidedly weird, and it's something docker handles very poorly.

                    1 Reply Last reply
                    0
                    • Q [email protected]

                      Docker docs:

                      Docker routes container traffic in the nat table, which means that packets are diverted before it reaches the INPUT and OUTPUT chains that ufw uses. Packets are routed before the firewall rules can be applied, effectively ignoring your firewall configuration.

                      P This user is from outside of this forum
                      P This user is from outside of this forum
                      [email protected]
                      wrote last edited by
                      #29

                      Ok

                      So, confession time.

                      I don't understand docker at all. Everyone at work says "but it makes things so easy." But it doesnt make things easy. It puts everything in a box, executes things in a box, and you have to pull other images to use in your images, and it's all spaghetti in the end anyway.

                      If I can build an Angular app the same on my Linux machine and my windows PC, and everything works identically on either, and The only thing I really have to make sure of is that the deployment environment has node and the angular CLI installed, how is that not simpler than everything you need to do to set up a goddamn container?

                      L S Q trickdacy@lemmy.worldT mangopenguin@lemmy.blahaj.zoneM 9 Replies Last reply
                      7
                      • P [email protected]

                        Ok

                        So, confession time.

                        I don't understand docker at all. Everyone at work says "but it makes things so easy." But it doesnt make things easy. It puts everything in a box, executes things in a box, and you have to pull other images to use in your images, and it's all spaghetti in the end anyway.

                        If I can build an Angular app the same on my Linux machine and my windows PC, and everything works identically on either, and The only thing I really have to make sure of is that the deployment environment has node and the angular CLI installed, how is that not simpler than everything you need to do to set up a goddamn container?

                        L This user is from outside of this forum
                        L This user is from outside of this forum
                        [email protected]
                        wrote last edited by
                        #30

                        You’re right. As an old-timey linux user I find it more confusing than running the services directly, too. It’s another abstraction layer that you need to manage and which has its own pitfalls.

                        1 Reply Last reply
                        3
                        • P [email protected]

                          Ok

                          So, confession time.

                          I don't understand docker at all. Everyone at work says "but it makes things so easy." But it doesnt make things easy. It puts everything in a box, executes things in a box, and you have to pull other images to use in your images, and it's all spaghetti in the end anyway.

                          If I can build an Angular app the same on my Linux machine and my windows PC, and everything works identically on either, and The only thing I really have to make sure of is that the deployment environment has node and the angular CLI installed, how is that not simpler than everything you need to do to set up a goddamn container?

                          S This user is from outside of this forum
                          S This user is from outside of this forum
                          [email protected]
                          wrote last edited by
                          #31

                          have to make sure of is that the deployment environment has node and the angular CLI installed

                          I have spent so many fucking hours trying to coordinate the correct Node version to a given OS version, fucked around with all sorts of Node management tools, ran into so many glibc compat problems, and regularly found myself blowing away the packages cache before Yarn fixed their shit and even then there's still a serious problem a few times a year.

                          No. Fuck no, you can pry Docker out of my cold dead hands, I'm not wasting literal man-weeks of time every year on that shit again.

                          (Sorry, that was an aggressive response and none of it was actually aimed at you, I just fucking hate managing Node.js manually at scale.)

                          P trickdacy@lemmy.worldT 2 Replies Last reply
                          8
                          • P [email protected]

                            Ok

                            So, confession time.

                            I don't understand docker at all. Everyone at work says "but it makes things so easy." But it doesnt make things easy. It puts everything in a box, executes things in a box, and you have to pull other images to use in your images, and it's all spaghetti in the end anyway.

                            If I can build an Angular app the same on my Linux machine and my windows PC, and everything works identically on either, and The only thing I really have to make sure of is that the deployment environment has node and the angular CLI installed, how is that not simpler than everything you need to do to set up a goddamn container?

                            Q This user is from outside of this forum
                            Q This user is from outside of this forum
                            [email protected]
                            wrote last edited by [email protected]
                            #32

                            This is less of an issue with JS, but say you're developing this C++ application. It relies on several dynamically linked libraries. So to run it, you need to install all of these libraries and make sure the versions are compatible and don't cause weird issues that didn't happen with the versions on the dev's machine. These libraries aren't available in your distro's package manager (only as RPM) so you will have to clone them from git and install all of them manually. This quickly turns into hassle, and it's much easier to just prepare one image and ship it, knowing the entire enviroment is the same as when it was tested.

                            However, the primary reason I use it is because I want to isolate software from the host system. It prevents clutter and allows me to just put all the data in designated structured folders. It also isolates the services when they get infected with malware.

                            P 1 Reply Last reply
                            10
                            • F [email protected]

                              Explicitly binding certain ports to the container has a similar effect, no?

                              static_rocket@lemmy.worldS This user is from outside of this forum
                              static_rocket@lemmy.worldS This user is from outside of this forum
                              [email protected]
                              wrote last edited by
                              #33

                              It's better than nothing but I hate the additional logs that came from it constantly fighting firewalld.

                              1 Reply Last reply
                              2
                              • S [email protected]

                                have to make sure of is that the deployment environment has node and the angular CLI installed

                                I have spent so many fucking hours trying to coordinate the correct Node version to a given OS version, fucked around with all sorts of Node management tools, ran into so many glibc compat problems, and regularly found myself blowing away the packages cache before Yarn fixed their shit and even then there's still a serious problem a few times a year.

                                No. Fuck no, you can pry Docker out of my cold dead hands, I'm not wasting literal man-weeks of time every year on that shit again.

                                (Sorry, that was an aggressive response and none of it was actually aimed at you, I just fucking hate managing Node.js manually at scale.)

                                P This user is from outside of this forum
                                P This user is from outside of this forum
                                [email protected]
                                wrote last edited by
                                #34

                                Well, I guess that's a good reason. Node version management seems to handle most of that for me though. I haven't worked on an OS without support for it.

                                1 Reply Last reply
                                0
                                • Q [email protected]

                                  Docker docs:

                                  Docker routes container traffic in the nat table, which means that packets are diverted before it reaches the INPUT and OUTPUT chains that ufw uses. Packets are routed before the firewall rules can be applied, effectively ignoring your firewall configuration.

                                  P This user is from outside of this forum
                                  P This user is from outside of this forum
                                  [email protected]
                                  wrote last edited by
                                  #35

                                  Well yea ofc it works like that, the services are not on the same network, so the packets need to be sent onto another adapter. That means either nat or forwarding tables.

                                  Now if that was a good design of docker is another question.

                                  1 Reply Last reply
                                  1
                                  • P [email protected]

                                    Ok

                                    So, confession time.

                                    I don't understand docker at all. Everyone at work says "but it makes things so easy." But it doesnt make things easy. It puts everything in a box, executes things in a box, and you have to pull other images to use in your images, and it's all spaghetti in the end anyway.

                                    If I can build an Angular app the same on my Linux machine and my windows PC, and everything works identically on either, and The only thing I really have to make sure of is that the deployment environment has node and the angular CLI installed, how is that not simpler than everything you need to do to set up a goddamn container?

                                    trickdacy@lemmy.worldT This user is from outside of this forum
                                    trickdacy@lemmy.worldT This user is from outside of this forum
                                    [email protected]
                                    wrote last edited by
                                    #36

                                    Even when it seems like an app runs identically on every platform, you can easily run into issues down the road. If you have a well configured docker image, that issue is just solved ahead of time. Hell, I find it worth messing with just moving a node.js app between Linux boxes, which would experience the least issues I can think of.

                                    1 Reply Last reply
                                    0
                                    • Q [email protected]

                                      This is less of an issue with JS, but say you're developing this C++ application. It relies on several dynamically linked libraries. So to run it, you need to install all of these libraries and make sure the versions are compatible and don't cause weird issues that didn't happen with the versions on the dev's machine. These libraries aren't available in your distro's package manager (only as RPM) so you will have to clone them from git and install all of them manually. This quickly turns into hassle, and it's much easier to just prepare one image and ship it, knowing the entire enviroment is the same as when it was tested.

                                      However, the primary reason I use it is because I want to isolate software from the host system. It prevents clutter and allows me to just put all the data in designated structured folders. It also isolates the services when they get infected with malware.

                                      P This user is from outside of this forum
                                      P This user is from outside of this forum
                                      [email protected]
                                      wrote last edited by
                                      #37

                                      Ok, see the sandboxing makes sense and for a language like C++ makes sense. But every other language I used it with is already portable to every OS I have access to, so it feels like that defeats the benefit of using a language that's portable.

                                      W 1 Reply Last reply
                                      2
                                      • S [email protected]

                                        have to make sure of is that the deployment environment has node and the angular CLI installed

                                        I have spent so many fucking hours trying to coordinate the correct Node version to a given OS version, fucked around with all sorts of Node management tools, ran into so many glibc compat problems, and regularly found myself blowing away the packages cache before Yarn fixed their shit and even then there's still a serious problem a few times a year.

                                        No. Fuck no, you can pry Docker out of my cold dead hands, I'm not wasting literal man-weeks of time every year on that shit again.

                                        (Sorry, that was an aggressive response and none of it was actually aimed at you, I just fucking hate managing Node.js manually at scale.)

                                        trickdacy@lemmy.worldT This user is from outside of this forum
                                        trickdacy@lemmy.worldT This user is from outside of this forum
                                        [email protected]
                                        wrote last edited by
                                        #38

                                        I agree, for any context that it makes sense, docker is so worth it

                                        1 Reply Last reply
                                        0
                                        • C [email protected]

                                          I've been playing with systemd-nspawn for my containers recently, and I've been enjoying it!

                                          K This user is from outside of this forum
                                          K This user is from outside of this forum
                                          [email protected]
                                          wrote last edited by
                                          #39

                                          Try podman and quadlets

                                          ambiguousprops@lemmy.todayA C 2 Replies Last reply
                                          2
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups