mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Parse SVCB/HTTPS SvcParams list
Add full support for RFC 9460's SvcParams list. Amend the existing `dns_svcb_rr` record by a vector of new `dns_svcb_param` records containing aptly typed SvcParamKey and SvcParamValue pairs. Example output: ``` @load base/protocols/dns event dns_HTTPS( c: connection , msg: dns_msg , ans: dns_answer , https: dns_svcb_rr ) { for (_, param in https$svc_params) print to_json(param); # filter uninitialised values } ``` ``` $ dig https cloudflare-ech.com +short | tr [:space:] \\n 1 . alpn="h3,h2" ipv4hint=104.18.10.118,104.18.11.118 ech=AEX+DQBBHgAgACBGL2e9TiFwjK/w1Zg9AmRm7mgXHz3PjffP0mTFNMxmDQAEAAEAAQASY2xvdWRmbGFyZS1lY2guY29tAAA= ipv6hint=2606:4700::6812:a76,2606:4700::6812:b76 ``` ``` {"key":1,"alpn":["h3","h2"]} {"key":4,"hint":["104.18.10.118","104.18.11.118"]} {"key":5,"ech":"AEX+DQBBHgAgACBGL2e9TiFwjK/w1Zg9AmRm7mgXHz3PjffP0mTFNMxmDQAEAAEAAQASY2xvdWRmbGFyZS1lY2guY29tAAA="} {"key":6,"hint":["2606:4700::6812:a76","2606:4700::6812:b76"]} ``` Values with malformed data or belonging to invalid/reserved keys are passed raw bytes in network order for script-level inspection. Follow up to "Initial Support to DNS SVCB/HTTPS RR" https://github.com/zeek/zeek/pull/1808
This commit is contained in:
parent
f38ac30418
commit
397f7e5c0e
9 changed files with 214 additions and 32 deletions
|
@ -0,0 +1,8 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
[key=4, mandatory=<uninitialized>, alpn=<uninitialized>, p=<uninitialized>, hint=[213.108.108.101], ech=<uninitialized>, raw=<uninitialized>]
|
||||
[key=5, mandatory=<uninitialized>, alpn=<uninitialized>, p=<uninitialized>, hint=<uninitialized>, ech=AMD+DQA8agAgACCuY19tSB4Tb5cnVHw9eCEj629o/whTJgMysNszoM7KSgAEAAEAAQANY292ZXIuZGVmby5pZQAA/g0APEcAIAAg8InmybO7/fiQqDA30bs6zU4TEkcHY3ExOgVOmpIPcWoABAABAAEADWNvdmVyLmRlZm8uaWUAAP4NADwiACAAIO4CLZ79TKIxJXvbhF13BQo7n8/umXWXCI4dydnNfjoFAAQAAQABAA1jb3Zlci5kZWZvLmllAAA=, raw=<uninitialized>]
|
||||
[key=6, mandatory=<uninitialized>, alpn=<uninitialized>, p=<uninitialized>, hint=[2a00:c6c0:0:116:5::10], ech=<uninitialized>, raw=<uninitialized>]
|
||||
[key=1, mandatory=<uninitialized>, alpn=[h3, h2], p=<uninitialized>, hint=<uninitialized>, ech=<uninitialized>, raw=<uninitialized>]
|
||||
[key=4, mandatory=<uninitialized>, alpn=<uninitialized>, p=<uninitialized>, hint=[104.18.10.118, 104.18.11.118], ech=<uninitialized>, raw=<uninitialized>]
|
||||
[key=5, mandatory=<uninitialized>, alpn=<uninitialized>, p=<uninitialized>, hint=<uninitialized>, ech=AEX+DQBBdAAgACDB6UNjy9kyv48V6cEOb99HnrfJuiTGKjW9A05sDxhcKQAEAAEAAQASY2xvdWRmbGFyZS1lY2guY29tAAA=, raw=<uninitialized>]
|
||||
[key=6, mandatory=<uninitialized>, alpn=<uninitialized>, p=<uninitialized>, hint=[2606:4700::6812:a76, 2606:4700::6812:b76], ech=<uninitialized>, raw=<uninitialized>]
|
|
@ -1,2 +1,2 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
[svc_priority=1, target_name=.]
|
||||
[svc_priority=1, target_name=., svc_params=[[key=1, mandatory=<uninitialized>, alpn=[h3, h3-29, h3-28, h3-27, h2], p=<uninitialized>, hint=<uninitialized>, ech=<uninitialized>, raw=<uninitialized>], [key=4, mandatory=<uninitialized>, alpn=<uninitialized>, p=<uninitialized>, hint=[104.16.132.229, 104.16.133.229], ech=<uninitialized>, raw=<uninitialized>], [key=6, mandatory=<uninitialized>, alpn=<uninitialized>, p=<uninitialized>, hint=[2606:4700::6810:84e5, 2606:4700::6810:85e5], ech=<uninitialized>, raw=<uninitialized>]]]
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
[svc_priority=0, target_name=foo.example.com]
|
||||
[svc_priority=0, target_name=foo.example.com, svc_params=<uninitialized>]
|
||||
|
|
BIN
testing/btest/Traces/dns/ech.pcap
Normal file
BIN
testing/btest/Traces/dns/ech.pcap
Normal file
Binary file not shown.
10
testing/btest/scripts/base/protocols/dns/ech.zeek
Normal file
10
testing/btest/scripts/base/protocols/dns/ech.zeek
Normal file
|
@ -0,0 +1,10 @@
|
|||
# @TEST-EXEC: zeek -r $TRACES/dns/ech.pcap %INPUT > output
|
||||
# @TEST-EXEC: btest-diff output
|
||||
|
||||
@load policy/protocols/dns/auth-addl
|
||||
|
||||
event dns_HTTPS(c: connection, msg: dns_msg, ans: dns_answer, https: dns_svcb_rr)
|
||||
{
|
||||
for (_, param in https$svc_params)
|
||||
print param;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue