]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
detect: add test for email.url keyword 2442/head
authorAlice Akaki <akakialice@gmail.com>
Wed, 9 Apr 2025 19:21:21 +0000 (15:21 -0400)
committerVictor Julien <victor@inliniac.net>
Sat, 12 Apr 2025 09:00:05 +0000 (11:00 +0200)
Ticket: #7597

tests/detect-email-url/README.md [new file with mode: 0644]
tests/detect-email-url/test.rules [new file with mode: 0644]
tests/detect-email-url/test.yaml [new file with mode: 0644]

diff --git a/tests/detect-email-url/README.md b/tests/detect-email-url/README.md
new file mode 100644 (file)
index 0000000..6f471bf
--- /dev/null
@@ -0,0 +1,8 @@
+# Test Description
+Test mime email.url keyword.
+
+## PCAP
+From ../smtp-extract-url-schemes/input.pcap
+
+## Redmine Ticket
+https://redmine.openinfosecfoundation.org/issues/7597
diff --git a/tests/detect-email-url/test.rules b/tests/detect-email-url/test.rules
new file mode 100644 (file)
index 0000000..d379d7a
--- /dev/null
@@ -0,0 +1,2 @@
+alert smtp any any -> any any (msg:"Test mime email url"; email.url; content:"test-site.org/blah/123/"; startswith; endswith; bsize:23; sid:1;)
+alert smtp any any -> any any (msg:"Test mime email url"; email.url; content:"google.com"; startswith; endswith; bsize:10; sid:2;)
diff --git a/tests/detect-email-url/test.yaml b/tests/detect-email-url/test.yaml
new file mode 100644 (file)
index 0000000..27f65e0
--- /dev/null
@@ -0,0 +1,21 @@
+requires:
+  min-version: 8
+
+pcap: ../smtp-extract-url-schemes/input.pcap
+
+args:
+  - -k none --set stream.inline=true
+
+checks:
+- filter:
+    count: 1
+    match:
+      event_type: alert
+      email.url[0]: "test-site.org/blah/123/"
+      alert.signature_id: 1
+- filter:
+    count: 1
+    match:
+      event_type: alert
+      email.url[1]: "google.com"
+      alert.signature_id: 2
\ No newline at end of file