
(Part 5 - Dynamic DNS Update Security, TSIG and Catalog-Zones)
Created: 2021-06-18 Fri 07:49


Welcome to part five of our BIND 9 webinar series


















All the algorithms take a random length input and create a fixed length fingerprint.
| Algorithm | fingerprint length |
|---|---|
| MD5 | 16 byte |
| SHA1 | 20 byte |
| SHA256 | 32 byte |
| SHA512 | 64 byte |


rndc-confgen: designed for keys for remote control.ddns-confgen: designed for keys for DDNS/nsupdate.tsig-keygen: a generic tool HMAC key creation. It was
introduced in BIND 9.10.

BIND 9.10 comes with the new command tsig-keygen to generate
TSIG-keys.
% tsig-keygen my-key
key "my-key" {
algorithm hmac-sha256;
secret "EvfRifkexW+81OmqFJSc9Z07IBVZxvZbKVJBhF8BwHo=";
};


rndc, may use TSIG for authentication.
rndc-confgen creates a template configuration including keys.

key prim-sec-example.com {
algorithm hmac-sha256;
secret "pDCQLRGpPN0h9ksqHBnGBra3U15QwlpQI5aPNO5d5xE=";
};
zone "example.com" {
type primary;
file "example.com";
allow-transfer { key prim-sec-example.com; };
};


key prim-sec-example.com {
algorithm hmac-sha256;
secret "pDCQLRGpPN0h9ksqHBnGBra3U15QwlpQI5aPNO5d5xE=";
};
# secondary zone
zone "example.com" {
type secondary;
file "example.com";
masters { 192.0.2.53 key prim-sec-example.com; };
};


TSIGs can be used to secure all communication between servers (queries, notifies, zone-transfers …):
key server1-server2 {
algorithm hmac-sha256;
secret "pDCQLRGpPN0h9ksqHBnGBra3U15QwlpQI5aPNO5d5xE=";
};
server 192.0.2.53 { # <-- IP Address of the remote DNS server
keys { server1-server2; };
};


allow-update {}; enables DDNS.


key dynamic-update-example.com {
algorithm hmac-sha256;
secret "pDCQLRGpPN0h9ksqHBnGBra3U15QwlpQI5aPNO5d5xE=";
};
zone "example.com" {
type primary;
file "example.com";
allow-update { key dynamic-update-example.com; };
};




allow-update, any change to the primary zone is secured by a
key
update-policy can be used to provide a more flexible
access control for dynamic updates
update-policy is mutually exclusive with allow-update

update-policy we can grant or deny the resource record
(RR) identity making changes
update-policy { grant identity matchtype tname [rr]; };
update-policy { deny identity matchtype tname [rr]; };


update-policy { grant identity matchtype tname [rr]; };
update-policy { deny identity matchtype tname [rr]; };
| Matchtype (literal) | Modification available |
|---|---|
| name | Target name (tname) only |
| subdomain | Subdomains of tname |
| zonesub | Subdomains of zone in which the update-policy statement appears |
| self | Own name (TSIG key name) only |
| selfsub | Updates own name and sub-domains of TSIG key name |
| selfwild | Only subdomains of self can be updated |
| wildcard | Wildcard expansion |


matchtype can be used to create rules for updates from
Microsoft AD or Kerberos signed updates
update-policy { grant identity matchtype tname [rr]; };
update-policy { deny identity matchtype tname [rr]; };
| Matchtype (literal) | Modification available |
|---|---|
| ms-self | allows a Microsoft client to update its own hostname |
| ms-selfsub | allows a Microsoft client to update its own hostname and subdomains |
| ms-subdomain | allows a Microsoft client to update any records inside its domain |
| krb5-self | allows a Kerberos client to update its own hostname |
| krb5-selfsub | allows a Kerberos client to update its own hostname and subdomains |
| krb5-subdomain | allows a Kerberos client to update any records inside its domain |


matchtype can also be used to create rules for updates
matching IP-addresses via TCP or 6to4 prefix names. The decision
about update permission can also be delegated to an external
process:
update-policy { grant identity matchtype tname [rr]; };
update-policy { deny identity matchtype tname [rr]; };
| Matchtype (literal) | Modification available |
|---|---|
| tcp-self | Allows updates via TCP that match the domain name of the sender's IP address reverse name resolution |
| 6to4-self | Allows the name matching a 6to4 IPv6 prefix to be updated via TCP from the 6to4 network or from the corresponding IPv4 address |
| external | Delegates the decision of whether to allow a given update to an external daemon |


update-policy { grant identity matchtype tname [rr]; };
update-policy { deny identity matchtype tname [rr]; };
tname defines the domain name or start of domain
name-space that can be updated by this TSIG key


update-policy { grant identity matchtype tname [rr]; };
update-policy { deny identity matchtype tname [rr]; };
rr: an optional space-delimited list of the resource record types
on which updates are allowed (or denied)ANY matches any resource record type except NSEC and
NSEC3

update-key can change A and AAAA records of
www.example.com (and nothing below)
update-policy { grant update-key name www.example.com A AAAA; };


www.example.com, that key can change
the IPv6 address of the domain name www.example.com
update-policy { grant * self * AAAA; };


superkey can change
anything at or below example.org:
update-policy { grant superkey subdomain example.org ANY; };












named.conf, a catalog zone is a completely normal zone.
zone "catalog.example.com" {
type primary;
file "catalog.example.com";
};








named.conf just like any other zone


PTR (Pointer) record where the data
part of that record is the zone name (newzone.example.com in
this example)
zones and the
domain name of the catalog zone
(new-zone20210615.zones.catalog.example.com. in the example)





primaries

primaries: this option sets one or more primary DNS servers for
the secondary zone. Primaries can be defined as IPv4 A or IPv6 AAAA
records.allow-query: this option defines the allow-query ACL. The ACLs
are defined with the help of the APL Resource record (see RFC
3123 "A DNS RR Type for Lists of Address Prefixes (APL RR)")allow-transfer: this option defines the allow-transfer ACL. It
also uses the APL record.







