Thanks I’ll look into these. Quick question: how does fail2ban use port 80 if that’s already used by nginx?
Comment on Am I doing this (networking) safely?
redlemace@lemmy.world 3 weeks ago
My usual additions:
- Have the router to block portscanners
- fail2ban on internet facing services.
flork@lemy.lol 3 weeks ago
redlemace@lemmy.world 3 weeks ago
It does not. It does not uses ports at all. Fail2ban monitors your logfiles and activates the firewall to block IP’s that matched your rules.
t.ex. You can block an IP that tried to access https://<url>/admin. You can block an IP that used wrong credentials x times to login on an ssh port. Or block one that tried to relay via your mailserver. The duration is configurable and alternative duration can be configured for recidivists.
And yes, you can whitelist IP’s to avoid locking yourself out. The possibilities are endless.
flork@lemy.lol 1 week ago
I see, the default docker installer for fail2ban gave me an error because “Port 80 was already in use” (by NGINX Manager).
redlemace@lemmy.world 1 week ago
Fail2ban does not listen on any port for it has no user interface. No interface at all actually. It’s just a process that monitors your logfiles and changes firewall rules and writes to syslog if you tell it to.
I run it on internet facing servers so I use a ‘regular’ install and never docker. I see no advantage for docker in this case, but one huge disadvantage: Docker changes a lot on the network side. It creates bridges, and picks IP’s all by itself. I hate that. (I know you can put in a lot of effort to manage it, but no thanks stay of my network config thank you)
non_burglar@lemmy.world 3 weeks ago
What do you mean by this?
redlemace@lemmy.world 3 weeks ago
I’m using RouterOS. In the firewall rules you can create a rule that if an IP touches a port, it get added to a address list (optional with a time-out). So my FW rules begin like this:
This too has endless possibilities. t.ex. like port knocking. (‘touch’ one or more ports in a specified sequence in a specified time to be allowed to access the actual service port)
non_burglar@lemmy.world 3 weeks ago
This is a waste of time and your router’s CPU. You already have a whitelist and know your safe TCP sources, just drop all wan traffic and only allow new input from whitelist. Your chain input rule is just creating a pretty list of bots you’re dropping anyway.
redlemace@lemmy.world 3 weeks ago
Well, here is the CPU load:
Image
And there is no increase on delay’s or jitter compared to what i’m already facing on the WAN itself.
It keep’s 6000+ hosts with possible harmful intend away from the ports I need/want open to the world. Actually, the router -while still being bored- offloads the services behind it. I really can’t see a reason not to keep doing it. But, sure, it’s a personal choice.
Appoxo@lemmy.dbzer0.com 3 weeks ago
Off-topic: Looks like you missed the two spaces after beginning a new line.
Just wanted to inform you in case you werent aware ;)
redlemace@lemmy.world 3 weeks ago
the spacebar on my Remington isn’t what it used to be, maybe a drop of oil will help ;)