2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-22 01:59:26 +00:00

Add manual-mode config option

Add a new option 'manual-mode' to 'dnssec-policy'. The intended
use is that if it is enabled, it will not automatically move to the
next state transition (RUMOURED, UNRETENTIVE), only after manual
confirmation. The intended state transition should be logged.
This commit is contained in:
Matthijs Mekking 2025-02-17 12:05:25 +01:00
parent b7eb292121
commit 63c5b453e0
9 changed files with 65 additions and 1 deletions

View File

@ -309,6 +309,7 @@ dnssec-policy \"default\" {\n\
cds-digest-types { 2; };\n\
dnskey-ttl " DNS_KASP_KEY_TTL ";\n\
inline-signing yes;\n\
manual-mode no;\n\
offline-ksk no;\n\
publish-safety " DNS_KASP_PUBLISH_SAFETY "; \n\
retire-safety " DNS_KASP_RETIRE_SAFETY "; \n\
@ -327,6 +328,7 @@ dnssec-policy \"insecure\" {\n\
max-zone-ttl 0; \n\
keys { };\n\
inline-signing yes;\n\
manual-mode no;\n\
};\n\
\n\
"

View File

@ -27,6 +27,7 @@ dnssec-policy "test" {
zsk lifetime P30D algorithm 13;
csk key-store "hsm" lifetime P30D algorithm 8 2048;
};
manual-mode no;
max-zone-ttl 86400;
nsec3param ;
parent-ds-ttl 7200;

View File

@ -6408,6 +6408,16 @@ keys
``insecure``. In this specific case, the existing key files should be moved
to the zone's ``key-directory`` from the new configuration.
.. namedconf:statement:: manual-mode
:tags: dnssec
:short: Run key management in a manual mode.
If enabled, BIND 9 does not automatically start and progress key rollovers,
instead the change is logged. Only after manual confirmation with
:option:`rndc dnssec -step <rndc dnssec>` the change is made.
This feature is off by default.
.. namedconf:statement:: offline-ksk
:tags: dnssec
:short: Specifies whether the DNSKEY, CDS, and CDNSKEY RRsets are being signed offline.

View File

@ -33,6 +33,7 @@ dnssec-policy "default" {
signatures-validity-dnskey 14d;
// Zone parameters
manual-mode no;
inline-signing yes;
max-zone-ttl 86400;
zone-propagation-delay 300;

View File

@ -16,6 +16,7 @@ dnssec-policy <string> {
dnskey-ttl <duration>;
inline-signing <boolean>;
keys { ( csk | ksk | zsk ) [ key-directory | key-store <string> ] lifetime <duration_or_unlimited> algorithm <string> [ tag-range <integer> <integer> ] [ <integer> ]; ... };
manual-mode <boolean>;
max-zone-ttl <duration>;
nsec3param [ iterations <integer> ] [ optout <boolean> ] [ salt-length <integer> ];
offline-ksk <boolean>;

View File

@ -108,6 +108,7 @@ struct dns_kasp {
dns_ttl_t zone_max_ttl;
uint32_t zone_propagation_delay;
bool inline_signing;
bool manual_mode;
/* Parent settings */
dns_ttl_t parent_ds_ttl;
@ -439,6 +440,30 @@ dns_kasp_setinlinesigning(dns_kasp_t *kasp, bool value);
*\li 'kasp' is a valid, thawed kasp.
*/
bool
dns_kasp_manualmode(dns_kasp_t *kasp);
/*%<
* Should we use manual-mode for this DNSSEC policy?
*
* Requires:
*
*\li 'kasp' is a valid, frozen kasp.
*
* Returns:
*
*\li true or false.
*/
void
dns_kasp_setmanualmode(dns_kasp_t *kasp, bool value);
/*%<
* Set manual-mode.
*
* Requires:
*
*\li 'kasp' is a valid, thawed kasp.
*/
dns_ttl_t
dns_kasp_zonemaxttl(dns_kasp_t *kasp, bool fallback);
/*%<

View File

@ -273,6 +273,22 @@ dns_kasp_setinlinesigning(dns_kasp_t *kasp, bool value) {
kasp->inline_signing = value;
}
bool
dns_kasp_manualmode(dns_kasp_t *kasp) {
REQUIRE(DNS_KASP_VALID(kasp));
REQUIRE(kasp->frozen);
return kasp->manual_mode;
}
void
dns_kasp_setmanualmode(dns_kasp_t *kasp, bool value) {
REQUIRE(DNS_KASP_VALID(kasp));
REQUIRE(!kasp->frozen);
kasp->manual_mode = value;
}
dns_ttl_t
dns_kasp_zonemaxttl(dns_kasp_t *kasp, bool fallback) {
REQUIRE(DNS_KASP_VALID(kasp));

View File

@ -473,7 +473,7 @@ cfg_kasp_fromconfig(const cfg_obj_t *config, dns_kasp_t *default_kasp,
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;
bool offline_ksk = false, manual_mode = false;
REQUIRE(config != NULL);
REQUIRE(kaspp != NULL && *kaspp == NULL);
@ -578,6 +578,13 @@ cfg_kasp_fromconfig(const cfg_obj_t *config, dns_kasp_t *default_kasp,
dns_kasp_setinlinesigning(kasp, true);
}
obj = NULL;
(void)confget(maps, "manual-mode", &obj);
if (obj != NULL) {
manual_mode = cfg_obj_asboolean(obj);
}
dns_kasp_setmanualmode(kasp, manual_mode);
maxttl = get_duration(maps, "max-zone-ttl", DNS_KASP_ZONE_MAXTTL);
dns_kasp_setzonemaxttl(kasp, maxttl);

View File

@ -2213,6 +2213,7 @@ static cfg_clausedef_t dnssecpolicy_clauses[] = {
{ "dnskey-ttl", &cfg_type_duration, 0 },
{ "inline-signing", &cfg_type_boolean, 0 },
{ "keys", &cfg_type_kaspkeys, 0 },
{ "manual-mode", &cfg_type_boolean, 0 },
{ "max-zone-ttl", &cfg_type_duration, 0 },
{ "nsec3param", &cfg_type_nsec3, 0 },
{ "offline-ksk", &cfg_type_boolean, 0 },