]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
tests: add test for smtp extract url schemes
authorAaron Bungay <amb240h@gmail.com>
Sat, 13 Jun 2020 18:31:01 +0000 (14:31 -0400)
committerVictor Julien <victor@inliniac.net>
Mon, 31 Jan 2022 12:20:12 +0000 (13:20 +0100)
tests/smtp-extract-url-schemes/input.pcap [new file with mode: 0644]
tests/smtp-extract-url-schemes/suricata.yaml [new file with mode: 0644]
tests/smtp-extract-url-schemes/test.yaml [new file with mode: 0644]

diff --git a/tests/smtp-extract-url-schemes/input.pcap b/tests/smtp-extract-url-schemes/input.pcap
new file mode 100644 (file)
index 0000000..bc1daa8
Binary files /dev/null and b/tests/smtp-extract-url-schemes/input.pcap differ
diff --git a/tests/smtp-extract-url-schemes/suricata.yaml b/tests/smtp-extract-url-schemes/suricata.yaml
new file mode 100644 (file)
index 0000000..19e25ec
--- /dev/null
@@ -0,0 +1,20 @@
+%YAML 1.1
+---
+
+outputs:
+  - eve-log:
+      enabled: yes
+      filetype: regular
+      types:
+        - smtp
+
+app-layer:
+  protocols:
+    smtp:
+      enabled: yes
+      mime:
+        decode-mime: yes
+        decode-base64: yes
+        extract-urls: yes
+        extract-urls-schemes: [http, https, ftp, mailto]
+        log-url-scheme: yes
diff --git a/tests/smtp-extract-url-schemes/test.yaml b/tests/smtp-extract-url-schemes/test.yaml
new file mode 100644 (file)
index 0000000..cae3e2f
--- /dev/null
@@ -0,0 +1,12 @@
+requires:
+  min-version: 7.0.0
+
+checks:
+  - filter:
+      count: 1
+      match:
+        event_type: smtp
+        email.url[0]: "ftp://172.42.48.124"
+        email.url[1]: "https://facebook.com"
+        email.url[2]: "http://test-site.org/blah/123/"
+        email.url[3]: "http://google.com"