The crowdsecurity/naxsi collection does not parse NAXSI action logs correctly
Describe the bug
The crowdsecurity/naxsi collection does not parse NAXSI action logs in the NAXSI_FMT format emitted by my nginx/NAXSI installation on OpnSense (version 26.7.6, os-nginx 1.36_5, os-crowdsec 1.0.12).
The collection's crowdsecurity/naxsi-logs parser expects NAXSI_EXLOG:
grok:
name: "NAXSI_EXLOG"
apply_on: message
However, NAXSI is generating NAXSI_FMT records. CrowdSec acquires these error-log entries, but the NAXSI parser reports them as unparsed. Consequently, the crowdsecurity/naxsi-exploit-vpatch scenario cannot evaluate the rule IDs in these events.
To Reproduce
- Install the
crowdsecurity/naxsicollection (version 0.2). - Configure CrowdSec to acquire nginx logs using the
nginxtype. - Generate a request that triggers a NAXSI rule.
- Inspect the nginx error log. An example from my installation is:
2026/10/09 11:05:56 [error] 22445#103046: *895 NAXSI_FMT: ip=95.178.148.157&server=cloud.example.com&uri=/&config=block&rid=484bf44606d45f99899463099cdc3658&cscore0=$policy06fa155002584a12aecf8220c9c88eb3&score0=8&zone0=ARGS&id0=1302&var_name0=naxsi_test, client: 95.178.148.157, server: cloud.example.com, request: "GET /?naxsi_test=%3Cscript%3E HTTP/2.0", host: "cloud.example.com"
- Run
cscli metrics show parsersorcscli explainagainst the captured log.
The NAXSI parser receives the event but fails to parse it because it expects NAXSI_EXLOG, not the actual NAXSI_FMT structure. The virtual-patch scenario consequently receives no matching NAXSI event.
Expected behavior
The collection should support the NAXSI_FMT format emitted by my installation, extracting the client IP, request URI, enforcement mode, and rule IDs. It should correctly handle records containing multiple zoneN/idN pairs.
Alternatively, if extended logging is a prerequisite for the existing parser, the collection should clearly document that requirement and provide the necessary NAXSI configuration.
The NAXSI-specific virtual-patch scenario should evaluate only enforced-mode events (config=block), not learning-mode events (config=learning).
Screenshots
Not applicable. The issue is reproducible using log records and cscli explain output.
Additional context
- CrowdSec is running on OPNsense with nginx and NAXSI.
- The installed collection is
crowdsecurity/naxsiversion 0.2. - The actual NAXSI logs use
config=blockorconfig=learning, followed by fields such asrid,cscore0,score0,zone0,id0, andvar_name0. - The installed parser instead matches the
NAXSI_EXLOGformat, whose fields includeid,zone,var_name, andcontent. - The stock
NAXSI_FMTgrok pattern available in my installation also does not match the observed record structure: it expects fields such aslearning,vers,total_processed,total_blocked, andblock. - I confirmed the failure using
cscli metrics show parsersandcscli explain. A locally implemented parser matching the observedNAXSI_FMTformat successfully parsed the events. - The general HTTP scenarios, including
crowdsecurity/http-xss-probing, are independent of this NAXSI-specific integration and should remain enabled.