Intermittent nginx startup failure on modsecurity_rules_remote with libnginx-mod-http-modsecurity 1.0.3 / libmodsecurity 3.0.12 on Ubuntu
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Attiva
- Stack tecnologico
- nginx
- Ambito
- security
Direzione di ricerca
Inizia dalla gestione della direttiva modsecurity_rules_remote nel connector, utilizzando la direttiva nginx.conf e l'impostazione SecRemoteRulesFailAction di modsecurity.conf come input per la riproduzione. Riproduci un errore transitorio nel recupero delle regole remote durante l'avvio di nginx, quindi determina se esiste una gestione lato connector e documenta o testa il risultato supportato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi guys, seeking assistance, if anyone face this issue, and if anyone face the same issue, and if there is any solution to this.
Environment
OS: Ubuntu 24.04.4 LTS (Noble Numbat)
Nginx: nginx/1.24.0 (Ubuntu)
ModSecurity library: libmodsecurity3t64 3.0.12-1.1build2
Nginx ModSecurity module: libnginx-mod-http-modsecurity 1.0.3-1build3
CRS package installed: modsecurity-crs 3.3.5-2
Problem
nginx sometimes fails to start at the modsecurity_rules_remote directive:
[emerg] "modsecurity_rules_remote" directive in /etc/nginx/nginx.conf:16 nginx: configuration file /etc/nginx/nginx.conf test failed
However, manual restart nginx later without any config changes succeeds:
ModSecurity-nginx v1.0.3 (rules loaded inline/local/remote: 0/7/1055)
Nginx Journactl log
Apr 22 03:09:50 web-server systemd[1]: Starting nginx.service - A high performance web server and a reverse proxy server...
Apr 22 03:09:53 web-server nginx[866]: 2026/04/22 03:09:50 [notice] 866#866: ModSecurity-nginx v1.0.3 (rules loaded inline/local/remote: 0/7/1055)
Apr 22 03:09:54 web-server nginx[1099]: 2026/04/22 03:09:53 [notice] 1099#1099: ModSecurity-nginx v1.0.3 (rules loaded inline/local/remote: 0/7/1055)
Apr 22 03:09:54 web-server systemd[1]: Started nginx.service - A high performance web server and a reverse proxy server.
Apr 23 06:33:27 web-server systemd[1]: Stopping nginx.service - A high performance web server and a reverse proxy server...
Apr 23 06:33:27 web-server systemd[1]: Starting nginx.service - A high performance web server and a reverse proxy server...
Apr 23 06:33:27 web-server nginx[50420]: 2026/04/23 06:33:27 [emerg] 50420#50420: "modsecurity_rules_remote" directive in /etc/nginx/nginx.conf:16
Apr 23 06:33:27 web-server nginx[50420]: nginx: configuration file /etc/nginx/nginx.conf test failed
Apr 23 06:33:27 web-server systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Apr 23 06:33:27 web-server systemd[1]: nginx.service: Failed with result 'exit-code'.
Apr 23 06:33:27 web-server systemd[1]: Failed to start nginx.service - A high performance web server and a reverse proxy server.
Apr 23 06:39:47 web-server systemd[1]: Starting nginx.service - A high performance web server and a reverse proxy server...
Apr 23 06:39:49 web-server nginx[55800]: 2026/04/23 06:39:47 [notice] 55800#55800: ModSecurity-nginx v1.0.3 (rules loaded inline/local/remote: 0/7/1055)
Apr 23 06:39:50 web-server nginx[55804]: 2026/04/23 06:39:49 [notice] 55804#55804: ModSecurity-nginx v1.0.3 (rules loaded inline/local/remote: 0/7/1055)
Apr 23 06:39:50 web-server systemd[1]: Started nginx.service - A high performance web server and a reverse proxy server
Line 16 in nginx.conf
14 modsecurity on;
15 modsecurity_rules_file /etc/nginx/modsecurity.conf;
16 modsecurity_rules_remoteSECKEYhttps://rules.malware.expert/download.php?rules=generic;
17 modsecurity_rules 'Include /etc/nginx/modsec/custom-whitelist-blacklist.conf';
18 server_tokens off;
I tried setting SecRemoteRulesFailAction Warn in /etc/nginx/modsecurity.conf based on https://github.com/owasp-modsecurity/ModSecurity-nginx/issues/109 but nginx startup failure still occurred.**
SecRuleEngine On
SecRemoteRulesFailAction Warn
Question: Is this expected behavior specifically for modsecurity_rules_remote in the nginx connector, and is there any connector-side supported way to avoid hard startup failure on transient remote rule retrieval issues?
Thanks!
- 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
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
GothenburgBitFactory/tw.org#1471 · 1 commento ·
-
✏️ Editing - Tags
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
openfoodfacts/openfoodfacts-server#15127 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
FIDO2 (ecdsa-sk / ed25519-sk) ingress keys rejected: missing in get_supported_ssh_algorithms_listAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ovh/the-bastion#695 ·
-
Range length wrong when an abbreviated range end contains a 0 (`pages = {315-20}` gives `\range{pages}{11}`)Forse già presa @plk l’ha presa 2 giorni fa. ApertaBug fixedindev
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100