]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
Adds http2 ugrade test
authorPhilippe Antoine <contact@catenacyber.fr>
Mon, 13 Jul 2020 14:06:45 +0000 (16:06 +0200)
committerPhilippe Antoine <contact@catenacyber.fr>
Tue, 8 Sep 2020 09:04:32 +0000 (11:04 +0200)
Adds http2 connection upgrade from http1 test

tests/http2-basic/test.yaml
tests/http2-upgrade/README.md [new file with mode: 0644]
tests/http2-upgrade/input.pcap [new file with mode: 0644]
tests/http2-upgrade/suricata.yaml [new file with mode: 0644]
tests/http2-upgrade/test.yaml [new file with mode: 0644]

index d3668b19854390b3b2dddac414b0b60aa1c4a4f8..c049301bcf201325b3d58f3172882db33d383f9e 100644 (file)
@@ -37,7 +37,9 @@ checks:
         http.length: 22617
         http.status: 200
         http.http_method: "GET"
+        http.url: "/doc/manual/html/index.html"
         http.http_user_agent: "nghttp2/0.5.2-DEV"
+        http.version: "2"
         http.http2.stream_id: 1
         http.request_headers[0].name: ":authority"
         http.request_headers[0].value: "localhost:3000"
diff --git a/tests/http2-upgrade/README.md b/tests/http2-upgrade/README.md
new file mode 100644 (file)
index 0000000..ae593c2
--- /dev/null
@@ -0,0 +1,7 @@
+# Description
+
+Test HTTP2 traffic after HTTP1 upgrade mechanism
+
+# PCAP
+
+The pcap comes from https://wiki.wireshark.org/HTTP2
diff --git a/tests/http2-upgrade/input.pcap b/tests/http2-upgrade/input.pcap
new file mode 100644 (file)
index 0000000..a77847a
Binary files /dev/null and b/tests/http2-upgrade/input.pcap differ
diff --git a/tests/http2-upgrade/suricata.yaml b/tests/http2-upgrade/suricata.yaml
new file mode 100644 (file)
index 0000000..82124d6
--- /dev/null
@@ -0,0 +1,20 @@
+%YAML 1.1
+---
+
+outputs:
+  - eve-log:
+      enabled: yes
+      filetype: regular
+      filename: eve.json
+      types:
+        - alert:
+            tagged-packets: yes
+        - http:
+            extended: yes
+        - http2
+        - files
+
+app-layer:
+  protocols:
+    http2:
+      enabled: yes
diff --git a/tests/http2-upgrade/test.yaml b/tests/http2-upgrade/test.yaml
new file mode 100644 (file)
index 0000000..0e24fb7
--- /dev/null
@@ -0,0 +1,52 @@
+requires:
+  features:
+    - HAVE_LIBJANSSON
+  min-version: 6.0.0
+
+# disables checksum verification
+args:
+  - -k none --set stream.midstream=true
+
+checks:
+
+  # Check that there is one file event with content range.
+  - filter:
+      count: 1
+      match:
+        event_type: http
+        http.url: /robots.txt
+        http.status: 101
+  - filter:
+      count: 1
+      match:
+        event_type: http
+        http.http2.stream_id: 0
+        http.http2.response.settings[2].settings_id: "SETTINGSHEADERTABLESIZE"
+        http.http2.response.settings[2].settings_value: 8192
+  - filter:
+      count: 2
+      match:
+        event_type: http
+        http.http2.stream_id: 0
+        http.http2.request.settings[2].settings_id: "SETTINGSENABLEPUSH"
+        http.http2.request.settings[2].settings_value: 0
+  - filter:
+      count: 1
+      match:
+        event_type: http
+        http.http2.stream_id: 1
+        http.version: "2"
+        http.http_method: "GET"
+        http.url: "/robots.txt"
+        http.request_headers[2].name: "Host"
+        http.request_headers[2].value: "nghttp2.org"
+        http.status: 200
+  - filter:
+      count: 1
+      match:
+        event_type: http
+        http.http2.stream_id: 3
+        http.request_headers[0].table_size_update: 4096
+        http.http_method: "GET"
+        http.url: "/humans.txt"
+        http.status: 404