]> git.ipfire.org Git - people/stevee/suricata-verify.git/commitdiff
dns-udp-eve-log-aaaa-only: add dns eve v2 test
authorJason Ish <jason.ish@oisf.net>
Mon, 15 Mar 2021 21:46:14 +0000 (15:46 -0600)
committerJason Ish <jason.ish@oisf.net>
Tue, 16 Mar 2021 04:25:35 +0000 (22:25 -0600)
tests/dns-udp-eve-log-aaaa-only-v1/README.md [new file with mode: 0644]
tests/dns-udp-eve-log-aaaa-only-v1/check.sh [moved from tests/dns-udp-eve-log-aaaa-only/check.sh with 100% similarity]
tests/dns-udp-eve-log-aaaa-only-v1/dns-udp-google.com-a-aaaa-mx.pcap [new file with mode: 0644]
tests/dns-udp-eve-log-aaaa-only-v1/suricata.yaml [new file with mode: 0644]
tests/dns-udp-eve-log-aaaa-only-v1/test.yaml [new file with mode: 0644]
tests/dns-udp-eve-log-aaaa-only/suricata.yaml
tests/dns-udp-eve-log-aaaa-only/test.yaml

diff --git a/tests/dns-udp-eve-log-aaaa-only-v1/README.md b/tests/dns-udp-eve-log-aaaa-only-v1/README.md
new file mode 100644 (file)
index 0000000..88649bf
--- /dev/null
@@ -0,0 +1,2 @@
+Test custom eve DNS logging by configuring it to log only AAAA
+records, and verifying that only AAAA records are logged.
diff --git a/tests/dns-udp-eve-log-aaaa-only-v1/dns-udp-google.com-a-aaaa-mx.pcap b/tests/dns-udp-eve-log-aaaa-only-v1/dns-udp-google.com-a-aaaa-mx.pcap
new file mode 100644 (file)
index 0000000..def918f
Binary files /dev/null and b/tests/dns-udp-eve-log-aaaa-only-v1/dns-udp-google.com-a-aaaa-mx.pcap differ
diff --git a/tests/dns-udp-eve-log-aaaa-only-v1/suricata.yaml b/tests/dns-udp-eve-log-aaaa-only-v1/suricata.yaml
new file mode 100644 (file)
index 0000000..2c9df4c
--- /dev/null
@@ -0,0 +1,12 @@
+%YAML 1.1
+---
+
+outputs:
+  - eve-log:
+      enabled: yes
+      filetype: regular
+      filename: eve.json
+      types:
+        - dns:
+            version: 1
+            custom: [aaaa]
diff --git a/tests/dns-udp-eve-log-aaaa-only-v1/test.yaml b/tests/dns-udp-eve-log-aaaa-only-v1/test.yaml
new file mode 100644 (file)
index 0000000..9ee272d
--- /dev/null
@@ -0,0 +1,4 @@
+requires:
+  features:
+    - HAVE_LIBJANSSON
+  lt-version: 7
index 2c9df4c08c994941416668166be99d11e4cb6e6f..443e47a280ad6510e49e25e520d9949e2a5d1d89 100644 (file)
@@ -8,5 +8,4 @@ outputs:
       filename: eve.json
       types:
         - dns:
-            version: 1
-            custom: [aaaa]
+            types: [aaaa]
index 56ea9b0d57173b93569d9c72c9b1372ce9234d13..f05f8e35c20b5a811a9cdc1a54ce796198cb645e 100644 (file)
@@ -1,3 +1,19 @@
 requires:
   features:
     - HAVE_LIBJANSSON
+
+checks:
+  - filter:
+      count: 1
+      match:
+        dns.type: query
+        dns.rrtype: AAAA
+  - filter:
+      count: 1
+      match:
+        dns.type: answer
+        dns.answers[0].rrtype: AAAA
+  - filter:
+      count: 0
+      match:
+        dns.rrtype: A