]> git.ipfire.org Git - thirdparty/suricata.git/commit
mdns: add mdns parser, logger and detection 13334/head
authorJason Ish <jason.ish@oisf.net>
Wed, 28 May 2025 18:43:05 +0000 (12:43 -0600)
committerVictor Julien <victor@inliniac.net>
Thu, 29 May 2025 08:59:16 +0000 (10:59 +0200)
commit4a655053e86d3f68ea0f59945461b05822dfd395
tree24fd0c80307f7d6c24027cebfc25aee335935fb9
parentde88d8ec4870de5068e0dcf4d6bc6aae6a8189d1
mdns: add mdns parser, logger and detection

The mDNS support is based heavily on the DNS support, reusing the
existing DNS parser where possible. This meant adding variations on
DNS, as mDNS is a little different. Mainly being that *all* mDNS
traffic is to_server, yet there is still the concept of request and
responses.

Keywords added are:
- mdns.queries.rrname
- mdns.answers.rrname
- mdns.additionals.rrname
- mdns.authorities.rrname
- mdns.response.rrname

They are mostly in-line with the DNS keywords, except
mdns.answers.rdata which is a better than that mdns.response.rrname,
as its actually looking at the rdata, and not rrnames.

mDNS has its own logger that differs from the DNS logger:

- No grouped logging

- In answers/additionals/authorities, the rdata is logged in a field
  that is named after the rdata type. For example, "txt" data is no
  longer logged in the "rdata" field, but instead a "txt" field. We
  currently already did this in DNS for fields that were not a single
  buffer, like SOA, SRV, etc. So this makes things more consistent. And
  gives query like semantics that the "grouped" object was trying to
  provide.

- Types are logged in lower case ("txt" instead of "TXT")

- Flags are logged as an array: "flags": ["aa", "z"]

Ticket: #3952
22 files changed:
doc/userguide/rules/index.rst
doc/userguide/rules/mdns-keywords.rst [new file with mode: 0644]
etc/schema.json
rust/src/dns/detect.rs
rust/src/dns/dns.rs
rust/src/dns/log.rs
rust/src/http2/http2.rs
rust/src/lib.rs
rust/src/mdns/log.rs [new file with mode: 0644]
rust/src/mdns/mdns.rs [new file with mode: 0644]
rust/src/mdns/mod.rs [new file with mode: 0644]
rust/sys/src/sys.rs
src/Makefile.am
src/app-layer-parser.c
src/app-layer-protos.h
src/app-layer.c
src/detect-dns-name.c
src/detect-dns-response.c
src/output-json-mdns.c [new file with mode: 0644]
src/output-json-mdns.h [new file with mode: 0644]
src/output.c
suricata.yaml.in