|
| 1 | +SecRuleEngine On |
| 2 | +SecRequestBodyAccess On |
| 3 | + |
| 4 | +SecRule REQUEST_HEADERS:Content-Type "(?:application(?:/soap\+|/)|text/)xml" \ |
| 5 | + "id:'200000',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=XML" |
| 6 | + |
| 7 | +SecRule REQUEST_HEADERS:Content-Type "application/json" \ |
| 8 | + "id:'200001',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=JSON" |
| 9 | + |
| 10 | +SecRequestBodyLimit 13107200 |
| 11 | +SecRequestBodyNoFilesLimit 131072 |
| 12 | +SecRequestBodyLimitAction Reject |
| 13 | + |
| 14 | +SecRule REQBODY_ERROR "!@eq 0" \ |
| 15 | +"id:'200002', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2" |
| 16 | + |
| 17 | +SecRule MULTIPART_STRICT_ERROR "!@eq 0" \ |
| 18 | +"id:'200003',phase:2,t:none,log,deny,status:400, \ |
| 19 | +msg:'Multipart request body failed strict validation: \ |
| 20 | +PE %{REQBODY_PROCESSOR_ERROR}, \ |
| 21 | +BQ %{MULTIPART_BOUNDARY_QUOTED}, \ |
| 22 | +BW %{MULTIPART_BOUNDARY_WHITESPACE}, \ |
| 23 | +DB %{MULTIPART_DATA_BEFORE}, \ |
| 24 | +DA %{MULTIPART_DATA_AFTER}, \ |
| 25 | +HF %{MULTIPART_HEADER_FOLDING}, \ |
| 26 | +LF %{MULTIPART_LF_LINE}, \ |
| 27 | +SM %{MULTIPART_MISSING_SEMICOLON}, \ |
| 28 | +IQ %{MULTIPART_INVALID_QUOTING}, \ |
| 29 | +IP %{MULTIPART_INVALID_PART}, \ |
| 30 | +IH %{MULTIPART_INVALID_HEADER_FOLDING}, \ |
| 31 | +FL %{MULTIPART_FILE_LIMIT_EXCEEDED}'" |
| 32 | + |
| 33 | +SecRule MULTIPART_UNMATCHED_BOUNDARY "!@eq 0" \ |
| 34 | +"id:'200004',phase:2,t:none,log,deny,msg:'Multipart parser detected a possible unmatched boundary.'" |
| 35 | + |
| 36 | +SecPcreMatchLimit 1000 |
| 37 | +SecPcreMatchLimitRecursion 1000 |
| 38 | + |
| 39 | +SecRule TX:/^MSC_/ "!@streq 0" \ |
| 40 | + "id:'200005',phase:2,t:none,deny,msg:'ModSecurity internal error flagged: %{MATCHED_VAR_NAME}'" |
| 41 | + |
| 42 | +SecResponseBodyAccess On |
| 43 | +SecResponseBodyMimeType text/plain text/html text/xml |
| 44 | +SecResponseBodyLimit 524288 |
| 45 | +SecResponseBodyLimitAction ProcessPartial |
| 46 | +SecTmpDir /tmp/ |
| 47 | +SecDataDir /tmp/ |
| 48 | +SecAuditEngine On |
| 49 | +SecAuditLogParts ABIJDEFHZ |
| 50 | +SecAuditLogType Concurrent |
| 51 | +SecAuditLogFormat JSON |
| 52 | +SecDebugLog /var/log/modsec-debug.log |
| 53 | +SecDebugLogLevel 9 |
| 54 | + |
| 55 | +SecArgumentSeparator & |
| 56 | +SecCookieFormat 0 |
| 57 | +SecUnicodeMapFile unicode.mapping 20127 |
| 58 | +SecStatusEngine On |
| 59 | +Include /etc/nginx/modsecurity.d/crs-setup.conf |
0 commit comments