diff options
| author | Neur0toxine <pashok9825@gmail.com> | 2025-04-21 01:18:21 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-20 22:18:21 +0000 |
| commit | 7dc545cfa9281efcf802ff0afd6d3796c4f5922c (patch) | |
| tree | 15bb4fbb17df640bb1d4860d5dcb0864488dcd73 /lib/policy/config/testdata | |
| parent | 1add24b907f35e645190078045867369f34919c2 (diff) | |
| download | anubis-7dc545cfa9281efcf802ff0afd6d3796c4f5922c.tar.xz anubis-7dc545cfa9281efcf802ff0afd6d3796c4f5922c.zip | |
Add headers bot rule (#300)
* Closes #291: add headers support to bot policy rules
* Fix config validator
Diffstat (limited to 'lib/policy/config/testdata')
| -rw-r--r-- | lib/policy/config/testdata/bad/badregexes.json | 7 | ||||
| -rw-r--r-- | lib/policy/config/testdata/good/block_cf_workers.json | 12 |
2 files changed, 19 insertions, 0 deletions
diff --git a/lib/policy/config/testdata/bad/badregexes.json b/lib/policy/config/testdata/bad/badregexes.json index e85b85b..db371b0 100644 --- a/lib/policy/config/testdata/bad/badregexes.json +++ b/lib/policy/config/testdata/bad/badregexes.json @@ -9,6 +9,13 @@ "name": "user-agent-bad", "user_agent_regex": "a(b", "action": "DENY" + }, + { + "name": "headers-bad", + "headers": { + "Accept-Encoding": "a(b" + }, + "action": "DENY" } ] }
\ No newline at end of file diff --git a/lib/policy/config/testdata/good/block_cf_workers.json b/lib/policy/config/testdata/good/block_cf_workers.json new file mode 100644 index 0000000..b84f1e0 --- /dev/null +++ b/lib/policy/config/testdata/good/block_cf_workers.json @@ -0,0 +1,12 @@ +{ + "bots": [ + { + "name": "Cloudflare Workers", + "headers_regex": { + "CF-Worker": ".*" + }, + "action": "DENY" + } + ], + "dnsbl": false +}
\ No newline at end of file |
