nuke/data
Xe Iaso 22c47f40d1
feat(expressions): add randInt function to allow making rules nondeterministic (#578)
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>
2025-05-28 16:36:27 -04:00
..
apps feat(apps): Make SASL login work on bookstack with Anubis (#502) 2025-05-16 17:01:34 +00:00
bots Bump AI-robots.txt rules to version 1.31 (#538) 2025-05-23 16:15:12 +00:00
clients feat(checker): add CEL for matching complicated expressions (#421) 2025-05-03 14:26:54 -04:00
common feat(checker): add CEL for matching complicated expressions (#421) 2025-05-03 14:26:54 -04:00
crawlers feat(config): allow multi-level imports (#402) 2025-05-02 13:57:20 -04:00
botPolicies.json feat(checker): add CEL for matching complicated expressions (#421) 2025-05-03 14:26:54 -04:00
botPolicies.yaml feat(expressions): add randInt function to allow making rules nondeterministic (#578) 2025-05-28 16:36:27 -04:00
embed.go feat(checker): add CEL for matching complicated expressions (#421) 2025-05-03 14:26:54 -04:00