Skip to content

feat: add UEFI SecureBoot enable/disable and key reset support - #457

Merged
mergify[bot] merged 2 commits into
bmc-toolbox:mainfrom
mcanevet:feat/secure-boot
Aug 18, 2026
Merged

feat: add UEFI SecureBoot enable/disable and key reset support#457
mergify[bot] merged 2 commits into
bmc-toolbox:mainfrom
mcanevet:feat/secure-boot

Conversation

@mcanevet

@mcanevet mcanevet commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

What does this PR implement/change/remove?

bmclib has no way to enable/disable UEFI SecureBoot or reset its key databases, despite gofish (already a direct dependency) fully supporting both via the ComputerSystem's SecureBoot resource (SecureBootEnable + .Update(), and .ResetKeys()).

Adds the standard three-layer bmclib capability, following the exact pattern of bmc/bios.go/bmc/boot_device.go:

  • internal/redfishwrapper: GetSecureBoot/SetSecureBoot/ResetSecureBootKeys wrapping gofish's schemas.SecureBoot.
  • bmc: SecureBootStateGetter/SecureBootSetter/SecureBootKeysResetter interfaces with the usual FromInterfaces dispatch.
  • Client.GetSecureBoot/SetSecureBoot/ResetSecureBootKeys passthroughs.

Wired into every provider that embeds redfishwrapper.Client - redfish (generic), dell, supermicro, and lenovo - plus new Feature* constants (FeatureGetSecureBoot, FeatureSetSecureBoot, FeatureResetSecureBootKeys) on each. This matches how every other redfishwrapper-backed capability (BIOS config, power state, NMI, ...) is exposed at each provider layer, even though the implementation is the same delegation in every case.

Checklist

  • Tests added
  • Similar commits squashed

The HW vendor this change applies to (if applicable)

Any BMC reached via the generic Redfish, Dell, Supermicro, or Lenovo XCC provider.

The HW model number, product name this change applies to (if applicable)

N/A - generic Redfish SecureBoot resource, not vendor-specific.

The BMC firmware and/or BIOS versions that this change applies to (if applicable)

Requires the standard Redfish SecureBoot resource under ComputerSystem.

What version of tooling - vendor specific or opensource does this change depend on (if applicable)

gofish (already a direct dependency, github.com/stmcginnis/gofish/schemas).

Description for changelog/release notes

Add SetSecureBoot/GetSecureBoot/ResetSecureBootKeys support for the redfish, dell, supermicro, and lenovo providers.

