2022-08-02 09:01:01 -04:00
#!/bin/sh
2014-01-10 15:07:56 -05:00
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
2012-06-28 21:39:47 -04:00
#
2005-06-23 02:52:23 -04:00
# SPDX-License-Identifier: MPL-2.0
2021-06-03 02:37:05 -04:00
#
2005-06-23 02:52:23 -04:00
# 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/.
2018-02-23 03:53:12 -05:00
#
2005-06-23 02:52:23 -04:00
# See the COPYRIGHT file distributed with this work for additional
2018-02-20 18:43:27 -05:00
# information regarding copyright ownership.
2005-06-23 02:52:23 -04:00
2023-06-07 09:35:57 -04:00
set -e
2020-07-21 06:12:59 -04:00
. ../conf.sh
2005-06-23 02:52:23 -04:00
status = 0
2016-11-02 02:47:51 -04:00
n = 0
2005-06-23 02:52:23 -04:00
2023-07-24 12:35:13 -04:00
mkdir -p keys
2021-05-04 10:30:17 -04:00
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " checking that named-checkconf handles a known good config ( $n ) "
2005-06-23 02:52:23 -04:00
ret = 0
2019-06-05 22:50:47 -04:00
$CHECKCONF good.conf >checkconf.out$n 2>& 1 || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
2005-06-23 02:52:23 -04:00
status = $(( status + ret))
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " checking that named-checkconf prints a known good config ( $n ) "
2010-06-01 21:07:47 -04:00
ret = 0
2022-07-05 05:38:31 -04:00
awk 'BEGIN { ok = 0; } /cut here/ { ok = 1; getline } ok == 1 { print }' good.conf >good.conf.raw
[ -s good.conf.raw ] || ret = 1
$CHECKCONF -p good.conf.raw >checkconf.out$n || ret = 1
grep -v '^good.conf.raw:' <checkconf.out$n >good.conf.out 2>& 1 || ret = 1
cmp good.conf.raw good.conf.out || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
2010-06-01 21:07:47 -04:00
status = $(( status + ret))
2011-05-07 01:55:17 -04:00
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " checking that named-checkconf -x removes secrets ( $n ) "
2014-01-10 00:56:36 -05:00
ret = 0
# ensure there is a secret and that it is not the check string.
2022-07-05 05:38:31 -04:00
grep 'secret "' good.conf.raw >/dev/null || ret = 1
grep 'secret "????????????????"' good.conf.raw >/dev/null 2>& 1 && ret = 1
$CHECKCONF -p -x good.conf.raw >checkconf.out$n || ret = 1
grep -v '^good.conf.raw:' <checkconf.out$n >good.conf.out 2>& 1 || ret = 1
2014-01-10 00:56:36 -05:00
grep 'secret "????????????????"' good.conf.out >/dev/null 2>& 1 || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
2014-01-10 00:56:36 -05:00
status = $(( status + ret))
2015-05-05 03:39:07 -04:00
for bad in bad-*.conf; do
2018-02-06 21:34:02 -05:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " checking that named-checkconf detects error in $bad ( $n ) "
2018-02-06 21:34:02 -05:00
ret = 0
2023-06-09 04:57:34 -04:00
{
$CHECKCONF $bad >checkconf.out$n 2>& 1
rc = $?
} || true
if [ $rc -ne 1 ] ; then ret = 1; fi
2019-06-05 22:50:47 -04:00
grep " ^ $bad :[0-9]*: " <checkconf.out$n >/dev/null || ret = 1
2018-02-06 21:34:02 -05:00
case $bad in
bad-update-policy[ 123] .conf)
pat = "identity and name fields are not the same"
2019-06-05 22:50:47 -04:00
grep " $pat " <checkconf.out$n >/dev/null || ret = 1
2018-02-06 21:34:02 -05:00
; ;
2018-09-09 19:52:36 -04:00
bad-update-policy[ 4589] .conf | bad-update-policy1[ 01] .conf)
2018-02-06 21:34:02 -05:00
pat = "name field not set to placeholder value"
2019-06-05 22:50:47 -04:00
grep " $pat " <checkconf.out$n >/dev/null || ret = 1
2018-02-06 21:34:02 -05:00
; ;
2018-09-12 22:39:06 -04:00
bad-update-policy[ 67] .conf | bad-update-policy1[ 2345789] .conf | bad-update-policy20.conf)
2018-09-06 05:36:17 -04:00
pat = "missing name field type '.*' found"
2019-06-05 22:50:47 -04:00
grep " $pat " <checkconf.out$n >/dev/null || ret = 1
2018-09-06 05:36:17 -04:00
; ;
2018-02-06 21:34:02 -05:00
esac
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
2018-02-06 21:34:02 -05:00
status = $(( status + ret))
2012-10-01 23:06:02 -04:00
done
2005-06-23 02:52:23 -04:00
2015-05-05 03:39:07 -04:00
for good in good-*.conf; do
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " checking that named-checkconf detects no error in $good ( $n ) "
2015-05-05 03:39:07 -04:00
ret = 0
2021-04-21 07:52:15 -04:00
if ! $FEATURETEST --with-libnghttp2; then
case $good in
2021-08-24 00:06:48 -04:00
good-doh-*.conf) continue ; ;
good-dot-*.conf) continue ; ;
2023-11-14 13:33:30 -05:00
good-proxy-*doh*.conf) continue ; ;
bad-proxy-*doh*.conf) continue ; ;
2021-04-21 07:52:15 -04:00
esac
2024-07-01 05:05:18 -04:00
else
2023-12-12 11:37:30 -05:00
case $good in
good-tls-cipher-suites-*.conf) continue ; ;
esac
2021-04-21 07:52:15 -04:00
fi
2023-06-09 04:57:34 -04:00
{
$CHECKCONF $good >checkconf.out$n 2>& 1
rc = $?
} || true
if [ $rc -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2015-05-05 03:39:07 -04:00
status = $(( status + ret))
done
2020-12-09 08:14:43 -05:00
for lmdb in lmdb-*.conf; do
n = $(( n + 1 ))
ret = 0
2023-10-24 08:43:14 -04:00
2023-06-09 04:57:34 -04:00
if $FEATURETEST --with-lmdb; then
2020-12-09 08:14:43 -05:00
echo_i " checking that named-checkconf detects no error in $lmdb ( $n ) "
2023-06-09 04:57:34 -04:00
{
$CHECKCONF $lmdb >checkconf.out$n 2>& 1
rc = $?
} || true
if [ $rc -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2020-12-09 08:14:43 -05:00
else
echo_i " checking that named-checkconf detects error in $lmdb ( $n ) "
2023-06-09 04:57:34 -04:00
{
$CHECKCONF $lmdb >checkconf.out$n 2>& 1
rc = $?
} || true
if [ $rc -eq 0 ] ; then
echo_i "failed"
ret = 1
2020-12-09 08:14:43 -05:00
fi
2023-10-24 08:43:14 -04:00
fi
2020-12-09 08:14:43 -05:00
status = $(( status + ret))
done
2019-01-21 02:50:17 -05:00
n = $(( n + 1 ))
echo_i " checking that ancient options report a fatal error ( $n ) "
ret = 0
$CHECKCONF ancient.conf >ancient.out 2>& 1 && ret = 1
grep "no longer exists" ancient.out >/dev/null || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
2019-01-21 02:50:17 -05:00
status = $(( status + ret))
2024-09-04 11:48:04 -04:00
for ancient_conf in ancient-*.conf; do
ancient_opt = " ${ ancient_conf #ancient- } "
ancient_opt = " ${ ancient_opt %.conf } "
n = $(( n + 1 ))
echo_i " checking that ancient \" ${ ancient_opt } \" option report a fatal error ( $n ) "
ret = 0
$CHECKCONF ${ ancient_conf } >" ${ ancient_conf } .out " 2>& 1 && ret = 1
grep "no longer exists" " ${ ancient_conf } .out " >/dev/null || ret = 1
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
status = $(( status + ret))
done
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " checking that named-checkconf -z catches missing hint file ( $n ) "
2013-11-25 15:26:53 -05:00
ret = 0
2015-01-08 03:19:12 -05:00
$CHECKCONF -z hint-nofile.conf >hint-nofile.out 2>& 1 && ret = 1
grep "could not configure root hints from 'nonexistent.db': file not found" hint-nofile.out >/dev/null || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
2013-11-25 15:26:53 -05:00
status = $(( status + ret))
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " checking that named-checkconf catches range errors ( $n ) "
2013-03-22 15:27:54 -04:00
ret = 0
2019-06-05 22:50:47 -04:00
$CHECKCONF range.conf >checkconf.out$n 2>& 1 && ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
2013-03-22 15:27:54 -04:00
status = $(( status + ret))
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " checking that named-checkconf warns of notify inconsistencies ( $n ) "
2014-01-20 18:53:51 -05:00
ret = 0
2019-06-05 22:50:47 -04:00
$CHECKCONF notify.conf >checkconf.out$n 2>& 1
warnings = $( grep "'notify' is disabled" <checkconf.out$n | wc -l)
2014-01-20 18:53:51 -05:00
[ $warnings -eq 3 ] || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
2014-01-20 18:53:51 -05:00
status = $(( status + ret))
2019-06-25 03:41:51 -04:00
n = $(( n + 1 ))
echo_i " checking named-checkconf deprecate warnings ( $n ) "
ret = 0
2023-07-03 19:22:04 -04:00
$CHECKCONF deprecated.conf >checkconf.out$n .1 2>& 1 || ret = 1
2022-07-11 16:38:51 -04:00
grep "option 'max-zone-ttl' is deprecated" <checkconf.out$n .1 >/dev/null || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
2019-06-25 03:41:51 -04:00
status = $(( status + ret))
# set -i to ignore deprecate warnings
2024-03-01 03:34:32 -05:00
$CHECKCONF -i deprecated.conf 2>& 1 | grep_v "rrset-order: order 'fixed' was disabled at compilation time" >checkconf.out$n .2
grep '^.+$' <checkconf.out$n .2 >/dev/null && ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
2019-06-25 03:41:51 -04:00
status = $(( status + ret))
2020-11-05 11:07:47 -05:00
n = $(( n + 1 ))
echo_i " checking named-checkconf servestale warnings ( $n ) "
ret = 0
$CHECKCONF servestale.stale-refresh-time.0.conf >checkconf.out$n .1 2>& 1
grep "'stale-refresh-time' should either be 0 or otherwise 30 seconds or higher" <checkconf.out$n .1 >/dev/null && ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
2020-11-05 11:07:47 -05:00
status = $(( status + ret))
ret = 0
$CHECKCONF servestale.stale-refresh-time.29.conf >checkconf.out$n .1 2>& 1
grep "'stale-refresh-time' should either be 0 or otherwise 30 seconds or higher" <checkconf.out$n .1 >/dev/null || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
2020-11-05 11:07:47 -05:00
status = $(( status + ret))
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " range checking fields that do not allow zero ( $n ) "
2012-08-14 01:39:42 -04:00
ret = 0
for field in max-retry-time min-retry-time max-refresh-time min-refresh-time; do
cat >badzero.conf <<EOF
options {
$field 0;
} ;
EOF
2023-06-09 04:57:34 -04:00
{
$CHECKCONF badzero.conf >checkconf.out$n .1 2>& 1
rc = $?
} || true
[ $rc -eq 1 ] || {
echo_i " options $field failed "
ret = 1
}
2012-08-14 01:39:42 -04:00
cat >badzero.conf <<EOF
view dummy {
$field 0;
} ;
EOF
2023-06-09 04:57:34 -04:00
{
$CHECKCONF badzero.conf >checkconf.out$n .2 2>& 1
rc = $?
} || true
[ $rc -eq 1 ] || {
echo_i " view $field failed "
ret = 1
}
2012-08-14 01:39:42 -04:00
cat >badzero.conf <<EOF
2012-08-15 23:53:47 -04:00
options {
$field 0;
} ;
view dummy {
} ;
EOF
2023-06-09 04:57:34 -04:00
{
$CHECKCONF badzero.conf >checkconf.out$n .3 2>& 1
rc = $?
} || true
[ $rc -eq 1 ] || {
echo_i " options + view $field failed "
ret = 1
}
2012-08-15 23:53:47 -04:00
cat >badzero.conf <<EOF
2012-08-14 01:39:42 -04:00
zone dummy {
2020-06-30 16:10:59 -04:00
type secondary;
primaries { 0.0.0.0; } ;
2012-08-14 01:39:42 -04:00
$field 0;
} ;
EOF
2023-06-09 04:57:34 -04:00
{
$CHECKCONF badzero.conf >checkconf.out$n .4 2>& 1
rc = $?
} || true
[ $rc -eq 1 ] || {
echo_i " zone $field failed "
ret = 1
}
2012-08-14 01:39:42 -04:00
done
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
2012-08-14 01:39:42 -04:00
status = $(( status + ret))
2017-10-29 17:50:00 -04:00
n = $(( n + 1 ))
2020-06-30 16:10:59 -04:00
echo_i " checking options allowed in inline-signing secondaries ( $n ) "
2012-10-26 19:14:59 -04:00
ret = 0
2023-06-22 11:34:44 -04:00
$CHECKCONF bad-dnssec.conf >checkconf.out$n .2 2>& 1 && ret = 1
2019-06-05 22:50:47 -04:00
l = $( grep "dnssec-loadkeys-interval.*requires inline" <checkconf.out$n .2 | wc -l)
2016-11-02 02:47:51 -04:00
[ $l -eq 1 ] || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
2013-06-03 21:34:03 -04:00
status = $(( status + ret))
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2020-06-30 16:10:59 -04:00
echo_i " check file + inline-signing for secondary zones ( $n ) "
2023-06-22 11:34:44 -04:00
$CHECKCONF inline-no.conf >checkconf.out$n .1 2>& 1 && ret = 1
2019-06-05 22:50:47 -04:00
l = $( grep "missing 'file' entry" <checkconf.out$n .1 | wc -l)
2016-11-02 02:47:51 -04:00
[ $l -eq 0 ] || ret = 1
2023-06-22 11:34:44 -04:00
$CHECKCONF inline-good.conf >checkconf.out$n .2 2>& 1 || ret = 1
2019-06-05 22:50:47 -04:00
l = $( grep "missing 'file' entry" <checkconf.out$n .2 | wc -l)
2016-11-02 02:47:51 -04:00
[ $l -eq 0 ] || ret = 1
2023-06-22 11:34:44 -04:00
$CHECKCONF inline-bad.conf >checkconf.out$n .3 2>& 1 && ret = 1
2019-06-05 22:50:47 -04:00
l = $( grep "missing 'file' entry" <checkconf.out$n .3 | wc -l)
2016-11-02 02:47:51 -04:00
[ $l -eq 1 ] || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
2013-06-03 21:34:03 -04:00
status = $(( status + ret))
2012-12-06 15:39:52 -05:00
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " checking named-checkconf DLZ warnings ( $n ) "
2012-12-06 15:39:52 -05:00
ret = 0
2023-06-22 11:34:44 -04:00
$CHECKCONF dlz-bad.conf >checkconf.out$n 2>& 1 && ret = 1
2019-06-05 22:50:47 -04:00
grep "'dlz' and 'database'" <checkconf.out$n >/dev/null || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
2012-10-26 19:14:59 -04:00
status = $(( status + ret))
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " checking for missing key directory warning ( $n ) "
2013-12-20 17:57:03 -05:00
ret = 0
rm -rf test.keydir
2022-02-09 06:19:06 -05:00
rm -rf test.keystoredir
2019-06-05 22:50:47 -04:00
$CHECKCONF warn-keydir.conf >checkconf.out$n .1 2>& 1
l = $( grep "'test.keydir' does not exist" <checkconf.out$n .1 | wc -l)
2016-11-02 02:47:51 -04:00
[ $l -eq 1 ] || ret = 1
2022-02-09 06:19:06 -05:00
l = $( grep "'test.keystoredir' does not exist" <checkconf.out$n .1 | wc -l)
[ $l -eq 1 ] || ret = 1
2013-12-20 17:57:03 -05:00
touch test.keydir
2022-02-09 06:19:06 -05:00
touch test.keystoredir
2019-06-05 22:50:47 -04:00
$CHECKCONF warn-keydir.conf >checkconf.out$n .2 2>& 1
l = $( grep "'test.keydir' is not a directory" <checkconf.out$n .2 | wc -l)
2016-11-02 02:47:51 -04:00
[ $l -eq 1 ] || ret = 1
2022-02-09 06:19:06 -05:00
l = $( grep "'test.keystoredir' is not a directory" <checkconf.out$n .2 | wc -l)
[ $l -eq 1 ] || ret = 1
2013-12-20 17:57:03 -05:00
rm -f test.keydir
2022-02-09 06:19:06 -05:00
rm -f test.keystoredir
2013-12-20 17:57:03 -05:00
mkdir test.keydir
2022-02-09 06:19:06 -05:00
mkdir test.keystoredir
2019-06-05 22:50:47 -04:00
$CHECKCONF warn-keydir.conf >checkconf.out$n .3 2>& 1
l = $( grep "key-directory" <checkconf.out$n .3 | wc -l)
2016-11-02 02:47:51 -04:00
[ $l -eq 0 ] || ret = 1
2022-02-09 06:19:06 -05:00
l = $( grep "key-store directory" <checkconf.out$n .3 | wc -l)
[ $l -eq 0 ] || ret = 1
2013-12-20 17:57:03 -05:00
rm -rf test.keydir
2022-02-09 06:19:06 -05:00
rm -rf test.keystoredir
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
2022-02-09 06:19:06 -05:00
status = $(( status + ret))
2014-02-19 02:26:50 -05:00
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " checking that named-checkconf -z catches conflicting ttl with max-ttl ( $n ) "
2014-02-19 02:26:50 -05:00
ret = 0
2023-06-22 11:34:44 -04:00
$CHECKCONF -z max-ttl.conf >check.out 2>& 1 && ret = 1
grep 'TTL 900 exceeds configured max-zone-ttl 600' check.out >/dev/null 2>& 1 || ret = 1
2014-02-19 02:26:50 -05:00
grep 'TTL 900 exceeds configured max-zone-ttl 600' check.out >/dev/null 2>& 1 || ret = 1
grep 'TTL 900 exceeds configured max-zone-ttl 600' check.out >/dev/null 2>& 1 || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2014-02-19 02:26:50 -05:00
status = $(( status + ret))
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " checking that named-checkconf -z catches invalid max-ttl ( $n ) "
2014-02-19 02:26:50 -05:00
ret = 0
2019-06-05 22:50:47 -04:00
$CHECKCONF -z max-ttl-bad.conf >checkconf.out$n 2>& 1 && ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2013-12-20 17:57:03 -05:00
status = $(( status + ret))
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " checking that named-checkconf -z skips zone check with alternate databases ( $n ) "
2014-04-07 16:29:56 -04:00
ret = 0
2019-06-05 22:50:47 -04:00
$CHECKCONF -z altdb.conf >checkconf.out$n 2>& 1 || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2014-04-07 16:29:56 -04:00
status = $(( status + ret))
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " checking that named-checkconf -z skips zone check with DLZ ( $n ) "
2014-04-07 16:29:56 -04:00
ret = 0
2019-06-05 22:50:47 -04:00
$CHECKCONF -z altdlz.conf >checkconf.out$n 2>& 1 || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2014-04-07 16:29:56 -04:00
status = $(( status + ret))
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " checking that named-checkconf -z fails on view with ANY class ( $n ) "
2016-02-08 03:26:19 -05:00
ret = 0
2019-06-05 22:50:47 -04:00
$CHECKCONF -z view-class-any1.conf >checkconf.out$n 2>& 1 && ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2016-02-08 03:26:19 -05:00
status = $(( status + ret))
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " checking that named-checkconf -z fails on view with CLASS255 class ( $n ) "
2016-02-08 03:26:19 -05:00
ret = 0
2019-06-05 22:50:47 -04:00
$CHECKCONF -z view-class-any2.conf >checkconf.out$n 2>& 1 && ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2016-02-08 03:26:19 -05:00
status = $(( status + ret))
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " checking that named-checkconf -z passes on view with IN class ( $n ) "
2016-02-08 03:26:19 -05:00
ret = 0
2019-06-05 22:50:47 -04:00
$CHECKCONF -z view-class-in1.conf >checkconf.out$n 2>& 1 || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2016-02-08 03:26:19 -05:00
status = $(( status + ret))
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " checking that named-checkconf -z passes on view with CLASS1 class ( $n ) "
2016-02-08 03:26:19 -05:00
ret = 0
2019-06-05 22:50:47 -04:00
$CHECKCONF -z view-class-in2.conf >checkconf.out$n 2>& 1 || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2016-02-08 03:26:19 -05:00
status = $(( status + ret))
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " check that check-names fails as configured ( $n ) "
2014-08-28 00:36:13 -04:00
ret = 0
2016-11-02 02:47:51 -04:00
$CHECKCONF -z check-names-fail.conf >checkconf.out$n 2>& 1 && ret = 1
2019-06-05 22:50:47 -04:00
grep "near '_underscore': bad name (check-names)" <checkconf.out$n >/dev/null || ret = 1
2016-11-02 02:47:51 -04:00
grep "zone check-names/IN: loaded serial" <checkconf.out$n >/dev/null && ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2014-08-28 00:36:13 -04:00
status = $(( status + ret))
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " check that check-mx fails as configured ( $n ) "
2014-08-28 00:36:13 -04:00
ret = 0
2016-11-02 02:47:51 -04:00
$CHECKCONF -z check-mx-fail.conf >checkconf.out$n 2>& 1 && ret = 1
2019-06-05 22:50:47 -04:00
grep "near '10.0.0.1': MX is an address" <checkconf.out$n >/dev/null || ret = 1
2016-11-02 02:47:51 -04:00
grep "zone check-mx/IN: loaded serial" <checkconf.out$n >/dev/null && ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2014-08-28 00:36:13 -04:00
status = $(( status + ret))
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " check that check-dup-records fails as configured ( $n ) "
2014-08-28 00:36:13 -04:00
ret = 0
2016-11-02 02:47:51 -04:00
$CHECKCONF -z check-dup-records-fail.conf >checkconf.out$n 2>& 1 && ret = 1
2019-06-05 22:50:47 -04:00
grep "has semantically identical records" <checkconf.out$n >/dev/null || ret = 1
2016-11-02 02:47:51 -04:00
grep "zone check-dup-records/IN: loaded serial" <checkconf.out$n >/dev/null && ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2014-08-28 00:36:13 -04:00
status = $(( status + ret))
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " check that check-mx fails as configured ( $n ) "
2014-08-28 00:36:13 -04:00
ret = 0
2016-11-02 02:47:51 -04:00
$CHECKCONF -z check-mx-fail.conf >checkconf.out$n 2>& 1 && ret = 1
2019-06-05 22:50:47 -04:00
grep "failed: MX is an address" <checkconf.out$n >/dev/null || ret = 1
2016-11-02 02:47:51 -04:00
grep "zone check-mx/IN: loaded serial" <checkconf.out$n >/dev/null && ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2014-08-28 00:36:13 -04:00
status = $(( status + ret))
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " check that check-mx-cname fails as configured ( $n ) "
2014-08-28 00:36:13 -04:00
ret = 0
2016-11-02 02:47:51 -04:00
$CHECKCONF -z check-mx-cname-fail.conf >checkconf.out$n 2>& 1 && ret = 1
2019-06-05 22:50:47 -04:00
grep "MX.* is a CNAME (illegal)" <checkconf.out$n >/dev/null || ret = 1
2016-11-02 02:47:51 -04:00
grep "zone check-mx-cname/IN: loaded serial" <checkconf.out$n >/dev/null && ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2014-08-28 00:36:13 -04:00
status = $(( status + ret))
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " check that check-srv-cname fails as configured ( $n ) "
2014-08-28 00:36:13 -04:00
ret = 0
2016-11-02 02:47:51 -04:00
$CHECKCONF -z check-srv-cname-fail.conf >checkconf.out$n 2>& 1 && ret = 1
2019-06-05 22:50:47 -04:00
grep "SRV.* is a CNAME (illegal)" <checkconf.out$n >/dev/null || ret = 1
2016-11-02 02:47:51 -04:00
grep "zone check-mx-cname/IN: loaded serial" <checkconf.out$n >/dev/null && ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2014-08-28 00:36:13 -04:00
status = $(( status + ret))
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " check that named-checkconf -z handles in-view ( $n ) "
2015-09-09 03:56:23 -04:00
ret = 0
2016-11-02 02:47:51 -04:00
$CHECKCONF -z in-view-good.conf >checkconf.out$n 2>& 1 || ret = 1
grep "zone shared.example/IN: loaded serial" <checkconf.out$n >/dev/null || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2015-09-09 03:56:23 -04:00
status = $(( status + ret))
2020-04-30 16:17:37 -04:00
n = $(( n + 1 ))
echo_i " check that named-checkconf -z returns error when a later view is okay ( $n ) "
ret = 0
$CHECKCONF -z check-missing-zone.conf >checkconf.out$n 2>& 1 && ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2020-04-30 16:17:37 -04:00
status = $(( status + ret))
2016-11-02 02:47:51 -04:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " check that named-checkconf prints max-cache-size <percentage> correctly ( $n ) "
2015-09-28 05:08:50 -04:00
ret = 0
2016-11-02 02:47:51 -04:00
$CHECKCONF -p max-cache-size-good.conf >checkconf.out$n 2>& 1 || ret = 1
2019-06-05 22:50:47 -04:00
grep "max-cache-size 60%;" <checkconf.out$n >/dev/null || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2016-11-02 02:47:51 -04:00
status = $(( status + ret))
n = $(( n + 1 ))
2020-05-05 15:48:31 -04:00
echo_i " check that named-checkconf -l prints out the zone list ( $n ) "
2016-11-02 02:47:51 -04:00
ret = 0
$CHECKCONF -l good.conf \
2023-01-06 20:01:06 -05:00
| grep -v "is deprecated" \
2016-11-02 02:47:51 -04:00
| grep -v "is not implemented" \
2021-09-13 20:55:34 -04:00
| grep -v "is not recommended" \
2019-01-21 02:50:17 -05:00
| grep -v "no longer exists" \
2016-11-02 02:47:51 -04:00
| grep -v "is obsolete" >checkconf.out$n || ret = 1
2019-06-05 22:50:47 -04:00
diff good.zonelist checkconf.out$n >diff.out$n || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2015-09-28 05:08:50 -04:00
status = $(( status + ret))
2018-02-08 20:04:45 -05:00
n = $(( n + 1 ))
2018-02-20 18:43:27 -05:00
echo_i " check that the 2010 ICANN ROOT KSK without the 2017 ICANN ROOT KSK generates a warning ( $n ) "
2018-02-08 20:04:45 -05:00
ret = 0
$CHECKCONF check-root-ksk-2010.conf >checkconf.out$n 2>/dev/null || ret = 1
[ -s checkconf.out$n ] || ret = 1
2019-06-05 22:50:47 -04:00
grep "key without the updated" <checkconf.out$n >/dev/null || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2018-02-08 20:04:45 -05:00
status = $(( status + ret))
2019-02-07 18:10:41 -05:00
n = $(( n + 1 ))
echo_i " check that the 2010 ICANN ROOT KSK with the 2017 ICANN ROOT KSK does not generate a warning ( $n ) "
2018-02-08 20:04:45 -05:00
ret = 0
$CHECKCONF check-root-ksk-both.conf >checkconf.out$n 2>/dev/null || ret = 1
[ -s checkconf.out$n ] && ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2018-02-08 20:04:45 -05:00
status = $(( status + ret))
2019-08-30 06:11:56 -04:00
n = $(( n + 1 ))
2018-08-15 19:59:45 -04:00
echo_i " check that the 2017 ICANN ROOT KSK alone does not generate a warning ( $n ) "
2018-02-08 20:04:45 -05:00
ret = 0
$CHECKCONF check-root-ksk-2017.conf >checkconf.out$n 2>/dev/null || ret = 1
[ -s checkconf.out$n ] && ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2018-02-08 20:04:45 -05:00
status = $(( status + ret))
2019-08-30 06:11:56 -04:00
n = $(( n + 1 ))
2018-10-03 14:46:06 -04:00
echo_i " check that a static root key generates a warning ( $n ) "
ret = 0
$CHECKCONF check-root-static-key.conf >checkconf.out$n 2>/dev/null || ret = 1
2019-09-16 02:14:51 -04:00
grep "static entry for the root zone WILL FAIL" checkconf.out$n >/dev/null || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2019-09-16 02:14:51 -04:00
status = $(( status + ret))
n = $(( n + 1 ))
echo_i " check that a static root DS trust anchor generates a warning ( $n ) "
ret = 0
$CHECKCONF check-root-static-ds.conf >checkconf.out$n 2>/dev/null || ret = 1
grep "static entry for the root zone WILL FAIL" checkconf.out$n >/dev/null || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2018-10-03 14:46:06 -04:00
status = $(( status + ret))
Introduce dnssec-policy configuration
This commit introduces the initial `dnssec-policy` configuration
statement. It has an initial set of options to deal with signature
and key maintenance.
Add some checks to ensure that dnssec-policy is configured at the
right locations, and that policies referenced to in zone statements
actually exist.
Add some checks that when a user adds the new `dnssec-policy`
configuration, it will no longer contain existing DNSSEC
configuration options. Specifically: `inline-signing`,
`auto-dnssec`, `dnssec-dnskey-kskonly`, `dnssec-secure-to-insecure`,
`update-check-ksk`, `dnssec-update-mode`, `dnskey-sig-validity`,
and `sig-validity-interval`.
Test a good kasp configuration, and some bad configurations.
2019-09-02 10:24:48 -04:00
n = $(( n + 1 ))
2020-02-06 15:13:20 -05:00
echo_i " checking named-checkconf kasp errors ( $n ) "
Introduce dnssec-policy configuration
This commit introduces the initial `dnssec-policy` configuration
statement. It has an initial set of options to deal with signature
and key maintenance.
Add some checks to ensure that dnssec-policy is configured at the
right locations, and that policies referenced to in zone statements
actually exist.
Add some checks that when a user adds the new `dnssec-policy`
configuration, it will no longer contain existing DNSSEC
configuration options. Specifically: `inline-signing`,
`auto-dnssec`, `dnssec-dnskey-kskonly`, `dnssec-secure-to-insecure`,
`update-check-ksk`, `dnssec-update-mode`, `dnskey-sig-validity`,
and `sig-validity-interval`.
Test a good kasp configuration, and some bad configurations.
2019-09-02 10:24:48 -04:00
ret = 0
2020-02-06 15:13:20 -05:00
$CHECKCONF kasp-and-other-dnssec-options.conf >checkconf.out$n 2>& 1 && ret = 1
2022-10-05 08:44:09 -04:00
grep "'inline-signing yes;' must also be configured explicitly for zones using dnssec-policy without a configured 'allow-update' or 'update-policy'" <checkconf.out$n >/dev/null || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
Introduce dnssec-policy configuration
This commit introduces the initial `dnssec-policy` configuration
statement. It has an initial set of options to deal with signature
and key maintenance.
Add some checks to ensure that dnssec-policy is configured at the
right locations, and that policies referenced to in zone statements
actually exist.
Add some checks that when a user adds the new `dnssec-policy`
configuration, it will no longer contain existing DNSSEC
configuration options. Specifically: `inline-signing`,
`auto-dnssec`, `dnssec-dnskey-kskonly`, `dnssec-secure-to-insecure`,
`update-check-ksk`, `dnssec-update-mode`, `dnskey-sig-validity`,
and `sig-validity-interval`.
Test a good kasp configuration, and some bad configurations.
2019-09-02 10:24:48 -04:00
status = $(( status + ret))
2020-10-13 11:48:22 -04:00
n = $(( n + 1 ))
echo_i " checking named-checkconf kasp nsec3 iterations errors ( $n ) "
ret = 0
2024-01-24 09:38:55 -05:00
if [ $RSASHA1_SUPPORTED = 0 ] ; then
2021-12-22 22:09:36 -05:00
conf = kasp-bad-nsec3-iter-fips.conf
expect = 2
else
conf = kasp-bad-nsec3-iter.conf
expect = 3
fi
$CHECKCONF $conf >checkconf.out$n 2>& 1 && ret = 1
2023-11-22 06:32:55 -05:00
grep "dnssec-policy: nsec3 iterations value 1 not allowed, must be zero" <checkconf.out$n >/dev/null || ret = 1
2020-10-13 11:48:22 -04:00
lines = $( wc -l <" checkconf.out $n " )
2021-12-22 22:09:36 -05:00
if [ $lines -ne $expect ] ; then ret = 1; fi
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
2020-10-13 11:48:22 -04:00
status = $(( status + ret))
2020-10-19 04:19:52 -04:00
n = $(( n + 1 ))
echo_i " checking named-checkconf kasp nsec3 algorithm errors ( $n ) "
ret = 0
$CHECKCONF kasp-bad-nsec3-alg.conf >checkconf.out$n 2>& 1 && ret = 1
2024-01-24 09:38:55 -05:00
if [ $RSASHA1_SUPPORTED = 0 ] ; then
2022-08-25 00:14:42 -04:00
grep "dnssec-policy: algorithm rsasha1 not supported" <checkconf.out$n >/dev/null || ret = 1
2022-07-11 19:09:57 -04:00
else
grep "dnssec-policy: cannot use nsec3 with algorithm 'RSASHA1'" <checkconf.out$n >/dev/null || ret = 1
fi
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
2020-10-19 04:19:52 -04:00
status = $(( status + ret))
2020-10-13 11:48:22 -04:00
n = $(( n + 1 ))
echo_i " checking named-checkconf kasp key errors ( $n ) "
ret = 0
$CHECKCONF kasp-bad-keylen.conf >checkconf.out$n 2>& 1 && ret = 1
2022-07-11 19:09:57 -04:00
grep "dnssec-policy: key with algorithm rsasha256 has invalid key length 511" <checkconf.out$n >/dev/null || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
2020-10-13 11:48:22 -04:00
status = $(( status + ret))
2024-03-22 06:48:53 -04:00
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))
2022-05-06 10:54:49 -04:00
n = $(( n + 1 ))
echo_i " checking named-checkconf kasp signatures refresh errors ( $n ) "
ret = 0
$CHECKCONF kasp-bad-signatures-refresh.conf >checkconf.out$n 2>& 1 && ret = 1
grep "dnssec-policy: policy 'bad-sigrefresh' signatures-refresh must be at most 90% of the signatures-validity" <checkconf.out$n >/dev/null || ret = 1
grep "dnssec-policy: policy 'bad-sigrefresh-dnskey' signatures-refresh must be at most 90% of the signatures-validity-dnskey" <checkconf.out$n >/dev/null || ret = 1
lines = $( wc -l <" checkconf.out $n " )
2022-08-02 09:07:49 -04:00
if [ $lines -ne 2 ] ; then ret = 1; fi
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
2022-05-06 10:54:49 -04:00
status = $(( status + ret))
2022-05-09 07:56:45 -04:00
n = $(( n + 1 ))
echo_i " checking named-checkconf kasp key lifetime errors ( $n ) "
ret = 0
$CHECKCONF kasp-bad-lifetime.conf >checkconf.out$n 2>& 1 && ret = 1
lines = $( grep "dnssec-policy: key lifetime is shorter than the time it takes to do a rollover" <checkconf.out$n | wc -l) || ret = 1
2022-08-02 09:07:49 -04:00
if [ $lines -ne 3 ] ; then ret = 1; fi
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
2022-05-09 07:56:45 -04:00
status = $(( status + ret))
2020-10-13 11:48:22 -04:00
n = $(( n + 1 ))
echo_i " checking named-checkconf kasp predefined key length ( $n ) "
2020-02-06 11:43:54 -05:00
ret = 0
2020-02-06 15:13:20 -05:00
$CHECKCONF kasp-ignore-keylen.conf >checkconf.out$n 2>& 1 || ret = 1
grep "dnssec-policy: key algorithm ecdsa256 has predefined length; ignoring length value 2048" <checkconf.out$n >/dev/null || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
2020-02-06 11:43:54 -05:00
status = $(( status + ret))
2022-05-06 10:08:39 -04:00
n = $(( n + 1 ))
echo_i " checking named-checkconf kasp warns about weird policies ( $n ) "
ret = 0
$CHECKCONF kasp-warning.conf >checkconf.out$n 2>& 1 || ret = 1
grep "dnssec-policy: algorithm 8 has multiple keys with ZSK role" <checkconf.out$n >/dev/null || ret = 1
grep "dnssec-policy: algorithm 8 has multiple keys with ZSK role" <checkconf.out$n >/dev/null || ret = 1
grep "dnssec-policy: algorithm 13 has multiple keys with KSK role" <checkconf.out$n >/dev/null || ret = 1
grep "dnssec-policy: algorithm 13 has multiple keys with ZSK role" <checkconf.out$n >/dev/null || ret = 1
2022-05-06 10:21:16 -04:00
grep "dnssec-policy: key lifetime is shorter than 30 days" <checkconf.out$n >/dev/null || ret = 1
2022-05-06 10:08:39 -04:00
lines = $( wc -l <" checkconf.out $n " )
2022-08-02 09:07:49 -04:00
if [ $lines -ne 5 ] ; then ret = 1; fi
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
2022-05-06 10:08:39 -04:00
status = $(( status + ret))
Introduce dnssec-policy configuration
This commit introduces the initial `dnssec-policy` configuration
statement. It has an initial set of options to deal with signature
and key maintenance.
Add some checks to ensure that dnssec-policy is configured at the
right locations, and that policies referenced to in zone statements
actually exist.
Add some checks that when a user adds the new `dnssec-policy`
configuration, it will no longer contain existing DNSSEC
configuration options. Specifically: `inline-signing`,
`auto-dnssec`, `dnssec-dnskey-kskonly`, `dnssec-secure-to-insecure`,
`update-check-ksk`, `dnssec-update-mode`, `dnskey-sig-validity`,
and `sig-validity-interval`.
Test a good kasp configuration, and some bad configurations.
2019-09-02 10:24:48 -04:00
n = $(( n + 1 ))
echo_i " check that a good 'kasp' configuration is accepted ( $n ) "
ret = 0
$CHECKCONF good-kasp.conf >checkconf.out$n 2>/dev/null || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
Introduce dnssec-policy configuration
This commit introduces the initial `dnssec-policy` configuration
statement. It has an initial set of options to deal with signature
and key maintenance.
Add some checks to ensure that dnssec-policy is configured at the
right locations, and that policies referenced to in zone statements
actually exist.
Add some checks that when a user adds the new `dnssec-policy`
configuration, it will no longer contain existing DNSSEC
configuration options. Specifically: `inline-signing`,
`auto-dnssec`, `dnssec-dnskey-kskonly`, `dnssec-secure-to-insecure`,
`update-check-ksk`, `dnssec-update-mode`, `dnskey-sig-validity`,
and `sig-validity-interval`.
Test a good kasp configuration, and some bad configurations.
2019-09-02 10:24:48 -04:00
status = $(( status + ret))
n = $(( n + 1 ))
echo_i " checking that named-checkconf prints a known good kasp config ( $n ) "
ret = 0
awk 'BEGIN { ok = 0; } /cut here/ { ok = 1; getline } ok == 1 { print }' good-kasp.conf >good-kasp.conf.in
[ -s good-kasp.conf.in ] || ret = 1
$CHECKCONF -p good-kasp.conf.in | grep -v '^good-kasp.conf.in:' >good-kasp.conf.out 2>& 1 || ret = 1
cmp good-kasp.conf.in good-kasp.conf.out || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then echo_i "failed" ; fi
Introduce dnssec-policy configuration
This commit introduces the initial `dnssec-policy` configuration
statement. It has an initial set of options to deal with signature
and key maintenance.
Add some checks to ensure that dnssec-policy is configured at the
right locations, and that policies referenced to in zone statements
actually exist.
Add some checks that when a user adds the new `dnssec-policy`
configuration, it will no longer contain existing DNSSEC
configuration options. Specifically: `inline-signing`,
`auto-dnssec`, `dnssec-dnskey-kskonly`, `dnssec-secure-to-insecure`,
`update-check-ksk`, `dnssec-update-mode`, `dnskey-sig-validity`,
and `sig-validity-interval`.
Test a good kasp configuration, and some bad configurations.
2019-09-02 10:24:48 -04:00
status = $(( status + ret))
2020-02-21 13:53:08 -05:00
n = $(( n + 1 ))
echo_i " check that max-ixfr-ratio 100% generates a warning ( $n ) "
ret = 0
$CHECKCONF warn-maxratio1.conf >checkconf.out$n 2>/dev/null || ret = 1
grep "exceeds 100%" <checkconf.out$n >/dev/null || ret = 1
2022-08-02 09:07:49 -04:00
if [ $ret -ne 0 ] ; then
echo_i "failed"
ret = 1
fi
2020-02-21 13:53:08 -05:00
status = $(( status + ret))
2022-11-09 06:12:20 -05:00
n = $(( n + 1 ))
echo_i " check that 'check-wildcard no;' succeeds as configured ( $n ) "
ret = 0
$CHECKCONF -z check-wildcard-no.conf >checkconf.out$n 2>& 1 || ret = 1
grep -F "warning: ownername 'foo.*.check-wildcard' contains an non-terminal wildcard" checkconf.out$n >/dev/null && ret = 1
if [ $ret != 0 ] ; then
echo_i "failed"
ret = 1
fi
status = $(( status + ret))
n = $(( n + 1 ))
echo_i " check that 'check-wildcard yes;' warns as configured ( $n ) "
ret = 0
$CHECKCONF -z check-wildcard.conf >checkconf.out$n 2>& 1 || ret = 1
grep -F "warning: ownername 'foo.*.check-wildcard' contains an non-terminal wildcard" checkconf.out$n >/dev/null || ret = 1
if [ $ret != 0 ] ; then
echo_i "failed"
ret = 1
fi
status = $(( status + ret))
2018-02-20 18:43:27 -05:00
echo_i " exit status: $status "
2016-06-13 23:48:39 -04:00
[ $status -eq 0 ] || exit 1