Repository navigation
Description
Scope: build and release in this repository, with a follow-up in installer-immutable and distribution (certificate and policy on the node).
Description
The SD sysexts (containerd, kubernetes, etcd, keepalived, kubeadm) are unsigned images. lib/generate.sh builds squashfs by default (erofs is an option), and the release publishes only SHA256SUMS. Flatcar signs its own extensions: on a 4757.2.1 node, 00-flatcar-default.raw and flatcar-python.raw are signed erofs images with a verity partition and a signature partition (flatcar/scripts#3162). The SD images are not.
If a node merges the sysexts with a signed-only image policy, an unsigned image stops the full merge. The node then comes up without containerd and kubelet.
Impact
- Today: no failure. Flatcar uses the default policy, which accepts unsigned images.
- Risk: Flatcar makes a signed-only policy the default, or a customer hardens the nodes with it. Then SD nodes do not start their Kubernetes components.
- Gap: the integrity of an SD sysext is checked only at the download (
SHA256SUMS, and an optional cosign or gpg signature ofSHA256SUMSinroles/sysext/tasks/component.yml, off by default because there is no signed release). After the download, nothing checks the image again.
Evidence
On node1.flatcar (Flatcar 4757.2.1, SD 1.36.0), systemd-dissect:
containerd.raw -> squashfs, no verity
kubernetes.raw -> squashfs, no verity
flatcar-python.raw -> erofs, signed
00-flatcar-default.raw (confext) -> erofs, signed, partitions root-x86-64 (merged on arm64)
The strict policy from flatcar/scripts#3162: systemd-sysext refresh --image-policy="root=verity+signed+absent:usr=verity+signed+absent".
Lab test (confext images, the same mechanism): with a signed-only policy, one unsigned image gives "Image does not match image policy" and "Failed to merge hierarchies". The node keeps the previous merge.
Proposal
- Build: in
installer-immutable-sysext, build each sysext as a signed DDI withsystemd-repart(an erofs root, a verity partition, a signature partition), as Flatcar does. flatcar/sysext-bakery#175 (open) adds the same to the upstream bakery that this repository forks. It reads the key and the certificate from CI secrets. - Publish the certificate as a release asset. Keep
SHA256SUMSfor the download check. - Node: Ignition writes the SD certificate to
/etc/verity.d/(the butane templates indistribution). systemd then checks the signature at each merge. - Policy: keep the default policy at first. A signed-only policy is a later, opt-in step, with a drop-in on
systemd-sysext.service(ExecStart=andExecReload=with--image-policy=...), as the example in sysext-bakery#175 does.
Notes
- Where systemd checks the signature. The Flatcar kernel has no
CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG. systemd checks the signature in userspace with the certificates in/usr/lib/verity.dand/etc/verity.d. Each merge of a signed image logsdevice-mapper: verity: Unrecognized verity feature request: root_hash_sig_key_desc. It is harmless. - Why
/etc/verity.d. In the review of Signed OS-dependent sysexts flatcar/scripts#3162, the maintainers plan/etc/verity.dfor the bakery extensions: the certificate can be rotated, and newer extensions work on older Flatcar releases. This also fits SD, where one sysext version runs on several Flatcar versions. - Security limit.
/etcis writable by root. The certificate protects against an image that was changed in transit or on the disk. It does not protect against a user with root on the node, who can add a certificate. In the review of sysext-bakery#175, a Flatcar maintainer says the same: the certificate under/etcadds no stronger protection. - Architecture.
systemd-repartwrites partition types of the build architecture. Flatcar's own confext hasroot-x86-64partitions and is merged on arm64. For sysexts, which hold binaries, the build is per architecture already (--arch), so this does not change the release.
Open questions
- Key management: who holds the private key, where (CI secrets), and the rotation procedure. Ignition writes the certificate at the install only, so a rotation needs a second certificate in
/etc/verity.dduring a transition, written by a reset or by the confext. - Format change: squashfs to erofs. Check the image size and the merge time on a node.
- Policy for the initrd merge: the drop-in covers
systemd-sysext.service. Check whether the initrd merges the SD sysexts, and how to set its policy. - Does the furyctl assets server (sysexts served at install) need a change? The images are only larger.
Acceptance
- A release of
installer-immutable-sysextpublishes signed DDI images and the certificate. - A node installed with the certificate in
/etc/verity.dmerges the SD sysexts with the strict policy, andsystemd-dissectshowssigned. - A node without the certificate still merges them with the default policy.
Activity