2019-03-31 12:49:47 +02:00
|
|
|
..
|
|
|
|
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
|
|
|
|
|
|
|
This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
License, v. 2.0. If a copy of the MPL was not distributed with this
|
2020-09-14 21:04:19 +00:00
|
|
|
file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
|
|
|
See the COPYRIGHT file distributed with this work for additional
|
|
|
|
information regarding copyright ownership.
|
|
|
|
|
|
|
|
.. _dnssec.dynamic.zones:
|
|
|
|
|
|
|
|
DNSSEC, Dynamic Zones, and Automatic Signing
|
|
|
|
--------------------------------------------
|
|
|
|
|
2020-05-26 17:42:52 +00:00
|
|
|
Converting From Insecure to Secure
|
2019-03-31 12:49:47 +02:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2020-09-10 13:48:04 +02:00
|
|
|
A zone can be changed from insecure to secure in three ways: using a
|
2020-09-21 11:03:30 +02:00
|
|
|
dynamic DNS update, via the ``auto-dnssec`` zone option, or by setting a
|
2020-09-10 13:48:04 +02:00
|
|
|
DNSSEC policy for the zone with ``dnssec-policy``.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2020-09-21 11:03:30 +02:00
|
|
|
For any method, ``named`` must be configured so that it can see
|
2019-03-31 12:49:47 +02:00
|
|
|
the ``K*`` files which contain the public and private parts of the keys
|
2020-05-26 17:42:52 +00:00
|
|
|
that are used to sign the zone. These files are generated
|
2020-09-21 11:03:30 +02:00
|
|
|
by ``dnssec-keygen``, or created when needed by ``named`` if
|
|
|
|
``dnssec-policy`` is used. Keys should be placed in the
|
2019-03-31 12:49:47 +02:00
|
|
|
key-directory, as specified in ``named.conf``:
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
zone example.net {
|
2020-06-08 15:33:45 +00:00
|
|
|
type primary;
|
2019-03-31 12:49:47 +02:00
|
|
|
update-policy local;
|
|
|
|
file "dynamic/example.net/example.net";
|
|
|
|
key-directory "dynamic/example.net";
|
|
|
|
};
|
|
|
|
|
|
|
|
If one KSK and one ZSK DNSKEY key have been generated, this
|
2020-05-26 17:42:52 +00:00
|
|
|
configuration causes all records in the zone to be signed with the
|
|
|
|
ZSK, and the DNSKEY RRset to be signed with the KSK. An NSEC
|
|
|
|
chain is generated as part of the initial signing process.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2020-09-21 11:03:30 +02:00
|
|
|
With ``dnssec-policy``, it is possible to specify which keys should be
|
|
|
|
KSK and/or ZSK. To sign all records with a key, a CSK must be specified.
|
|
|
|
For example:
|
2020-09-10 13:48:04 +02:00
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
dnssec-policy csk {
|
|
|
|
keys {
|
|
|
|
csk lifetime unlimited algorithm 13;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-05-26 17:42:52 +00:00
|
|
|
Dynamic DNS Update Method
|
2019-03-31 12:49:47 +02:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
To insert the keys via dynamic update:
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
% nsupdate
|
|
|
|
> ttl 3600
|
|
|
|
> update add example.net DNSKEY 256 3 7 AwEAAZn17pUF0KpbPA2c7Gz76Vb18v0teKT3EyAGfBfL8eQ8al35zz3Y I1m/SAQBxIqMfLtIwqWPdgthsu36azGQAX8=
|
|
|
|
> update add example.net DNSKEY 257 3 7 AwEAAd/7odU/64o2LGsifbLtQmtO8dFDtTAZXSX2+X3e/UNlq9IHq3Y0 XtC0Iuawl/qkaKVxXe2lo8Ct+dM6UehyCqk=
|
|
|
|
> send
|
|
|
|
|
2020-05-26 17:42:52 +00:00
|
|
|
While the update request completes almost immediately, the zone is
|
2020-06-08 15:33:45 +00:00
|
|
|
not completely signed until ``named`` has had time to "walk" the zone
|
2019-03-31 12:49:47 +02:00
|
|
|
and generate the NSEC and RRSIG records. The NSEC record at the apex
|
2020-05-26 17:42:52 +00:00
|
|
|
is added last, to signal that there is a complete NSEC chain.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2020-05-26 17:42:52 +00:00
|
|
|
To sign using NSEC3 instead of NSEC, add an
|
|
|
|
NSEC3PARAM record to the initial update request. The OPTOUT bit in the NSEC3
|
|
|
|
chain can be set in the flags field of the
|
2019-03-31 12:49:47 +02:00
|
|
|
NSEC3PARAM record.
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
% nsupdate
|
|
|
|
> ttl 3600
|
|
|
|
> update add example.net DNSKEY 256 3 7 AwEAAZn17pUF0KpbPA2c7Gz76Vb18v0teKT3EyAGfBfL8eQ8al35zz3Y I1m/SAQBxIqMfLtIwqWPdgthsu36azGQAX8=
|
|
|
|
> update add example.net DNSKEY 257 3 7 AwEAAd/7odU/64o2LGsifbLtQmtO8dFDtTAZXSX2+X3e/UNlq9IHq3Y0 XtC0Iuawl/qkaKVxXe2lo8Ct+dM6UehyCqk=
|
|
|
|
> update add example.net NSEC3PARAM 1 1 100 1234567890
|
|
|
|
> send
|
|
|
|
|
2020-05-26 17:42:52 +00:00
|
|
|
Again, this update request completes almost immediately; however,
|
|
|
|
the record does not show up until ``named`` has had a chance to
|
|
|
|
build/remove the relevant chain. A private type record is created
|
2019-03-31 12:49:47 +02:00
|
|
|
to record the state of the operation (see below for more details), and
|
2020-05-26 17:42:52 +00:00
|
|
|
is removed once the operation completes.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
|
|
|
While the initial signing and NSEC/NSEC3 chain generation is happening,
|
|
|
|
other updates are possible as well.
|
|
|
|
|
2020-05-26 17:42:52 +00:00
|
|
|
Fully Automatic Zone Signing
|
2019-03-31 12:49:47 +02:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2020-09-21 11:03:30 +02:00
|
|
|
To enable automatic signing, set a ``dnssec-policy`` or add the
|
2020-09-10 13:48:04 +02:00
|
|
|
``auto-dnssec`` option to the zone statement in ``named.conf``.
|
|
|
|
``auto-dnssec`` has two possible arguments: ``allow`` or ``maintain``.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
|
|
|
With ``auto-dnssec allow``, ``named`` can search the key directory for
|
|
|
|
keys matching the zone, insert them into the zone, and use them to sign
|
2020-05-26 17:42:52 +00:00
|
|
|
the zone. It does so only when it receives an
|
2019-03-31 12:49:47 +02:00
|
|
|
``rndc sign <zonename>``.
|
|
|
|
|
2020-05-26 17:42:52 +00:00
|
|
|
``auto-dnssec maintain`` includes the above functionality, but also
|
|
|
|
automatically adjusts the zone's DNSKEY records on a schedule according to
|
2019-03-31 12:49:47 +02:00
|
|
|
the keys' timing metadata. (See :ref:`man_dnssec-keygen` and
|
|
|
|
:ref:`man_dnssec-settime` for more information.)
|
|
|
|
|
2020-09-21 11:03:30 +02:00
|
|
|
``dnssec-policy`` is similar to ``auto-dnssec maintain``, but
|
|
|
|
``dnssec-policy`` also automatically creates new keys when necessary. In
|
|
|
|
addition, any configuration related to DNSSEC signing is retrieved from the
|
|
|
|
policy, ignoring existing DNSSEC ``named.conf`` options.
|
2020-09-10 13:48:04 +02:00
|
|
|
|
2020-05-26 17:42:52 +00:00
|
|
|
``named`` periodically searches the key directory for keys matching
|
|
|
|
the zone; if the keys' metadata indicates that any change should be
|
2020-06-08 15:33:45 +00:00
|
|
|
made to the zone - such as adding, removing, or revoking a key - then that
|
2020-05-26 17:42:52 +00:00
|
|
|
action is carried out. By default, the key directory is checked for
|
2020-06-08 15:33:45 +00:00
|
|
|
changes every 60 minutes; this period can be adjusted with
|
2019-03-31 12:49:47 +02:00
|
|
|
``dnssec-loadkeys-interval``, up to a maximum of 24 hours. The
|
2020-05-26 17:42:52 +00:00
|
|
|
``rndc loadkeys`` command forces ``named`` to check for key updates immediately.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
|
|
|
If keys are present in the key directory the first time the zone is
|
2020-05-26 17:42:52 +00:00
|
|
|
loaded, the zone is signed immediately, without waiting for an
|
|
|
|
``rndc sign`` or ``rndc loadkeys`` command. Those commands can still be
|
|
|
|
used when there are unscheduled key changes.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
|
|
|
When new keys are added to a zone, the TTL is set to match that of any
|
2020-05-26 17:42:52 +00:00
|
|
|
existing DNSKEY RRset. If there is no existing DNSKEY RRset, the
|
|
|
|
TTL is set to the TTL specified when the key was created (using the
|
2019-03-31 12:49:47 +02:00
|
|
|
``dnssec-keygen -L`` option), if any, or to the SOA TTL.
|
|
|
|
|
2020-05-26 17:42:52 +00:00
|
|
|
To sign the zone using NSEC3 instead of NSEC, submit an
|
2019-03-31 12:49:47 +02:00
|
|
|
NSEC3PARAM record via dynamic update prior to the scheduled publication
|
2020-05-26 17:42:52 +00:00
|
|
|
and activation of the keys. The OPTOUT bit for the NSEC3 chain can be set
|
|
|
|
in the flags field of the NSEC3PARAM record. The
|
|
|
|
NSEC3PARAM record does not appear in the zone immediately, but it is
|
|
|
|
stored for later reference. When the zone is signed and the NSEC3
|
|
|
|
chain is completed, the NSEC3PARAM record appears in the zone.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
|
|
|
Using the ``auto-dnssec`` option requires the zone to be configured to
|
|
|
|
allow dynamic updates, by adding an ``allow-update`` or
|
|
|
|
``update-policy`` statement to the zone configuration. If this has not
|
2020-05-26 17:42:52 +00:00
|
|
|
been done, the configuration fails.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2020-06-08 15:33:45 +00:00
|
|
|
Private Type Records
|
2019-03-31 12:49:47 +02:00
|
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2020-06-08 15:33:45 +00:00
|
|
|
The state of the signing process is signaled by private type records
|
2020-05-26 17:42:52 +00:00
|
|
|
(with a default type value of 65534). When signing is complete, those
|
2020-06-08 15:33:45 +00:00
|
|
|
records with a non-zero initial octet have a non-zero value for the final octet.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2020-06-08 15:33:45 +00:00
|
|
|
If the first octet of a private type record is non-zero, the
|
2020-05-26 17:42:52 +00:00
|
|
|
record indicates either that the zone needs to be signed with the key matching
|
2019-03-31 12:49:47 +02:00
|
|
|
the record, or that all signatures that match the record should be
|
2020-06-08 15:33:45 +00:00
|
|
|
removed. Here are the meanings of the different values of the first octet:
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2020-06-08 15:33:45 +00:00
|
|
|
- algorithm (octet 1)
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2020-06-08 15:33:45 +00:00
|
|
|
- key id in network order (octet 2 and 3)
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2020-06-08 15:33:45 +00:00
|
|
|
- removal flag (octet 4)
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2020-06-08 15:33:45 +00:00
|
|
|
- complete flag (octet 5)
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2020-06-08 15:33:45 +00:00
|
|
|
Only records flagged as "complete" can be removed via dynamic update; attempts
|
|
|
|
to remove other private type records are silently ignored.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
|
|
|
If the first octet is zero (this is a reserved algorithm number that
|
2020-06-08 15:33:45 +00:00
|
|
|
should never appear in a DNSKEY record), the record indicates that
|
2019-03-31 12:49:47 +02:00
|
|
|
changes to the NSEC3 chains are in progress. The rest of the record
|
2020-05-26 17:42:52 +00:00
|
|
|
contains an NSEC3PARAM record, while the flag field tells what operation to
|
2020-06-08 15:33:45 +00:00
|
|
|
perform based on the flag bits:
|
2019-03-31 12:49:47 +02:00
|
|
|
|
|
|
|
0x01 OPTOUT
|
|
|
|
|
|
|
|
0x80 CREATE
|
|
|
|
|
|
|
|
0x40 REMOVE
|
|
|
|
|
|
|
|
0x20 NONSEC
|
|
|
|
|
2020-05-26 17:42:52 +00:00
|
|
|
DNSKEY Rollovers
|
2019-03-31 12:49:47 +02:00
|
|
|
~~~~~~~~~~~~~~~~
|
|
|
|
|
2020-05-26 17:42:52 +00:00
|
|
|
As with insecure-to-secure conversions, DNSSEC keyrolls can be done
|
|
|
|
in two ways: using a dynamic DNS update, or via the ``auto-dnssec`` zone
|
2019-03-31 12:49:47 +02:00
|
|
|
option.
|
|
|
|
|
2020-05-26 17:42:52 +00:00
|
|
|
Dynamic DNS Update Method
|
2019-03-31 12:49:47 +02:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2020-12-16 10:24:01 +01:00
|
|
|
To perform key rollovers via a dynamic update, the ``K*``
|
2020-05-26 17:42:52 +00:00
|
|
|
files for the new keys must be added so that ``named`` can find them.
|
|
|
|
The new DNSKEY RRs can then be added via dynamic update. ``named`` then causes the
|
|
|
|
zone to be signed with the new keys; when the signing is complete, the
|
2020-06-08 15:33:45 +00:00
|
|
|
private type records are updated so that the last octet is non-zero.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2020-05-26 17:42:52 +00:00
|
|
|
If this is for a KSK, the parent and any trust anchor
|
|
|
|
repositories of the new KSK must be informed.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2020-05-26 17:42:52 +00:00
|
|
|
The maximum TTL in the zone must expire before removing the
|
|
|
|
old DNSKEY. If it is a KSK that is being updated,
|
|
|
|
the DS RRset in the parent must also be updated and its TTL allowed to expire. This
|
|
|
|
ensures that all clients are able to verify at least one signature
|
|
|
|
when the old DNSKEY is removed.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2020-05-26 17:42:52 +00:00
|
|
|
The old DNSKEY can be removed via UPDATE, taking care to specify the
|
|
|
|
correct key. ``named`` cleans out any signatures generated by the
|
2019-03-31 12:49:47 +02:00
|
|
|
old key after the update completes.
|
|
|
|
|
2020-05-26 17:42:52 +00:00
|
|
|
Automatic Key Rollovers
|
2019-03-31 12:49:47 +02:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
When a new key reaches its activation date (as set by ``dnssec-keygen``
|
2020-06-08 15:33:45 +00:00
|
|
|
or ``dnssec-settime``), and if the ``auto-dnssec`` zone option is set to
|
2020-05-26 17:42:52 +00:00
|
|
|
``maintain``, ``named`` automatically carries out the key rollover.
|
2019-03-31 12:49:47 +02:00
|
|
|
If the key's algorithm has not previously been used to sign the zone,
|
2020-05-26 17:42:52 +00:00
|
|
|
then the zone is fully signed as quickly as possible. However, if
|
|
|
|
the new key replaces an existing key of the same algorithm, the
|
|
|
|
zone is re-signed incrementally, with signatures from the old key
|
|
|
|
replaced with signatures from the new key as their signature
|
2019-03-31 12:49:47 +02:00
|
|
|
validity periods expire. By default, this rollover completes in 30 days,
|
2020-05-26 17:42:52 +00:00
|
|
|
after which it is safe to remove the old key from the DNSKEY RRset.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2020-05-26 17:42:52 +00:00
|
|
|
NSEC3PARAM Rollovers via UPDATE
|
2019-03-31 12:49:47 +02:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2020-05-26 17:42:52 +00:00
|
|
|
The new NSEC3PARAM record can be added via dynamic update. When the new NSEC3
|
|
|
|
chain has been generated, the NSEC3PARAM flag field is set to zero. At
|
|
|
|
that point, the old NSEC3PARAM record can be removed. The old chain is
|
|
|
|
removed after the update request completes.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2020-05-26 17:42:52 +00:00
|
|
|
Converting From NSEC to NSEC3
|
2019-03-31 12:49:47 +02:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2020-10-09 14:19:10 +02:00
|
|
|
Add a ``nsec3param`` option to your ``dnssec-policy`` and
|
|
|
|
run ``rndc reconfig``.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2020-10-09 14:19:10 +02:00
|
|
|
Or use ``nsupdate`` to add an NSEC3PARAM record.
|
|
|
|
|
|
|
|
In both cases, the NSEC3 chain is generated and the NSEC3PARAM record is
|
|
|
|
added before the NSEC chain is destroyed.
|
2020-09-10 13:48:04 +02:00
|
|
|
|
2020-05-26 17:42:52 +00:00
|
|
|
Converting From NSEC3 to NSEC
|
2019-03-31 12:49:47 +02:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2020-10-09 14:19:10 +02:00
|
|
|
To do this, remove the ``nsec3param`` option from the ``dnssec-policy`` and
|
|
|
|
run ``rndc reconfig``.
|
|
|
|
|
|
|
|
Or use ``nsupdate`` to remove all NSEC3PARAM records with a
|
2020-05-26 17:42:52 +00:00
|
|
|
zero flag field. The NSEC chain is generated before the NSEC3 chain
|
2019-03-31 12:49:47 +02:00
|
|
|
is removed.
|
|
|
|
|
2020-05-26 17:42:52 +00:00
|
|
|
Converting From Secure to Insecure
|
2019-03-31 12:49:47 +02:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
To convert a signed zone to unsigned using dynamic DNS, delete all the
|
|
|
|
DNSKEY records from the zone apex using ``nsupdate``. All signatures,
|
2020-05-26 17:42:52 +00:00
|
|
|
NSEC or NSEC3 chains, and associated NSEC3PARAM records are removed
|
|
|
|
automatically. This takes place after the update request completes.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
|
|
|
This requires the ``dnssec-secure-to-insecure`` option to be set to
|
|
|
|
``yes`` in ``named.conf``.
|
|
|
|
|
|
|
|
In addition, if the ``auto-dnssec maintain`` zone statement is used, it
|
2020-05-26 17:42:52 +00:00
|
|
|
should be removed or changed to ``allow`` instead; otherwise it will re-sign.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2020-05-26 17:42:52 +00:00
|
|
|
Periodic Re-signing
|
2019-03-31 12:49:47 +02:00
|
|
|
~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2020-05-26 17:42:52 +00:00
|
|
|
In any secure zone which supports dynamic updates, ``named``
|
|
|
|
periodically re-signs RRsets which have not been re-signed as a result of
|
|
|
|
some update action. The signature lifetimes are adjusted to
|
2019-03-31 12:49:47 +02:00
|
|
|
spread the re-sign load over time rather than all at once.
|
|
|
|
|
|
|
|
NSEC3 and OPTOUT
|
|
|
|
~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
``named`` only supports creating new NSEC3 chains where all the NSEC3
|
|
|
|
records in the zone have the same OPTOUT state. ``named`` supports
|
|
|
|
UPDATES to zones where the NSEC3 records in the chain have mixed OPTOUT
|
|
|
|
state. ``named`` does not support changing the OPTOUT state of an
|
2020-05-26 17:42:52 +00:00
|
|
|
individual NSEC3 record; if the
|
|
|
|
OPTOUT state of an individual NSEC3 needs to be changed, the entire chain must be changed.
|