Add headers bot rule (#300)
* Closes #291: add headers support to bot policy rules * Fix config validator
This commit is contained in:
parent
1add24b907
commit
7dc545cfa9
9 changed files with 125 additions and 21 deletions
|
|
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
12
lib/policy/config/testdata/good/block_cf_workers.json
vendored
Normal file
12
lib/policy/config/testdata/good/block_cf_workers.json
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"bots": [
|
||||
{
|
||||
"name": "Cloudflare Workers",
|
||||
"headers_regex": {
|
||||
"CF-Worker": ".*"
|
||||
},
|
||||
"action": "DENY"
|
||||
}
|
||||
],
|
||||
"dnsbl": false
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue