Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • 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
104 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 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]
    #1

    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.

    static_rocket@lemmy.worldS dohpaz42@lemmy.worldD D M S 23 Replies Last reply
    387
    • 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.

      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
      #2

      This was a large part of the reason I switched to rootless podman for everything

      F P K 3 Replies Last reply
      63
      • static_rocket@lemmy.worldS [email protected]

        This was a large part of the reason I switched to rootless podman for everything

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

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

        static_rocket@lemmy.worldS D 2 Replies Last reply
        7
        • static_rocket@lemmy.worldS [email protected]

          This was a large part of the reason I switched to rootless podman for everything

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

          This is the way.

          1 Reply Last reply
          5
          • 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.

            dohpaz42@lemmy.worldD This user is from outside of this forum
            dohpaz42@lemmy.worldD This user is from outside of this forum
            [email protected]
            wrote last edited by
            #5

            It’s my understanding that docker uses a lot of fuckery and hackery to do what they do. And IME they don’t seem to care if it breaks things.

            L M G 3 Replies Last reply
            18
            • dohpaz42@lemmy.worldD [email protected]

              It’s my understanding that docker uses a lot of fuckery and hackery to do what they do. And IME they don’t seem to care if it breaks things.

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

              This is why I hate Docker.

              1 Reply Last reply
              0
              • dohpaz42@lemmy.worldD [email protected]

                It’s my understanding that docker uses a lot of fuckery and hackery to do what they do. And IME they don’t seem to care if it breaks things.

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

                To be fair, the largest problem here is that it presents itself as the kind of isolation that would respect firewall rules, not that they don't respect them.

                People wouldn't make the same mistake in NixOS, despite it doing exactly the same.

                1 Reply Last reply
                14
                • 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.

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

                  I DIDNT KNOW THAT! WOW, this puts “not to use network_mode: host” another level.

                  exu@feditown.comE G 2 Replies Last reply
                  15
                  • 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
                    #9

                    This is why I install on bare metal, baby!

                    1 Reply Last reply
                    8
                    • D [email protected]

                      I DIDNT KNOW THAT! WOW, this puts “not to use network_mode: host” another level.

                      exu@feditown.comE This user is from outside of this forum
                      exu@feditown.comE This user is from outside of this forum
                      [email protected]
                      wrote last edited by
                      #10

                      network: host gives the container basically full access to any port it wants. But even with other network modes you need to be careful, as any -p <external port>:<container port> creates the appropriate firewall rule automatically.

                      ambiguousprops@lemmy.todayA 1 Reply Last reply
                      6
                      • 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
                        #11

                        You're forgetting the part where they had an option to disable this fuckery, and then proceeded to move it twice - exposing containers to everyone by default.

                        I had to clean up compromised services twice because of it.

                        1 Reply Last reply
                        11
                        • static_rocket@lemmy.worldS [email protected]

                          This was a large part of the reason I switched to rootless podman for everything

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

                          My problem with podman is the incompatibility with portainer 😞

                          Any recommendations?

                          S G G 3 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.

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

                            Docker does not play fair, does not play nice. It’s a dozer that plow through everything for devops that yolo and rush to production.

                            1 Reply Last reply
                            2
                            • K [email protected]

                              My problem with podman is the incompatibility with portainer 😞

                              Any recommendations?

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

                              CLI and Quadlet? /s but seriously, that's what I use lol

                              C 1 Reply Last reply
                              4
                              • 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.

                                grrgyle@slrpnk.netG This user is from outside of this forum
                                grrgyle@slrpnk.netG This user is from outside of this forum
                                [email protected]
                                wrote last edited by
                                #15

                                If I had a nickel for every database I've lost because I let docker broadcast its port on 0.0.0.0 I'd have about 35¢

                                mangopenguin@lemmy.blahaj.zoneM 1 Reply Last reply
                                13
                                • K [email protected]

                                  My problem with podman is the incompatibility with portainer 😞

                                  Any recommendations?

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

                                  cockpit has a podman/container extension you might like.

                                  Q 1 Reply Last reply
                                  9
                                  • 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.

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

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

                                    K 1 Reply Last reply
                                    4
                                    • K [email protected]

                                      My problem with podman is the incompatibility with portainer 😞

                                      Any recommendations?

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

                                      I assume portainer communicates via the docker socket? If so, couldn’t you just point portainer to the podman socket?

                                      Q 1 Reply Last reply
                                      0
                                      • dohpaz42@lemmy.worldD [email protected]

                                        It’s my understanding that docker uses a lot of fuckery and hackery to do what they do. And IME they don’t seem to care if it breaks things.

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

                                        I don’t know how much hackery and fuckery there is with docker specifically. The majority of what docker does was already present in the Linux kernel namespaces, cgroups etc. Docker just made it easier to build and ship the isolated environments between systems.

                                        1 Reply Last reply
                                        2
                                        • 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
                                          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