2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-10-20 06:35:33 +00:00

Change Ubuntu to seal to pcrs on firstboot

Consistent with changes for EL, seal PCRs on firstboot to extend the usefulness of some sealing.
This commit is contained in:
Jarrod Johnson
2026-08-11 08:43:25 -04:00
parent 8d519b57a6
commit 0746b843d2
3 changed files with 13 additions and 10 deletions
@@ -22,6 +22,18 @@ hostnamectl set-hostname $(grep ^NODENAME: /etc/confluent/confluent.info | awk '
touch /etc/cloud/cloud-init.disabled
source /etc/confluent/functions
confluent_profile=$(grep ^profile: /etc/confluent/confluent.deploycfg|awk '{print $2}')
if [ -e /etc/confluent/luks.key ]; then
tpm2pcrs=""
encryptboot=$(grep ^encryptboot: /target/etc/confluent/confluent.deploycfg | sed -e 's/^encryptboot://' -e 's/ //g')
case "$encryptboot" in
*pcrs=*)
tpm2pcrs=$(echo "$encryptboot" | sed -e 's/.*pcrs=//' -e 's/:.*//')
;;
esac
if [ -n "$tpm2pcrs" ]; then
run_remote tpm_luks_reseal.sh
fi
fi
export confluent_mgr confluent_profile
run_remote_python confignet
run_remote_parts firstboot.d
@@ -112,16 +112,7 @@ if [ -f /etc/confluent_lukspass ]; then
chmod 000 /target/etc/confluent/luks.key
lukspass=$(cat /etc/confluent_lukspass)
chroot /target apt install libtss2-rc0
tpm2pcrs=""
encryptboot=$(grep ^encryptboot: /target/etc/confluent/confluent.deploycfg | sed -e 's/^encryptboot://' -e 's/ //g')
case "$encryptboot" in
*pcrs=*)
tpm2pcrs=$(echo "$encryptboot" | sed -e 's/.*pcrs=//' -e 's/:.*//')
;;
esac
PASSWORD=$lukspass chroot /target systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs="$tpm2pcrs" $CRYPTTAB_SOURCE
PASSWORD=$lukspass chroot /target systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs="" $CRYPTTAB_SOURCE
fetch_remote systemdecrypt
mv systemdecrypt /target/etc/initramfs-tools/scripts/local-top/systemdecrypt
fetch_remote systemdecrypt-hook