Downstream DNS Cookies a la RFC7873 and RFC9018

Create server cookies for clients that send client cookies.
Needs to be turned on in the config file with:

	answer-cookie: yes

A cookie-secret can be configured for anycast setups.
Also adds an access control list that will allow queries with
either a valid cookie or over a stateful transport.
This commit is contained in:
Willem Toorop
2022-09-28 10:28:19 +02:00
parent 71f23ef354
commit 75f3fbdd65
17 changed files with 473 additions and 19 deletions
+2
View File
@@ -1263,6 +1263,8 @@ struct serviced_query* outnet_serviced_query(struct outside_network* outnet,
if(dnssec)
edns.bits = EDNS_DO;
edns.padding_block_size = 0;
edns.cookie_present = 0;
edns.cookie_valid = 0;
edns.opt_list_in = NULL;
edns.opt_list_out = per_upstream_opt_list;
edns.opt_list_inplace_cb_out = NULL;