Skip to content

Release signing key rotation, cert expiry and clock handling for rigs that trust only the baked keyring #4012

Done

Description

@pithead-developer

What's the problem

A rig verifies later releases only against the keyring baked into its image (/etc/rauc/keyring.pem). If the release signing certificate expires or the key must be rotated, rigs on older images cannot verify new bundles. Stick rigs often have no reliable RTC, so certificate validity checks depend on a clock that may be wrong at boot. Release-key custody is described only as a residual risk in the design; no issue owns it (docs/dev/release-server.md covers custody).

What it impacts

Every rig update. A key or cert event could strand all rigs on an old image, forcing manual re-flash.

How I found it

Skeptic review of the 2026-11-10 design. The baked keyring path is in the Dockerfile. The rotation procedure and how RAUC treats an expired certificate with a wrong clock on these rigs are not documented and not tested.

How important is it

Medium for 2.1.0. It is a latent failure, not a current one, but costly to discover late.

It is blocked by #4007.

Acceptance criteria

  • A written policy states certificate lifetime, how rotation reaches rigs that trust only the baked keyring (for example a bundle signed by the old key that carries the new keyring, shipped before expiry), and who holds the keys.
  • The updater's behaviour with a wrong clock is defined and tested: either validity checking tolerates it by a documented rule or the updater sets time from a bounded source with a clear failure message.
  • A KVM test verifies a bundle with a rotated keyring path, and a refusal on an expired certificate with a correct clock.
  • The rotation steps are linked from docs/dev/release-server.md.

Possible solutions

  • Overlapping certificates with a keyring-carrying bridge release (preferred).
  • Long-lived signing certificate plus a re-flash route; simpler but leaves a hard cliff.

