Skip to content

Sign the SD sysexts as verity images #4

Open

Description

@ralgozino

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 of SHA256SUMS in roles/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

  1. Build: in installer-immutable-sysext, build each sysext as a signed DDI with systemd-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.
  2. Publish the certificate as a release asset. Keep SHA256SUMS for the download check.
  3. Node: Ignition writes the SD certificate to /etc/verity.d/ (the butane templates in distribution). systemd then checks the signature at each merge.
  4. 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= and ExecReload= 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.d and /etc/verity.d. Each merge of a signed image logs device-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.d for 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. /etc is 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 /etc adds no stronger protection.
  • Architecture. systemd-repart writes partition types of the build architecture. Flatcar's own confext has root-x86-64 partitions 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.d during 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-sysext publishes signed DDI images and the certificate.
  • A node installed with the certificate in /etc/verity.d merges the SD sysexts with the strict policy, and systemd-dissect shows signed.
  • A node without the certificate still merges them with the default policy.

Activity

  1. added
    enhancement
    on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions