Hi!
Sorry for the delay!, I hope you are doing fine!
Regarding the new question, it would be correct creates a new thread for it, so we keep it easier to search this kind of problems. And really I can't see any known issue in the error. Please, post a new thread for that.
In other hand, I have been analyzing the Suricata events, and it includes 2 example event types,
STATS and
DNS events, at this moment Wazuh supports DNS event, but it doesn't fires an alert, because the rule has
level 0.
Suricata default rules file:
/var/ossec/ruleset/rules/0475-suricata_rules.xml (be careful, any change of this file will be restored in a Wazuh upgrade)
DNS rule:
<rule id="86603" level="0"> <---- if you want fires an alert with this kind of Suricata events, change the level to 3 or higher.
<if_sid>86600</if_sid>
<field name="event_type">^dns$</field>
<description>Suricata: DNS.</description>
<options>no_full_log</options>
</rule>Also I created a new rule to process
STATS <rule id="86605" level="3">
<if_sid>86600</if_sid>
<field name="event_type">^stats$</field>
<description>Suricata: STATS.</description>
<options>no_full_log</options>
</rule>
This new rule could be added in
/var/ossec/etc/rules/local_rules.xml
Remember restart the manager after change any rule.
After updated these rules, I pointed the Wazuh logcollector to a similar file as yours (localfile config), then I pasted your Suricata example event in the file, and following alert was fired.
STATS Alert example: (file /var/ossec/logs/alerts/alerts.json)
{"timestamp":"2022-09-01T18:06:57.613-0300","rule":{"level":3,"description":"Suricata: STATS.","id":"86605","firedtimes":1,"mail":false,"groups":["syscheck"]},"agent":{"id":"000","name":"VBox"},"manager":{"name":"VBox"},"id":"1662066417.4963461","decoder":{"name":"json"},"data":{"timestamp":"2022-08-29T13:28:12.179164+0300","event_type":"stats","stats":{"uptime":"73","capture":{"kernel_packets":"5416","kernel_drops":"0","kernel_ifdrops":"0"},"decoder":{"pkts":"5652","bytes":"5780995","invalid":"0","ipv4":"5652","ipv6":"0","ethernet":"5652","chdlc":"0","raw":"0","null":"0","sll":"0","tcp":"134","udp":"5517","sctp":"0","icmpv4":"1","icmpv6":"0","ppp":"0","pppoe":"0","geneve":"0","gre":"0","vlan":"0","vlan_qinq":"0","vxlan":"0","vntag":"0","ieee8021ah":"0","teredo":"0","ipv4_in_ipv6":"0","ipv6_in_ipv6":"0","mpls":"0","avg_pkt_size":"1022","max_pkt_size":"1514","max_mac_addrs_src":"0","max_mac_addrs_dst":"0","erspan":"0","event":{"ipv4":{"pkt_too_small":"0","hlen_too_small":"0","iplen_smaller_than_hlen":"0","trunc_pkt":"0","opt_invalid":"0","opt_invalid_len":"0","opt_malformed":"0","opt_pad_required":"0","opt_eol_required":"0","opt_duplicate":"0","opt_unknown":"0","wrong_ip_version":"0","icmpv6":"0","frag_pkt_too_large":"0","frag_overlap":"0","frag_ignored":"0"},"icmpv4":{"pkt_too_small":"0","unknown_type":"0","unknown_code":"0","ipv4_trunc_pkt":"0","ipv4_unknown_ver":"0"},"icmpv6":{"unknown_type":"0","unknown_code":"0","pkt_too_small":"0","ipv6_unknown_version":"0","ipv6_trunc_pkt":"0","mld_message_with_invalid_hl":"0","unassigned_type":"0","experimentation_type":"0"},"ipv6":{"pkt_too_small":"0","trunc_pkt":"0","trunc_exthdr":"0","exthdr_dupl_fh":"0","exthdr_useless_fh":"0","exthdr_dupl_rh":"0","exthdr_dupl_hh":"0","exthdr_dupl_dh":"0","exthdr_dupl_ah":"0","exthdr_dupl_eh":"0","exthdr_invalid_optlen":"0","wrong_ip_version":"0","exthdr_ah_res_not_null":"0","hopopts_unknown_opt":"0","hopopts_only_padding":"0","dstopts_unknown_opt":"0","dstopts_only_padding":"0","rh_type_0":"0","zero_len_padn":"0","fh_non_zero_reserved_field":"0","data_after_none_header":"0","unknown_next_header":"0","icmpv4":"0","frag_pkt_too_large":"0","frag_overlap":"0","frag_invalid_length":"0","frag_ignored":"0","ipv4_in_ipv6_too_small":"0","ipv4_in_ipv6_wrong_version":"0","ipv6_in_ipv6_too_small":"0","ipv6_in_ipv6_wrong_version":"0"},"tcp":{"pkt_too_small":"0","hlen_too_small":"0","invalid_optlen":"0","opt_invalid_len":"0","opt_duplicate":"0"},"udp":{"pkt_too_small":"0","hlen_too_small":"0","hlen_invalid":"0"},"sll":{"pkt_too_small":"0"},"ethernet":{"pkt_too_small":"0"},"ppp":{"pkt_too_small":"0","vju_pkt_too_small":"0","ip4_pkt_too_small":"0","ip6_pkt_too_small":"0","wrong_type":"0","unsup_proto":"0"},"pppoe":{"pkt_too_small":"0","wrong_code":"0","malformed_tags":"0"},"gre":{"pkt_too_small":"0","wrong_version":"0","version0_recur":"0","version0_flags":"0","version0_hdr_too_big":"0","version0_malformed_sre_hdr":"0","version1_chksum":"0","version1_route":"0","version1_ssr":"0","version1_recur":"0","version1_flags":"0","version1_no_key":"0","version1_wrong_protocol":"0","version1_malformed_sre_hdr":"0","version1_hdr_too_big":"0"},"vlan":{"header_too_small":"0","unknown_type":"0","too_many_layers":"0"},"ieee8021ah":{"header_too_small":"0"},"vntag":{"header_too_small":"0","unknown_type":"0"},"ipraw":{"invalid_ip_version":"0"},"ltnull":{"pkt_too_small":"0","unsupported_type":"0"},"sctp":{"pkt_too_small":"0"},"mpls":{"header_too_small":"0","pkt_too_small":"0","bad_label_router_alert":"0","bad_label_implicit_null":"0","bad_label_reserved":"0","unknown_payload_type":"0"},"vxlan":{"unknown_payload_type":"0"},"geneve":{"unknown_payload_type":"0"},"erspan":{"header_too_small":"0","unsupported_version":"0","too_many_vlan_layers":"0"},"dce":{"pkt_too_small":"0"},"chdlc":{"pkt_too_small":"0"}},"too_many_layers":"0"},"flow":{"memcap":"0","tcp":"12","udp":"27","icmpv4":"0","icmpv6":"0","tcp_reuse":"0","get_used":"0","get_used_eval":"0","get_used_eval_reject":"0","get_used_eval_busy":"0","get_used_failed":"0","wrk":{"spare_sync_avg":"100","spare_sync":"3","spare_sync_incomplete":"0","spare_sync_empty":"0","flows_evicted_needs_work":"0","flows_evicted_pkt_inject":"0","flows_evicted":"0","flows_injected":"0"},"mgr":{"full_hash_pass":"1","closed_pruned":"0","new_pruned":"0","est_pruned":"0","bypassed_pruned":"0","rows_maxlen":"1","flows_checked":"4","flows_notimeout":"4","flows_timeout":"0","flows_timeout_inuse":"0","flows_evicted":"0","flows_evicted_needs_work":"0"},"spare":"9700","emerg_mode_entered":"0","emerg_mode_over":"0","memuse":"6834304"},"defrag":{"ipv4":{"fragments":"0","reassembled":"0","timeouts":"0"},"ipv6":{"fragments":"0","reassembled":"0","timeouts":"0"},"max_frag_hits":"0"},"flow_bypassed":{"local_pkts":"0","local_bytes":"0","local_capture_pkts":"0","local_capture_bytes":"0","closed":"0","pkts":"0","bytes":"0"},"tcp":{"sessions":"5","ssn_memcap_drop":"0","pseudo":"0","pseudo_failed":"0","invalid_checksum":"0","no_flow":"0","syn":"5","synack":"5","rst":"5","midstream_pickups":"0","pkt_on_wrong_thread":"0","segment_memcap_drop":"0","stream_depth_reached":"0","reassembly_gap":"0","overlap":"0","overlap_diff_data":"0","insert_data_normal_fail":"0","insert_data_overlap_fail":"0","insert_list_fail":"0","memuse":"1818624","reassembly_memuse":"299008"},"detect":{"engines":[{"id":0,"last_reload":"2022-08-29T13:28:12.179164+0300","rules_loaded":0,"rules_failed":0}],"alert":"0","alert_queue_overflow":"0","alerts_suppressed":"0"},"app_layer":{"flow":{"imap":"0","dns_tcp":"0","sip":"0","rfb":"0","mqtt":"0","rdp":"0","http2":"0","failed_tcp":"3","dns_udp":"13","failed_udp":"14"},"tx":{"imap":"0","dns_tcp":"0","sip":"0","rfb":"0","mqtt":"0","rdp":"0","http2":"0","dns_udp":"29"},"expectations":"0"},"http":{"memuse":"0","memcap":"0"},"ftp":{"memuse":"0","memcap":"0"},"file_store":{"open_files":"0"}}},"location":"/home/workspace/eve.json"}
Let me know if this works for you.
Regards!