Hi I am trying to parse pfSense logs coming via Syslog (agent install doesn't work on the current version). It won't work as expected. Here are my custom decoder:
<decoder name="pf-php-fpm">
<prematch>php-fpm</prematch>
</decoder>
<decoder name="pf-php-fpm-login">
<parent>pf-php-fpm</parent>
<regex type="pcre2">php-fpm\[\d+\]: /index\.php: Successful login for user '(.+?)' from: (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})</regex>
<order>username, source_ip</order>
</decoder>
<decoder name="pf-php-fpm-auth-error">
<parent>pf-php-fpm</parent>
<regex type="pcre2">php-fpm\[\d+\]: /index\.php: webConfigurator authentication error for user '(.+?)' from: (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})</regex>
<order>username, source_ip</order>
</decoder>
<decoder name="pf-ssh-connection-closed">
<prematch>Connection closed by authenticating user</prematch>
<regex type="pcre2">user (\S+) (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) port (\d+)</regex>
<order>username, source_ip, source_port</order>
</decoder>
<decoder name="pf-ssh-publickey-accepted">
<prematch>Accepted publickey for</prematch>
<regex type="pcre2">for (\S+) from (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) port (\d+) ssh2: (\S+) (\S+)</regex>
<order>username, source_ip, source_port, key_algorithm, key_signature</order>
</decoder>
And here is what happens to an example failed login (from the full_log in the archive.json):
Sep 23 19:43:21 php-fpm[63232]: /index.php: webConfigurator authentication error for user 'Martin' from: 10.21.0.9
**Messages:
WARNING: (7003): 'a49ca664' token expires
INFO: (7202): Session initialized with token '10cd2455'
**Phase 1: Completed pre-decoding.
full event: 'Sep 23 19:43:21 php-fpm[63232]: /index.php: webConfigurator authentication error for user 'Martin' from: 10.21.0.9'
timestamp: 'Sep 23 19:43:21'
hostname: 'php-fpm[63232]:'
**Phase 2: Completed decoding.
name: 'pf-php-fpm'
**Phase 3: Completed filtering (rules).
id: '2501'
level: '5'
description: 'syslog: User authentication failure.'
groups: '["syslog","access_control","authentication_failed"]'
firedtimes: '1'
gdpr: '["IV_35.7.d","IV_32.2"]'
gpg13: '["7.8"]'
hipaa: '["164.312.b"]'
mail: 'false'
nist_800_53: '["AU.14","AC.7"]'
pci_dss: '["10.2.4","10.2.5"]'
tsc: '["CC6.1","CC6.8","CC7.2","CC7.3"]'
**Alert to be generated.
Why is this random syslog alert generated?
Why does it say decoder being 'pf-php-fpm' does that mean that the other sub-decoders failed? if so then why? I don't understand. I just want Wazuh to use my decoders.