-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample-rules.json
More file actions
77 lines (77 loc) · 2.07 KB
/
example-rules.json
File metadata and controls
77 lines (77 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{
"rules": [
{
"rule_id": "test-eq-cond",
"condition": {"eq": {"request.method": "GET"}},
"action": {"type": "setHeader", "headerName": "foo", "headerValue": "bar"}
},
{
"rule_id": "test-and-cond",
"condition": {
"and": [
{"eq": {"request.method": "GET"}},
{"eq": {"request.header.host": "example.com"}}
]
},
"action": {"type": "setHeader", "headerName": "hi", "headerValue": "there"}
},
{
"rule_id": "test-or-cond",
"condition": {
"or": [
{"eq": {"request.method": "GET"}},
{"eq": {"request.header.host": "foo.com"}}
]
},
"action": {"type": "setHeader", "headerName": "or", "headerValue": "condition"}
},
{
"rule_id": "test-not-cond",
"condition": {
"not": {"eq": {"request.method": "PUT"}}
},
"action": {"type": "block", "statusCode": 503}
},
{
"rule_id": "test-client-ip",
"condition": {
"eq": {"request.clientIp": "127.0.0.99"}
},
"action": {"type": "block", "statusCode": 429}
},
{
"rule_id": "test-static-throttle",
"condition": {
"and": [
{"eq": {"request.header.host": "deactivated.example.com"}}
]
},
"action": {"type": "throttle", "max_tokens": 50, "refill_amount": 5, "refill_time": 1 }
},
{
"rule_id": "test-eachUnique-throttle",
"condition": {
"and": [
{"eq": {"request.header.host": "throttled.example.com"}}
]
},
"action": {
"type": "throttle",
"max_tokens": 5,
"refill_amount": 5,
"refill_time": 1,
"each_unique": "request.clientIp"
}
},
{
"rule_id": "test-queryParam",
"condition": {"eq": {"request.queryParam.userId": "paul"}},
"action": {"type": "block", "statusCode": 503}
},
{
"rule_id": "test-in-condition",
"condition": {"in": {"request.queryParam.userId": ["joe", "jane", "victor"]}},
"action": {"type": "block", "statusCode": 503}
}
]
}