]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
http2: adds test for http2.errorcode keyword 2689/head
authorPhilippe Antoine <pantoine@oisf.net>
Fri, 26 Sep 2025 10:44:46 +0000 (12:44 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 14 Oct 2025 17:40:52 +0000 (19:40 +0200)
Ticket: 7889

tests/http2-errorcode/README.md [new file with mode: 0644]
tests/http2-errorcode/input.pcap [new file with mode: 0644]
tests/http2-errorcode/test.rules [new file with mode: 0644]
tests/http2-errorcode/test.yaml [new file with mode: 0644]

diff --git a/tests/http2-errorcode/README.md b/tests/http2-errorcode/README.md
new file mode 100644 (file)
index 0000000..e5b39cb
--- /dev/null
@@ -0,0 +1,11 @@
+# Description
+
+Test http2.errorcode keyword
+
+# Ticket
+
+https://redmine.openinfosecfoundation.org/issues/7889
+
+# PCAP
+
+The pcap comes from https://github.com/grpc/grpc-node/issues/2744
diff --git a/tests/http2-errorcode/input.pcap b/tests/http2-errorcode/input.pcap
new file mode 100644 (file)
index 0000000..1bc3c77
Binary files /dev/null and b/tests/http2-errorcode/input.pcap differ
diff --git a/tests/http2-errorcode/test.rules b/tests/http2-errorcode/test.rules
new file mode 100644 (file)
index 0000000..d3f6de0
--- /dev/null
@@ -0,0 +1,6 @@
+alert http2 any any -> any any (http2.errorcode:INTERNAL_ERROR; sid:1;)
+alert http2 any any -> any any (http2.errorcode:!NO_ERROR; sid:2;)
+# no match
+alert http2 any any -> any any (http2.errorcode:HTTP_1_1_REQUIRED; sid:3;)
+# new format
+alert http2 any any -> any any (http2.errorcode:HTTP11_REQUIRED; sid:4;)
diff --git a/tests/http2-errorcode/test.yaml b/tests/http2-errorcode/test.yaml
new file mode 100644 (file)
index 0000000..0d96831
--- /dev/null
@@ -0,0 +1,25 @@
+requires:
+  min-version: 9
+
+# disables checksum verification
+args:
+  - -k none
+
+checks:
+  - filter:
+      count: 2
+      match:
+        event_type: alert
+        alert.signature_id: 1
+        http.http2.request.error_code: INTERNALERROR
+  - filter:
+      count: 2
+      match:
+        event_type: alert
+        alert.signature_id: 2
+        http.http2.request.error_code: INTERNALERROR
+  - filter:
+      count: 0
+      match:
+        event_type: alert
+        alert.signature_id: 3