]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
dns: add test for NULL record
authorSimon Dugas <simdugas@gmail.com>
Thu, 10 Sep 2020 21:04:40 +0000 (21:04 +0000)
committerVictor Julien <victor@inliniac.net>
Mon, 7 Dec 2020 10:47:28 +0000 (11:47 +0100)
Add test case to show that NULL record types are being logged.

tests/dns-udp-null/README.md [new file with mode: 0644]
tests/dns-udp-null/dns-tunnel-iodine.pcap [new file with mode: 0644]
tests/dns-udp-null/suricata.yaml [new file with mode: 0644]
tests/dns-udp-null/test.yaml [new file with mode: 0644]

diff --git a/tests/dns-udp-null/README.md b/tests/dns-udp-null/README.md
new file mode 100644 (file)
index 0000000..7d14453
--- /dev/null
@@ -0,0 +1,4 @@
+Verify the eve output for a DNS response with a NULL record type.
+
+The pcap contains the first two packets of
+https://redmine.openinfosecfoundation.org/attachments/2062.
diff --git a/tests/dns-udp-null/dns-tunnel-iodine.pcap b/tests/dns-udp-null/dns-tunnel-iodine.pcap
new file mode 100644 (file)
index 0000000..0b72526
Binary files /dev/null and b/tests/dns-udp-null/dns-tunnel-iodine.pcap differ
diff --git a/tests/dns-udp-null/suricata.yaml b/tests/dns-udp-null/suricata.yaml
new file mode 100644 (file)
index 0000000..5f7eded
--- /dev/null
@@ -0,0 +1,10 @@
+%YAML 1.1
+---
+
+outputs:
+  - eve-log:
+      enabled: yes
+      filename: eve.json
+      types:
+        - dns:
+            version: 1
diff --git a/tests/dns-udp-null/test.yaml b/tests/dns-udp-null/test.yaml
new file mode 100644 (file)
index 0000000..f7ab522
--- /dev/null
@@ -0,0 +1,19 @@
+requires:
+  script:
+    - grep -q parse_rdata_null rust/src/dns/parser.rs
+
+checks:
+  - filter:
+      count: 1
+      match:
+        event_type: dns
+        dns.type: query
+        dns.rrtype: "NULL"
+  - filter:
+      count: 1
+      match:
+        event_type: dns
+        dns.type: answer
+        dns.rcode: NOERROR
+        dns.rrtype: "NULL"
+        dns.rdata: "VACKD\u0003\\xc5\\xe9\u0001"