]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
detect: add a test for protocol mismatch detection 1832/head
authorPhilippe Antoine <pantoine@oisf.net>
Tue, 7 May 2024 07:06:15 +0000 (09:06 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 15 May 2024 15:03:53 +0000 (17:03 +0200)
Ticket: #4921

tests/detect-app-layer-protocol-05/README.md [new file with mode: 0644]
tests/detect-app-layer-protocol-05/test.rules [new file with mode: 0644]
tests/detect-app-layer-protocol-05/test.yaml [new file with mode: 0644]

diff --git a/tests/detect-app-layer-protocol-05/README.md b/tests/detect-app-layer-protocol-05/README.md
new file mode 100644 (file)
index 0000000..ad27636
--- /dev/null
@@ -0,0 +1,11 @@
+# Test Purpose
+
+Test `app-layer-protocol` keyword with protocol mismatch
+
+## PCAP
+
+PCAP reused from proto-mismatch-http-ssh
+
+## Redmine ticket
+
+https://redmine.openinfosecfoundation.org/issues/4921
diff --git a/tests/detect-app-layer-protocol-05/test.rules b/tests/detect-app-layer-protocol-05/test.rules
new file mode 100644 (file)
index 0000000..150dd00
--- /dev/null
@@ -0,0 +1 @@
+alert tcp any any -> any any (msg:"HTTP client to SSH server"; flow:to_client; app-layer-protocol:http1,to_server; app-layer-protocol:ssh,to_client; sid:1; )
diff --git a/tests/detect-app-layer-protocol-05/test.yaml b/tests/detect-app-layer-protocol-05/test.yaml
new file mode 100644 (file)
index 0000000..9ae49ce
--- /dev/null
@@ -0,0 +1,11 @@
+pcap: ../output-eve-anomaly-02/input.pcap
+
+requires:
+  min-version: 8
+
+checks:
+- filter:
+    count: 1
+    match:
+      event_type: alert
+      alert.signature_id: 1