See https://redmine.openinfosecfoundation.org/issues/7323 and
https://forum.suricata.io/t/question-about-mqtt-detection/4890/3
--- /dev/null
+%YAML 1.1
+---
+
+outputs:
+ - eve-log:
+ enabled: yes
+ filetype: regular
+ filename: eve.json
+ types:
+ - mqtt
+ - alert
+
+app-layer:
+ protocols:
+ mqtt:
+ enabled: yes
\ No newline at end of file
--- /dev/null
+alert mqtt any any -> any any (msg:"MQTT CONNACK reason code 134"; mqtt.type:CONNACK; mqtt.reason_code:134; sid:1;)
+alert mqtt any any -> any any (msg:"MQTT CONNACK reason code 0"; mqtt.type:CONNACK; mqtt.reason_code:0; sid:2;)
+
+
--- /dev/null
+requires:
+ min-version: 8
+
+args:
+ - -k none
+
+checks:
+
+ - filter:
+ count: 1
+ match:
+ event_type: alert
+ alert.signature: MQTT CONNACK reason code 134
+
+ - filter:
+ count: 0
+ match:
+ event_type: alert
+ alert.signature: MQTT CONNACK reason code 0