Also if I make rules like this:
<rule id="64500" level="3">
<decoded_as>paloalto_system</decoded_as>
<description>SYSTEM Palo Alto logs type</description>
</rule>
<rule id="64512" level="3">
<if_sid>64500</if_sid>
<field name="eventid">auth-fail</field>
<description>Palo Alto System: User $(srcusr) failed to login from $(srcip).</description>
<group>access_control,authentication_failed</group>
</rule>
And decoders:
<decoder name="paloalto_system_fail_auth">
<parent>paloalto_system</parent>
<prematch>\.*failed authentication for user\.*</prematch>
<regex >(\d*/\d*/\d* \d*:\d*:\d*),(\d*),(\w*),(\w*),\.*,(\.*),(\.*),(\S*),(\.*),\.*,\.*,(\w*),\w*,"failed authentication for user '(\S+)'.\.*. From: (\d+.\d+.\d+.\d+).",(\d*),(\S*),(\d*,\d*,\d*,\d*),(\.*),(\S*)</regex>
<order>receive_time,serial_number,type,content_type,time_generated,virtual_system,eventid,object,module,srcusr,srcip,sequence_number,actionflags,dg_hier_level_1_to_dg_hier_level_4,virtual_system_name,device_name</order>
</decoder>
<decoder name="paloalto_system_fail_sso">
<parent>paloalto_system</parent>
<prematch>\.*SAML SSO authentication failed for\.*</prematch>
<regex >(\d*/\d*/\d* \d*:\d*:\d*),(\d*),(\w*),(\w*),\.*,(\.*),(\.*),(\S*),(\.*),\.*,\.*,(\w*),\w*,"SAML SSO authentication failed for user '(\S+)'. \.*,\.*,\.*,\.*, From: (\d+.\d+.\d+.\d+).",(\d*),(\S*),(\d*,\d*,\d*,\d*),(\.*),(\S*)</regex>
<order>receive_time,serial_number,type,content_type,time_generated,virtual_system,eventid,object,module,srcusr,srcip,sequence_number,actionflags,dg_hier_level_1_to_dg_hier_level_4,virtual_system_name,device_name</order>
</decoder>
Both these log examples are decoded and have field eventid: auth-fail, but rule only works for the first log entry, not for second:
Jun 22 09:42:34 firewall_01 1,2022/06/22 09:42:33,007254000215990,SYSTEM,auth,2561,2022/06/22 09:42:33,,auth-fail,,0,0,general,medium,"failed authentication for user 'fake.user.login.admin'. Reason: Authentication profile not found for the user. From: 10.10.10.2.",7083838222996489638,0x0,0,0,0,0,,firewall_01,0,0,2022-06-22T09:42:34.062+00:00
Jun 22 14:17:39 firewall_01 1,2022/06/22 14:17:39,007254000215990,SYSTEM,auth,2561,2022/06/22 14:17:39,,auth-fail,SSO-Provider Prod,0,0,general,informational,"SAML SSO authentication failed for user '
test...@testemail.com'. auth profile 'SSO-Provider', vsys 'vsys1', server profile 'SSO-provider', IdP entityID '
http://www.sso-prov.com/exk6n31jk12kl1k1l', From: 192.168.0.1.",7083838222996490650,0x0,0,0,0,0,,firewall_01,0,0,2022-06-22T14:17:39.887+00:0
For first in logtest result is:
**Phase 3: Completed filtering (rules).
id: '64512'
level: '3'
description: 'Palo Alto System: User fake.user.login failed to login from 10.10.10.2.'
groups: '['paloalto', 'access_control', 'authentication_failed']'
firedtimes: '1'
mail: 'False'
For second logtest result is:
**Phase 3: Completed filtering (rules).
id: '2501'
level: '5'
description: 'syslog: User authentication failure.'
groups: '['syslog', 'access_control', 'authentication_failed']'
firedtimes: '2'
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']'
Can't understand where is the problem, tried other rules with <match>, <regex>, nothing works.