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.

Edit: Adding in image of my analysis of the IPs scanning for vulnerabilities.

  • Xanza@lemm.ee
    link
    fedilink
    English
    arrow-up
    5
    ·
    edit-2
    22 hours ago

    https://github.com/fail2ban/fail2ban

    You can set dbpurgeage to 30d and pretty much just run it–or you can setup jail.conf with a bantime.factor. Its appeal is that you basically can download it, enable it, and it just works for you. It depends on your environment, though. If you have incoming authorized requests from other services it might be a pain to configure, but I’ve never used anything easier to protect you from bad actors.

  • callcc@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    5
    ·
    12 hours ago

    Wafs don’t make you safer but create unnecessary attack surface. Just keep your machine and services up to date.

    • AustralianSimon@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      15 minutes ago

      I’m trying to block the most likely attack vectors which is definitely VPS providers at this point in time. I just figure if I am blocking subnets plus additionals I identify it will force them out of these vectors to attack in ways I might be able to report better abuse.

      Here check out my analysis.

    • thelittleblackbird@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      10 hours ago

      You will need to explain a bit further this statement to mild knowledged internet stranger…

      Because the point of waf is exactly about reducing the exposed surface…

    • AustralianSimon@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      edit-2
      21 hours ago

      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
        link
        fedilink
        English
        arrow-up
        3
        ·
        15 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.

        • AustralianSimon@lemmy.worldOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          26 minutes ago

          No I think f2b handling it would be totally fine for me. Kids got in the way with digging around too much but will try this week.

  • The Bard in Green@lemmy.starlightkel.xyz
    link
    fedilink
    English
    arrow-up
    4
    ·
    1 day ago

    If you want to DIY something, I have a bash script that builds OpenResty with NAXSI from source. Most of the web apps I write anymore are actually in Lua, for OpenResty, maybe with an API written in something else. But I also help other members of my team deploy their Node and Python apps and stuff, and I always just park those behind OpenResty with NAXSI, just doing a standard nginx reverse proxy.