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

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

diff --git a/tests/detect-app-layer-protocol-04/README.md b/tests/detect-app-layer-protocol-04/README.md
new file mode 100644 (file)
index 0000000..da5438e
--- /dev/null
@@ -0,0 +1,11 @@
+# Test Purpose
+
+Test `app-layer-protocol` keyword with protocol change
+
+## PCAP
+
+PCAP reused from http2-keywords2
+
+## Redmine ticket
+
+https://redmine.openinfosecfoundation.org/issues/4921
diff --git a/tests/detect-app-layer-protocol-04/test.rules b/tests/detect-app-layer-protocol-04/test.rules
new file mode 100644 (file)
index 0000000..3a58e55
--- /dev/null
@@ -0,0 +1 @@
+alert tcp any any -> any any (msg:"HTTP1 to HTTP2";  app-layer-protocol:http1,original; prefilter; app-layer-protocol:http2,final; sid:1; )
diff --git a/tests/detect-app-layer-protocol-04/test.yaml b/tests/detect-app-layer-protocol-04/test.yaml
new file mode 100644 (file)
index 0000000..72e4a7c
--- /dev/null
@@ -0,0 +1,15 @@
+pcap: ../http2-keywords2/input.pcap
+
+requires:
+  min-version: 8
+
+# disables checksum verification
+args:
+  - -k none --set stream.midstream=true
+
+checks:
+- filter:
+    count: 1
+    match:
+      event_type: alert
+      alert.signature_id: 1