opnsense / opnsense/plugins

os-crowdsec (1.10.12): opnsense-gui-logs and sshd-logs parsers do not match OPNsense 26.1.9 audit log format

Open
#5,483 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
1.2k
Forks
863
Avg merge
2d 6h
Merged PRs (30d)
10

Description

Important notices
Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug
The crowdsecurity/opnsense-gui-logs and crowdsecurity/sshd-logs parsers do not match the audit log format used by OPNsense 26.1.9. All authentication-related log lines show parser failure at s01-parse despite syslog-logs parsing successfully at s00-raw.

Parser expects:
/index.php: Web GUI authentication error for 'username' from 1.2.3.4

Actual log format in /var/log/audit/latest.log:
user installer failed authentication for login on OPNsense\Auth\Services\System via OPNsense\Auth\Local

cscli explain output:
line: <39>1 2026-06-07T05:45:06+00:00 OPNsense.internal audit 41095 - [meta sequenceId="18"] user installer failed authentication for login on OPNsense\Auth\Services\System via OPNsense\Auth\Local
โ”œ s00-raw
| โ”” ๐ŸŸข crowdsecurity/syslog-logs (+15 ~9)
โ”œ s01-parse
| โ”œ ๐Ÿ”ด crowdsecurity/opnsense-gui-logs
| โ”œ ๐Ÿ”ด firewallservices/pf-logs
| โ”œ ๐Ÿ”ด firewallservices/pf-logs-drop
| โ”œ ๐Ÿ”ด crowdsecurity/sshd-logs
| โ”” ๐Ÿ”ด crowdsecurity/sshd-success-logs
โ””-------- parser failure ๐Ÿ”ด

line: <39>1 2026-06-07T05:54:19+00:00 OPNsense.internal audit 91309 - [meta sequenceId="1"] user \x1b[6~\x1b\x1b[6~ failed authentication for login on OPNsense\Auth\Services\System via OPNsense\Auth\Local
โ”œ s00-raw
| โ”” ๐ŸŸข crowdsecurity/syslog-logs (+15 ~9)
โ”œ s01-parse
| โ”œ ๐Ÿ”ด crowdsecurity/opnsense-gui-logs
| โ”œ ๐Ÿ”ด firewallservices/pf-logs
| โ”œ ๐Ÿ”ด firewallservices/pf-logs-drop
| โ”œ ๐Ÿ”ด crowdsecurity/sshd-logs
| โ”” ๐Ÿ”ด crowdsecurity/sshd-success-logs
โ””-------- parser failure ๐Ÿ”ด

cscli metrics show parsers output:

Parser Metrics

โ”‚ Parser----------------------------------โ”‚ Hits โ”‚ Parsed โ”‚ Unparsed โ”‚
โ”‚ child-crowdsecurity/syslog-logs------| 2.65k โ”‚ 1.32k----โ”‚ 1.32k-----โ”‚
โ”‚ crowdsecurity/dateparse-enrich------โ”‚ 210 โ”‚ 210 ----โ”‚ -----------โ”‚
โ”‚ crowdsecurity/geoip-enrich---------- โ”‚ 160 โ”‚ 160----โ”‚ ------------โ”‚
โ”‚ crowdsecurity/public-dns-allowlist---โ”‚ 210 โ”‚ 210 ----โ”‚ ------------|
โ”‚ crowdsecurity/syslog-logs------------โ”‚ 1.32k โ”‚ 1.32k---|-------------โ”‚
โ”‚ firewallservices/pf-logs----------------โ”‚ 920 โ”‚ 907----โ”‚ 13--------โ”‚
โ”‚ firewallservices/pf-logs-drop---------โ”‚ 210 โ”‚ 210-----โ”‚ ------------โ”‚

To Reproduce
Steps to reproduce the behavior:

  1. Install os-crowdsec on OPNsense 26.1.x
  2. Run: grep "authentication" /var/log/audit/latest.log | tail -3 | cscli explain -f- --type syslog
  3. Observe parser failure at s01-parse for crowdsecurity/opnsense-gui-logs

Expected behavior
Failed authentication attempts should be parsed and trigger the crowdsecurity/opnsense-gui-bf brute force scenario.

Relevant log files
onsuccess: next_stage
filter: "evt.Parsed.program == 'audit'"
name: crowdsecurity/opnsense-gui-logs
description: "Parse OPNSense web auth logs"
#/index.php: Web GUI authentication error for 'toto' from 1.2.3.4
grok:
pattern: "/index.php: Web GUI authentication error for '%{USERNAME:username}' from %{IPORHOST:source_ip}"
apply_on: message
statics:

  • meta: service
    value: opnsense-gui
  • meta: username
    expression: "evt.Parsed.username"
  • meta: source_ip
    expression: evt.Parsed.source_ip
  • meta: log_type
    value: opnsense-gui-failed-auth

Environment
OPNsense 26.1.9 (amd64).
Ryzen 7 Pro 6850U
Dual Intelยฎ I2226 V 2.5GB NICs
CrowdSec plugin 1.10.12

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up โ€” it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the crowdsecurity/opnsense-gui-logs parser configuration shown in the issue and reproduce the failure with the listed grep and cscli explain command. Compare the expected and actual audit lines, then verify that failed authentication lines are parsed and trigger the crowdsecurity/opnsense-gui-bf brute-force scenario.

Written by the indexing model from the issue text.

Assessment

Domain
authentication, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.