]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
tests: add tls alpn tests 1927/head
authorVictor Julien <victor@inliniac.net>
Fri, 31 May 2024 13:14:29 +0000 (15:14 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 20 Jun 2024 04:57:21 +0000 (06:57 +0200)
tests/tls-alpn-client-log-01/test.yaml [new file with mode: 0644]
tests/tls-alpn-log-detect-02/README.md [new file with mode: 0644]
tests/tls-alpn-log-detect-02/input.pcap [new file with mode: 0644]
tests/tls-alpn-log-detect-02/test.rules [new file with mode: 0644]
tests/tls-alpn-log-detect-02/test.yaml [new file with mode: 0644]

diff --git a/tests/tls-alpn-client-log-01/test.yaml b/tests/tls-alpn-client-log-01/test.yaml
new file mode 100644 (file)
index 0000000..65ddb58
--- /dev/null
@@ -0,0 +1,15 @@
+requires:
+  min-version: 8.0.0
+
+args:
+  - -k none
+
+pcap: ../ja4-tls-quic/input.pcap
+
+checks:
+  - filter:
+      count: 1
+      match:
+        event_type: tls
+        tls.client_alpns[0]: h2
+        tls.client_alpns[1]: http/1.1
diff --git a/tests/tls-alpn-log-detect-02/README.md b/tests/tls-alpn-log-detect-02/README.md
new file mode 100644 (file)
index 0000000..3495076
--- /dev/null
@@ -0,0 +1,4 @@
+PCAP
+====
+
+Pcap recorded by Victor Julien
diff --git a/tests/tls-alpn-log-detect-02/input.pcap b/tests/tls-alpn-log-detect-02/input.pcap
new file mode 100644 (file)
index 0000000..f08296a
Binary files /dev/null and b/tests/tls-alpn-log-detect-02/input.pcap differ
diff --git a/tests/tls-alpn-log-detect-02/test.rules b/tests/tls-alpn-log-detect-02/test.rules
new file mode 100644 (file)
index 0000000..dc1994b
--- /dev/null
@@ -0,0 +1,2 @@
+alert tls any any -> any any (tls.sni; content:"icloud"; tls.alpn; content:"http/1.1"; sid:1;)
+alert tls any any -> any any (tls.subjectaltname; content:"p142-contacts.icloud.com"; tls.alpn; content:"http/1.1"; sid:2;)
diff --git a/tests/tls-alpn-log-detect-02/test.yaml b/tests/tls-alpn-log-detect-02/test.yaml
new file mode 100644 (file)
index 0000000..deb1be8
--- /dev/null
@@ -0,0 +1,27 @@
+requires:
+  min-version: 8.0.0
+
+checks:
+  - filter:
+      count: 1
+      match:
+        event_type: tls
+        tls.client_alpns[0]: h2
+        tls.client_alpns[1]: http/1.1
+        tls.server_alpns[0]: http/1.1
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 1
+        tls.client_alpns[0]: h2
+        tls.client_alpns[1]: http/1.1
+        tls.server_alpns[0]: http/1.1
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 2
+        tls.client_alpns[0]: h2
+        tls.client_alpns[1]: http/1.1
+        tls.server_alpns[0]: http/1.1