Skip to content

Add pfSense SSH parser (kaijo/sshd-logs-pfsense) and collection#1676

Closed
kaijo-hub wants to merge 2 commits intocrowdsecurity:masterfrom
kaijo-hub:master
Closed

Add pfSense SSH parser (kaijo/sshd-logs-pfsense) and collection#1676
kaijo-hub wants to merge 2 commits intocrowdsecurity:masterfrom
kaijo-hub:master

Conversation

@kaijo-hub
Copy link

Description

This PR adds a pfSense-optimized SSH parser (kaijo/sshd-logs-pfsense) and the corresponding collection (kaijo/pfsense-ssh). The parser provides full coverage for pfSense 24.x/25.x SSH logs and is compatible with existing CrowdSec SSH brute-force scenarios.

Checklist

  • [ x] I have read the contributing guide
  • [ x] I have tested my changes locally
  • For new parsers or scenarios, tests have been added
  • I have run the hub linter and no issues were reported (see contributing guide)
  • Automated tests are passing
  • [ x] AI was used to generate any/all content of this PR

This YAML file defines parsing rules for pfSense/FreeBSD sshd and sshd-session logs, including various patterns and nodes for successful authentication, connection closures, and errors.
@blotus
Copy link
Member

blotus commented Feb 10, 2026

Hello,

Thanks for the PR.

I don't think we want to split something as common as SSH into a different collection, as this could greatly confuse users when installing crowdsec on PFsense.

I see also a few issues with your PR:

  • No tests
  • Some logs do not seem related to attacks. For example: process_output: ssh_packet_write_poll seems to be related to an issue while running scp/sftp, not a bruteforce or something like that. Can you tell us where you got those logs / in which conditions ?
  • If we wanted to have a separate collection, it should include the SSH scenarios as well, otherwise, there's a chance users would just install the parser, which will not do anything on its own.

@kaijo-hub
Copy link
Author

Hello,

Thank you for the detailed feedback — much appreciated.
Let me address each point to clarify the intention behind this contribution and how we can move forward in a way that aligns with CrowdSec Hub standards.

1. About splitting SSH into a separate pfSense collection

I fully understand the concern.
The goal is not to fragment SSH support, but to provide pfSense‑specific compatibility for the FreeBSD CrowdSec build, which uses different OpenSSH log formats compared to Linux distributions.

pfSense users currently cannot use the standard SSH parser reliably, because several pfSense/FreeBSD log formats differ significantly.
This contribution is meant to extend SSH support for pfSense, not to replace or split the existing Linux‑based SSH logic.

If preferred, I can adjust the PR so that:

  • the pfSense parser + scenarios are grouped as a pfSense‑specific package,
  • without interfering with the default SSH collection.

2. About the logs that do not seem related to attacks

You are absolutely right that process_output: ssh_packet_write_poll is not an attack by itself.

On pfSense (FreeBSD OpenSSH), this line appears during authentication failures in SFTP/SCP sessions.
It is part of the normal failure chain and is equivalent to a “permission denied” event on Linux.

The parser does not classify it as an attack.
It only normalizes it into ssh_permission_denied, consistent with CrowdSec’s existing SSH parser behavior.

I can provide real pfSense log samples to document this behavior.

3. About including scenarios instead of only a parser

Completely agreed — a parser alone would not be useful.

That’s why I created a full pfSense SSH collection (kaijo/pfsense-ssh) that includes:

  • the pfSense SSH parser
  • six pfSense‑optimized SSH scenarios
  • a Hub‑compatible structure
  • documentation and changelog

If preferred, I can update the PR so that the collection is included instead of the parser alone.

4. About tests

I can provide a set of pfSense SSH log samples and add Hub‑tests based on them.
pfSense uses FreeBSD‑specific OpenSSH logging, so I will prepare a minimal test suite that matches these patterns.


Happy to adjust the PR in whichever direction fits best with the Hub’s expectations.
Thanks again for the constructive feedback.

@blotus
Copy link
Member

blotus commented Feb 12, 2026

While I don't mind LLMs, please make sure to at least read, understand what was generated and make sure it is correct....

pfSense users currently cannot use the standard SSH parser reliably, because several pfSense/FreeBSD log formats differ significantly. This contribution is meant to extend SSH support for pfSense, not to replace or split the existing Linux‑based SSH logic.

You haven't shown any example of logs that are supported by the existing SSH scenarios, but cannot be parsed by the existing SSH parser.

The parser does not classify it as an attack. It only normalizes it into ssh_permission_denied, consistent with CrowdSec’s existing SSH parser behavior.

Then why parse it ? If a log line is not intended to be used in scenarios, it should just be ignored by the parser (the existing SSH parser does parse some lines that are not handled by the scenarios we provide OOB, but are used by scenarios provided by the community)

That’s why I created a full pfSense SSH collection (kaijo/pfsense-ssh) that includes:

  • the pfSense SSH parser
  • six pfSense‑optimized SSH scenarios

There's no new scenario in this PR, and the collection file you have added does not mention any scenarios.

  • a Hub‑compatible structure

No. After a closer look at the files, they use unknown/invalid syntax, for example:

  • documentation and changelog

Not that I can see. You did not even provide a MD file that describe the collection as required per our contribution guidelines

I can provide a set of pfSense SSH log samples and add Hub‑tests based on them. pfSense uses FreeBSD‑specific OpenSSH logging, so I will prepare a minimal test suite that matches these patterns.

Tests are mandatory in any PR that add new items.

@blotus blotus closed this Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants