Hi! Thanks for using our community
First we need to see if logs are being sent to the Manager.
From the manager try running
tcpdump -i any udp -nn port 514 -AA
With that you will see the traffic coming to the 514 Port on your manager, try to filter the result with the UniFi controller ip to see if anything is coming from it.
In case nothing shows up you will need to check that syslog forwarding is correctly configured on the UniFi and that connections are opened between the VMs
In case you see traffic between the server, please edit your ossec.conf file on the manager ( /var/ossec/etc/ossec.conf ) and edit the line
no to yes
After that restart the manager: systemctl restart wazuh-manager
This will save all the incoming logs either they trigger alerts or not in the /var/ossec/logs/alerts/alerts.json file, you can filter by the IP of the UniFi controller to see the information on the logs being received and what wazuh is doing with them (rule.id if triggered, full_log, etc). If you have that information please share it so we can analyze it.
Also if you can please attach the example of wazuh-logtest you are getting, I tried to replicate on my lab with the log you shared and Wazuh is decoding the message as this:
**Phase 3: Completed filtering (rules).
Rule id: '7300'
Level: '0'
Description: 'Grouping of Symantec AV rules.'
Let me know if this helps
Reference:
global - Local configuration (ossec.conf) · Wazuh documentation (logall_json)
Regards!
Hi ! Thanks a lot for all your precious advice :-)
I have 2 labs. One at home, the other at the office.
I tried the tcpdump on both and had the same result : syslog messages received on both !
Before the ossec.conf modification, I tried a quick cat /var/ossec/logs/alerts/alerts.log on both my labs :
After that, I modified the ossec.conf file to edit the <logall> and <logall_json> options to “yes”.
Restarted the wazuh-manager.
cat /var/ossec/logs/alerts/alerts.json | grep "*unifi controller IP and other filters*"
At work : nothing… (but in the documentation, it mentions the archives.json file, see below)
At home : as I said before, I already had alerts created with the custom decoder and rule triggered in the alerts.json file, so still had them with the <logall> option to yes.
I also check in the /var/ossec/logs/archives/archives.log file and there I found the UniFi logs, at home and at work.
Well, at least it reminded me of a difference between my 2 labs : I installed the wazuh-agent on the UniFi controller from work. Don’t know if it makes a difference in the Syslog sending behavior…
Also I forgot to mention that I disabled the symantec-av decoders and rules by renaming their config files (with “.off” at the end). My logs were triggering them, so I disabled them in order to use mine. As I am not using any Symantec product it should not be a problem, right ?
Here are some logs found in the /var/ossec/logs/alerts/alerts.json file in my home lab :
{"timestamp":"2022-05-31T22:19:38.099+0200","rule":{"level":5,"description":" WIFI log UniFi","id":"100013","firedtimes":19,"mail":false,"groups":["local","syslog","sshd"]},"agent":{"id":"000","name":"wazuh-manager"},"manager":{"name":"wazuh-manager"},"id":"1654028378.13441","full_log":"May 31 22:19:38 wap001 78455819c06e,UAP-AC-InWall-6.0.18+13660: mcad: mcad[1464]: wireless_agg_stats.log_sta_anomalies(): bssid=7e:45:58:1b:c0:6e radio=wifi1 vap=ath3 sta=1a:77:92:7c:fc:a8 satisfaction_now=60 anomalies=tcp
_latency","predecoder":{"timestamp":"May 31 22:19:38","hostname":"wap001"},"decoder":{"name":"unifi"},"location":"192.168.1.31"}
{"timestamp":"2022-05-31T22:19:42.734+0200","rule":{"level":5,"description":" WIFI log UniFi","id":"100013","firedtimes":20,"mail":false,"groups":["local","syslog","sshd"]},"agent":{"id":"000","name":"wazuh-manager"},"manager":{"name":"wazuh-manager"},"id":"1654028382.13807","full_log":"May 31 22:19:42 wap001 78455819c06e,UAP-AC-InWall-6.0.18+13660: mcad: mcad[1464]: wireless_agg_stats.log_sta_anomalies(): bssid=7e:45:58:1b:c0:6e radio=wifi1 vap=ath3 sta=1a:77:92:7c:fc:a8 satisfaction_now=60 anomalies=tcp_latency","predecoder":{"timestamp":"May 31 22:19:42","hostname":"wap001"},"decoder":{"name":"unifi"},"location":"192.168.1.31"}
{"timestamp":"2022-05-31T22:19:53.320+0200","rule":{"level":5,"description":" WIFI log UniFi","id":"100013","firedtimes":21,"mail":false,"groups":["local","syslog","sshd"]},"agent":{"id":"000","name":"wazuh-manager"},"manager":{"name":"wazuh-manager"},"id":"1654028393.14173","full_log":"May 31 22:19:53 wap001 78455819c06e,UAP-AC-InWall-6.0.18+13660: mcad: mcad[1464]: wireless_agg_stats.log_sta_anomalies(): bssid=7e:45:58:1b:c0:6e radio=wifi1 vap=ath3 sta=1a:77:92:7c:fc:a8 satisfaction_now=60 anomalies=tcp_latency","predecoder":{"timestamp":"May 31 22:19:53","hostname":"wap001"},"decoder":{"name":"unifi"},"location":"192.168.1.31"}
{"timestamp":"2022-05-31T22:19:53.727+0200","rule":{"level":5,"description":" WIFI log UniFi","id":"100013","firedtimes":22,"mail":false,"groups":["local","syslog","sshd"]},"agent":{"id":"000","name":"wazuh-manager"},"manager":{"name":"wazuh-manager"},"id":"1654028393.14539","full_log":"May 31 22:19:53 wap001 78455819c06e,UAP-AC-InWall-6.0.18+13660: mcad: mcad[1464]: wireless_agg_stats.log_sta_anomalies(): bssid=7e:45:58:1b:c0:6e radio=wifi1 vap=ath3 sta=1a:77:92:7c:fc:a8 satisfaction_now=60 anomalies=tcp_latency","predecoder":{"timestamp":"May 31 22:19:53","hostname":"wap001"},"decoder":{"name":"unifi"},"location":"192.168.1.31"}
Here are some logs found in the /var/ossec/logs/archives/archives.log file in my home lab :
2022 May 31 23:10:25 wap001->192.168.1.31 May 31 23:10:25 wap001 78455819c06e,UAP-AC-InWall-6.0.18+13660: kernel: [ 7087.760732] [wifi1] FWLOG: [7277914] WLAN_DEBUG_DBGID_PEER ( 0xdead, 0x1a7cfca8, 0x1 )
2022 May 31 23:10:25 wap001->192.168.1.31 May 31 23:10:25 wap001 78455819c06e,UAP-AC-InWall-6.0.18+13660: kernel: [ 7087.760749] [wifi1] FWLOG: [7277960] WLAN_DEBUG_DBGID_PEER ( 0xadd, 0x4e4573c1, 0x1, 0x3, 0x65 )
2022 May 31 23:10:25 wap001->192.168.1.31 May 31 23:10:25 wap001 78455819c06e,UAP-AC-InWall-6.0.18+13660: kernel: [ 7087.760771] [wifi1] FWLOG: [7277964] WAL_DBGID_TX_AC_BUFFER_SET ( 0x678, 0x87, 0x13 )
2022 May 31 23:10:25 wap001->192.168.1.31 May 31 23:10:25 wap001 78455819c06e,UAP-AC-InWall-6.0.18+13660: kernel: [ 7087.760787] [wifi1] FWLOG: [7277964] RATE: ChainMask 1, peer_mac 73:c1, phymode 1044484, ni_flags 0x00201006, vht_mcs_set 0x0000, ht_mcs_set 0x00ff, legacy_rate_set 0x0000
2022 May 31 23:10:25 wap001->192.168.1.31 May 31 23:10:25 wap001 78455819c06e,UAP-AC-InWall-6.0.18+13660: kernel: [ 7087.760810] [wifi1] FWLOG: [7278019] WAL_DBGID_SECURITY_UCAST_KEY_SET ( 0x0, 0x4ece73c1 )
2022 May 31 23:10:25 wap001->192.168.1.31 May 31 23:10:25 wap001 78455819c06e,UAP-AC-InWall-6.0.18+13660: kernel: [ 7087.760824] [wifi1] FWLOG: [7278019] WAL_DBGID_SECURITY_ENCR_EN ( )
2022 May 31 23:10:25 wap001->192.168.1.31 May 31 23:10:25 wap001 78455819c06e,UAP-AC-InWall-6.0.18+13660: kernel: [ 7087.760835] [wifi1] FWLOG: [7278019] WAL_DBGID_SECURITY_ALLOW_DATA ( 0x4349a4 )
2022 May 31 23:10:25 wap001->192.168.1.31 May 31 23:10:25 wap001 78455819c06e,UAP-AC-InWall-6.0.18+13660: kernel: [ 7087.760847] [wifi1] FWLOG: [7278064] RATE: ChainMask 1, peer_mac 73:c1, phymode 1044484, ni_flags 0x00201006, vht_mcs_set 0x0000, ht_mcs_set 0x00ff, legacy_rate_set 0x0000
(please note : 192.168.1.31 is the wifi access point IP address)
Here is the output I get when I use the wazuh-logtest tool :
root@wazuh-manager:~# /var/ossec/bin/wazuh-logtest
Starting wazuh-logtest v4.2.5
Type one log per line
May 31 23:10:25 wap001 78455819c06e,UAP-AC-InWall-6.0.18+13660: kernel: [ 7087.760847] [wifi1] FWLOG: [7278064] RATE: ChainMask 1, peer_mac 73:c1, phymode 1044484, ni_flags 0x00201006, vht_mcs_set 0x0000, ht_mcs_set 0x00ff, legacy_rate_set 0x0000
**Phase 1: Completed pre-decoding.
full event: 'May 31 23:10:25 wap001 78455819c06e,UAP-AC-InWall-6.0.18+13660: kernel: [ 7087.760847] [wifi1] FWLOG: [7278064] RATE: ChainMask 1, peer_mac 73:c1, phymode 1044484, ni_flags 0x00201006, vht_mcs_set 0x0000, ht_mcs_set 0x00ff, legacy_rate_set 0x0000'
timestamp: 'May 31 23:10:25'
hostname: 'wap001'
**Phase 2: Completed decoding.
name: 'unifi'
**Phase 3: Completed filtering (rules).
id: '100013'
level: '5'
description: ' WIFI log UniFi'
groups: '['local', 'syslog', 'sshd']'
firedtimes: '1'
mail: 'False'
**Alert to be generated.
I paste you here my decoder and rule once more :
<decoder name="unifi">
<prematch type="pcre2">UAP-</prematch>
</decoder>
<rule id="100013" level="5">
<decoded_as>unifi</decoded_as>
<description> WIFI log UniFi</description>
</rule>
I hope you have all the information you requested ^^
If not, please let me know.
Thanks again for your help :-)
Kind regards !