From 7a82af2f31b66b2446ec2dfc001a4dcefc674839 Mon Sep 17 00:00:00 2001 From: Shivani Bhardwaj Date: Tue, 9 Aug 2022 10:44:35 +0530 Subject: [PATCH] add test for broken smtp url logging --- tests/smtp-url-schemes-bug-5174/README.md | 17 +++++++++++++++ tests/smtp-url-schemes-bug-5174/input.pcap | Bin 0 -> 3468 bytes tests/smtp-url-schemes-bug-5174/suricata.yaml | 20 ++++++++++++++++++ tests/smtp-url-schemes-bug-5174/test.yaml | 7 ++++++ 4 files changed, 44 insertions(+) create mode 100644 tests/smtp-url-schemes-bug-5174/README.md create mode 100644 tests/smtp-url-schemes-bug-5174/input.pcap create mode 100644 tests/smtp-url-schemes-bug-5174/suricata.yaml create mode 100644 tests/smtp-url-schemes-bug-5174/test.yaml diff --git a/tests/smtp-url-schemes-bug-5174/README.md b/tests/smtp-url-schemes-bug-5174/README.md new file mode 100644 index 000000000..121d7e26e --- /dev/null +++ b/tests/smtp-url-schemes-bug-5174/README.md @@ -0,0 +1,17 @@ +Description +----------- +Since the feature for extracting MIME urls (ref: [Feature #2054](https://redmine.openinfosecfoundation.org/issues/2054)) +was introduced, the logging of urls in case the `suricata.yaml` configuration was not updated +has been broken (ref: [Bug #5174](https://redmine.openinfosecfoundation.org/issues/5174)). +The issue happens when both the `extract-urls-schemes` and `log-url-scheme` settings are +missing from `suricata.yaml`. +The behavior in such a case should be fallback to the defaults i.e. only extract the urls +that begin with the `http` scheme. + +PCAP +---- +PCAP comes from the existing test [smtp-extract-url-schemes](https://github.com/OISF/suricata-verify/blob/master/tests/smtp-extract-url-schemes). + +Reported and fixed by +--------------------- +Eric Leblond diff --git a/tests/smtp-url-schemes-bug-5174/input.pcap b/tests/smtp-url-schemes-bug-5174/input.pcap new file mode 100644 index 0000000000000000000000000000000000000000..bc1daa8915fef05a92a46edfc72777cb916b3f66 GIT binary patch literal 3468 zc-p0x&u`mg7{}jE2tlSv&>^t_LXRfaA+b2N)1+hG-oS3+v0b<$}i63YFfStzUA8W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T^&z{{i+~x9$J{ literal 0 Hc-jL100001 diff --git a/tests/smtp-url-schemes-bug-5174/suricata.yaml b/tests/smtp-url-schemes-bug-5174/suricata.yaml new file mode 100644 index 000000000..c8b6678a5 --- /dev/null +++ b/tests/smtp-url-schemes-bug-5174/suricata.yaml @@ -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-url-schemes-bug-5174/test.yaml b/tests/smtp-url-schemes-bug-5174/test.yaml new file mode 100644 index 000000000..b9e4b314e --- /dev/null +++ b/tests/smtp-url-schemes-bug-5174/test.yaml @@ -0,0 +1,7 @@ +checks: + - filter: + count: 1 + match: + event_type: smtp + email.url[0]: "test-site.org/blah/123/" + email.url[1]: "google.com" -- 2.47.2