mirror of
https://github.com/TecharoHQ/anubis.git
synced 2025-08-03 17:59:24 -04:00

This seems counter-intuitive at first glance, but let me cook. One of the problems with Anubis is that the rule matching is super deterministic. This means that attackers can figure out what patterns they are hitting and change things to bypass them. The randInt function lets you have rulesets behave nondeterministically. This is a very easy way to hang yourself, but can be great to psychologically mess with scraper operators. Consider this rule: ```yaml - name: deny-lightpanda-sometimes action: DENY expression: all: - userAgent.matches("LightPanda") - randInt(16) >= 4 ``` It would match about 75% of the time. Signed-off-by: Xe Iaso <me@xeiaso.net>