feat: the Keel Web overlay packages, nginx, coraza and anubis (0041 step 6) #21
No reviewers
Labels
No labels
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/common!21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/web-overlay-packages"
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?
Step 6 of handbook decision 0041's first implementation:
keel-overlay-nginx,keel-overlay-corazaandkeel-overlay-anubis, a source package each underpackages/, with their manifests. Design and reasons inpackages/README.md, "The Web overlays".Done criterion, on Core
Measured on an LXC container (
s6-test) made from the step 4 Core imagedebian-13-keel-core_19.0-3+step4-20260930_amd64.tar.zst, headless first boot, keel upgraded to 0.14.0 (main, 527dc85), the three overlays installed in one apt transaction with the step 5 packages built withgbp buildpackagefrom theirkeel/trixieheads (libcoraza 2dd7785, coreruleset 7411b7a, libnginx-mod-http-coraza 630c68f, anubis e2512d3).nginx answers
/keel-healthwith 204 on the loopback onlyCoraza and Anubis installed and disabled
Turned on in the spec,
waf-blocksandanubispass. A spec withappliance: web(the format'sweb.yamlplaced by hand until step 7 shipskeel-web),coraza: enabled,anubis: enabled, applied withkeel spec apply --system-only:anubis@keel.service; the key unit made/etc/anubis/keel.key(0600 root, 64 hex) on that start; Monitkeel-check-anubisOK.waf-blocksinto Monit's file but loaded nothing: Coraza has no unit. Monit:failed protocol test ... Server returned status 204./usr/lib/keel/overlays/coraza/state enabled:coraza: enabled: the probe got 403 and /keel-health 204. Next Monit run:'keel-check-waf-blocks' connection succeeded, summary OK for nginx, waf-blocks and anubis.tests/overlay-web.batson the same container: 28 of 28.Fact 1 (corazawaf/coraza-nginx#139)
Handled in the overlay's enable hook,
/usr/lib/keel/overlays/coraza/state enabled: links,nginx -t, reload, then waits for the probe to get 403 and/keel-health204; otherwise restores the links, reloads, checks Nginx answers, and fails naming the cause. Reproduced and covered by a test:SecRule ARGS "@rx (" ...appended toREQUEST-900passesnginx -t, all workers exit with fatal code 2; the hook rolls back and Nginx answers 204 again. keel 0.14.0 does not call the hook yet: listed for step 7 / the 0042 work in the README.What keel lacks
/usr/lib/keel/overlays/<name>/state enabled|disabledon a state change (Coraza has no unit to converge).diff/inspectfor a unit-less overlay ("not compared" today).generate: trueyields a short token for the conf, not an Anubis key; the emitter should write{file: /etc/anubis/keel.key}and a replica should get the primary's key before its first start.%253C); CRS still blocks it (403).Notes
unit: anubis@keel.service(step 5 ships a template) andaddress: "::1". A handbook erratum should follow.[::1]rather than a unix socket for Anubis: the manifest's check is a TCP probe and format v1 has no socket check.keel-health.conflistens on[::1]:80/127.0.0.1:80, so it answers all loopback traffic on port 80 whatever the Host.crowdsecurity/whitelistson the Core image already whitelists127.0.0.1and::1.packages / build; their live suite needs systemd, which Keel runs in system containers only, so it ran on the test VM.installnow installs only the Core four. The two hook scripts are unit tested at 100 percent intests / coverage.After review
flockserialises runs.state recheck, which turns Coraza off when the new files kill the workers (tested with a coreruleset carrying a bad rule). Other reloads (by hand, cert renewal, other modules' trigger, edits under /etc/coreruleset) are documented as unguarded.prerm removedrops both links; a purge of the Anubis overlay stops and disablesanubis@keel.{file: PATH}, refuses a missing one, and makes none on a database replica or where/etc/anubis/keel.key.from-primaryexists. keel's part: Keel-Linux/keel#62. Manifest erratum: Keel-Linux/handbook#33.web / trixierunstests/overlay-web.bats(32 tests) in a booted LXC system container, with step 5's packages built there.The first live run was on
edfcf68.cfedd9aonly joins the hook's continued lines (kcov measured 82 of 84 on the CI runner); its unit suite passes unchanged and coverage is 100.The container was destroyed after the run.