Skip to content

Commit 0006355

Browse files
committed
ci: unbound: revert do dns-root-data package
A prior test seems to have not been done careful: The Unbound daemon itself does NOT create the root trust anchors from internal data if missing. Only unbound-anchor does this. There are several options to bootstrap it: - Ship unbound-anchor and add "Provides" + "Conflicts" for Debian's unbound-anchor package. - Bootstrap them from online data, though there is no DNSKEY format file with the exact needed data, but they would need to be extracted from https://www.internic.net/domain/root.zone (DNSKEY format, but large document) or https://data.iana.org/root-anchors/root-anchors.xml (exact needed keys, but XML format), and we'd again introduce the attack vector as of download with HTTPS authenticity only. - Ship it, hardcoded in our build script. - Use again the dns-root-data package from Debian. For now, since we do not distribute our package yet, hence need to assure dns-root-data is installed anyway on dietpi-software Unbound installs. Trusting Debian and the additional APT-side authenticity is probably easier in any case. We will go with this for now, aligning with the Debian package. Once we ship it with our own APT repository, we can again think about shipping the initial key with the package itself, for easier maintenance by running unbound-anchor within the build script. However, instead of updating the anchors on every service start, we bootstrap them only once on package install, if missing, generally verifying that Unbound can keep them updated even after long downtimes.
1 parent 85fbce0 commit 0006355

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.build/software/unbound/build.bash

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ header=()
77
[[ $GH_TOKEN ]] && header=('-H' "Authorization: token $GH_TOKEN")
88

99
# APT dependencies
10-
adeps_build=('make' 'gcc' 'bison' 'flex' 'file' 'pkg-config' 'libc6-dev' 'libsystemd-dev' 'libssl-dev' 'libevent-dev' 'libexpat1-dev' 'libhiredis-dev' 'libnghttp2-dev' 'protobuf-c-compiler' 'libprotobuf-c-dev')
11-
adeps=('libc6' 'libsystemd0' 'libevent-2.1-7' 'libnghttp2-14' 'libprotobuf-c1')
10+
adeps_build=('make' 'gcc' 'bison' 'flex' 'file' 'pkg-config' 'libc6-dev' 'libsystemd-dev' 'libssl-dev' 'libevent-dev' 'libexpat1-dev' 'libhiredis-dev' 'libnghttp2-dev' 'protobuf-c-compiler' 'libprotobuf-c-dev' 'dns-root-data')
11+
adeps=('libc6' 'libsystemd0' 'libevent-2.1-7' 'libnghttp2-14' 'libprotobuf-c1' 'dns-root-data')
1212
(( $G_DISTRO > 6 )) && adeps+=('libssl3') || adeps+=('libssl1.1')
1313
(( $G_DISTRO > 7 )) && adeps+=('libhiredis1.1.0') || adeps+=('libhiredis0.14')
1414

@@ -225,13 +225,20 @@ then
225225
mkdir -pm 0755 /var/lib/$NAME
226226
chown -R '$NAME:$NAME' /var/lib/$NAME
227227
228-
echo 'Configuring $PRETTY systemd service ...'
228+
if [ ! -f '/var/lib/$NAME/root.key' ]
229+
then
230+
echo 'Bootstrapping root trust anchors /var/lib/$NAME/root.key from /usr/share/dns/root.key ...'
231+
setpriv --reuid=$NAME --regid=$NAME --clear-groups cp -v /usr/share/dns/root.key /var/lib/$NAME/
232+
fi
233+
229234
if [ -f '/etc/init.d/$NAME' ]
230235
then
231236
echo 'Removing obsolete $PRETTY SysV service'
232237
rm /etc/init.d/$NAME
233238
update-rc.d $NAME remove
234239
fi
240+
241+
echo 'Configuring $PRETTY systemd service ...'
235242
systemctl unmask $NAME
236243
systemctl --no-reload enable $NAME
237244
systemctl restart $NAME

0 commit comments

Comments
 (0)