this post was submitted on 24 Mar 2025
96 points (95.3% liked)

Selfhosted

45119 readers
783 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

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?

you are viewing a single comment's thread
view the rest of the comments
[–] agile_squirrel@lemmy.ml 2 points 5 days ago (3 children)

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.

[–] swab148@lemm.ee 6 points 5 days ago (1 children)

Sounds like you could use a reverse proxy.

[–] Jakeroxs@sh.itjust.works 2 points 4 days ago (1 children)

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 4 points 4 days ago (1 children)

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.

[–] Jakeroxs@sh.itjust.works 2 points 4 days ago

True, I love not having to open ports anymore, game changing.

[–] Fizz@lemmy.nz 2 points 4 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.

[–] eldain@feddit.nl 2 points 4 days ago (2 children)

I recommend fail2ban to stop the automated attacks that are the background noise of the internet. It will set your firewall to block certain ip's for a while, especially ports 21/22 are getting hammered with dictionary login attempts. And port 80 and 8080 for example get constantly version checked to see if you are vulnerable with an old apache, old dokuwiki etc, so don't expose more than you need to and maybe learn about ssh tunnels and close a few.

I once installed ossim in a small network with a server and it showed me it is war out there, scripts flying everywhere.

[–] lud@lemm.ee 3 points 4 days ago

Also get rid of password authentication if you can.

[–] agile_squirrel@lemmy.ml 1 points 4 days ago (1 children)

My server is only available on my LAN and via a VPN. Is fail2ban applicable? Or is it mainly for public facing servers?

[–] eldain@feddit.nl 1 points 4 days ago

Only public facing ports, maybe your openvpn login. But that means you are already firewalled up and your attack surface is tiny, good 👍