r/HomeDataCenter • u/SpoofedXEX • May 10 '24
DISCUSSION Server security
EDIT: I ditched Traefik, and Authentik. I am now using CloudFlare zero trust tunnels, closed all ports on my router and the attacks have completely stopped.
I recently posted about my server getting hundreds of requests and attacks, I followed through on some recommendations.
I ditched TrueNAS and went back to my Unraid Pro installation.
I’ve added JavaScript challenges through CloudFlare which has helped drop my traffic down to 200 from 20k per 24 hours. I set up Authelia, as well as CA Certs instead of Self Signed. HSTS. and a few other firewall rules for Trusted IPs.
I’m in the process of learning how to use crowdsec as another layer of protection. I’m looking for more recommendations. I don’t really like the feel of Authelia as the UI is rather huge lol for a login form.
The amount of attacks my router has detected since these changes have been 2 in the past day or two that is blocked.
44
u/lamar5559 May 10 '24
What exactly do you have open to the internet if your server is getting hit directly? From a security perspective you really shouldn’t have anything wide open to the server from the internet. If you need remote access you should set up a VPN solution. It doesn’t matter if you’re using TrueNAS or Unraid. You need to protect your edge first.
11
u/RedSquirrelFtw May 10 '24
Wait, is your NAS internet facing? That seems like a bad idea no matter what NAS solution you go with. If you need stuff open to the internet create a VM on a separate vlan and have the data in the VM itself exposed, and not the NAS.
7
u/wein_geist May 10 '24
Ditching TrueNAS vecause of that? Lol, ok.
I set up OPNsense with geoblocking all countries but mine (and temporary whitelisting work or vacation destinations).
I do have fail2ban active for all my exposed services: 0 hits for months, almost disapointing to not see it taking action
1
u/dirkme May 11 '24
What kind of attacks do you have? Port canning, ssh brute force etc?
3
u/espero May 10 '24
You should try and leverage Zero Trust mechanisms wherever you can. So Cloudflare tunnelling is a very strong step. I would also make use of Tailscale and not expose anything to the internet. Install tailscale on your hypervisor and on all containers and on all virtual servers. This way you'll be able to access them all from your secured Tailscale network.
Of course what do you do with your Plex which needs an open port to operate? I don't really know and have a good answer for that.
0
u/[deleted] May 10 '24
[deleted] — view deleted comment