Add a new configuration option to enable Offline KSK key management.
Offline KSK cannot work with CSK because it splits how keys with the
KSK and ZSK role operate. Therefore, one key cannot have both roles.
Add a configuration check to ensure this.
cds-digest-types { 2; };\n\
dnskey-ttl " DNS_KASP_KEY_TTL ";\n\
inline-signing yes;\n\
+ offline-ksk no;\n\
publish-safety " DNS_KASP_PUBLISH_SAFETY "; \n\
retire-safety " DNS_KASP_RETIRE_SAFETY "; \n\
purge-keys " DNS_KASP_PURGE_KEYS "; \n\
};
max-zone-ttl 86400;
nsec3param iterations 0 optout no salt-length 8;
+ offline-ksk no;
parent-ds-ttl 7200;
parent-propagation-delay PT1H;
publish-safety PT3600S;
--- /dev/null
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * 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
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+/*
+ * Offline KSK is not possible with CSK
+ * (even if there are other key roles present).
+ */
+dnssec-policy "bad-offline-ksk" {
+ offline-ksk yes;
+ keys {
+ ksk lifetime P10Y algorithm rsasha256;
+ zsk lifetime P10Y algorithm rsasha256;
+ csk lifetime P10Y algorithm rsasha256;
+ };
+};
+
+zone "example.net" {
+ type primary;
+ file "example.db";
+ dnssec-policy "bad-offline-ksk";
+};
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status + ret))
+n=$((n + 1))
+echo_i "checking named-checkconf kasp offline-ksk with csk errors ($n)"
+ret=0
+$CHECKCONF kasp-bad-offline-ksk.conf >checkconf.out$n 2>&1 && ret=1
+grep "dnssec-policy: csk keys are not allowed when offline-ksk is enabled" <checkconf.out$n >/dev/null || ret=1
+if [ $ret -ne 0 ]; then echo_i "failed"; fi
+status=$((status + ret))
+
n=$((n + 1))
echo_i "checking named-checkconf kasp signatures refresh errors ($n)"
ret=0
``insecure``. In this specific case you should move the existing key files
to the zone's ``key-directory`` from the new configuration.
+.. namedconf:statement:: offline-ksk
+ :tags: dnssec
+ :short: Specifies whether the DNSKEY, CDS, and CDNSKEY RRsets are being signed offline.
+
+ If enabled, BIND 9 does not generate signatures for the DNSKEY, CDS, and
+ CDNSKEY RRsets. Instead, the signed DNSKEY, CDS and CDNSKEY RRsets are
+ looked up from Signed Key Response (SKR) files.
+
+ Any existing DNSKEY, CDS, and CDNSKEY RRsets in the unsigned version of the
+ zone are filtered and replaced with RRsets from the SKR file.
+
+ This feature is off by default. Configuring ``offline-ksk`` in conjunction
+ with a CSK is a configuration error.
+
.. namedconf:statement:: purge-keys
:tags: dnssec
:short: Specifies the amount of time after which DNSSEC keys that have been deleted from the zone can be removed from disk.
dnssec-policy "default" {
// Keys
+ offline-ksk no;
keys {
csk key-directory lifetime unlimited algorithm 13;
};
keys { ( csk | ksk | zsk ) [ key-directory | key-store <string> ] lifetime <duration_or_unlimited> algorithm <string> [ <integer> ]; ... };
max-zone-ttl <duration>;
nsec3param [ iterations <integer> ] [ optout <boolean> ] [ salt-length <integer> ];
+ offline-ksk <boolean>;
parent-ds-ttl <duration>;
parent-propagation-delay <duration>;
publish-safety <duration>;
uint32_t signatures_validity_dnskey;
/* Configuration: Keys */
+ bool offlineksk;
bool cdnskey;
dns_kasp_digestlist_t digests;
dns_kasp_keylist_t keys;
*
*/
+bool
+dns_kasp_offlineksk(dns_kasp_t *kasp);
+/*%<
+ * Should we be using Offline KSK key management?
+ *
+ * Requires:
+ *
+ *\li 'kasp' is a valid, frozen kasp.
+ *
+ */
+
+void
+dns_kasp_setofflineksk(dns_kasp_t *kasp, bool offlineksk);
+/*%<
+ * Enable/disable Offline KSK.
+ *
+ * Requires:
+ *
+ *\li 'kasp' is a valid, unfrozen kasp.
+ *
+ */
+
bool
dns_kasp_cdnskey(dns_kasp_t *kasp);
/*%<
void
dns_kasp_setcdnskey(dns_kasp_t *kasp, bool cdnskey);
/*%<
- * Set to enable publication of CDNSKEY records.
+ * Enable/disable publication of CDNSKEY records.
*
* Requires:
*
kasp->nsec3param.saltlen = saltlen;
}
+bool
+dns_kasp_offlineksk(dns_kasp_t *kasp) {
+ REQUIRE(kasp != NULL);
+ REQUIRE(kasp->frozen);
+
+ return kasp->offlineksk;
+}
+
+void
+dns_kasp_setofflineksk(dns_kasp_t *kasp, bool offlineksk) {
+ REQUIRE(kasp != NULL);
+ REQUIRE(!kasp->frozen);
+
+ kasp->offlineksk = offlineksk;
+}
+
bool
dns_kasp_cdnskey(dns_kasp_t *kasp) {
REQUIRE(kasp != NULL);
*/
static isc_result_t
cfg_kaspkey_fromconfig(const cfg_obj_t *config, dns_kasp_t *kasp,
- bool check_algorithms, dns_keystorelist_t *keystorelist,
+ bool check_algorithms, bool offline_ksk,
+ dns_keystorelist_t *keystorelist,
uint32_t ksk_min_lifetime, uint32_t zsk_min_lifetime) {
isc_result_t result;
dns_kasp_key_t *key = NULL;
if (config == NULL) {
/* We are creating a key reference for the default kasp. */
+ INSIST(!offline_ksk);
key->role |= DNS_KASP_KEY_ROLE_KSK | DNS_KASP_KEY_ROLE_ZSK;
key->lifetime = 0; /* unlimited */
key->algorithm = DNS_KEYALG_ECDSA256;
} else if (strcmp(rolestr, "zsk") == 0) {
key->role |= DNS_KASP_KEY_ROLE_ZSK;
} else if (strcmp(rolestr, "csk") == 0) {
+ if (offline_ksk) {
+ cfg_obj_log(
+ config, ISC_LOG_ERROR,
+ "dnssec-policy: csk keys are not "
+ "allowed when offline-ksk is enabled");
+ result = ISC_R_FAILURE;
+ goto cleanup;
+ }
key->role |= DNS_KASP_KEY_ROLE_KSK;
key->role |= DNS_KASP_KEY_ROLE_ZSK;
}
uint32_t zonepropdelay = 0, parentpropdelay = 0;
uint32_t ipub = 0, iret = 0;
uint32_t ksk_min_lifetime = 0, zsk_min_lifetime = 0;
+ bool offline_ksk = false;
REQUIRE(config != NULL);
REQUIRE(kaspp != NULL && *kaspp == NULL);
dns_kasp_setparentpropagationdelay(kasp, parentpropdelay);
/* Configuration: Keys */
+ obj = NULL;
+ (void)confget(maps, "offline-ksk", &obj);
+ if (obj != NULL) {
+ offline_ksk = cfg_obj_asboolean(obj);
+ }
+ dns_kasp_setofflineksk(kasp, offline_ksk);
+
obj = NULL;
(void)confget(maps, "cdnskey", &obj);
if (obj != NULL) {
{
cfg_obj_t *kobj = cfg_listelt_value(element);
result = cfg_kaspkey_fromconfig(
- kobj, kasp, check_algorithms, keystorelist,
- ksk_min_lifetime, zsk_min_lifetime);
+ kobj, kasp, check_algorithms, offline_ksk,
+ keystorelist, ksk_min_lifetime,
+ zsk_min_lifetime);
if (result != ISC_R_SUCCESS) {
cfg_obj_log(kobj, ISC_LOG_ERROR,
"dnssec-policy: failed to "
{ "keys", &cfg_type_kaspkeys, 0 },
{ "max-zone-ttl", &cfg_type_duration, 0 },
{ "nsec3param", &cfg_type_nsec3, 0 },
+ { "offline-ksk", &cfg_type_boolean, 0 },
{ "parent-ds-ttl", &cfg_type_duration, 0 },
{ "parent-propagation-delay", &cfg_type_duration, 0 },
{ "parent-registration-delay", &cfg_type_duration,