forked from angeloxx/swagger2modsec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSAMPLE1.conf
47 lines (34 loc) · 3.64 KB
/
SAMPLE1.conf
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
# This file is auto-generated with swagger2modsec script and is based on
# swagger input file SAMPLE1.json
# SHA256 hash 5b34c38cd1052a8614ea73740fd1e2d52f9ffbe111041348bdeec938a186061c
SecAction "id:10000,phase:request,t:none,log,setenv:'isValidURI=No'"
# /pets ######################################################################
SecRule REQUEST_URI "@streq /pets" "id:10001,phase:request,t:none,log,tag:'SWAGGER/WHITELIST_URI',setenv:'isValidURI=Yes'"
SecRule REQUEST_URI "@streq /pets" "id:10002,phase:request,t:none,log,tag:'SWAGGER/METHOD_NOT_ALLOWED',deny,chain"
SecRule REQUEST_METHOD "!^(GET|POST)$" "t:none"
SecRule REQUEST_URI "@streq /pets" "id:10003,phase:request,t:none,log,tag:'SWAGGER/PARAMETER_NAME_VALIDATION',deny,chain"
SecRule REQUEST_METHOD "GET" "t:none,chain"
SecRule ARGS_NAMES "!^(tags|limit)$" "t:none"
SecRule REQUEST_URI "@streq /pets" "id:10004,phase:request,t:none,log,tag:'SWAGGER/PARAMETER_TYPE_VALIDATION',deny,chain"
SecRule REQUEST_METHOD "GET" "t:none,chain"
SecRule ARGS:limit "!^([0-9]+)$" "t:none"
SecRule REQUEST_URI "@streq /pets" "id:10005,phase:request,t:none,log,tag:'SWAGGER/PARAMETER_NAME_VALIDATION',deny,chain"
SecRule REQUEST_METHOD "POST" "t:none,chain"
SecRule ARGS_NAMES "!^(pet)$" "t:none"
# /pets/{id} #################################################################
SecRule REQUEST_URI "^\/pets\/[0-9]+$" "id:10006,phase:request,t:none,log,tag:'SWAGGER/WHITELIST_URI',setenv:'isValidURI=Yes'"
SecRule REQUEST_URI "^\/pets\/[0-9]+$" "id:10007,phase:request,t:none,log,tag:'SWAGGER/METHOD_NOT_ALLOWED',deny,chain"
SecRule REQUEST_METHOD "!^(GET|DELETE)$" "t:none"
SecRule REQUEST_URI "^\/pets\/[0-9]+$" "id:10008,phase:request,t:none,log,tag:'SWAGGER/PARAMETER_NAME_VALIDATION',deny,chain"
SecRule REQUEST_METHOD "GET" "t:none,chain"
SecRule ARGS_NAMES "!^(id)$" "t:none"
SecRule REQUEST_URI "^\/pets\/[0-9]+$" "id:10009,phase:request,t:none,log,tag:'SWAGGER/PARAMETER_TYPE_VALIDATION',deny,chain"
SecRule REQUEST_METHOD "GET" "t:none,chain"
SecRule ARGS:id "!^([0-9]+)$" "t:none"
SecRule REQUEST_URI "^\/pets\/[0-9]+$" "id:10010,phase:request,t:none,log,tag:'SWAGGER/PARAMETER_NAME_VALIDATION',deny,chain"
SecRule REQUEST_METHOD "DELETE" "t:none,chain"
SecRule ARGS_NAMES "!^(id)$" "t:none"
SecRule REQUEST_URI "^\/pets\/[0-9]+$" "id:10011,phase:request,t:none,log,tag:'SWAGGER/PARAMETER_TYPE_VALIDATION',deny,chain"
SecRule REQUEST_METHOD "DELETE" "t:none,chain"
SecRule ARGS:id "!^([0-9]+)$" "t:none"
SecRule ENV:isValidURI "No" "id:10012,phase:request,t:none,log,tag:'SWAGGER/DENY_ALL',deny"