]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
dns: test DNS frames
authorJason Ish <ish@unx.ca>
Mon, 14 Feb 2022 14:49:16 +0000 (08:49 -0600)
committerJason Ish <jason.ish@oisf.net>
Mon, 11 Jul 2022 19:01:49 +0000 (13:01 -0600)
tests/dns/dns-frames/input.pcap [new file with mode: 0644]
tests/dns/dns-frames/test.rules [new file with mode: 0644]
tests/dns/dns-frames/test.yaml [new file with mode: 0644]

diff --git a/tests/dns/dns-frames/input.pcap b/tests/dns/dns-frames/input.pcap
new file mode 100644 (file)
index 0000000..21a2996
Binary files /dev/null and b/tests/dns/dns-frames/input.pcap differ
diff --git a/tests/dns/dns-frames/test.rules b/tests/dns/dns-frames/test.rules
new file mode 100644 (file)
index 0000000..6303c1d
--- /dev/null
@@ -0,0 +1,8 @@
+# These 2 rules are trying to verify that the TCP and UDP PDU
+# frame are showing the same data for similar requests.
+alert tcp any any -> any any (msg:"DNS UDP Frame"; flow:to_server; \
+    frame:dns.pdu; content:"|01 20 00 01|"; offset:2; \
+    content:"suricata"; offset:13; sid:1; rev:1;)
+alert udp any any -> any any (msg:"DNS UDP Frame"; flow:to_server; \
+    frame:dns.pdu; content:"|01 20 00 01|"; offset:2;  \
+    content:"suricata"; offset:13; sid:2; rev:1;)
diff --git a/tests/dns/dns-frames/test.yaml b/tests/dns/dns-frames/test.yaml
new file mode 100644 (file)
index 0000000..1ba2b64
--- /dev/null
@@ -0,0 +1,15 @@
+requires:
+  min-version: 7
+
+args:
+- -k none
+
+checks:
+- filter:
+    count: 1
+    match:
+      alert.signature_id: 1
+- filter:
+    count: 1
+    match:
+      alert.signature_id: 2