On Mon, Jan 6, 2020 at 6:09 AM Pierre Gremaud wrote:
>
> I'm trying to decode syslog messages sent by pfsence
>
> The log received in archives.log is the following :
>
> 2020 Jan 05 22:02:05 LAN-HIDS->192.168.85.40 Jan 5 21:02:05 php-fpm[338]:
> /index.php: webConfigurator authentication error for user 'admin' from:
> 192.168.85.1
>
So stripping the archives header from the log file, the log message
you need to test against is:
Jan 5 21:02:05 php-fpm[338]: /index.php: webConfigurator
authentication error for user 'admin' from: 192.168.85.1
Later in your message you're testing against:
192.168.85.40 Jan 5 21:02:05 php-fpm[338]: /index.php:
webConfigurator authentication error for user 'admin' from:
192.168.85.1
So when the message comes into OSSEC it looks like the first one
(starting with Jan), but you're developing based on the second
(starting with the IP address).
Your decoders should look more like:
php-fpm
pfsense
webConfigurator authentication error \.+ user '(\w+)' from:
(\d+.\d+.\d+.\d+)
user, dstip
>
> The alert shown in kibana is the following :
>
>
> I created a custom decoder in local_decoder.xml
>
>
>
>
> \.+ php-fpm
>
>
>
>
>
>
>
> pfsense
>
> ^(\d+.\d+.\d+.\d+) \.+ webConfigurator authentication error \.+ user
> '(\w+)' from: (\d+.\d+.\d+.\d+)
>
> srcip, user, dstip
>
>
>
>
> I created a custom rule in local_rules.xml
>
>
>
>
>
>
>
>
> 2501
>
> pfsense
>
> Pfsense authentication error
>
> no_full_log
>
>
>
>
>
>
> The output from ossec-test is the following :
>
>
> **Phase 1: Completed pre-decoding.
>
>full event: '192.168.85.40 Jan 5 21:02:05 php-fpm[338]: /index.php:
> webConfigurator authentication error for user 'admin' from: 192.168.85.1'
>
>timestamp: '(null)'
>
>hostname: 'LAN-HIDS'
>
>program_name: '(null)'
>
>log: '192.168.85.40 Jan 5 21:02:05 php-fpm[338]: /index.php:
> webConfigurator authentication error for user 'admin' from: 192.168.85.1'
>
>
> **Phase 2: Completed decoding.
>
>decoder: 'pfsense'
>
>srcip: '192.168.85.40'
>
>dstuser: 'admin'
>
>dstip: '192.168.85.1'
>
>
> **Phase 3: Completed filtering (rules).
>
>Rule id: '100040'
>
>Level: '6'
>
>Description: 'Pfsense authentication error'
>
> **Alert to be generated.
>
>
> The alert generated in kibana still shows rule id 2501 and not 100040
>
>
>
>
>
> Any suggestions ?
>
>
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ossec-list" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ossec-list+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ossec-list/5aca1f7e-0367-46cc-8067-fd881a495008%40googlegroups.com.
--
---
You received this message because you are subscribed to the Google Groups
"ossec-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ossec-list+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ossec-list/CAMyQvMrLLWi0nycr4EwXgn8iykX01o4pYHTHZtjrLZUmLZM0Pw%40mail.gmail.com.