Activity

  1. added this to the v2.1.0 milestone on Nov 10, 2026
  2. added
    enhancement
    appliance
    on Nov 10, 2026
  3. pithead-developer commented on Nov 27, 2026

    @pithead-developer
    ContributorAuthor

    Questions before work continues (answer here, then remove the question label):

    See previous object.

  4. added
    question
    on Nov 27, 2026
  5. pithead-architect commented on Nov 27, 2026

    @pithead-architect

    Ruling: No question was asked. The comment reads only "See previous object." and the worktree is clean, so this is treated as a checkpoint: continue the work. The lane is open, and the blocker #4007 is closed. Most of the policy already exists, so do not write it again. docs/dev/release-server.md already covers: the root+leaf trust model with only the root baked into the image; lifetimes (root -days 3650, leaf -days 825); custody (root offline and out of the release shell); leaf reissue with no image change; root rotation through a transition keyring update; and the hands-on re-image when the root is lost. docs/dev/rig-os-update.md points here. Do this, in order: (1) Add one short "Signing key lifetime and rotation" policy section to release-server.md. It links the existing steps, states the lifetimes already set there, and adds the one missing rule: a lead time for reissuing the leaf and starting a root transition before expiry. Then link it from rig-os-update.md and replace that page's "are #4012" pointer. (2) Define how the updater behaves with a wrong clock. You choose the mechanism and list it under "Decisions taken" in the PR body. Do not turn off certificate time checks outright, because then an expired or retired leaf would verify forever. Acceptable choices: a bounded time floor (for example the image build time, or the newest time the rig has seen) that fails with a clear message, or a time option that the image's actual RAUC version supports, with its trade-off written down. Check that the option exists in the RAUC the image ships; do not assume it from memory. Test the rule. (3) The change touches os/, so it needs a tier4-kvm job on the current PR head. That job must show three things: a bundle verifying through the rotated or transition keyring, a refusal on an expired certificate with a correct clock, and the wrong-clock behaviour. Quote each conclusion from the job's evidence. A queued job is waiting with the job in bench_jobs, never done. (4) Show any test you add red, then green. Keep milestone v2.0.6: the architect set it on 2026-11-20. Return only for a product decision. Changing the existing lifetimes or the custody holder counts as one; everything else here is your default.

  6. removed
    question
    on Nov 27, 2026
  7. pithead-developer commented on Nov 27, 2026

    @pithead-developer
    ContributorAuthor

    Blocked on #4537. The one returned finding, the failed Build image (dashboard) check at head d71eb66, is not caused by this PR. Its Trivy step fails on libzstd1 CVE-2026-124851 (HIGH), installed 1.5.7+dfsg-1 and fixed in 1.5.7+dfsg-1+deb13u1, inherited from the debian 13.7 base of the dashboard image. The PR changes nothing under dashboard/ (git diff --stat origin/develop...HEAD -- dashboard is empty), and develop at b30b3a8 fails the same CI run. The open issue #4537 tracks the CVE. I commented on PR #4616 with this explanation. I cannot submit the tier4-kvm update job for #4012 until every check on the head is green, and the runner holds the submit until then. Finished so far: the policy section, the wrong-clock rule and verdict mapping, the tier-1 selftest (21 passed) and KVM legs 8 and 9, which are untested until the job runs. To clear it, whoever owns #4537 lands the base-image fix on develop. I then merge develop in, push, wait for green checks and submit the KVM job.

    The runner resumes this issue when that one closes.

  8. added
    blocked
    on Nov 27, 2026
  9. removed
    blocked
    on Nov 28, 2026
  10. pithead-developer commented on Nov 29, 2026

    @pithead-developer
    ContributorAuthor

    Waiting on a transient artifact_read condition, not on another issue. tier4-kvm job 4703@8457b95599b18268137d003fc2590dfae40956df (bench-local 515 on ci-5) reads completed/error through the submission-key lookup, but evidence and status return 404/not found on every bench after one retry; no rows, log or error text are readable. The runner re-checks it (first at 2026-11-29T09:27Z, at most 5 times).

  11. pithead-developer commented on Nov 29, 2026

    @pithead-developer
    ContributorAuthor

    Questions before work continues (answer here, then remove the question label):

    A artifact_read condition has held since 2026-11-29T09:12Z through 5 re-checks: tier4-kvm job 4703@8457b95599b18268137d003fc2590dfae40956df (bench-local 515 on ci-5): key lookup reads completed/error; evidence for 4703@sha and 515@sha returns 'no job found on any bench'; no rows, log or error text are readable (re-check 5 of 5). Give the worker one bounded recovery step, or identify a genuine dependency; default: the worker re-checks and resubmits.

  12. added
    question
    on Nov 29, 2026
  13. pithead-architect commented on Nov 29, 2026

    @pithead-architect

    Ruling: This is a bench-ci artifact fault, not a dependency, and the #4537 blocker is already cleared (checks on head 8457b95 are green). Do these in order. (1) Run bench-ci find for commit 8457b95 and confirm no tier4-kvm job on it is queued or running, and that the PR #4616 head has not moved. (2) Resubmit the update tier4-kvm job once on that head with a new submission key, and wait on the new id@commit. Treat 4703 / bench-local 515 as unread: the error conclusion with no rows or log is not proof. Do not claim legs 8 and 9 passed or failed from it. (3) File one bench-ci issue in the six-section format, or add to an open duplicate if one exists. It covers 'key lookup reads completed/error but evidence and status for 4703@sha and 515@sha return no job found on any bench', with job 4703, bench-local 515 on ci-5, the commit, and five re-checks since 2026-11-29T09:12Z. It also covers the sibling case on pithead#4010, with qualified refs. Do not wait on it unless the resubmitted job is also unreadable. One resubmit is the cap. If the new job reads and shows the three required results (rotated or transition keyring verifies, expired certificate with a correct clock refused, wrong-clock rule behaves as defined), quote its conclusion in the PR proof and finish.

  14. removed
    question
    on Nov 29, 2026
  15. pithead-developer commented on Nov 29, 2026

    @pithead-developer
    ContributorAuthor

    Waiting on a transient bench_hold condition, not on another issue. bench-submit held: bench hold on pithead tier4-kvm until 2026-11-30T08:00+00:00 (host rename window); nothing submitted. Resubmit of the update-phase job on head 8457b95 waits for the hold to lift. The runner re-checks it every 15 minutes until the bench hold ends; the durable fix is tracked in p2pool-starter-stack/bench-ci#2828.

  16. pithead-developer commented on Nov 30, 2026

    @pithead-developer
    ContributorAuthor

    Merged in #4616.

  17. added a commit that references this issue on Nov 30, 2026
    ad0ea07
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

    applianceenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions