]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
tests: add engine-analysis de_only rule type tests
authorJuliana Fajardini <jufajardini@gmail.com>
Wed, 22 Jan 2025 19:51:57 +0000 (16:51 -0300)
committerVictor Julien <victor@inliniac.net>
Tue, 28 Jan 2025 08:32:49 +0000 (09:32 +0100)
To accompany rule types documentation.

Related to
Task #7031

tests/rules/rule-type-de-only/test.rules [new file with mode: 0644]
tests/rules/rule-type-de-only/test.yaml [new file with mode: 0644]

diff --git a/tests/rules/rule-type-de-only/test.rules b/tests/rules/rule-type-de-only/test.rules
new file mode 100644 (file)
index 0000000..a22b5b2
--- /dev/null
@@ -0,0 +1,4 @@
+# Decoder Events Only
+alert pkthdr any any -> any any (msg:"SURICATA IPv6 duplicated Hop-By-Hop Options extension header"; decode-event:ipv6.exthdr_dupl_hh; classtype:protocol-command-decode; sid:1101;)
+drop pkthdr any any -> any any (msg:"SURICATA IPv4 invalid option length"; decode-event:ipv4.opt_invalid_len; classtype:protocol-command-decode; sid:2200005; rev:2;)
+
diff --git a/tests/rules/rule-type-de-only/test.yaml b/tests/rules/rule-type-de-only/test.yaml
new file mode 100644 (file)
index 0000000..54b1f61
--- /dev/null
@@ -0,0 +1,20 @@
+requires:
+    min-version: 7
+    pcap: false
+
+args:
+- --engine-analysis
+
+checks:
+    - filter:
+        filename: rules.json
+        count: 1
+        match:
+            id: 1101
+            type: de_only
+    - filter:
+        filename: rules.json
+        count: 1
+        match:
+            id: 2200005
+            type: de_only