this post was submitted on 09 Mar 2025
30 points (96.9% liked)

Selfhosted

43809 readers
449 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'm running a website that is getting a lot of bot traffic and found Cloudflare free rule tier to be a bit limiting. (5 custom rules with length limits)

Ive got subnets for major VPS providers to block and will run analysis against my traffic to build on these lists.

What do others do?

I'm contemplating my Cloudflared tunnel into Crowdsec to my app.

you are viewing a single comment's thread
view the rest of the comments
[–] ArrowMax@feddit.org 6 points 22 hours ago (1 children)

FYI, IP access rules don't count towards the 5 custom rules limit, but the more generous 50k limit.

With fail2ban, you can setup IP access rules via the cftoken-action quite easily.

Security --> WAF --> Tools to access the IP rules in the dashboard. https://developers.cloudflare.com/waf/tools/ip-access-rules/

[–] AustralianSimon@lemmy.world 3 points 19 hours ago* (last edited 19 hours ago) (1 children)

I have more than 50k but even that page doesn't recommend it.

Top of that page

Recommendation: Use WAF custom rules instead

Cloudflare recommends that you create WAF custom rules instead of IP Access rules to perform IP-based or geography-based blocking (geoblocking):

  • For IP-based blocking, use an IP list in the custom rule expression.

On the fail2ban front, can I run my traffic through a f2b container and out into my app?

[–] ArrowMax@feddit.org 2 points 13 hours ago

WAF custom rules are more flexible, of course, and from a business perspective, I can understand why they would recommend that option instead.

I currently filter on an nginx access log file among other filters (sshd, bot-search, bad-requests) and let fail2ban execute the ban/unban action itself.

From a quick search, it should be possible to handle bans/unbans externally, if that's what you're after.