-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DNSSEC ZSK Rollover #22
Comments
In case the page referenced above vanishes: #!/bin/sh
KEYGEN="/usr/sbin/dnssec-keygen"
SETTIME="/usr/sbin/dnssec-settime"
DNSSEC_KEYS="/var/named/chroot/etc/pki/dnssec-keys"
ZONEFILES="/var/named/chroot/var/named/master"
DOMAIN="$1"
if [ $# -eq 0 ]
then
echo "Syntax: ./$(basename $0) mydomain.tld"
exit 1
fi
ZONEFILE="${ZONEFILES}/${DOMAIN}.zone"
if [ ! -f $ZONEFILE ]
then
echo "File ${DOMAIN}.zone not found!"
exit 1
fi
OLDKEYS="$(grep -l "zone-signing key" $DNSSEC_KEYS/K$DOMAIN.*)"
if [ -z "$OLDKEYS" ]
then
echo "Unable to find an existing zone-signing key, exiting."
exit 1
fi
ACTIVEKEY="$(grep -L "Inactive" $OLDKEYS)"
if [ -z "$ACTIVEKEY" ]
then
echo "Unable to find an active zone-signing key, exiting."
exit 1
fi
if (( $(grep -c . <<<"$ACTIVEKEY") > 1 ))
then
echo "Found multiple active zone-signing keys, exiting."
exit 1
fi
echo "Found key: $ACTIVEKEY"
$SETTIME -I +172800 -D +345600 $ACTIVEKEY
KEYNAME="$($KEYGEN -K $DNSSEC_KEYS -S $ACTIVEKEY -i 172800)"
echo "Generated key: ${KEYNAME}"
echo "Setting owner on generated key"
chown "named:named" "$DNSSEC_KEYS/$KEYNAME.key"
chown "named:named" "$DNSSEC_KEYS/$KEYNAME.private" |
This was referenced Apr 8, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ZSKs should rollover automatically.
The text was updated successfully, but these errors were encountered: