From: Philippe Antoine Date: Wed, 27 Aug 2025 20:42:57 +0000 (+0200) Subject: dns: add test with response with data length 0 X-Git-Tag: suricata-7.0.12~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F2630%2Fhead;p=thirdparty%2Fsuricata-verify.git dns: add test with response with data length 0 Ticket: 7574 --- diff --git a/tests/dns/dns-answer-emptydata/README.md b/tests/dns/dns-answer-emptydata/README.md new file mode 100644 index 000000000..2f0b0e88e --- /dev/null +++ b/tests/dns/dns-answer-emptydata/README.md @@ -0,0 +1,5 @@ +Test that we do not fail parsing on DNS answer with Data Length 0 `dns.resp.len == 0` + +Ticket: https://redmine.openinfosecfoundation.org/issues/7574 + +Pcap from ticket diff --git a/tests/dns/dns-answer-emptydata/input.pcap b/tests/dns/dns-answer-emptydata/input.pcap new file mode 100644 index 000000000..7a57bc256 Binary files /dev/null and b/tests/dns/dns-answer-emptydata/input.pcap differ diff --git a/tests/dns/dns-answer-emptydata/test.rules b/tests/dns/dns-answer-emptydata/test.rules new file mode 100644 index 000000000..a6cb2a2f2 --- /dev/null +++ b/tests/dns/dns-answer-emptydata/test.rules @@ -0,0 +1,2 @@ +alert dns any any -> any any (msg:"SURICATA DNS malformed request data"; flow:to_server; app-layer-event:dns.malformed_data; classtype:protocol-command-decode; sid:2240002; rev:2;) +alert dns any any -> any any (msg:"SURICATA DNS malformed response data"; flow:to_client; app-layer-event:dns.malformed_data; classtype:protocol-command-decode; sid:2240003; rev:2;) diff --git a/tests/dns/dns-answer-emptydata/test.yaml b/tests/dns/dns-answer-emptydata/test.yaml new file mode 100644 index 000000000..cf28e97e6 --- /dev/null +++ b/tests/dns/dns-answer-emptydata/test.yaml @@ -0,0 +1,9 @@ +checks: + - filter: + count: 2 + match: + event_type: dns + - filter: + count: 0 + match: + event_type: alert