最新のコアルールでmod_securityを使用しています。
クエリ文字列を使用すると、すべてのページでトリガーされます。
www.mypage.com/index.php?querystring=1
引数の最大許容数を超えているという警告が表示されますが、基本構成ではmax_numb_argsを= 255に定義していますが、これはもちろん超えません。
なぜ何かアイデアはありますか?
基本設定:
SecRuleEngine On
SecAuditEngine RelevantOnly
SecAuditLog /var/log/apache2/modsec_audit.log
SecDebugLog /var/log/apache2/modsec_debug_log
SecDebugLogLevel 3
SecDefaultAction "phase:2、pass、log、status:500"
SecRule REMOTE_ADDR "^ 127.0.0.1 $" no 、allow
SecRequestBodyAccess On
SecResponseBodyAccess On
SecResponseBodyMimeType(null)text / html text / plain text / xml
SecResponseBodyLimit 2621440
SecServerSignature Apache SecUploadDir /
tmp
SecUploadKeepFiles Off
SecAuditLogParts ABIFHZ
SecArgumentSeparator "&"
SecCookieFormat 0
Sec
SecTmpDir / tmp
SecAuditLogStorageDir / var / log / apache2 / audit
SecResponseBodyLimitAction ProcessPartial
SecAction "phase:1、t:none、nolog、pass、setvar:tx.max_num_args = 255"
トリガーするルール:
# Maximum number of arguments in request limited
SecRule &TX:MAX_NUM_ARGS "@eq 1" "chain,phase:2,t:none,pass,nolog,auditlog,msg:'Maximum number of arguments in request reached',id:'960335',severity:'4',rev:'2.0.7'"
SecRule &ARGS "@gt %{tx.max_num_args}" "t:none,setvar:'tx.msg=%{rule.msg}',setvar:tx.anomaly_score=+%{tx.notice_anomaly_score},setvar:tx.policy_score=+%{tx.notice_anomaly_score},setvar:tx.%{rule.id}-POLICY/SIZE_LIMIT-%{matched_var_name}=%{matched_var}"
そして、ログ出力:
--ad5dc005-C-- queryString = 2 --ad5dc005-F-- HTTP / 1.1 200 OK
X-Powered-By:PHP / 5.3
Expires:Thu、19 Nov 1981 08:52:00 GMT
Cache-Control:no- store、no-cache、must-revalidate、post-check = 0、pre-check = 0
プラグマ:no-cache
Set-Cookie:SESSION = ak19oq36gpi94rco2qbi6j2k20; path = /
Vary:Accept-Encoding
Content-Encoding:gzip
Content-Length:1272
Keep-Alive:timeout = 15、max = 99
Connection:Keep-Alive
Content-Type:text / html; charset = utf-8--ad5dc005-H--
メッセージ:オペレーターGTがARGSで0と一致しました。[file "/etc/apache2/conf/modsecurity_crs/base_rules/modsecurity_crs_23_request_limits.conf"] [line "30"] [id "960335"] [rev "2.0.7"][msg"リクエストの最大引数数に達しました" ] [重大度"警告"]
メッセージ:オペレーターGEはTX:anomaly_scoreで0と一致しました。[file "/etc/apache2/conf/modsecurity_crs/base_rules/modsecurity_crs_49_inbound_blocking.conf"] [line "18"] [msg "Inbound Anomaly Score Exceeded(Total Score:5、SQLi =、XSS =):引数の最大数リクエストに達しました」]
メッセージ:警告。演算子GEはTX:inbound_anomaly_scoreで0に一致しました。[file "/etc/apache2/conf/modsecurity_crs/base_rules/modsecurity_crs_60_correlation.conf"] [line "35"] [msg "Inbound Anomaly Score Exceeded(Total Inbound Score:5、SQLi =、XSS =):引数の最大数リクエストに達しました"]
Apache-Handler:application / x-httpd-php
Stopwatch:1279667800315092 76979(1546 * 7522 72931)
Producer:ModSeurity for Apache / 2.5.11(http://www.modsecurity.org/); コアルールセット/2.0.7。サーバー:Apache