This is a little bit of a wall of text but I hope it will be a nice sample for such a setup.

all 12 comments

sorted by: hot top controversial new old
[–] 2 points 1 month ago (8 children)

Isn’t Anubis useless against AI scrapers and just annoying people by now?

  • source
  • hideshow 8 child comments
  • [–] [S] 3 points 1 month ago (1 child)

    The principle is pretty simple : use a little bit of compute. If you're a bot and want to visit many sites the cost will add up, if you are a human going to a website the 1 second cost for the initial page is not a big deal.

    Also notice the difference with the extremely annoying cloudflare checkbox asking if you are a human that became ubiquitous lately. I'd rather wait a second.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 1 point 1 month ago (5 children)

    I haven't heard anything like that. If so, hope we get a source.

  • source
  • parent
  • hideshow 5 child comments
  • [–] 2 points 1 month ago (4 children)
  • [–] [S] 1 point 1 month ago* (last edited 1 month ago) (3 children)

    Thanks for the sources, reading them make me realize : MAYBE I have been protected so far because my website is built using InfernoJS and I didn't realize Forgejo doesn't requires Javascript.

    So the spams are more likely to appear from the "low-effort" bots that don't run a Javascript engine. The problem is that the website has only 5 static pages (the JS framework allows better server efficiency and language/theme switch) so spam were never an issue (you can get the whole websites in 10 requests).

    I am thinking about adding a fail2ban rule on the 503 answers triggered by nginx rate limit. This should but this would once again only protected against low-effort bot that don't calculate the rate limit.

    Experience will tell how good of a protection this is.

    Let me add that the website is still not using Anubis, this is only for the public forgejo instance. Also any published software is mirrored on codeberg. I think visitors of the self-host git repository is very niche and specialized, for any one but me looking at this forgejo instance should be more of looking my work or backup of the published work than anything, so very niche.

    PS : loving the runtimewire article concluding "instead of repeatedly charging the humans trying to read the page" when they have this

  • source
  • parent
  • hideshow 3 child comments
  • [–] 1 point 1 month ago (2 children)

    For me, every single request is coming from a different random IP address (different ASN, different country, etc.) using a random plausible User-Agent. There's no way to discern them as bot requests. And since every request is coming from a random source, things like fail2ban or CrowdSec don't really work. You can block a few major ASNs but there will still be lots of requests making it through.

    And these things work by going through a list of URLs previously collected. About a week ago I've configured a redirect for ALL requests to my personal Gitea instance to a zip bomb. It's been 7 days now where the website was inaccessible and I still see requests for deep links, e.g. specific commits or lists of pull requests. These things are relentless. That's also one of the arguments against Anubis - those scrapers just don't care.

    I've found some comments that at least a few ISPs check AbuseIPDB.com and cancel their customer's contracts if their IP appears in that database. So, I've now resorted to occasionally collect those IPs hammering my poor Raspberry Pi and reporting them to the AbuseIPDB. If people are unknowingly running a "residential proxy" (why don't we call them "open proxies" anymore?) somebody needs to let them know, I guess.

  • source
  • parent
  • hideshow 2 child comments
  • [–] [S] 1 point 1 month ago (1 child)

    Isn't the use of different random IP per request by bots a stronger arguments in favor of the default Anubis behavior? This would mean a lot of POW to be done by the bots.

    The deep link accesses is worrying indeed and Anubis is not a silver bullet.

    I also agree with the use of a known abusive IP database.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 1 point 1 month ago

    The bots don’t care about Anubis, though. Yes, their request will take a bit longer, but since each request is coming from a different device, they don’t care. They’ll just do the pow in parallel. And in the meantime you’re annoying every actual human visiting your site.

  • source
  • parent
  • [–] 1 point 1 month ago (2 children)

    I feel like a simple rate limit set to what your server can handle without issues is a better solution. Or combine it with Anubis at least.

  • source
  • hideshow 2 child comments
  • [–] [S] 1 point 1 month ago (1 child)

    This seems to be exactly the content of the post: rate limit + Anubis.

    The main point is more about "How to setup Anubis" rather than "Should we use Anubis" as I documented how I did my setup so I will not forget and at the same time sharing the resource. I am also using fail2ban but I didn't feel a post about how to set ip up would be as useful as documentation and guides seems already there.

  • source
  • parent
  • hideshow 1 child comment
  • 4 comments in c/opensource@lemmy.ml view that post
    [–] 8 points 1 month ago (1 child)

    Nice write-up. This is the first time I've encountered DynamicUser= in systemd, so I learnt something new.

  • source
  • hideshow 1 child comment
  • [–] [S] 3 points 1 month ago

    Actually same, this blog is also a nice way for me to document how my server was setup.

    I am quiet distro hopping because of ARM based distribution never really working nicely (GPU acceleration, old hardware not being updated). I need to remember what is what and why as my main job is not really taking care of servers but coding.

  • source
  • parent
  • [–] 3 points 1 month ago (1 child)

    scrap (third-person singular simple present scraps, present participle scrapping , simple past and past participle scrapped)

    (transitive) To discard; to get rid of.

    (transitive) To stop working on (a project or plan) indefinitely.

    Synonyms: abort, cancel, mothball

    https://en.wiktionary.org/wiki/scrap

    vs.

    scrape (third-person singular simple present scrapes, present participle scraping , simple past and past participle scraped)

    (ambitransitive) To draw (an object, especially a sharp or angular one), along (something) while exerting pressure.

    Synonym: scuff
    She scraped the wooden plate with her fingernails.
    That car often scrapes the shallowest of humps because of its low ground clearance.
    ...
    (transitive) To collect or gather, especially without regard to the quality of what is chosen.

    Just use whatever you can scrape together.

    (computing, transitive) To extract data by automated means from a format not intended to be machine-readable, such as a screenshot or a formatted web page.

    They didn't provide an API, so I simply scraped their website.

    https://en.wiktionary.org/wiki/scrape

  • source
  • hideshow 1 child comment
  • 4 comments in c/selfhosting@slrpnk.net view that post
    [–] 7 points 1 month ago (1 child)

    The rate limit is a bit pointless as the scrapers cycle through IPs via residential proxies and large data centers with many IPs and sadly there is an increasing number of scrapers that seems to be able to solve the Anubis challenge.

    Never the less, a nice tutorial for the basic setup that does still help to some extend 👍

  • source
  • hideshow 1 child comment
  • [–] 4 points 1 month ago (1 child)

    Unrelated to the actual anti-bot topic discussed here, but I would just like to mention this point:

    PROTOCOL = http+unix: because UNIX sockets are said to be faster locally but also because this avoids the painful management of ports. Also feels safer [as] there is no way to connect from outside.

    This is really underrated. I try to use this for all the server software I host, and not having to manage ports is absolutely great, along with knowing that nothing can connect to the service internally when it's not supposed to.

    Except I actually go a step further and use systemd's socket activation feature, which has a few additional benefits (like seamless restarts, no need for CAP_NET_BIND_SERVICE (my webserver and reverse proxy runs as a completely unprivileged user!), only starting the service once there is a request (this one is admittedly less useful), and having a quick overview of bound ports and Unix socket paths listed in the .socket file). Unfortunately, most programs need to be patched to support this, including forgejo (outdated codeberg link here because I had to set the forgejo repository on my own code forge to private earlier today because of scrapers…).

  • source
  • hideshow 1 child comment