Log request details for refusals and add Grafana dashboards #15

Merged
james merged 2 commits from log-request-details into main 2026-10-24 16:20:56 +00:00
Owner

Makes it possible to review what centinela refused and why.

Optional request details in the decision log. A new setting, CENTINELA_LOG_DETAILS=true, adds query, ua and matched (each WAF rule's id and the text it matched) to every decision that is not an allow. It is off by default, because a refused request's query string can contain a token or password. Allowed requests never log these fields. Tests cover both settings.

Grafana dashboards in integrations/grafana/, with a README:

  • centinela-overview: verdicts, blocks and shuns, refusal reasons, traffic by country, top clients and paths, model failures.
  • centinela-review: opened by clicking any count on the overview. It shows the clients, hosts, paths and individual requests behind that count, with filters for verdict, source, client, country, host, path and reason.
  • Both take their Loki stream selector from a Log stream variable, so they work with any log shipper's labels.
  • These are the dashboards running on our Grafana, generalized. All 59 queries pass Loki's format_query check.

After release, set CENTINELA_LOG_DETAILS=true in the deployment to fill in the review dashboard's Query, User agent and WAF matched columns.

Makes it possible to review what centinela refused and why. **Optional request details in the decision log.** A new setting, `CENTINELA_LOG_DETAILS=true`, adds `query`, `ua` and `matched` (each WAF rule's id and the text it matched) to every decision that is not an allow. It is off by default, because a refused request's query string can contain a token or password. Allowed requests never log these fields. Tests cover both settings. **Grafana dashboards** in `integrations/grafana/`, with a README: - `centinela-overview`: verdicts, blocks and shuns, refusal reasons, traffic by country, top clients and paths, model failures. - `centinela-review`: opened by clicking any count on the overview. It shows the clients, hosts, paths and individual requests behind that count, with filters for verdict, source, client, country, host, path and reason. - Both take their Loki stream selector from a **Log stream** variable, so they work with any log shipper's labels. - These are the dashboards running on our Grafana, generalized. All 59 queries pass Loki's `format_query` check. After release, set `CENTINELA_LOG_DETAILS=true` in the deployment to fill in the review dashboard's Query, User agent and WAF matched columns.
CENTINELA_LOG_DETAILS=true adds the query string, user agent and the
text each WAF rule matched to the log line of every decision that is not
an allow, so a reviewer can see what was requested and judge whether the
refusal was right. It is off by default: a refused request's query or
matched text can hold a token or password, and allows never log them.
Add Grafana dashboards for the decision log
All checks were successful
security-scan / security-scan (pull_request) Successful in 27s
test / go (pull_request) Successful in 3m0s
8f23310ea2
centinela-overview shows verdicts, blocks and shuns, refusal reasons,
traffic by country and model health. centinela-review is the drill-down
every count links to: the clients, hosts, paths and individual requests
behind it, with filters for verdict, source, client, country, host, path
and reason. Both read the Loki stream named by a Log stream variable, so
they work with any log shipper's labels.

🔎 ojo scan results

No findings.

<!-- ojo-scan-summary --> ### 🔎 ojo scan results No findings.
james merged commit 4aa0545b5c into main 2026-10-24 16:20:56 +00:00
james deleted branch log-request-details 2026-10-24 16:20:56 +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!15
No description provided.