]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
tests/tls: add testcases for tls.certs keyword 60/head
authorMats Klepsland <mats.klepsland@gmail.com>
Wed, 15 May 2019 12:57:09 +0000 (14:57 +0200)
committerMats Klepsland <mats.klepsland@gmail.com>
Thu, 16 May 2019 20:57:09 +0000 (22:57 +0200)
tests/tls-certs-alert/input.pcap [new file with mode: 0644]
tests/tls-certs-alert/suricata.yaml [new file with mode: 0644]
tests/tls-certs-alert/test.rules [new file with mode: 0644]
tests/tls-certs-alert/test.yaml [new file with mode: 0644]

diff --git a/tests/tls-certs-alert/input.pcap b/tests/tls-certs-alert/input.pcap
new file mode 100644 (file)
index 0000000..f50866f
Binary files /dev/null and b/tests/tls-certs-alert/input.pcap differ
diff --git a/tests/tls-certs-alert/suricata.yaml b/tests/tls-certs-alert/suricata.yaml
new file mode 100644 (file)
index 0000000..0211a9f
--- /dev/null
@@ -0,0 +1,16 @@
+%YAML 1.1
+---
+
+outputs:
+  - eve-log:
+      enabled: yes
+      filetype: regular #regular|syslog|unix_dgram|unix_stream|redis
+      filename: eve.json
+      types:
+        - alert:
+            payload: no
+            payload-buffer-size: 4kb
+            payload-printable: no
+            packet: no
+            metadata: no
+        - tls
diff --git a/tests/tls-certs-alert/test.rules b/tests/tls-certs-alert/test.rules
new file mode 100644 (file)
index 0000000..98913ad
--- /dev/null
@@ -0,0 +1,3 @@
+alert tls any any -> any any (msg:"Match first certificate"; flow:established,to_client; tls.certs; content:"|30160603550403130f|"; sid:1;)
+alert tls any any -> any any (msg:"Match second certificate"; flow:established,to_client; tls.certs; content:"|30250603550403131e|"; sid:2;)
+alert tls any any -> any any (msg:"Match third certificate"; flow:established,to_client; tls.certs; content:"|301e06035504031317|"; sid:3;)
diff --git a/tests/tls-certs-alert/test.yaml b/tests/tls-certs-alert/test.yaml
new file mode 100644 (file)
index 0000000..c97d62b
--- /dev/null
@@ -0,0 +1,28 @@
+requires:
+  min-version: 5.0.0
+  features:
+    - HAVE_LIBJANSSON
+
+args:
+ - -k none
+
+checks:
+  # Check that we can alert on all three certs in the certificate chain
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        app_proto: tls
+        alert.signature_id: 1
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        app_proto: tls
+        alert.signature_id: 2
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        app_proto: tls
+        alert.signature_id: 3