ip collection does not seem to work properly with latest ModSecurity
メンテナーはふだん 1 日以内に返信
@airween がすでに取り組んでいます。
2025年5月30日 から。
評価
この issue はまだ評価されていません。
説明
I am using @rbl xbl.spamhaus.org. rule for protecting my Fediverse server and I face the issue that with latest version of either ModSecurity or the docker.io/owasp/modsecurity-crs:nginx container the collection handling for the IP collection seems to not longer work properly.
In my pi-hole I see a huge number of queries to .xbl.spamhaus.org for all the ip addresses checked and with queries to the same ip based query many times where I would expect that this is not the case due to how I set up the ModSecurity rules.
- The issue is happening with the latest version of the docker.io/owasp/modsecurity-crs:nginx container.
- It is far less a occuring with docker.io/owasp/modsecurity-crs:4.10-nginx-202501050801 even when mounting ruleset 4.14 to this container.
- I don't believe it is a problem with the CRS.
Based on what I see I would see it as if
- the expirevar for the IP collection is not working properly
- maybe the persistent store is causing the problem (as I don't see any problems with the TX collection which is also a collection but not persistet). This might be an docker image problem.
According to modsecurity.conf the SecTmpDir is set to /tmp/modsecurity/tmp (as data and upload directory are also located in /tmp/modsecurity).
This directory is empty. Wouldn't this be the directory for persistent storage and shouldn't there be a file for the IP collection database?
This is the rules I use:
# xbl.spamhaus.org to block malicious/infected ips
SecAction \
"phase:1,id:1100,\
t:none,pass,nolog,\
tag:'COLLECTIONS',\
initcol:ip=%{remote_addr},\
setvar:'tx.real_ip=%{remote_addr}'"
SecRule IP:SPAMMER "@eq 1" \
"phase:1,id:1101,\
t:none,deny,log,auditlog,\
msg:'Request from Known SPAM Source (Previous RBL Match)',\
tag:'AUTOMATION/MALICIOUS',\
severity:'CRITICAL',\
setvar:'tx.msg=%{rule.msg}'"
SecRule IP:PREVIOUS_RBL_CHECK "@eq 1" "phase:1,id:1102,t:none,pass,nolog,skipAfter:END_RBL_LOOKUP"
SecAction "phase:1,id:1103,\
t:none,pass,nolog,\
setvar:ip.previous_rbl_check=1,\
expirevar:ip.previous_rbl_check=3600"
SecRule REMOTE_ADDR "@rbl xbl.spamhaus.org." \
"phase:1,id:1104,\
t:none,deny,log,auditlog,\
msg:'RBL Match for SPAM Source',\
tag:'AUTOMATION/MALICIOUS',\
severity:'CRITICAL',\
setvar:'tx.msg=%{rule.msg}',\
setvar:ip.spammer=1,\
expirevar:ip.spammer=3600"
SecMarker END_RBL_LOOKUP
This is part of my setup.conf before including the CRS rules. As said, it worked much better (but also not perfect) with the older docker image mentioned above.
- 主要言語
- C++
- スター
- 9.8k
- フォーク
- 1.8k
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 13
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
owasp-modsecurity/ModSecurity のほかの issue
-
v2: t:utf8toUnicode drops the last hex digit of code points above U+FFFF (regression since 2.9.9)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
owasp-modsecurity/ModSecurity#3684 ·
メンテナーはふだん 1 日以内に返信
-
IIS: ReadFileChunk allocates only 1 byte but reads m_dwPageSize (latent overflow)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン2.x bug Platform - IIS pr available windows
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
owasp-modsecurity/ModSecurity#3623 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
IIS: Host header fallback is dead code (r->hostname == NULL can never be true)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン2.x bug Platform - IIS pr available windows
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
owasp-modsecurity/ModSecurity#3621 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
IIS: Content-Length header corrupted/truncated for large responses (wrong printf format + off-by-one buffer size)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン2.x bug Platform - IIS pr available windows
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
owasp-modsecurity/ModSecurity#3619 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
2.x bug Platform - IIS pr available windows
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
owasp-modsecurity/ModSecurity#3612 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
owasp-modsecurity/ModSecurity の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
eclipse-score/inc_someip_gateway#356 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
HarperFast/rocksdb-js#945 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
[Other] error detected in the compilation of Strata/src/qwen35/q36_engine.cu対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンneeds-format
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
Niko1221/Strata#3368 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信