Question about conflicting modsecurity_rules/modsecurity_rules_file precedence
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start with the configuration examples in the issue and the referenced ModSecurity rules_set_properties.h source, then compare them with the linked ingress-nginx reports. Determine the documented precedence for conflicting modsecurity_rules and modsecurity_rules_file settings, and explain when the observed outcomes differ from last-write-wins.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
This question is in relation to some troubles the downstream ingress-nginx project has with modsecurity: https://github.com/kubernetes/ingress-nginx/issues/8388
When conflicting modsecurity rules/settings are loaded, how is that conflict resolved? Is it always "last write wins"? Seems that's not always the case.
For example, say I have the following config:
modsecurity on;
modsecurity_rules 'SecRuleEngine On';
modsecurity_rules_file /etc/nginx/modsecurity/modsecurity.conf;
# modsecurity.conf includes the line: "SecRuleEngine DetectionOnly"
modsecurity_rules_file /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf;
# Just Includes all the coreruleset rules files
If "last write wins", I would expect that modsecurity_rules 'SecRuleEngine On'; would do nothing; the subsequent line would override that and set the mode to DetectionOnly. But for me, the mode stays "On" with the above config and requests get blocked instead of just logged. However other users have reported the opposite behavior as well: https://github.com/kubernetes/ingress-nginx/pull/8021
Looking at the source code, I would expect that "last write wins" is the intended behavior: https://github.com/SpiderLabs/ModSecurity/blob/5519f6cfae45a47d8dc3ac1b084319611a9b386b/headers/modsecurity/rules_set_properties.h#L45-L48
But are there situations where "last write wins" doesn't hold?
- Lingua principale
- Perl
- Stelle
- 1.9k
- Fork
- 311
- Merge medio
- 7h 5m
- PR unite (30g)
- 2
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di owasp-modsecurity/ModSecurity-nginx
-
Possible dereference of NullAperta:1st_place_medal: good first issue enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
owasp-modsecurity/ModSecurity-nginx#359 · 3 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
owasp-modsecurity/ModSecurity-nginx#400 · 2 commenti ·
-
Module logs version of libmodsecurity headers it was built against, not dynamically linked versionAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
owasp-modsecurity/ModSecurity-nginx#383 · 1 commento ·
Tutte le issue di owasp-modsecurity/ModSecurity-nginx
Issue simili
-
Type: Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
inverse-inc/packetfence#9605 ·
I maintainer di solito rispondono entro 10 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
RotherOSS/otobo#6344 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
darold/pgFormatter#426 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 77/100
libwww-perl/URI#219 ·