kys13
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
SecRuleEngine On
|
||||
SecRequestBodyAccess On
|
||||
SecResponseBodyAccess Off
|
||||
SecResponseBodyAccess On
|
||||
SecDebugLog /var/log/modsecurity/debug.log
|
||||
SecDebugLogLevel 0
|
||||
SecAuditLogParts ABIJ
|
||||
@@ -8,26 +8,28 @@ SecAuditLogType Serial
|
||||
SecAuditLog /var/log/modsecurity/audit.log
|
||||
|
||||
# sql injection
|
||||
SecRule ARGS "['\";]|--" \
|
||||
"id:950001,phase:2,deny,status:403,msg:'SQL Injection Attack Detected',log"
|
||||
SecRule REQUEST_URI|ARGS "['\";]|--" \
|
||||
SecRule REQUEST_URI|ARGS "(?i:(?:select|insert|update|delete|drop|union|create|alter|truncate)\s+.+\s+from|'[^']*'|--|;|\b(or|and)\b\s+\d+\s*=\s*\d+)" \
|
||||
"id:950001,phase:1,deny,status:403,msg:'SQL INJECTION ATTACK DETECTED!!!',log,t:urlDecode,t:sqlHexDecode,t:lowercase"
|
||||
|
||||
# xss / html injection
|
||||
SecRule ARGS "<.*>" \
|
||||
"id:950003,phase:2,deny,status:403,msg:'XSS/HTML Injection Detected',log"
|
||||
SecRule REQUEST_URI|ARGS "(<.*>)|(%3C.*%3E)" \
|
||||
"id:950003,phase:1,deny,status:403,msg:'XSS/HTML INJECTION DETECTED!!!',log"
|
||||
|
||||
# command injection
|
||||
SecRule ARGS "(\"role\".*:.*\"admin\")|exec|cat|more|ls|dir|/etc/passwd" \
|
||||
"id:950006,phase:2,deny,status:403,msg:'Command Injection Detected',log"
|
||||
"id:950006,phase:2,deny,status:403,msg:'COMMAND INJECTION DETECTED!!!',log"
|
||||
|
||||
# path traversal
|
||||
SecRule ARGS "\%00|\%2500|(\./|\.\./)|ftp|metrics|api-docs" \
|
||||
"id:950007,phase:2,deny,status:403,msg:'Path Traversal Attempt',log"
|
||||
SecRule REQUEST_URI|ARGS "\%00|\%2500|\.\./|ftp|metrics|api-docs" \
|
||||
"id:950007,phase:2,deny,status:403,msg:'PATH TRAVERSAL ATTEMPT!!!',log"
|
||||
|
||||
# exposed stuff
|
||||
SecRule REQUEST_URI "\%00|\%2500|ftp|metrics|api-docs" \
|
||||
"id:950008,phase:2,deny,status:500,msg:'Attempt to access ftp, metrics, api-docs',log"
|
||||
# exposed stuff (redundante ?)
|
||||
SecRule REQUEST_URI|ARGS "\%00|\%2500|ftp|metrics|api-docs" \
|
||||
"id:950008,phase:2,deny,status:500,msg:'ATTEMPT TO ACCESS FTP, METRICS, API-DOCS!!!',log"
|
||||
|
||||
# rate limiting on login endpoint (max 5 requests per 30s per IP)
|
||||
# rate limiting on login endpoint
|
||||
# (max 5 requests per 30s per IP)
|
||||
SecAction \
|
||||
"id:950009,phase:1,initcol:ip=%{REMOTE_ADDR},pass,nolog"
|
||||
SecRule REQUEST_URI "@streq /rest/user/login" \
|
||||
|
||||
Reference in New Issue
Block a user