forked from Rev3rseSecurity/wordpress-modsecurity-ruleset
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path04-EVENTS.conf
61 lines (53 loc) · 2.23 KB
/
04-EVENTS.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Log relevant events
SecRule tx:wprs_log_authentications "@eq 0" "phase:1,id:22110001,nolog,pass,\
skipAfter:END_WPRS_LOG_AUTH"
SecMarker BEGIN_WPRS_LOG_AUTH
SecRule &RESPONSE_HEADERS:Set-Cookie "@gt 1" "phase:3,id:22110011,nolog,chain,pass"
SecRule RESPONSE_HEADERS:Location "@rx .*admin.*" "id:22110011,t:lowercase,nolog,chain"
SecRule REQUEST_METHOD "^POST$" "id:22110011,t:uppercase,nolog,chain"
SecRule REQUEST_FILENAME "^/wp\-login\.php" "id:22110011,t:lowercase,\
log,\
rev:'1',\
severity:'6',\
maturity:'9',\
accuracy:'9',\
ver:'%{tx.wprs_version}',\
tag:'wordpress',\
tag:'login',\
logdata:'Username: %{ARGS_POST:log}',\
msg:'WordPress: User logged in'"
# logout:
# - /wp-login.php?action=logout
# - res 302 Found
# - Location: wp-login.php?loggedout=true
SecRule RESPONSE_STATUS "@eq 302" "phase:3,id:22110013,nolog,chain,pass"
SecRule RESPONSE_HEADERS:Location "@rx wp\-login\.php\?loggedout\=true" "id:22110013,t:lowercase,nolog,chain"
SecRule ARGS:action "^logout$" "id:22110013,t:lowercase,nolog,chain"
SecRule REQUEST_FILENAME "^/wp\-login\.php" "id:22110013,t:lowercase,\
log,\
rev:'1',\
severity:'6',\
maturity:'9',\
accuracy:'9',\
ver:'%{tx.wprs_version}',\
tag:'wordpress',\
tag:'logout',\
msg:'WordPress: User logged out'"
SecRule &RESPONSE_HEADERS:Set-Cookie "@eq 1" "phase:3,id:22110014,nolog,chain,pass"
SecRule &RESPONSE_HEADERS:Location "@eq 0" "id:22110014,nolog,chain"
SecRule REQUEST_METHOD "^POST$" "id:22110014,t:uppercase,nolog,chain"
SecRule &ARGS_POST_NAMES:log "@ge 1" "id:22110014,t:lowercase,nolog,chain"
SecRule &ARGS_POST_NAMES:pwd "@ge 1" "id:22110014,t:lowercase,nolog,chain"
SecRule REQUEST_FILENAME "^/wp\-login\.php" "id:22110014,t:lowercase,\
log,\
rev:'1',\
severity:'6',\
maturity:'9',\
accuracy:'9',\
ver:'%{tx.wprs_version}',\
tag:'wordpress',\
tag:'login',\
tag:'failed',\
logdata:'Login failed with username: %{ARGS_POST:log}',\
msg:'WordPress: Login failed'"
SecMarker END_WPRS_LOG_AUTH