]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
Adds basic http2 test
authorPhilippe Antoine <contact@catenacyber.fr>
Mon, 13 Jul 2020 14:06:45 +0000 (16:06 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 6 Aug 2020 10:28:07 +0000 (12:28 +0200)
tests/http2-basic/README.md [new file with mode: 0644]
tests/http2-basic/input.pcap [new file with mode: 0644]
tests/http2-basic/test.rules [new file with mode: 0644]
tests/http2-basic/test.yaml [new file with mode: 0644]

diff --git a/tests/http2-basic/README.md b/tests/http2-basic/README.md
new file mode 100644 (file)
index 0000000..4d6d3a6
--- /dev/null
@@ -0,0 +1,7 @@
+# Description
+
+Test http2 basic functionality
+
+# PCAP
+
+The pcap comes from https://wiki.wireshark.org/HTTP2
diff --git a/tests/http2-basic/input.pcap b/tests/http2-basic/input.pcap
new file mode 100644 (file)
index 0000000..0e1ada8
Binary files /dev/null and b/tests/http2-basic/input.pcap differ
diff --git a/tests/http2-basic/test.rules b/tests/http2-basic/test.rules
new file mode 100644 (file)
index 0000000..d0866da
--- /dev/null
@@ -0,0 +1,4 @@
+alert http2 any any -> any any (http2.header; content:"agent: nghttp2"; sid:1; rev:1;)
+alert http2 any any -> any any (http2.frametype:GOAWAY; sid:2; rev:1;)
+alert http2 any any -> any any (http2.settings:SETTINGS_HEADER_TABLE_SIZE>1000; sid:3; rev:1;)
+alert http2 any any -> any any (http2.window:34634; sid:4; rev:1;)
diff --git a/tests/http2-basic/test.yaml b/tests/http2-basic/test.yaml
new file mode 100644 (file)
index 0000000..98f7e94
--- /dev/null
@@ -0,0 +1,65 @@
+requires:
+  features:
+    - HAVE_LIBJANSSON
+  min-version: 6.0.0
+
+# disables checksum verification
+args:
+  - -k none
+
+checks:
+
+  # Check that there is one file event with content range.
+  - filter:
+      count: 1
+      match:
+        event_type: http2
+        http2.stream_id: 0
+        http2.response.settings[0].settings_id: "SETTINGSMAXCONCURRENTSTREAMS"
+        http2.response.settings[0].settings_value: 100
+  - filter:
+      count: 1
+      match:
+        event_type: http2
+        http2.stream_id: 0
+        http2.request.settings[1].settings_id: "SETTINGSINITIALWINDOWSIZE"
+        http2.request.settings[1].settings_value: 65535
+  - filter:
+      count: 1
+      match:
+        event_type: http2
+        http2.stream_id: 0
+        http2.request.error_code: "NOERROR"
+  - filter:
+      count: 1
+      match:
+        event_type: http2
+        http2.stream_id: 1
+        http2.request.headers[0].name: ":authority"
+        http2.request.headers[0].value: "localhost:3000"
+        http2.request.headers[1].name: ":method"
+        http2.request.headers[1].value: "GET"
+        http2.request.headers[2].name: ":path"
+        http2.request.headers[2].value: "/doc/manual/html/index.html"
+        http2.response.headers[0].name: ":status"
+        http2.response.headers[0].value: "200"
+  - filter:
+      count: 6
+      match:
+        event_type: alert
+        alert.signature_id: 1
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 2
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 3
+  - filter:
+      count: 2
+      match:
+        event_type: alert
+        alert.signature_id: 4