def is_zsk(self) -> bool:
return self.get_metadata("ZSK") == "yes"
+ def role(self) -> str:
+ if self.is_ksk() and self.is_zsk():
+ return "CSK"
+ if self.is_ksk():
+ return "KSK"
+ return "ZSK"
+
@property
def algorithm(self) -> Algorithm:
num = int(self.get_metadata("Algorithm"))
assert verified
-def check_dnssecstatus(server, zone, keys, policy=None, view=None):
+def check_dnssecstatus(server, zone, keys, policy=None, view=None, verbose=False):
# Call rndc dnssec -status on 'server' for 'zone'. Expect 'policy' in
# the output. This is a loose verification, it just tests if the right
# policy name is returned, and if all expected keys are listed.
response = ""
+
+ # Verbose output.
+ v = ""
+ if verbose:
+ v = "-v "
+
if view is None:
- response = server.rndc(f"dnssec -status {zone}", log=False)
+ response = server.rndc(f"dnssec -status {v}{zone}", log=False)
else:
- response = server.rndc(f"dnssec -status {zone} in {view}", log=False)
+ response = server.rndc(f"dnssec -status {v}{zone} in {view}", log=False)
if policy is None:
assert "Zone does not have dnssec-policy" in response
return
- assert f"dnssec-policy: {policy}" in response
+ assert f"DNSSEC status for zone '{zone}' using policy '{policy}'" in response
for key in keys:
if not key.external:
- assert f"key: {key.tag}" in response
+ assert f"{key.role()} {key.tag}" in response
def _check_signatures(
check_keytimes_flag = step.get("check-keytimes", True)
zone_signed = step.get("zone-signed", True)
manual_mode = step.get("manual-mode", False)
+ verbose = step.get("verbose", False)
isctest.log.info(f"check rollover step {zone}")
if check_keytimes_flag:
check_keytimes(keys, expected)
- check_dnssecstatus(server, zone, keys, policy=policy)
+ check_dnssecstatus(server, zone, keys, policy=policy, verbose=verbose)
check_apex(
server,
zone,
pytest.param(
{
"zone": "rsasha1-nsec3.kasp",
- "policy": "rsasha1",
+ "policy": "rsasha1-nsec3",
"config": kasp_config,
"key-properties": rsa1_properties(7),
},
# Standard dynamic zone.
isctest.log.info("check dynamic zone is updated and signed after update")
zone = "dynamic.kasp"
- policy = "default"
+ policy = "default-dynamic"
isctest.kasp.wait_keymgr_done(ns3, zone)
# Dynamic, and inline-signing.
zone = "dynamic-inline-signing.kasp"
+ policy = "default"
isctest.kasp.wait_keymgr_done(ns3, zone)
# test zone is correctly signed
# - check rndc dnssec -status output
- isctest.kasp.check_dnssecstatus(ns1, zone, overlapping_zsks, policy=policy)
+ isctest.kasp.check_dnssecstatus(
+ ns1, zone, overlapping_zsks, policy=policy, verbose=True
+ )
# - dnssec_verify
isctest.kasp.check_dnssec_verify(ns1, zone)
# - check keys
# test zone is correctly signed
# - check rndc dnssec -status output
- isctest.kasp.check_dnssecstatus(ns1, zone, zsks, policy=policy)
+ isctest.kasp.check_dnssecstatus(ns1, zone, zsks, policy=policy, verbose=True)
# - dnssec_verify
isctest.kasp.check_dnssec_verify(ns1, zone)
# - check keys
# test zone is correctly signed
# - check rndc dnssec -status output
- isctest.kasp.check_dnssecstatus(ns1, zone, zsks, policy=policy)
+ isctest.kasp.check_dnssecstatus(ns1, zone, zsks, policy=policy, verbose=True)
# - dnssec_verify
isctest.kasp.check_dnssec_verify(ns1, zone)
# - check keys
# test zone is correctly signed
# - check rndc dnssec -status output
- isctest.kasp.check_dnssecstatus(ns1, zone, zsks, policy=policy)
+ isctest.kasp.check_dnssecstatus(ns1, zone, zsks, policy=policy, verbose=True)
# - dnssec_verify
isctest.kasp.check_dnssec_verify(ns1, zone)
# - check keys
# test zone is correctly signed
# - check rndc dnssec -status output
- isctest.kasp.check_dnssecstatus(ns1, zone, zsks, policy=policy)
+ isctest.kasp.check_dnssecstatus(ns1, zone, zsks, policy=policy, verbose=True)
# - dnssec_verify
isctest.kasp.check_dnssec_verify(ns1, zone)
# - check keys
# test zone is correctly signed
# - check rndc dnssec -status output
- isctest.kasp.check_dnssecstatus(ns1, zone, zsks, policy=policy)
+ isctest.kasp.check_dnssecstatus(ns1, zone, zsks, policy=policy, verbose=True)
# - dnssec_verify
isctest.kasp.check_dnssec_verify(ns1, zone)
# - check keys
@pytest.mark.parametrize(
"tld, policy",
[
- param("kasp", "csk-algoroll"),
+ param("kasp", "csk-algoroll-kasp"),
param("manual", "csk-algoroll-manual"),
],
)
# keys have an unlimited lifetime. Fallback to the default
# loadkeys interval.
"nextev": TIMEDELTA["PT1H"],
+ # Include hidden keys in output.
+ "verbose": True,
}
isctest.kasp.check_rollover_step(ns6, CONFIG, policy, step)
# platforms by subtracting the number of seconds which passed
# between key creation and invoking 'rndc reconfig'.
"nextev": ALGOROLL_IRET - ALGOROLL_IRETKSK - ALGOROLL_KEYTTLPROP - TIME_PASSED,
+ # Include hidden keys in output.
+ "verbose": True,
}
isctest.kasp.check_rollover_step(ns6, CONFIG, policy, step)
# keys have an unlimited lifetime. Fallback to the default
# loadkeys interval.
"nextev": TIMEDELTA["PT1H"],
+ # Include hidden keys in output.
+ "verbose": True,
}
isctest.kasp.check_rollover_step(ns6, CONFIG, policy, step)
# This is the Lcsk, minus time passed since the key started signing,
# minus the prepublication time.
"nextev": CSK_LIFETIME - IRETZSK - IPUB - KEYTTLPROP,
+ # Include hidden keys in output.
+ "verbose": True,
}
isctest.kasp.check_rollover_step(ns3, CONFIG, policy, step)
# Next key event is when the new successor needs to be published.
# This is the Lcsk, minus time passed since the key was published.
"nextev": CSK_LIFETIME - IRET - IPUB - KEYTTLPROP,
+ # Include hidden keys in output.
+ "verbose": True,
}
isctest.kasp.check_rollover_step(ns3, CONFIG, policy, step)
],
"keyrelationships": [0, 1],
"nextev": None,
+ # Include hidden keys in output.
+ "verbose": True,
}
isctest.kasp.check_rollover_step(ns3, CONFIG, policy, step)
# Next key event is when the new successor needs to be published.
# This is the KSK lifetime minus Ipub minus Iret minus time elapsed.
"nextev": KSK_LIFETIME - KSK_IPUB - KSK_IRET - KSK_KEYTTLPROP,
+ # Include hidden keys in output.
+ "verbose": True,
}
isctest.kasp.check_rollover_step(ns3, KSK_CONFIG, policy, step)
step["smooth"] = False
step["nextev"] = Iret(CONFIG, smooth=False)
- isctest.kasp.check_rollover_step(ns3, CONFIG, POLICY, step)
+ isctest.kasp.check_rollover_step(ns3, CONFIG, policy, step)
@pytest.mark.parametrize(
# this is the zsk lifetime minus IRET minus IPUB minus time
# elapsed.
"nextev": ZSK_LIFETIME - IRET - IPUB - KEYTTLPROP,
+ # Include hidden keys in output.
+ "verbose": True,
}
isctest.kasp.check_rollover_step(ns3, CONFIG, policy, step)