]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
dns: add test for SRV EVE-JSON output
authorSascha Steinbiss <satta@debian.org>
Tue, 3 Nov 2020 23:55:36 +0000 (00:55 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 7 Dec 2020 10:47:28 +0000 (11:47 +0100)
tests/dns-udp-eve-log-srv/input.pcap [new file with mode: 0644]
tests/dns-udp-eve-log-srv/suricata.yaml [new file with mode: 0644]
tests/dns-udp-eve-log-srv/test.yaml [new file with mode: 0644]

diff --git a/tests/dns-udp-eve-log-srv/input.pcap b/tests/dns-udp-eve-log-srv/input.pcap
new file mode 100644 (file)
index 0000000..a3a58db
Binary files /dev/null and b/tests/dns-udp-eve-log-srv/input.pcap differ
diff --git a/tests/dns-udp-eve-log-srv/suricata.yaml b/tests/dns-udp-eve-log-srv/suricata.yaml
new file mode 100644 (file)
index 0000000..e1afb7b
--- /dev/null
@@ -0,0 +1,15 @@
+%YAML 1.1
+---
+
+outputs:
+  - eve-log:
+      enabled: yes
+      filetype: regular
+      filename: eve.json
+      types:
+        - dns
+
+app-layer:
+  protocols:
+    dns:
+      enabled: yes
diff --git a/tests/dns-udp-eve-log-srv/test.yaml b/tests/dns-udp-eve-log-srv/test.yaml
new file mode 100644 (file)
index 0000000..cfcfff0
--- /dev/null
@@ -0,0 +1,33 @@
+requires:
+  script:
+    - grep -q parse_rdata_srv rust/src/dns/parser.rs
+
+args:
+  - -k none
+
+checks:
+
+  - filter:
+      count: 1
+      match:
+        event_type: dns
+        dns.type: query
+        dns.rrname: _sip._udp.sip.voice.google.com
+        dns.rrtype: SRV
+
+  - filter:
+      count: 1
+      match:
+        event_type: dns
+        dns.type: answer
+        dns.rrname: _sip._udp.sip.voice.google.com
+        dns.rrtype: SRV
+        dns.rcode: NOERROR
+        dns.answers[0].srv.priority: 20
+        dns.answers[0].srv.weight: 1
+        dns.answers[0].srv.port: 5060
+        dns.answers[0].srv.name: sip-anycast-2.voice.google.com
+        dns.answers[1].srv.priority: 10
+        dns.answers[1].srv.weight: 1
+        dns.answers[1].srv.port: 5060
+        dns.answers[1].srv.name: sip-anycast-1.voice.google.com