[–] [S] 2 points 2 months ago (1 child)

I've not set up nice graphics for iocaine (or any of the host stats) bu this is the last 5 days and that is with the asn-blocks and AI block turned on in CF

curl -s http://127.0.0.1:42042/metrics | grep '^qmk_'
qmk_garbage_generated{host="127.0.0.1:42069"} 3888
qmk_garbage_generated{host="no.lastname.nz"} 1147955554
qmk_requests{host="127.0.0.1:42069"} 2
qmk_requests{host="172.18.0.1:42069"} 6
qmk_requests{host="no.lastname.nz"} 1386448
qmk_ruleset_hits{outcome="default",ruleset="default"} 490771
qmk_ruleset_hits{outcome="default",ruleset="trusted-agent"} 2
qmk_ruleset_hits{outcome="default",ruleset="trusted-path"} 134
qmk_ruleset_hits{outcome="garbage",ruleset="ai.robots.txt"} 1689
qmk_ruleset_hits{outcome="garbage",ruleset="major-browsers"} 48928
qmk_ruleset_hits{outcome="garbage",ruleset="poisoned-url"} 844868
qmk_ruleset_hits{outcome="garbage",ruleset="unwanted-visitors"} 64
  • source
  • parent
  • context
  • [–] 1 point 2 months ago (2 children)

    Do you know how many of those are being caught by iocaine?

    These are my stats for anubis (this is only UI requests - LemmyUI and Mlmym mostly, no federation or app usage in this). A total of about 600k requests. Weigh and Challenge are the options given a proof of work challenge to solve (weigh just means the rules for the user agent or whatever mean the challenge difficulty was adjusted, often to make it harder for suspicious requests).

    Out of the challenges issued in this time period, around 11% were validated (so 89% of the weigh and challenge traffic was also denied in addition to "deny" which was denied without issuing a challenge due to rules).

  • source
  • parent
  • context
  • [–] 1 point 2 months ago (7 children)

    For the last 3 days (since turning on the block) there has been a dead spot from China from 4:00 to 14:00 NZST.

    @Dave@lemmy.nz you seeing the same drop?

    Ah i missed your edit. I don't have per country data like that, I've only very recently played with removing Cloudflare from the equation and haven't set up any geo-location stuff yet. My requests are coming pretty evenly over the day though, up and down a bit bit depending on time but nothing like what you're describing. I'm looking at all traffic though, not just China.

  • source
  • parent
  • context
  • [–] 1 point 2 months ago (1 child)

    Seeing multiple operating systems and several browser versions from the same IP address over a relatively short period is very unlikely to represent ordinary human traffic.

    This is not true, NAT makes this happen. From your home your android device, apple devices and windows devices will have different user agents based non the software version.

    Now scale that up with technology like Carrier Grade NAT where one public IP is used for a dozen or several dozen houses.
    At one IPS I worked for we had 140 apartments behind a single IP address. You can imagine the chaos of user agents happening there.

    No doubt there is dodgy stuff going on, just that assumption doesn't match with technology.

  • source
  • [–] 1 point 2 months ago (10 children)

    Damn. I've got Cloudflare off so should go install a geoip database so I can check what country things are coming from.

    Not to out do you but we actually hit 50 requests per second a few hours back! That's through the reverse proxy so includes federation and other traffic not hitting anubis.

  • source
  • parent
  • context
  • [–] 2 points 2 months ago (12 children)

    Damn, you're getting similar levels to us. Got about 520k requests to the UIs in the past 24 hours (this excludes federation or app usage that hit APIs directly, I have Anubis placed after those are split off).

    Of those 520k, Anubis flat denies about half. and virtually all the rest are challenged, with somewhere around 7% actually being completed. So we are talking about 18k of the 520k getting through now. Most of those are probably still bots (logged in users get a straight pass through, and as mentioned federation or app users don't follow this path), but the server is much happier now than it was a few days ago.

    I have Cloudflare disabled now, trying that out. I've had to get Grafana up to scratch as I don't get to use Cloudflare stats to track anymore.

  • source
  • parent
  • context
  • [–] [S] 2 points 2 months ago* (15 children)
    CF ASN and bot block
    │
    ▼
    Caddy/Iocaine
    │
    ├── response other than 421 ──► return Iocaine response
    │
    └── 421 ──────────────────────► continue to normal Caddy routing
                                      │
                                      ▼
                                   Caddy - CN block
                                      │
                                      ▼
                                    Lemmy
    

    Caddyfile:

    {$LEMMY_HOSTNAME} {
        import caddy-common
    
        ######################################
        ########## log files        ##########
        log cn_blocked {
                output file /data/cn-blocked.log
                format json
                no_hostname
        }
    
        ########## iocaine  code ##########
        @read method GET HEAD
                reverse_proxy @read host.docker.internal:42069 {
                @fallback status 421
                handle_response @fallback
        }
    
        ########## cn blocking code ##########
        @blocked {
                remote_ip 1.0.1.0/24 ...
        }
    
        route @blocked {
                log_name cn_blocked
                respond "<h1>Access Denied</h1>" 403
        }
        ##########   cn block ends  ##########
        ######################################  
    

    Iocaine metrics with CF still on:

    $ curl -s http://127.0.0.1:42042/metrics | grep '^qmk_'
    qmk_garbage_generated{host="127.0.0.1:42069"} 3888
    qmk_garbage_generated{host="no.lastname.nz"} 251440
    qmk_requests{host="127.0.0.1:42069"} 2
    qmk_requests{host="172.18.0.1:42069"} 2
    qmk_requests{host="no.lastname.nz"} 404
    qmk_ruleset_hits{outcome="default",ruleset="default"} 223
    qmk_ruleset_hits{outcome="default",ruleset="trusted-path"} 1
    qmk_ruleset_hits{outcome="garbage",ruleset="ai.robots.txt"} 11
    qmk_ruleset_hits{outcome="garbage",ruleset="major-browsers"} 172
    qmk_ruleset_hits{outcome="garbage",ruleset="unwanted-visitors"} 1
    
  • source
  • parent
  • context
  • [–] 1 point 2 months ago (16 children)

    I remember investigating and finding all the problematic IPs had requests evenly spread. Dozens of IPs from China, Singapore, and various South American countries. All of them had approx 80k requests in the period I was looking at, as if they send a few requests with one, then the next, then the next, rotating through then back to the start. Avoids rate limits I guess.

    I am considering adding Iocaine as a first line of defence before Anubis, and seeing if that helps

  • source
  • parent
  • context
  • [–] [S] 2 points 2 months ago (17 children)

    Yeah, I had about 600k + the ones I blackholed in Caddy in the 20h yesterday (I blackholed the whole 36.0.0.0/8 block in the end on the server)

    3 requests (/api/v3/site /api/v3/post? /api/v3/comment/list?) in 50ms, from a IP then that IP would go silent for ages, then 500ms latter it was a fresh IP

  • source
  • parent
  • context
  • [–] 1 point 2 months ago (18 children)

    Installing Anubis was certainly a big help for us, Iocaine should do something similar for you, fingers crossed!

    I have been toggling the Cloudflare proxying trying to handle bots without it. old.lemmy.nz has had over 100k hits in the last 12 hours, this is just the ones that got past anubis. Something tells me that's not legit.

  • source
  • parent
  • context
  • [–] 2 points 2 months ago*

    The robots.txt is for well behaved bots. I already deployed that list quite some time back but it didn't help, because the problem are the not well behaved bots.

    Iocane should be showing hidden links that only bots can see, and leading then into a maze of gibberish. It has other features too, but the core function is to keep them busy on easy to serve pages that poison their training and are inexpensive for your site to serve (as opposed to the lemmy pages, that have expensive database calls on every page load).

  • source
  • parent
  • context
  • view more: next ›