sudo cscli collections install crowdsecurity/unifiInstalls 5 parsers and 2 scenarios.
View UniFi →sudo cscli parsers install crowdsecurity/unifi-cefThen 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_stagefilter: "evt.Parsed.cef_device_vendor == 'Ubiquiti' && evt.Parsed.cef_device_product == 'UniFi Network' && ParseKVLax(evt.Parsed.message, evt.Unmarshaled, 'unifi') == nil"name: crowdsecurity/unifi-cefdescription: "Parse Unifi CEF logs"statics:- meta: servicevalue: unifi- meta: vendorexpression: evt.Parsed.cef_device_vendor- meta: productexpression: evt.Parsed.cef_device_product- meta: device_versionexpression: evt.Parsed.cef_device_version- meta: event_severityexpression: evt.Parsed.cef_severity- meta: event_signature_idexpression: evt.Parsed.cef_signature_id- meta: source_ipexpression: evt.Unmarshaled.unifi.src- meta: protocolexpression: evt.Unmarshaled.unifi.proto- meta: source_portexpression: evt.Unmarshaled.unifi.spt- meta: destination_ipexpression: evt.Unmarshaled.unifi.dst- meta: destination_portexpression: evt.Unmarshaled.unifi.dpt- meta: actionexpression: evt.Unmarshaled.unifi.act- meta: applicationexpression: evt.Unmarshaled.unifi.app- meta: categoryexpression: evt.Unmarshaled.unifi.UNIFIcategory- meta: subcategoryexpression: evt.Unmarshaled.unifi.UNIFIsubCategory- meta: hostexpression: evt.Unmarshaled.unifi.UNIFIhost- meta: risk_levelexpression: evt.Unmarshaled.unifi.UNIFIrisk- meta: policy_name
Sign in to see the Security Engines that run this log parser, the version they run and whether it was modified locally.
This parser specifically handles CEF logs from Ubiquiti UniFi Network devices, filtering by vendor and product to ensure it only processes relevant logs.
The parser extracts Unifi-specific CEF extension fields that contain valuable metadata about network events, device information, and security alerts from UniFi devices.
It uses comprehensive grok patterns that parse the entire CEF extension message in the expected field order, ensuring compatibility with the Go grok implementation.
The parser uses a single configuration with two grok patterns, each optimized for different types of Unifi CEF events with pattern-specific statics:
UNIFI_ADMIN_PATTERN): Handles administrative actions like logins and system accessUNIFI_SECURITY_PATTERN): Handles security alerts and intrusion preventionPattern matches logs like:
1UNIFIcategory=System UNIFIsubCategory=Admin UNIFIhost=Unifi Dream Machine UNIFIaccessMethod=web UNIFIadmin=Secure Admin src=192.168.1.100 UNIFIutcTime=2025-09-04T08:32:58.445Z msg=...
Admin pattern extracts and sets:
admin_user - Admin user who performed the actionaccess_method - How access was performed (web, API, etc.)timestamp - UTC timestamp of the eventPattern matches logs like:
1proto=TCP src=10.0.0.100 spt=54587 dst=192.168.0.233 dpt=443 UNIFIcategory=Security UNIFIsubCategory=Intrusion Prevention UNIFIhost=Express 7 UNIFIdeviceMac=84:78:48:80:0d:86 UNIFIdeviceName=Express 7 UNIFIdeviceModel=UX7 UNIFIdeviceIp=192.168.0.1 UNIFIdeviceVersion=4.3.9 UNIFIrisk=medium UNIFIipsSessionId=54725290909450 UNIFIipsSignature=ET DROP Dshield Block Listed Source group 1 UNIFIipsSignatureId=2402000 UNIFIutcTime=2025-08-30T17:53:21.915Z msg=A network intrusion attempt has been detected and blocked.
Security pattern extracts and sets:
device_name, device_model, device_mac, device_ip - Device informationprotocol, source_port, destination_ip, destination_port - Network detailsrisk_level, ips_signature, ips_signature_id, ips_session_id - Threat informationThe parser automatically filters for logs where:
cef_device_vendor equals "Ubiquiti"cef_device_product equals "UniFi Network"This ensures the parser only processes actual Unifi CEF logs and doesn't interfere with other CEF sources.
The parser extracts the following Unifi-specific fields into metadata:
device_name - Name of the Unifi devicedevice_model - Model of the device (e.g., UX7, USG)device_mac - MAC address of the devicedevice_version - Firmware versionhost - Hostname of the devicesource_ip - Source IP addressprotocol - Network protocol (TCP, UDP, etc.)source_port - Source portdestination_port - Destination portcategory - Event category (System, Security, etc.)subcategory - Event subcategoryrisk_level - Risk level (high, medium, low)event_severity - CEF severity leveladmin_user - Admin user who performed actionaccess_method - How access was performed (web, API, etc.)ips_signature - IPS signature that triggeredips_signature_id - IPS signature IDips_session_id - IPS session identifierThis parser should be used after the cef-logs parser in the s00-raw stage. It will automatically filter and enrich Unifi CEF logs with structured metadata for use in scenarios and correlation rules.