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.
  • mangopenguin@lemmy.blahaj.zoneM [email protected]

    For local access you can use 127.0.0.1:80:80 and it won't put a hole in your firewall.

    Or if your database is access by another docker container, just put them on the same docker network and access via container name, and you don't need any port mapping at all.

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

    Yeah, I know that now lol, but good idea to spell it out. So what Docker does, which is so confusing when you first discover the behaviour, is it will bind your ports automatically to 0.0.0.0 if all you specify is 27017:27017 as you port (without an IP address prefixing). AKA what the meme is about.

    1 Reply Last reply
    0
    • grrgyle@slrpnk.netG [email protected]

      My use case was run a mongodb container on my local, while I run my FE+BE with fast live-reloading outside of a container. Then package it all up in services for docker compose on the remote.

      firelizzard@programming.devF This user is from outside of this forum
      firelizzard@programming.devF This user is from outside of this forum
      [email protected]
      wrote last edited by
      #102

      Ok… but that doesn’t answer my question. Where are you physically when you’re working on this that people are attacking exposed ports? I’m either at home or in the office, and in either case there’s an external firewall between me and any assholes who want to exploit exposed ports. Are your roommates or coworkers those kinds of assholes? Or are you sitting in a coffee shop or something?

      grrgyle@slrpnk.netG 1 Reply Last reply
      1
      • firelizzard@programming.devF [email protected]

        Ok… but that doesn’t answer my question. Where are you physically when you’re working on this that people are attacking exposed ports? I’m either at home or in the office, and in either case there’s an external firewall between me and any assholes who want to exploit exposed ports. Are your roommates or coworkers those kinds of assholes? Or are you sitting in a coffee shop or something?

        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 [email protected]
        #103

        This was on a VPS (remote) where I didn't realise Docker was even capable of punching through UFW. I assumed (incorrectly) that if a port wasn't reversed proxied in my nginx config, then it would remain on localhost only.

        Just run docker run -p 27017:27017 mongo:latest on a VPS and check the default collections after a few hours and you'll likely find they're replaced with a ransom message.

        firelizzard@programming.devF 1 Reply Last reply
        0
        • grrgyle@slrpnk.netG [email protected]

          This was on a VPS (remote) where I didn't realise Docker was even capable of punching through UFW. I assumed (incorrectly) that if a port wasn't reversed proxied in my nginx config, then it would remain on localhost only.

          Just run docker run -p 27017:27017 mongo:latest on a VPS and check the default collections after a few hours and you'll likely find they're replaced with a ransom message.

          firelizzard@programming.devF This user is from outside of this forum
          firelizzard@programming.devF This user is from outside of this forum
          [email protected]
          wrote last edited by
          #104

          Ah, when you said local I assumed you meant your physical device

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

            Or maybe it should be easy to configure correctly?

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

            That's asking a lot, these days.

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