8
8
# ------------------------------------------------------------------------
9
9
10
10
# OWASP CRS Plugin
11
- # Plugin name: template -plugin
12
- # Plugin description: Example plugin. Use and adopt this for your own plugins.
11
+ # Plugin name: wordpress-hardering -plugin
12
+ # Plugin description: harden wordpress, minimize php/sql impact
13
13
# Rule ID block base: 9,522,000-9,522,999
14
14
# Plugin version: 1.0.0
15
15
@@ -57,7 +57,6 @@ SecRule &TX:wphard.block_wpcron "@eq 0" \
57
57
setvar:tx.wphard.block_wpcron=0"
58
58
59
59
# Check if xmlrpc should be blocked and if not, skip.
60
- # (regression test on default)
61
60
SecRule &TX:wphard.block_xmlrpc "@eq 0" \
62
61
"id:9522101,\
63
62
phase:2,\
@@ -73,6 +72,7 @@ SecRule REQUEST_FILENAME "^/xmlrpc\.php" \
73
72
t:lowercase,t:normalizePath,t:trim,\
74
73
tag:'wordpress',\
75
74
tag:'xmlrpc',\
75
+ tag:'paranoia-level/1',\
76
76
accuracy:'9',\
77
77
maturity:'1',\
78
78
severity:'NOTICE',\
@@ -86,7 +86,6 @@ SecRule REQUEST_FILENAME "^/xmlrpc\.php" \
86
86
SecMarker "END_WPHARD_XMLRPC"
87
87
88
88
# check if user enumaration should be blocked and if not, skip
89
- # (regression test on default)
90
89
SecRule TX:wphard.block_user_enumeration "@eq 0" \
91
90
"phase:2,\
92
91
id:9522103,\
@@ -102,6 +101,7 @@ SecRule REQUEST_URI "@rx (author\=[0-9]+)|(wp/v2/users)" \
102
101
t:lowercase,t:normalizePath,t:trim,\
103
102
tag:'wordpress',\
104
103
tag:'enumeration',\
104
+ tag:'paranoia-level/1',\
105
105
accuracy:'9',\
106
106
maturity:'1',\
107
107
severity:'NOTICE',\
@@ -115,7 +115,6 @@ SecRule REQUEST_URI "@rx (author\=[0-9]+)|(wp/v2/users)" \
115
115
SecMarker "END_WPHARD_USER_ENUMERATION"
116
116
117
117
# Check if restapi should be blocked and if not, skip
118
- # (regression test on default)
119
118
SecRule TX:wphard.block_rest_api "@eq 0" \
120
119
"phase:2,\
121
120
id:9522106,\
@@ -132,6 +131,7 @@ SecRule REQUEST_FILENAME "@rx ^/wp-json/.+" \
132
131
tag:'wordpress',\
133
132
tag:'rest-api',\
134
133
tag:'wp-json',\
134
+ tag:'paranoia-level/1',\
135
135
accuracy:'9',\
136
136
maturity:'1',\
137
137
severity:'NOTICE',\
@@ -144,8 +144,7 @@ SecRule REQUEST_FILENAME "@rx ^/wp-json/.+" \
144
144
145
145
SecMarker "END_WPHARD_BLOCK_REST_API"
146
146
147
- # Check if admin login should be blocked and if not, skip
148
- # (regression test on default)
147
+ # Check if login 'admin' should be blocked and if not, skip
149
148
SecRule TX:wphard.block_admin_login "@eq 0" \
150
149
"phase:2,\
151
150
id:9522108,\
@@ -161,6 +160,7 @@ SecRule REQUEST_URI "@beginsWith /wp-login.php" \
161
160
t:lowercase,t:normalizePath,t:trim,\
162
161
tag:'wordpress',\
163
162
tag:'admin-login',\
163
+ tag:'paranoia-level/1',\
164
164
accuracy:'9',\
165
165
maturity:'1',\
166
166
severity:'WARNING',\
@@ -176,7 +176,6 @@ SecRule REQUEST_URI "@beginsWith /wp-login.php" \
176
176
SecMarker "END_WPHARD_BLOCK_ADMIN_LOGIN"
177
177
178
178
# Check if wpcron should be blocked and if not, skip
179
- # (regression test on default)
180
179
SecRule TX:wphard.block_wpcron "@eq 0" \
181
180
"id:9522110,\
182
181
phase:2,\
@@ -192,6 +191,7 @@ SecRule REQUEST_FILENAME "^/wp-cron\.php" \
192
191
t:lowercase,t:normalizePath,t:trim,\
193
192
tag:'wordpress',\
194
193
tag:'wpcron',\
194
+ tag:'paranoia-level/1',\
195
195
accuracy:'9',\
196
196
maturity:'1',\
197
197
severity:'NOTICE',\
@@ -205,13 +205,13 @@ SecRule REQUEST_FILENAME "^/wp-cron\.php" \
205
205
SecMarker "END_WPHARD_WPCRON"
206
206
207
207
# No direct access to .php files except index.php/wp-admin/xmlrpc/wpcron
208
- # (regression test)
209
208
SecRule REQUEST_FILENAME "@rx ^(?!.*(?:\/wp-admin\/|(?:^|\/)(index|xmlrpc|wp-cron|wp-login)\.php$)).*\.php$" \
210
209
"id:9522200,\
211
210
phase:2,\
212
211
t:lowercase,t:normalizePath,t:trim,\
213
212
tag:'wordpress',\
214
213
tag:'direct-access',\
214
+ tag:'paranoia-level/1',\
215
215
accuracy:'9',\
216
216
maturity:'1',\
217
217
severity:'NOTICE',\
@@ -223,13 +223,13 @@ SecRule REQUEST_FILENAME "@rx ^(?!.*(?:\/wp-admin\/|(?:^|\/)(index|xmlrpc|wp-cro
223
223
setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
224
224
225
225
# No direct access to these files (PL1)
226
- # (regression test)
227
226
SecRule REQUEST_FILENAME "@pmFromFile wordpress-hardening-files.data" \
228
227
"id:9522202,\
229
228
phase:2,\
230
229
t:lowercase,t:normalizePath,t:trim,\
231
230
tag:'wordpress',\
232
231
tag:'direct-access',\
232
+ tag:'paranoia-level/1',\
233
233
accuracy:'9',\
234
234
maturity:'1',\
235
235
severity:'NOTICE',\
@@ -241,13 +241,13 @@ SecRule REQUEST_FILENAME "@pmFromFile wordpress-hardening-files.data" \
241
241
setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
242
242
243
243
# Don't allow other script languages. (PL2)
244
- # (no regression test yet)
245
244
SecRule REQUEST_FILENAME "@rx .(pl|cgi|py|sh|lua|asp)$" \
246
245
"id:9522203,\
247
246
phase:2,\
248
247
t:lowercase,t:normalizePath,t:trim,\
249
248
tag:'wordpress',\
250
249
tag:'only-allow-php-extension',\
250
+ tag:'paranoia-level/2',\
251
251
accuracy:'9',\
252
252
maturity:'1',\
253
253
severity:'NOTICE',\
@@ -259,13 +259,13 @@ SecRule REQUEST_FILENAME "@rx .(pl|cgi|py|sh|lua|asp)$" \
259
259
setvar:'tx.inbound_anomaly_score_pl2=+%{tx.critical_anomaly_score}'"
260
260
261
261
# Deny certain nasty stuff in uploads (PL1)
262
- # (regression test)
263
- SecRule REQUEST_FILENAME "@rx ^/wp-content/uploads/.*\.(?:s?html?|js|swf|lua)$" \
262
+ SecRule REQUEST_FILENAME "@rx ^/wp-content/uploads/.*\.(?:s?html?|swf|lua)$" \
264
263
"id:9522205,\
265
264
phase:2,\
266
265
t:lowercase,t:normalizePath,t:trim,\
267
266
tag:'wordpress',\
268
267
tag:'uploads',\
268
+ tag:'paranoia-level/1',\
269
269
accuracy:'9',\
270
270
maturity:'1',\
271
271
severity:'NOTICE',\
@@ -276,14 +276,14 @@ SecRule REQUEST_FILENAME "@rx ^/wp-content/uploads/.*\.(?:s?html?|js|swf|lua)$"
276
276
msg:'Wordpress hardening: attempt to access wp-content/uploads nasty stuff',\
277
277
setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
278
278
279
- # Deny access to sensitive files (Pl1)
280
- # (regression test)
279
+ # Deny access to sensitive files (PL1)
281
280
SecRule REQUEST_FILENAME "@rx \.(conf|htaccess|htpass|sql|orig|bak|db|ini|md|log|git|github|swp|DS_STORE)($|/)?" \
282
281
"id:9522206,\
283
282
phase:2,\
284
283
t:lowercase,t:normalizePath,t:trim,\
285
284
tag:'wordpress',\
286
285
tag:'sensitive-files',\
286
+ tag:'paranoia-level/1',\
287
287
accuracy:'9',\
288
288
maturity:'1',\
289
289
severity:'NOTICE',\
@@ -295,14 +295,14 @@ SecRule REQUEST_FILENAME "@rx \.(conf|htaccess|htpass|sql|orig|bak|db|ini|md|log
295
295
setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
296
296
297
297
# Deny access to ^/wp-json$ while api keeps functioning (PL1)
298
- # (regression test)
299
298
SecRule REQUEST_FILENAME "@rx ^/wp-json/?$" \
300
299
"id:9522207,\
301
300
phase:2,\
302
301
t:lowercase,t:normalizePath,t:trim,\
303
302
tag:'wordpress',\
304
303
tag:'sensitive-files',\
305
304
tag:'wp-json',\
305
+ tag:'paranoia-level/1',\
306
306
accuracy:'9',\
307
307
maturity:'1',\
308
308
severity:'NOTICE',\
0 commit comments