| 1 | bots:
|
| 2 | - name: php
|
| 3 | path_regex: php$
|
| 4 | action: DENY
|
| 5 | - name: api-calls
|
| 6 | expression:
|
| 7 | any:
|
| 8 | - 'method == "POST"'
|
| 9 | - 'method == "PATCH"'
|
| 10 | - 'method == "DELETE"'
|
| 11 | - 'path.contains("/api/")'
|
| 12 | action: ALLOW
|
| 13 | # Defaults taken from https://github.com/TecharoHQ/anubis/blob/main/data/botPolicies.yaml
|
| 14 | # Pathological bots to deny
|
| 15 | - import: (data)/bots/_deny-pathological.yaml
|
| 16 | - import: (data)/bots/aggressive-brazilian-scrapers.yaml
|
| 17 | - import: (data)/meta/ai-block-aggressive.yaml
|
| 18 | # Search engine crawlers to allow, defaults to:
|
| 19 | - import: (data)/crawlers/_allow-good.yaml
|
| 20 | # Challenge Firefox AI previews
|
| 21 | - import: (data)/clients/x-firefox-ai.yaml
|
| 22 | # Allow common "keeping the internet working" routes (well-known, favicon, robots.txt)
|
| 23 | - import: (data)/common/keep-internet-working.yaml
|
| 24 | # Generic catchall rule
|
| 25 | - name: generic-browser
|
| 26 | user_agent_regex: >-
|
| 27 | Mozilla|Opera
|
| 28 | action: WEIGH
|
| 29 | weight:
|
| 30 | adjust: 10
|
| 31 |
|
| 32 | # The weight thresholds for when to trigger individual challenges. Any
|
| 33 | # CHALLENGE will take precedence over this.
|
| 34 | #
|
| 35 | # A threshold has four configuration options:
|
| 36 | #
|
| 37 | # - name: the name that is reported down the stack and used for metrics
|
| 38 | # - expression: A CEL expression with the request weight in the variable
|
| 39 | # weight
|
| 40 | # - action: the Anubis action to apply, similar to in a bot policy
|
| 41 | # - challenge: which challenge to send to the user, similar to in a bot policy
|
| 42 | #
|
| 43 | # See https://anubis.techaro.lol/docs/admin/configuration/thresholds for more
|
| 44 | # information.
|
| 45 | thresholds:
|
| 46 | # By default Anubis ships with the following thresholds:
|
| 47 | - name: minimal-suspicion # This client is likely fine, its soul is lighter than a feather
|
| 48 | expression: weight <= 0 # a feather weighs zero units
|
| 49 | action: ALLOW # Allow the traffic through
|
| 50 | # For clients that had some weight reduced through custom rules, give them a
|
| 51 | # lightweight challenge.
|
| 52 | - name: mild-suspicion
|
| 53 | expression:
|
| 54 | all:
|
| 55 | - weight > 0
|
| 56 | - weight < 10
|
| 57 | action: CHALLENGE
|
| 58 | challenge:
|
| 59 | # https://anubis.techaro.lol/docs/admin/configuration/challenges/metarefresh
|
| 60 | algorithm: metarefresh
|
| 61 | difficulty: 1
|
| 62 | report_as: 1
|
| 63 | # For clients that are browser-like but have either gained points from custom rules or
|
| 64 | # report as a standard browser.
|
| 65 | - name: moderate-suspicion
|
| 66 | expression:
|
| 67 | all:
|
| 68 | - weight >= 10
|
| 69 | - weight < 20
|
| 70 | action: CHALLENGE
|
| 71 | challenge:
|
| 72 | # https://anubis.techaro.lol/docs/admin/configuration/challenges/proof-of-work
|
| 73 | algorithm: fast
|
| 74 | difficulty: 2 # two leading zeros, very fast for most clients
|
| 75 | report_as: 2
|
| 76 | # For clients that are browser like and have gained many points from custom rules
|
| 77 | - name: extreme-suspicion
|
| 78 | expression: weight >= 20
|
| 79 | action: CHALLENGE
|
| 80 | challenge:
|
| 81 | # https://anubis.techaro.lol/docs/admin/configuration/challenges/proof-of-work
|
| 82 | algorithm: fast
|
| 83 | difficulty: 4
|
| 84 | report_as: 4
|
| 85 |
|