Load optional local WAF rules before CRS #16

Merged
james merged 1 commit from waf-extra-rules into main 2026-10-25 16:04:21 +00:00
Owner

Adds CENTINELA_WAF_EXTRA_RULES: a file of Coraza directives the embedded WAF loads after the virtual patches and before the CRS rules, so local exclusions can live in deployment config.

  • Unset: no change.
  • Unreadable file or a parse error: centinela exits at startup.
  • Rules with ids 1100000-1199999 show in the decision log like CRS rules.

Why: about 980 of 1,363 refusals over 3 days (shunned clients excluded) were Forgejo views of .gitignore, Dockerfile, .dockerignore, php.ini and .htaccess, which CRS 930130 flags and the model then blocks as path_traversal. gitops-infra will ship the exclusion as a ConfigMap.

Tests: with the Forgejo exclusion loaded, 930130 no longer matches git.colibrisec.org///src|raw/... but still matches the same path on another host and /.htaccess on git.colibrisec.org. A rule that fails to parse makes New fail. README documents the setting with the example.

Adds `CENTINELA_WAF_EXTRA_RULES`: a file of Coraza directives the embedded WAF loads after the virtual patches and before the CRS rules, so local exclusions can live in deployment config. - Unset: no change. - Unreadable file or a parse error: centinela exits at startup. - Rules with ids 1100000-1199999 show in the decision log like CRS rules. Why: about 980 of 1,363 refusals over 3 days (shunned clients excluded) were Forgejo views of .gitignore, Dockerfile, .dockerignore, php.ini and .htaccess, which CRS 930130 flags and the model then blocks as path_traversal. gitops-infra will ship the exclusion as a ConfigMap. Tests: with the Forgejo exclusion loaded, 930130 no longer matches git.colibrisec.org/<owner>/<repo>/src|raw/... but still matches the same path on another host and /.htaccess on git.colibrisec.org. A rule that fails to parse makes New fail. README documents the setting with the example.
Load optional local WAF rules before CRS
All checks were successful
security-scan / security-scan (pull_request) Successful in 1m27s
test / go (pull_request) Successful in 4m12s
1d86cf50fd
CENTINELA_WAF_EXTRA_RULES names a file of Coraza directives that the
embedded WAF loads after the virtual patches and before the CRS rules, so
local exclusions (ctl:ruleRemoveById and the like) can live in deployment
config. Unset changes nothing; a file that can't be read or parsed stops
startup. Rules with ids 1100000-1199999 are reported like CRS rules.

The tests cover the Forgejo file-view exclusion for CRS 930130: removed
for /<owner>/<repo>/src/... on the named host only, kept for other hosts
and for /.htaccess.

🔎 ojo scan results

No findings.

<!-- ojo-scan-summary --> ### 🔎 ojo scan results No findings.
james merged commit 9376904c74 into main 2026-10-25 16:04:21 +00:00
james deleted branch waf-extra-rules 2026-10-25 16:04:21 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ColibriSec/centinela!16
No description provided.