Coraza: another nginx-reload trigger in the same dpkg run can reload before the recheck #48
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Keel-Linux/tracker#48
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Remaining gap of the Coraza upgrade guard (Keel-Linux/common#21, packages/README.md "The Web overlays").
keel-overlay-coraza's dpkg trigger runs
state recheckafter coreruleset, libnginx-mod-http-coraza or libcoraza are upgraded, and turns Coraza off when the new files kill Nginx's workers (corazawaf/coraza-nginx#139). But another package in the same dpkg run can activate nginx's ownnginx-reloadtrigger (any libnginx-mod-* does), and dpkg may process it before ours: Nginx reloads with the new rules, every worker dies, and requests hang until the recheck rolls back seconds later.If dpkg is killed in that window (power loss, OOM, an interrupted apt), the recheck never runs and Nginx stays without workers, with Coraza still linked, until someone runs
/usr/lib/keel/overlays/coraza/state recheckordisabled. Monit's nginx check restarts Nginx, which loads the same rules and dies again; waf-blocks alerts.Options to weigh: a boot-time or Monit-driven
state recheck(e.g. as the nginx check's restart program while Coraza is enabled), or making the recheck run before any reload by awaiting the trigger (interestinstead ofinterest-noawait, which does not order it against nginx's trigger either).