]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
tests: engine-analysis app_layer rule type tests
authorJuliana Fajardini <jufajardini@gmail.com>
Mon, 20 Jan 2025 20:33:45 +0000 (17:33 -0300)
committerVictor Julien <victor@inliniac.net>
Tue, 28 Jan 2025 08:32:49 +0000 (09:32 +0100)
Add tests for the app_layer rule type for the engine-analysis report to
accompany rule types documentation.

Related to
Task #7031

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

diff --git a/tests/rules/rule-type-app-layer/test.rules b/tests/rules/rule-type-app-layer/test.rules
new file mode 100644 (file)
index 0000000..5f767e5
--- /dev/null
@@ -0,0 +1,5 @@
+# Application Layer Protocol Rules
+alert dns any any -> any any (msg:"app-layer, dns"; sid:404;)
+alert http any any -> any any (msg:"http, no content"; sid:601;)
+pass tls any any -> any any (msg:"tls, pkt or app-layer? pass"; sid:605;)
+alert tls any any -> any any (msg:"tls, pkt or app-layer?"; flowint:tls_error_int,=,0; sid:613;)
diff --git a/tests/rules/rule-type-app-layer/test.yaml b/tests/rules/rule-type-app-layer/test.yaml
new file mode 100644 (file)
index 0000000..8e3a62e
--- /dev/null
@@ -0,0 +1,25 @@
+requires:
+  min-version: 7
+  pcap: false
+args:
+- --engine-analysis
+checks:
+  - filter:
+      filename: rules.json
+      count: 1
+      match:
+        id: 404
+        type: "app_layer"
+  - filter:
+      filename: rules.json
+      count: 1
+      match:
+        raw: "alert http any any -> any any (msg:\"http, no content\"; sid:601;)"
+        id: 601
+        type: "app_layer"
+  - filter:
+      filename: rules.json
+      count: 1
+      match:
+        id: 613
+        type: "app_layer"