Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Intermittent nginx startup failure on modsecurity_rules_remote with libnginx-mod-http-modsecurity 1.0.3 / libmodsecurity 3.0.12 on Ubuntu

Aperta
#375 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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_remote SECKEY https://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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di owasp-modsecurity/ModSecurity-nginx

Tutte le issue di owasp-modsecurity/ModSecurity-nginx

Issue simili

Altre issue su Perl

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.