|
|
bb7e57 |
<IfModule mod_security2.c>
|
|
|
bb7e57 |
# ModSecurity Core Rules Set configuration
|
|
|
bb7e57 |
Include modsecurity.d/*.conf
|
|
|
bb7e57 |
Include modsecurity.d/activated_rules/*.conf
|
|
|
bb7e57 |
|
|
|
bb7e57 |
# Default recommended configuration
|
|
|
bb7e57 |
SecRuleEngine On
|
|
|
bb7e57 |
SecRequestBodyAccess On
|
|
|
bb7e57 |
SecRule REQUEST_HEADERS:Content-Type "text/xml" \
|
|
|
bb7e57 |
"id:'200000',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=XML"
|
|
|
bb7e57 |
SecRequestBodyLimit 13107200
|
|
|
bb7e57 |
SecRequestBodyNoFilesLimit 131072
|
|
|
bb7e57 |
SecRequestBodyInMemoryLimit 131072
|
|
|
bb7e57 |
SecRequestBodyLimitAction Reject
|
|
|
bb7e57 |
SecRule REQBODY_ERROR "!@eq 0" \
|
|
|
bb7e57 |
"id:'200001', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2"
|
|
|
bb7e57 |
SecRule MULTIPART_STRICT_ERROR "!@eq 0" \
|
|
|
bb7e57 |
"id:'200002',phase:2,t:none,log,deny,status:44,msg:'Multipart request body \
|
|
|
bb7e57 |
failed strict validation: \
|
|
|
bb7e57 |
PE %{REQBODY_PROCESSOR_ERROR}, \
|
|
|
bb7e57 |
BQ %{MULTIPART_BOUNDARY_QUOTED}, \
|
|
|
bb7e57 |
BW %{MULTIPART_BOUNDARY_WHITESPACE}, \
|
|
|
bb7e57 |
DB %{MULTIPART_DATA_BEFORE}, \
|
|
|
bb7e57 |
DA %{MULTIPART_DATA_AFTER}, \
|
|
|
bb7e57 |
HF %{MULTIPART_HEADER_FOLDING}, \
|
|
|
bb7e57 |
LF %{MULTIPART_LF_LINE}, \
|
|
|
bb7e57 |
SM %{MULTIPART_MISSING_SEMICOLON}, \
|
|
|
bb7e57 |
IQ %{MULTIPART_INVALID_QUOTING}, \
|
|
|
bb7e57 |
IP %{MULTIPART_INVALID_PART}, \
|
|
|
bb7e57 |
IH %{MULTIPART_INVALID_HEADER_FOLDING}, \
|
|
|
bb7e57 |
FL %{MULTIPART_FILE_LIMIT_EXCEEDED}'"
|
|
|
bb7e57 |
|
|
|
bb7e57 |
SecRule MULTIPART_UNMATCHED_BOUNDARY "!@eq 0" \
|
|
|
bb7e57 |
"id:'200003',phase:2,t:none,log,deny,status:44,msg:'Multipart parser detected a possible unmatched boundary.'"
|
|
|
bb7e57 |
|
|
|
bb7e57 |
SecPcreMatchLimit 1000
|
|
|
bb7e57 |
SecPcreMatchLimitRecursion 1000
|
|
|
bb7e57 |
|
|
|
bb7e57 |
SecRule TX:/^MSC_/ "!@streq 0" \
|
|
|
bb7e57 |
"id:'200004',phase:2,t:none,deny,msg:'ModSecurity internal error flagged: %{MATCHED_VAR_NAME}'"
|
|
|
bb7e57 |
|
|
|
bb7e57 |
SecResponseBodyAccess Off
|
|
|
bb7e57 |
SecDebugLog /var/log/httpd/modsec_debug.log
|
|
|
bb7e57 |
SecDebugLogLevel 0
|
|
|
bb7e57 |
SecAuditEngine RelevantOnly
|
|
|
bb7e57 |
SecAuditLogRelevantStatus "^(?:5|4(?!04))"
|
|
|
bb7e57 |
SecAuditLogParts ABIJDEFHZ
|
|
|
bb7e57 |
SecAuditLogType Serial
|
|
|
bb7e57 |
SecAuditLog /var/log/httpd/modsec_audit.log
|
|
|
bb7e57 |
SecArgumentSeparator &
|
|
|
bb7e57 |
SecCookieFormat 0
|
|
|
bb7e57 |
SecTmpDir /var/lib/mod_security
|
|
|
bb7e57 |
SecDataDir /var/lib/mod_security
|
|
|
bb7e57 |
</IfModule>
|