mcanevet added a commit to mcanevet/tinkerbell that referenced this pull request Aug 14, 2026
Adds SecureBootAction (enable/disable) and SecureBootResetKeysAction
(ResetAllKeysToDefault/DeleteAllKeys/DeletePK) to bmc.Action, wired
into rufio's Task reconciler via bmclib's GetSecureBoot/SetSecureBoot/
ResetSecureBootKeys (bmc-toolbox/bmclib#457, not yet merged).

Since bmc.Action is reused as Workflow.spec.bootOptions.custombootConfig's
preparingActions/postActions element type, this also becomes usable
there once bmclib#457 lands - e.g. resetting a Dell node to SetupMode
right before the PXE boot attempt that provisioning depends on.

Verified via the existing fake-provider-backed TestTaskReconcile
harness (registrar dispatch through a real bmclib.Client, no live BMC
needed) - new cases cover success/failure for both actions. go.mod/
go.sum intentionally left uncommitted: they carry a local
replace directive pointing bmc-toolbox/bmclib/v2 at a local checkout
of the unmerged bmclib#457 branch, needed to build this locally before
that PR merges.
mcanevet added a commit to mcanevet/tinkerbell that referenced this pull request Aug 14, 2026
Temporary replace directive so this branch builds against the SecureBoot
support this depends on (bmc-toolbox/bmclib#457) before that PR merges.

DO NOT MERGE this commit - drop it (go mod edit -dropreplace, then go mod
tidy) once bmclib#457 lands and a tagged bmclib release picks it up.
mcanevet added a commit to mcanevet/tinkerbell that referenced this pull request Aug 14, 2026
Adds SecureBootAction (enable/disable) and SecureBootResetKeysAction
(ResetAllKeysToDefault/DeleteAllKeys/DeletePK) to bmc.Action, wired
into rufio's Task reconciler via bmclib's GetSecureBoot/SetSecureBoot/
ResetSecureBootKeys (bmc-toolbox/bmclib#457, not yet merged).

Since bmc.Action is reused as Workflow.spec.bootOptions.custombootConfig's
preparingActions/postActions element type, this also becomes usable
there once bmclib#457 lands - e.g. resetting a Dell node to SetupMode
right before the PXE boot attempt that provisioning depends on.

Verified via the existing fake-provider-backed TestTaskReconcile
harness (registrar dispatch through a real bmclib.Client, no live BMC
needed) - new cases cover success/failure for both actions. go.mod/
go.sum intentionally left uncommitted: they carry a local
replace directive pointing bmc-toolbox/bmclib/v2 at a local checkout
of the unmerged bmclib#457 branch, needed to build this locally before
that PR merges.
mcanevet added a commit to mcanevet/tinkerbell that referenced this pull request Aug 14, 2026
Temporary replace directive so this branch builds against the SecureBoot
support this depends on (bmc-toolbox/bmclib#457) before that PR merges.

DO NOT MERGE this commit - drop it (go mod edit -dropreplace, then go mod
tidy) once bmclib#457 lands and a tagged bmclib release picks it up.
mcanevet added a commit to mcanevet/tinkerbell that referenced this pull request Aug 14, 2026
Adds SecureBootAction (enable/disable) and SecureBootResetKeysAction
(ResetAllKeysToDefault/DeleteAllKeys/DeletePK) to bmc.Action, wired
into rufio's Task reconciler via bmclib's GetSecureBoot/SetSecureBoot/
ResetSecureBootKeys (bmc-toolbox/bmclib#457, not yet merged).

Since bmc.Action is reused as Workflow.spec.bootOptions.custombootConfig's
preparingActions/postActions element type, this also becomes usable
there once bmclib#457 lands - e.g. resetting a Dell node to SetupMode
right before the PXE boot attempt that provisioning depends on.

Verified via the existing fake-provider-backed TestTaskReconcile
harness (registrar dispatch through a real bmclib.Client, no live BMC
needed) - new cases cover success/failure for both actions. go.mod/
go.sum intentionally left uncommitted: they carry a local
replace directive pointing bmc-toolbox/bmclib/v2 at a local checkout
of the unmerged bmclib#457 branch, needed to build this locally before
that PR merges.

Signed-off-by: Mickaël Canévet <mickael.canevet@proton.ch>
mcanevet added a commit to mcanevet/tinkerbell that referenced this pull request Aug 14, 2026
Temporary replace directive so this branch builds against the SecureBoot
support this depends on (bmc-toolbox/bmclib#457) before that PR merges.

DO NOT MERGE this commit - drop it (go mod edit -dropreplace, then go mod
tidy) once bmclib#457 lands and a tagged bmclib release picks it up.

Signed-off-by: Mickaël Canévet <mickael.canevet@proton.ch>
mcanevet added a commit to mcanevet/tinkerbell that referenced this pull request Aug 14, 2026
Adds SecureBootAction (enable/disable) and SecureBootResetKeysAction
(ResetAllKeysToDefault/DeleteAllKeys/DeletePK) to bmc.Action, wired
into rufio's Task reconciler via bmclib's GetSecureBoot/SetSecureBoot/
ResetSecureBootKeys (bmc-toolbox/bmclib#457, not yet merged).

Since bmc.Action is reused as Workflow.spec.bootOptions.custombootConfig's
preparingActions/postActions element type, this also becomes usable
there once bmclib#457 lands - e.g. resetting a Dell node to SetupMode
right before the PXE boot attempt that provisioning depends on.

Verified via the existing fake-provider-backed TestTaskReconcile
harness (registrar dispatch through a real bmclib.Client, no live BMC
needed) - new cases cover success/failure for both actions. go.mod/
go.sum intentionally left uncommitted: they carry a local
replace directive pointing bmc-toolbox/bmclib/v2 at a local checkout
of the unmerged bmclib#457 branch, needed to build this locally before
that PR merges.

Signed-off-by: Mickaël Canévet <mickael.canevet@proton.ch>
mcanevet added a commit to mcanevet/tinkerbell that referenced this pull request Aug 14, 2026
Temporary replace directive so this branch builds against the SecureBoot
support this depends on (bmc-toolbox/bmclib#457) before that PR merges.

DO NOT MERGE this commit - drop it (go mod edit -dropreplace, then go mod
tidy) once bmclib#457 lands and a tagged bmclib release picks it up.

Signed-off-by: Mickaël Canévet <mickael.canevet@proton.ch>
Comment thread internal/redfishwrapper/secure_boot.go Outdated
Comment thread internal/redfishwrapper/secure_boot.go Outdated
Comment thread internal/redfishwrapper/secure_boot.go Outdated
@mcanevet
mcanevet requested a review from joelrebel August 14, 2026 15:46
bmclib has no way to enable/disable UEFI SecureBoot or reset its key
databases, despite gofish (already a direct dependency) fully supporting
both via the ComputerSystem's SecureBoot resource (SecureBootEnable +
.Update(), and .ResetKeys()).

Adds the standard three-layer bmclib capability, following the exact
pattern of bmc/bios.go/bmc/boot_device.go:
- internal/redfishwrapper: GetSecureBoot/SetSecureBoot/ResetSecureBootKeys
  wrapping gofish's schemas.SecureBoot.
- bmc: SecureBootStateGetter/SecureBootSetter/SecureBootKeysResetter
  interfaces with the usual FromInterfaces dispatch.
- Client.GetSecureBoot/SetSecureBoot/ResetSecureBootKeys passthroughs.

Wired into every provider that embeds redfishwrapper.Client - redfish
(generic), dell, supermicro, and lenovo - matching how every other
redfishwrapper-backed capability (BIOS config, power state, NMI, ...) is
exposed at each of those provider layers, even though the implementation
is the same delegation in each case.

Tests added at the redfishwrapper and bmc dispatch layers (Dell fixture),
and at the lenovo provider layer (XCC fixture/mock server, already
scaffolded for SecureBoot ahead of this).

Description for changelog/release notes:

Add SetSecureBoot/GetSecureBoot/ResetSecureBootKeys support for the
redfish, dell, supermicro, and lenovo providers.
…ata ID

GetSecureBoot/SetSecureBoot/ResetSecureBootKeys returned nil on an
incompatible System odata ID, which the bmc dispatch loop treats as a
successful result and stops trying other providers. Return
ErrRedfishSystemOdataID instead, matching inventory.go's handling of
the same check.
@mergify

mergify Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-08-18 05:46 UTC · Rule: default · triggered by rule refactored queue action rule
  • Checks skipped · PR is already up-to-date
  • Merged2026-08-18 05:46 UTC · at 51a7f0e471abc21d5fe354eabb185767ac0a09d9 · merge

This pull request spent 13 seconds in the queue, including 2 seconds running CI.

Required conditions to merge

@mergify
mergify Bot merged commit 89df130 into bmc-toolbox:main Aug 18, 2026
4 of 5 checks passed
@mergify mergify Bot removed the queued label Aug 18, 2026
mcanevet added a commit to mcanevet/tinkerbell that referenced this pull request Aug 26, 2026
Adds SecureBootAction (enable/disable) and SecureBootResetKeysAction
(ResetAllKeysToDefault/DeleteAllKeys/DeletePK) to bmc.Action, wired
into rufio's Task reconciler via bmclib's GetSecureBoot/SetSecureBoot/
ResetSecureBootKeys (bmc-toolbox/bmclib#457, not yet merged).

Since bmc.Action is reused as Workflow.spec.bootOptions.custombootConfig's
preparingActions/postActions element type, this also becomes usable
there once bmclib#457 lands - e.g. resetting a Dell node to SetupMode
right before the PXE boot attempt that provisioning depends on.

Verified via the existing fake-provider-backed TestTaskReconcile
harness (registrar dispatch through a real bmclib.Client, no live BMC
needed) - new cases cover success/failure for both actions. go.mod/
go.sum intentionally left uncommitted: they carry a local
replace directive pointing bmc-toolbox/bmclib/v2 at a local checkout
of the unmerged bmclib#457 branch, needed to build this locally before
that PR merges.

Signed-off-by: Mickaël Canévet <mickael.canevet@proton.ch>
mcanevet added a commit to mcanevet/tinkerbell that referenced this pull request Aug 27, 2026
Adds SecureBootAction (enable/disable) and SecureBootResetKeysAction
(ResetAllKeysToDefault/DeleteAllKeys/DeletePK) to bmc.Action, wired
into rufio's Task reconciler via bmclib's GetSecureBoot/SetSecureBoot/
ResetSecureBootKeys (bmc-toolbox/bmclib#457, not yet merged).

Since bmc.Action is reused as Workflow.spec.bootOptions.custombootConfig's
preparingActions/postActions element type, this also becomes usable
there once bmclib#457 lands - e.g. resetting a Dell node to SetupMode
right before the PXE boot attempt that provisioning depends on.

Verified via the existing fake-provider-backed TestTaskReconcile
harness (registrar dispatch through a real bmclib.Client, no live BMC
needed) - new cases cover success/failure for both actions. go.mod/
go.sum intentionally left uncommitted: they carry a local
replace directive pointing bmc-toolbox/bmclib/v2 at a local checkout
of the unmerged bmclib#457 branch, needed to build this locally before
that PR merges.

Signed-off-by: Mickaël Canévet <mickael.canevet@proton.ch>
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