- version update to 2.9.8 (changed upstream: Trustwave -> OWASP) * Fixed ap_log_perror() usage * Memory leaks + enhanced logging * CI improvement: First check syntax & always display error/audit logs * Fixed assert() usage * Removed useless code * feat: Check if the MP header contains invalid character * Use standard httpd logging format in error log * fix msc_regexec() != PCRE_ERROR_NOMATCH strict check * Move xmlFree() call to the right place * Add collection size in log in case of writing error * Passing address of lock instead of lock in acquire_global_lock() * Invalid pointer access in case rule id == NOT_SET_P * Show error.log after httpd start in CI * chore: add pull request template * chore: add gitignore file * Possible double free * Set 'jit' variable's initial value * Missing null byte + optimization * fix: remove usage of insecure tmpname * docs: update copyright * Enhanced logging [Issue #3107] * Check for null pointer dereference (almost) everywhere * Fix possible segfault in collection_unpack * fix: Replace obsolete macros * chore: update bug-report-for-version-2-x.md * feat: Add more steps: install built module and restart the server * Add new flag: --without-lua * Initial release of CI worklow OBS-URL: https://build.opensuse.org/package/show/Apache:Modules/apache2-mod_security2?expand=0&rev=97
56 lines
2.1 KiB
Plaintext
56 lines
2.1 KiB
Plaintext
<IfModule mod_security2.c>
|
|
# Default recommended configuration
|
|
SecRuleEngine On
|
|
SecRequestBodyAccess On
|
|
SecRule REQUEST_HEADERS:Content-Type "text/xml" \
|
|
"id:'200000',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=XML"
|
|
SecRequestBodyLimit 13107200
|
|
SecRequestBodyNoFilesLimit 131072
|
|
SecRequestBodyInMemoryLimit 131072
|
|
SecRequestBodyLimitAction Reject
|
|
SecRule REQBODY_ERROR "!@eq 0" \
|
|
"id:'200001', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2"
|
|
SecRule MULTIPART_STRICT_ERROR "!@eq 0" \
|
|
"id:'200002',phase:2,t:none,log,deny,status:400,msg:'Multipart request body \
|
|
failed strict validation: \
|
|
PE %{REQBODY_PROCESSOR_ERROR}, \
|
|
BQ %{MULTIPART_BOUNDARY_QUOTED}, \
|
|
BW %{MULTIPART_BOUNDARY_WHITESPACE}, \
|
|
DB %{MULTIPART_DATA_BEFORE}, \
|
|
DA %{MULTIPART_DATA_AFTER}, \
|
|
HF %{MULTIPART_HEADER_FOLDING}, \
|
|
LF %{MULTIPART_LF_LINE}, \
|
|
SM %{MULTIPART_MISSING_SEMICOLON}, \
|
|
IQ %{MULTIPART_INVALID_QUOTING}, \
|
|
IP %{MULTIPART_INVALID_PART}, \
|
|
IH %{MULTIPART_INVALID_HEADER_FOLDING}, \
|
|
FL %{MULTIPART_FILE_LIMIT_EXCEEDED}'"
|
|
|
|
SecRule MULTIPART_UNMATCHED_BOUNDARY "!@eq 0" \
|
|
"id:'200003',phase:2,t:none,log,deny,status:44,msg:'Multipart parser detected a possible unmatched boundary.'"
|
|
|
|
SecPcreMatchLimit 1000
|
|
SecPcreMatchLimitRecursion 1000
|
|
|
|
SecRule TX:/^MSC_/ "!@streq 0" \
|
|
"id:'200004',phase:2,t:none,deny,msg:'ModSecurity internal error flagged: %{MATCHED_VAR_NAME}'"
|
|
|
|
SecResponseBodyAccess Off
|
|
SecDebugLog /var/log/apache2/modsec_debug.log
|
|
SecDebugLogLevel 0
|
|
SecAuditEngine RelevantOnly
|
|
SecAuditLogRelevantStatus "^(?:5|4(?!04))"
|
|
SecAuditLogParts ABIJDEFHZ
|
|
SecAuditLogType Serial
|
|
SecAuditLog /var/log/apache2/modsec_audit.log
|
|
SecArgumentSeparator &
|
|
SecCookieFormat 0
|
|
SecTmpDir /var/lib/mod_security2
|
|
SecDataDir /var/lib/mod_security2
|
|
|
|
IncludeOptional /etc/apache2/mod_security2.d/*.conf
|
|
IncludeOptional /etc/apache2/mod_security2.d/rules/*.conf
|
|
|
|
</IfModule>
|
|
|