]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
dns-udp-unsolicited-response: v2 and v3 tests
authorJason Ish <jason.ish@oisf.net>
Thu, 4 Jul 2024 21:20:43 +0000 (15:20 -0600)
committerVictor Julien <victor@inliniac.net>
Tue, 9 Jul 2024 10:15:24 +0000 (12:15 +0200)
tests/dns/dns-udp-unsolicited-response/README.md [moved from tests/dns-udp-unsolicited-response/README.md with 100% similarity]
tests/dns/dns-udp-unsolicited-response/suricata.yaml [moved from tests/dns-udp-unsolicited-response/suricata.yaml with 100% similarity]
tests/dns/dns-udp-unsolicited-response/test.yaml [new file with mode: 0644]
tests/dns/v2/dns-udp-unsolicited-response/README.md [new file with mode: 0644]
tests/dns/v2/dns-udp-unsolicited-response/suricata.yaml [new file with mode: 0644]
tests/dns/v2/dns-udp-unsolicited-response/test.yaml [moved from tests/dns-udp-unsolicited-response/test.yaml with 73% similarity]

diff --git a/tests/dns/dns-udp-unsolicited-response/test.yaml b/tests/dns/dns-udp-unsolicited-response/test.yaml
new file mode 100644 (file)
index 0000000..3f857b3
--- /dev/null
@@ -0,0 +1,16 @@
+requires:
+  min-version: 8
+
+pcap: ../../dns-udp-unsolicited-response-v1/dns-response-2x.pcap
+
+checks:
+  - filter:
+      count: 1
+      match:
+        event_type: dns
+        dns.type: request
+  - filter:
+      count: 2
+      match:
+        event_type: dns
+        dns.type: response
diff --git a/tests/dns/v2/dns-udp-unsolicited-response/README.md b/tests/dns/v2/dns-udp-unsolicited-response/README.md
new file mode 100644 (file)
index 0000000..e202ff9
--- /dev/null
@@ -0,0 +1,11 @@
+Test the following sequence of DNS messages on a flow:
+
+- DNS request with ID 0x99ab.
+- DNS response with ID 0x9941 (unsolicited response).
+- DNS response with ID 0x99ab (expected response).
+
+Check that all 3 DNS message are logged, and that an unsolicted dns
+response event is logged.
+
+NOTE: Unsolicited responses do not exist with the Rust DNS parser as
+it doesn't correlate responses with requests.
diff --git a/tests/dns/v2/dns-udp-unsolicited-response/suricata.yaml b/tests/dns/v2/dns-udp-unsolicited-response/suricata.yaml
new file mode 100644 (file)
index 0000000..8ebe4e4
--- /dev/null
@@ -0,0 +1,11 @@
+%YAML 1.1
+---
+
+outputs:
+  - eve-log:
+      enabled: true
+      filename: eve.json
+      types:
+        - alert
+        - dns:
+            version: 2
similarity index 73%
rename from tests/dns-udp-unsolicited-response/test.yaml
rename to tests/dns/v2/dns-udp-unsolicited-response/test.yaml
index 0c6222324b48e8d4258f1e23fab361ca33d20823..03619f38e9d85db46ce9ddc8c0a0574f79154e0d 100644 (file)
@@ -1,4 +1,4 @@
-pcap: ../dns-udp-unsolicited-response-v1/dns-response-2x.pcap
+pcap: ../../../dns-udp-unsolicited-response-v1/dns-response-2x.pcap
 
 checks:
   - filter: