Skip to content

feat: add CustomSecureBootKeysAllower for out-of-band custom key acceptance - #466

Merged
mergify[bot] merged 4 commits into
bmc-toolbox:mainfrom
mcanevet:secure-boot-key-management
Sep 25, 2026
Merged

mergify[bot] merged 4 commits into
bmc-toolbox:mainfrom
mcanevet:secure-boot-key-management

Conversation

@mcanevet

@mcanevet mcanevet commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds bmc.CustomSecureBootKeysAllower, a new interface controlling whether a platform will accept custom UEFI Secure Boot keys (as opposed to only the vendor-shipped key set). This is distinct from SecureBootSetter (enabling/disabling Secure Boot itself) and from SecureBootCertificateImporter (enrolling a specific certificate) - it's the out-of-band gate some vendors require before a certificate import will be accepted at all.

Implemented for Dell, which models this as the SecureBootPolicy BIOS attribute (Standard/Custom). Not implemented for Lenovo yet: XCC-based systems have an analogous SecureBootPolicy attribute, but it's unconfirmed whether it's reachable through the same generic /Bios attribute PATCH this package already uses, or requires Lenovo's proprietary OneCLI/XCC transport - documented as a known gap with links to Lenovo's public docs (including the FQXSFPU4097G error code callers will hit without it).

rebootRequired reports that a successful change is staged and takes effect only after a power cycle, matching how BIOS Setup attribute changes work generally.

Also fixes a bug in AllowCustomSecureBootKeys itself: it returned early when the attribute's currently applied value already matched the request, which is unsafe if a different value is genuinely pending from an earlier call in the same boot cycle - confirmed live, that left a stale pending value in place, silently reverting an explicit request on the next reboot (observed as a certificate import rejected because SecureBootPolicy committed as Standard despite requesting Custom moments earlier). The write is now unconditional; the attribute is still read first, but only to reject platforms that don't expose it at all. Relies on stmcginnis/gofish#571 (via #468, merged) to correctly detect a stale-but-different pending value.

Test plan

  • bmc/secure_boot_test.go: TestAllowCustomSecureBootKeysFromInterfaces covering success/no-implementation/error cases.
  • providers/dell/secure_boot_test.go: enable-from-Standard, already-Custom-but-stale-pending, disable-from-Custom, already-Standard-but-stale-pending, and the attribute-absent (ErrUnsupportedHardware) case.
  • go build ./..., go vet ./..., golangci-lint run ./... (0 new issues), go test ./... all pass.

@mcanevet
mcanevet marked this pull request as draft September 10, 2026 14:24
@mcanevet
mcanevet force-pushed the secure-boot-key-management branch from 9be4fae to bc1cdab Compare September 10, 2026 14:39
@mcanevet
mcanevet force-pushed the secure-boot-key-management branch 2 times, most recently from dfd74c5 to 9be4fae Compare September 10, 2026 15:10
@mcanevet
mcanevet marked this pull request as ready for review September 10, 2026 15:43
@mcanevet
mcanevet force-pushed the secure-boot-key-management branch from 9be4fae to b8a17f6 Compare September 11, 2026 08:06
mcanevet added a commit to mcanevet/tinkerbell that referenced this pull request Sep 11, 2026
bmclib gained a Dell-only SecureBootKeyManagementSetter capability for
enabling/disabling out-of-band acceptance of custom UEFI Secure Boot keys.
Rufio had no Secure Boot support of any kind yet, so this adds the first
action for it: SecureBootKeyManagement{Enable bool} on the shared bmc.Action
type (v1alpha1 only - v1alpha2 isn't wired to any controller yet), reusable
from both bmc.Task/Job and Workflow's preparingActions/postActions since they
embed the same Action type. runTask calls bmcClient.SetSecureBootKeyManagement
directly; no status polling is needed since, like BootDevice/VirtualMedia,
it's a single synchronous call rather than a converging state. The web UI's
task-type label (bmcTaskType) is updated too, so these tasks don't render as
"Unknown".

CRD manifests and deepcopy code regenerated via make manifests-v1alpha1 and
make generate-deepcopy.

TEMPORARY: go.mod/go.sum replace bmclib with mcanevet/bmclib's
secure-boot-key-management branch (bmc-toolbox/bmclib#466), since
SetSecureBootKeyManagement isn't in any bmclib release yet. Drop this replace
and bump the real require once bmclib tags a release containing it, or
CI/reviewers will rightly reject it.

Signed-off-by: Mickael Canevet <mickael.canevet@proton.ch>
@mcanevet
mcanevet force-pushed the secure-boot-key-management branch 2 times, most recently from ec4a204 to ab9fc16 Compare September 14, 2026 06:28
Comment thread bmc/secure_boot.go Outdated
mcanevet added a commit to mcanevet/tinkerbell that referenced this pull request Sep 15, 2026
Matches the corresponding rename in bmc-toolbox/bmclib#466, made per
maintainer review feedback there: the old name read like it managed
something generic, when it actually just toggles whether the platform
accepts non-factory UEFI Secure Boot keys.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Mickael Canevet <mickael.canevet@proton.ch>
@mcanevet mcanevet changed the title feat: add SecureBootKeyManagementSetter for out-of-band custom key acceptance feat: add CustomSecureBootKeysAllower for out-of-band custom key acceptance Sep 15, 2026
mcanevet added a commit to mcanevet/tinkerbell that referenced this pull request Sep 15, 2026
Matches the rename in bmc-toolbox/bmclib#466, made per maintainer review
feedback there: the old name read like it managed something generic, when
it actually just toggles whether the platform accepts non-factory UEFI
Secure Boot keys.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Mickael Canevet <mickael.canevet@proton.ch>
@joelrebel
joelrebel force-pushed the secure-boot-key-management branch from c85a686 to 7d76db0 Compare September 16, 2026 10:49
@mcanevet
mcanevet force-pushed the secure-boot-key-management branch from 7d76db0 to 58a7d1b Compare September 17, 2026 14:13
mcanevet and others added 4 commits September 17, 2026 16:17
…ptance

New interface controlling whether a platform will accept custom UEFI
Secure Boot keys, as opposed to only the vendor-shipped key set. Distinct
from SecureBootSetter (enabling/disabling Secure Boot itself) and from
SecureBootCertificateImporter (enrolling a specific certificate) - it's
the out-of-band gate some vendors require before a certificate import
will be accepted at all.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Mickaël Canévet <mickael.canevet@proton.ch>
Implements bmc.CustomSecureBootKeysAllower via the SecureBootPolicy BIOS
attribute (Standard/Custom).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Mickaël Canévet <mickael.canevet@proton.ch>
XCC-based systems have an analogous SecureBootPolicy attribute, but it's
unconfirmed whether it's reachable through the same generic /Bios
attribute PATCH this package already uses, or requires Lenovo's
proprietary OneCLI/XCC transport - left undocumented otherwise, this is
the FQXSFPU4097G error code callers will hit without it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Mickaël Canévet <mickael.canevet@proton.ch>
…atches

AllowCustomSecureBootKeys read the attribute's currently applied value and
returned early when it already matched what was requested. Confirmed live,
that's unsafe: currently-applied state can match while a different value is
genuinely pending from an earlier call in the same boot cycle (e.g. a stale
pending PATCH left staged by an interrupted, unrelated caller). Skipping the
write left that stale pending value in place, silently reverting an explicit
request on the next reboot - observed as a certificate import rejected
because SecureBootPolicy committed as Standard despite requesting Custom
moments earlier. It's the same class of bug stmcginnis/gofish#571 fixes one
layer down, in SetBiosConfiguration's own diff baseline - but this early
return happens before SetBiosConfiguration is ever called, so #571 can't
reach it.

The attribute is still read first, but only to reject platforms that don't
expose it at all. The write itself is now unconditional.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Mickaël Canévet <mickael.canevet@proton.ch>
@mcanevet
mcanevet force-pushed the secure-boot-key-management branch from 58a7d1b to 0964644 Compare September 17, 2026 14:18
mcanevet added a commit to mcanevet/tinkerbell that referenced this pull request Sep 23, 2026
Matches the rename in bmc-toolbox/bmclib#466, made per maintainer review
feedback there: the old name read like it managed something generic, when
it actually just toggles whether the platform accepts non-factory UEFI
Secure Boot keys.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Mickael Canevet <mickael.canevet@proton.ch>
mcanevet added a commit to mcanevet/tinkerbell that referenced this pull request Sep 23, 2026
Matches the rename in bmc-toolbox/bmclib#466, made per maintainer review
feedback there: the old name read like it managed something generic, when
it actually just toggles whether the platform accepts non-factory UEFI
Secure Boot keys.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Mickael Canevet <mickael.canevet@proton.ch>
mcanevet added a commit to mcanevet/tinkerbell that referenced this pull request Sep 24, 2026
bmclib gained a Dell-only AllowCustomSecureBootKeys capability for
enabling/disabling out-of-band acceptance of custom UEFI Secure Boot keys.
Rufio had no Secure Boot support of any kind yet, so this adds the first
action for it: AllowCustomSecureBootKeys{Enable bool} on the shared
bmc.Action type (v1alpha1 only - v1alpha2 isn't wired to any controller yet),
reusable from both bmc.Task/Job and Workflow's preparingActions/postActions
since they embed the same Action type. runTask calls
bmcClient.AllowCustomSecureBootKeys directly; no status polling is needed
since, like BootDevice/VirtualMedia, it's a single synchronous call rather
than a converging state. The web UI's task-type label (bmcTaskType) is
updated too, so these tasks don't render as "Unknown".

CRD manifests and deepcopy code regenerated via make manifests-v1alpha1 and
make generate-deepcopy.

TEMPORARY: go.mod/go.sum replace bmclib with mcanevet/bmclib's
secure-boot-key-management branch (bmc-toolbox/bmclib#466), since
AllowCustomSecureBootKeys isn't in any bmclib release yet. Drop this replace
and bump the real require once bmclib tags a release containing it, or
CI/reviewers will rightly reject it.

Signed-off-by: Mickael Canevet <mickael.canevet@proton.ch>
@mergify

mergify Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-09-25 06:03 UTC · Rule: default · triggered by rule refactored queue action rule
  • ✅ Checks skipped · PR is already up-to-date
  • ✅ Merged — 2026-09-25 06:03 UTC · at fec875d8e0c4e8bd5f56ba44bd008300978d52fb · merge

This pull request spent 10 seconds in the queue, including 1 second running CI.

Required conditions to merge

@mergify
mergify Bot merged commit fec875d into bmc-toolbox:main Sep 25, 2026
4 of 5 checks passed
@mergify mergify Bot removed the queued label Sep 25, 2026
mcanevet added a commit to mcanevet/tinkerbell that referenced this pull request Sep 25, 2026
bmc-toolbox/bmclib#466 (CustomSecureBootKeysAllower) merged upstream, so
the temporary go.mod/go.sum replace pointing at mcanevet/bmclib's PR
branch is no longer needed - point the require directly at the real
bmc-toolbox/bmclib commit instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Mickaël Canévet <mickael.canevet@proton.ch>
mcanevet added a commit to mcanevet/tinkerbell that referenced this pull request Sep 29, 2026
bmclib gained a Dell-only AllowCustomSecureBootKeys capability for
enabling/disabling out-of-band acceptance of custom UEFI Secure Boot keys.
Rufio had no Secure Boot support of any kind yet, so this adds the first
action for it: AllowCustomSecureBootKeys{Enable bool} on the shared
bmc.Action type (v1alpha1 only - v1alpha2 isn't wired to any controller yet),
reusable from both bmc.Task/Job and Workflow's preparingActions/postActions
since they embed the same Action type. runTask calls
bmcClient.AllowCustomSecureBootKeys directly; no status polling is needed
since, like BootDevice/VirtualMedia, it's a single synchronous call rather
than a converging state. The web UI's task-type label (bmcTaskType) is
updated too, so these tasks don't render as "Unknown".

CRD manifests and deepcopy code regenerated via make manifests-v1alpha1 and
make generate-deepcopy.

TEMPORARY: go.mod/go.sum replace bmclib with mcanevet/bmclib's
secure-boot-key-management branch (bmc-toolbox/bmclib#466), since
AllowCustomSecureBootKeys isn't in any bmclib release yet. Drop this replace
and bump the real require once bmclib tags a release containing it, or
CI/reviewers will rightly reject it.

Signed-off-by: Mickaël Canévet <mickael.canevet@proton.ch>
mcanevet added a commit to mcanevet/tinkerbell that referenced this pull request Sep 29, 2026
bmc-toolbox/bmclib#466 (CustomSecureBootKeysAllower) merged upstream, so
the temporary go.mod/go.sum replace pointing at mcanevet/bmclib's PR
branch is no longer needed - point the require directly at the real
bmc-toolbox/bmclib commit instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

Signed-off-by: Mickaël Canévet <mickael.canevet@proton.ch>
mcanevet added a commit to mcanevet/tinkerbell that referenced this pull request Sep 29, 2026
bmclib gained a Dell-only AllowCustomSecureBootKeys capability for
enabling/disabling out-of-band acceptance of custom UEFI Secure Boot keys.
Rufio had no Secure Boot support of any kind yet, so this adds the first
action for it: AllowCustomSecureBootKeys{Enable bool} on the shared
bmc.Action type (v1alpha1 only - v1alpha2 isn't wired to any controller yet),
reusable from both bmc.Task/Job and Workflow's preparingActions/postActions
since they embed the same Action type. runTask calls
bmcClient.AllowCustomSecureBootKeys directly; no status polling is needed
since, like BootDevice/VirtualMedia, it's a single synchronous call rather
than a converging state. The web UI's task-type label (bmcTaskType) is
updated too, so these tasks don't render as "Unknown".

CRD manifests and deepcopy code regenerated via make manifests-v1alpha1 and
make generate-deepcopy.

Requires bmclib at the merged bmc-toolbox/bmclib#466 (CustomSecureBootKeysAllower),
so go.mod points at that upstream commit directly.

Signed-off-by: Mickaël Canévet <mickael.canevet@proton.ch>
mcanevet added a commit to mcanevet/tinkerbell that referenced this pull request Sep 29, 2026
bmclib gained a Dell-only AllowCustomSecureBootKeys capability for
enabling/disabling out-of-band acceptance of custom UEFI Secure Boot keys.
Rufio had no Secure Boot support of any kind yet, so this adds the first
action for it: AllowCustomSecureBootKeys{Enable bool} on the shared
bmc.Action type (v1alpha1 only - v1alpha2 isn't wired to any controller yet),
reusable from both bmc.Task/Job and Workflow's preparingActions/postActions
since they embed the same Action type. runTask calls
bmcClient.AllowCustomSecureBootKeys directly; no status polling is needed
since, like BootDevice/VirtualMedia, it's a single synchronous call rather
than a converging state. The web UI's task-type label (bmcTaskType) is
updated too, so these tasks don't render as "Unknown".

CRD manifests and deepcopy code regenerated via make manifests-v1alpha1 and
make generate-deepcopy.

Requires bmclib at the merged bmc-toolbox/bmclib#466 (CustomSecureBootKeysAllower),
so go.mod points at that upstream commit directly.

Signed-off-by: Mickaël Canévet <mickael.canevet@proton.ch>
mcanevet added a commit to mcanevet/tinkerbell that referenced this pull request Sep 30, 2026
bmclib gained a Dell-only AllowCustomSecureBootKeys capability for
enabling/disabling out-of-band acceptance of custom UEFI Secure Boot keys.
Rufio had no Secure Boot support of any kind yet, so this adds the first
action for it: AllowCustomSecureBootKeys{Enable bool} on the shared
bmc.Action type (v1alpha1 only - v1alpha2 isn't wired to any controller yet),
reusable from both bmc.Task/Job and Workflow's preparingActions/postActions
since they embed the same Action type. runTask calls
bmcClient.AllowCustomSecureBootKeys directly; no status polling is needed
since, like BootDevice/VirtualMedia, it's a single synchronous call rather
than a converging state. The web UI's task-type label (bmcTaskType) is
updated too, so these tasks don't render as "Unknown".

CRD manifests and deepcopy code regenerated via make manifests-v1alpha1 and
make generate-deepcopy.

Requires bmclib at the merged bmc-toolbox/bmclib#466 (CustomSecureBootKeysAllower),
so go.mod points at that upstream commit directly.

Signed-off-by: Mickaël Canévet <mickael.canevet@proton.ch>
mcanevet added a commit to mcanevet/tinkerbell that referenced this pull request Sep 30, 2026
bmclib gained a Dell-only AllowCustomSecureBootKeys capability for
enabling/disabling out-of-band acceptance of custom UEFI Secure Boot keys.
Rufio had no Secure Boot support of any kind yet, so this adds the first
action for it: AllowCustomSecureBootKeys{Enable bool} on the shared
bmc.Action type (v1alpha1 only - v1alpha2 isn't wired to any controller yet),
reusable from both bmc.Task/Job and Workflow's preparingActions/postActions
since they embed the same Action type. runTask calls
bmcClient.AllowCustomSecureBootKeys directly; no status polling is needed
since, like BootDevice/VirtualMedia, it's a single synchronous call rather
than a converging state. The web UI's task-type label (bmcTaskType) is
updated too, so these tasks don't render as "Unknown".

CRD manifests and deepcopy code regenerated via make manifests-v1alpha1 and
make generate-deepcopy.

Requires bmclib at the merged bmc-toolbox/bmclib#466 (CustomSecureBootKeysAllower),
so go.mod points at that upstream commit directly.

Signed-off-by: Mickaël Canévet <mickael.canevet@proton.ch>
mcanevet added a commit to mcanevet/tinkerbell that referenced this pull request Sep 30, 2026
bmclib gained a Dell-only AllowCustomSecureBootKeys capability for
enabling/disabling out-of-band acceptance of custom UEFI Secure Boot keys.
Rufio had no Secure Boot support of any kind yet, so this adds the first
action for it: AllowCustomSecureBootKeys{Enable bool} on the shared
bmc.Action type (v1alpha1 only - v1alpha2 isn't wired to any controller yet),
reusable from both bmc.Task/Job and Workflow's preparingActions/postActions
since they embed the same Action type. runTask calls
bmcClient.AllowCustomSecureBootKeys directly; no status polling is needed
since, like BootDevice/VirtualMedia, it's a single synchronous call rather
than a converging state. The web UI's task-type label (bmcTaskType) is
updated too, so these tasks don't render as "Unknown".

CRD manifests and deepcopy code regenerated via make manifests-v1alpha1 and
make generate-deepcopy.

Requires bmclib at the merged bmc-toolbox/bmclib#466 (CustomSecureBootKeysAllower),
so go.mod points at that upstream commit directly.

Signed-off-by: Mickaël Canévet <mickael.canevet@proton.ch>
@nuxster nuxster mentioned this pull request Oct 6, 2026
2 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants