this post was submitted on 15 Sep 2026
42 points (97.7% liked)

Selfhosted

62975 readers
750 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:

Detailed Rules Post

  1. Be civil.

  2. No spam.

  3. Posts are to be related to self-hosting.

  4. Don't duplicate the full text of your blog or readme if you're providing a link.

  5. Submission headline should match the article title.

  6. No trolling.

  7. Promotion posts require active participation, with an account that is at least 30 days old. F/LOSS without a paywall has exceptions, with requirements. See the rules link for details. Tags [CBH] or [AIP] are required, see the links in Rule 8 for details.

  8. AI-related discussions and AI-involved promotional posts have additional requirements for tagging, as noted in Rule 7 and the AI & Promotional Post Expanded Rules post, and find example disclosures here.

Resources:

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

Questions? DM the mods!

founded 3 years ago
MODERATORS
 

I have everything I host and expose behind authelia (which requires 2fa) as middleware or as the only login method with oicd, thus far it seems to work well, of course I get a bunch of malicious traffic and spam but this gets to authelia and stops there, I don't even see multiple tried login tries ever so I felt pretty safe. However it does seem that everyone uses either fail2ban or crowdsec in addition so I have been wondering if it would really add any security in my setup or if I'm missing something. I'm sure it wouldn't hurt but crowdsec always seemed a little too complex for me and I don't want something I don't fully understand in my security layer and I never saw a nice way to setup fail2ban so never bothered. Afaik there's no webui or such things and you have to manually make working regex for everything. I'd like to know if I'm missing something or if anyone has tipps to give

all 18 comments
sorted by: hot top controversial new old
[–] jrgd@lemmy.zip 19 points 1 month ago

Generally, your auth provider (assuming setup correctly) should be one of the most secure components of your internet-exposed setup. That being said, vulnerabilities can and do occur. Adding a combination of Crowdsec, OWASP CRS, other ModSecurity rulesets, and/or fail2ban will add a degree of migitation of potential exploits by blacklisting known bad actors/active bad behavior.

Above all, you should have a plan to keep aware of updates to your publicly-exposed software and be able to deploy those updates in a timely fashion.

[–] folekaule@lemmy.world 12 points 1 month ago

Fail2ban is just another tool in your toolbox. Defense in depth, as others mentioned.

Fail2ban is primarily a tool to prevent brute force attacks, especially useful for services that don't do their own throttling. For example I usually put ssh in fail2ban, but if Authelia's built-in protection is good enough, then use that.

Outside ssh, anything that could be used to brute force credentials should be in fail2ban if they're exposed: web sites with simple auth, mail, etc.

[–] hendrik@palaver.p3x.de 11 points 1 month ago* (last edited 1 month ago) (2 children)

Authelia should come with rate limiting to protect against brute-force attacks. That could be enough.

I'd generally advise to make sure such protection actually works. Like look up the limits and try to login with a wrong password 30 times... Especially if you added stuff on top (fail2ban, crowdsec...). Has happened to me I misconfigured stuff and it didn't limit anything... Now I check to make sure for important bits like an authentication service.

[–] wreckedcarzz@lemmy.world 5 points 1 month ago

Do make sure that you can eventually get back in after testing, though. Sure, it's safer when even you can't access it, but... :p

[–] Arda@piefed.social 3 points 1 month ago (1 children)

i do have ratelimiting configured but yes i never tested it which i should

[–] hendrik@palaver.p3x.de 1 points 1 month ago* (last edited 1 month ago)

Guess if it works, you don't really need fail2ban as f2b pretty much does the same job. I mean it can do more, but you don't really need to protect against PHP issues, broken wordpress plugins etc since none of that is part of Authelia.

I use fail2ban, as I have SSH running and several other services exposed which come with default fail2ban configurations. And I never got crowdsec running properly. So I skipped it. I think frequent updates and all those things are more important than a web application firewall anyway.

[–] frongt@lemmy.zip 8 points 1 month ago (1 children)

Security works in layers. You don't know if there's a vulnerability in Authelia.

[–] Arda@piefed.social 3 points 1 month ago (1 children)

sure but if there would be an exploit in authelia would f2b even help, isnt the way it works that it blocks mostly spam and known bad traffic? If its already known by filterlists i feel its safe to assume its patched in authelia

[–] IanTwenty@piefed.social 3 points 1 month ago

Say that new authelia exploit looks like one fail2ban already recognises or relies on timing/brute-force then you're covered even before a patch is available.

Here's a real authelia vuln:

https://app.opencve.io/cve/CVE-2026-47203

allowing an attacker to circumvent login throttling or account lockouts by simply altering the case of their credentials.

I think fail2ban would help protect authelia here?

[–] Knossos@lemmy.world 6 points 1 month ago

I used to have my system through CrowdSec and authentik. Now it's Lan and Vpn only. Ai makes things too spicy for my liking.

[–] shininghero@pawb.social 3 points 1 month ago* (last edited 1 month ago)

My network has all the web ui stuff kept local and only accessible via OpenVPN on port 443, with fail2ban as well.

By the time a would-be attacker realizes it's not actually a webserver, they'll have exhausted most, if not all, of their public IP addresses on fuzzing for webserver vulnerabilities.

EDIT: and as a bonus, I can also just punch out through the firewall my work has on the visitor network with ease. All I needed was a second fail2ban rule for their static IP to deal with followup scans.

[–] CompactFlax@discuss.tchncs.de 3 points 1 month ago

I am not a fan of geoblocking as a first line defense but when I blocked everything outside of my country, fail2ban stopped firing, entirely.

[–] RIotingPacifist@lemmy.world 1 points 1 month ago

Put as many layers in your onion as possible, also limit outbiund traffic which will make further exploration more difficult (especially if it's an automated attack)