sudo cscli collections install crowdsecurity/unifiInstalls 5 parsers and 2 scenarios, via Iptables - Portscan Detection.
View UniFi →sudo cscli parsers install crowdsecurity/iptables-logsThen reload CrowdSec: sudo systemctl reload crowdsec
Sign in to see which of your engines run it →Hover a line or a note to see what each field does.
onsuccess: next_stage#debug: truefilter: "evt.Parsed.program == 'kernel' and evt.Parsed.message contains 'IN=' and not (evt.Parsed.message contains 'ACCEPT') and not (evt.Parsed.message contains '[UFW AUDIT]' )"name: crowdsecurity/iptables-logsdescription: "Parse iptables drop logs"statics:- parsed: unused #this is never used setting to random varexpression: ParseKV(evt.Parsed.message, evt.Unmarshaled, "iptables")- meta: serviceexpression: Lower(evt.Unmarshaled.iptables.PROTO)- meta: log_typeexpression: |evt.Meta.log_type != "" ? evt.Meta.log_type : evt.Meta.service in ["tcp", "udp"] && evt.Unmarshaled.iptables.OUT == "" ? "iptables_drop" : ""- meta: icmp_typeexpression: evt.Unmarshaled.iptables.TYPE- meta: icmp_codeexpression: evt.Unmarshaled.iptables.CODE- meta: source_ipexpression: "evt.Unmarshaled.iptables.SRC"## For backporting reason all previous variables will be reparsed out to the parsed object- parsed: dst_portexpression: evt.Unmarshaled.iptables.DPT- parsed: int_ethexpression: evt.Unmarshaled.iptables.IN- parsed: src_ipexpression: evt.Unmarshaled.iptables.SRC- parsed: dst_ipexpression: evt.Unmarshaled.iptables.DST- parsed: lengthexpression: evt.Unmarshaled.iptables.LEN- parsed: protoexpression: evt.Unmarshaled.iptables.PROTO- parsed: src_portexpression: evt.Unmarshaled.iptables.SPT
Sign in to see the Security Engines that run this log parser, the version they run and whether it was modified locally.
A parser for iptables -j LOG logs :
IN=ACCEPTTCP and UDP packets are considered as DROPs.icmp_typeicmp_codeTo make this parser relevant, you should have a iptables -A INPUT -m state --state NEW -j LOG or similar into your configuration. This one will log all new connections, successful or not.