I’ve been running my server without a firewall for quite some time now, I have a piped instance and snikket running on it. I’ve been meaning to get UFW on it but I’ve been too lazy to do so. Is it a necessary thing that I need to have or it’s a huge security vulnerability? I can only SSH my server from only my local network and must use a VPN if I wanna SSH in outside so I’d say my server’s pretty secure but not the furthest I could take it. Opinions please?

  • Fizz@lemmy.nz
    link
    fedilink
    English
    arrow-up
    4
    ·
    13 days ago

    Disclaimer, I’m not a network professional im only learning. But you dont need ufw since your router firewall should be able to filter majority of the traffic. But in security there is a concept of layers. You want your router firewall then your device firewall to provide multiple layers incase something slips through one layer.

    So to give a simple answer, it depends how secure you want your network to be. Personally I think UFW is easy so you may as well set it up. 5sec of config might stop a hacker traversing your network hoping from device to device.

    • farcaller@fstab.sh
      link
      fedilink
      English
      arrow-up
      3
      arrow-down
      1
      ·
      13 days ago

      This is the best answer. Your router protects you from the outside, but a local firewall can protect you from someone prodding your lan from a hacked camera or some other IoT device. By having a firewall locally you just minimize the attack surface further.

    • mr_jaaay@lemmy.ml
      link
      fedilink
      English
      arrow-up
      1
      ·
      12 days ago

      To follow up on this, I’d look to network segmentation as another useful security barrier. I’ve just started playing around with VLANs, but the way I plan on setting things up is to have individual VLANs for services, management and IoT, with the LAN for all other user-land devices. On top of this you add strict firewall rules to what can talk to what, on which ports, etc. So all devices on the network can do DNS queries to my two DNS servers, for instance, but things from my services VLAN can’t reach anything outside of this VLAN…

      • Elvith Ma'for@feddit.org
        link
        fedilink
        English
        arrow-up
        2
        arrow-down
        1
        ·
        13 days ago

        Instead of thinking with layers, you should use think of Swiss cheese. Each slice of cheese has some holes - think of weaknesses in the defense (or intentional holes as you need a way to connect to the target legitimately). Putting several slices back to back (in random order and orientation) means that the way to penetrate all layers is not a simple straight way, but that you need to work around each layer.

        • null_dot@lemmy.dbzer0.com
          link
          fedilink
          English
          arrow-up
          1
          ·
          13 days ago

          I’ve heard this analogy before but I don’t really care for it myself.

          It creates a mental image but isn’t really analogous.

          In the case of a firewall on a server behind a NAT, ports forwarded through the NAT are holes through the first several slices.

          • Elvith Ma'for@feddit.org
            link
            fedilink
            English
            arrow-up
            0
            arrow-down
            1
            ·
            13 days ago

            If done correctly, those may only be open from the internet, but not from the local network. While SSH may only be available from your local network - or maybe only by the fixed IP of your PC. Other services may only be reachable, when coming from the correct VLAN (assuming you did segment your home network). Maybe your server can only access the internet, but not to the home network, so that an attacker has a harder time spreading into your home network (note: that’s only really meaningful, if it’s not a software firewall on that same server…)

    • agile_squirrel@lemmy.ml
      link
      fedilink
      English
      arrow-up
      0
      ·
      13 days ago

      I have about 20 services on my machine so I’m going to need to open a ton of ports (ssh, SSL, multiple higher number ports since some services require several ports). At that point, what is the point of a firewall if so many ports are open? With so many ports open, it seems like a firewall doesn’t add much security vs the complexity it adds.

        • Jakeroxs@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          0
          ·
          13 days ago

          That doesn’t count as a firewall though no? I use traefik as my reverse proxy (and like one thing on nginx that also goes through traefik ultimately) but I still put crowdsec on top

          • swab148@lemm.ee
            link
            fedilink
            English
            arrow-up
            1
            ·
            13 days ago

            No, but putting a bunch of those services behind a reverse proxy would lower the amount of open ports. It would also have the side effect of making firewall configuration easier, since you don’t need rules for all those ports anymore.

      • Fizz@lemmy.nz
        link
        fedilink
        English
        arrow-up
        0
        arrow-down
        1
        ·
        12 days ago

        If someone exploits a service on the machine they can then connect outside that machine on any port. Ufw would prevent this. The router firewall would also likely prevent this unless they used an open port of the router or upnp was enabled.