You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
metalman: bind bootstrap credentials to the attested Machine - #946
Metalman bootstrap tokens are now bound to the specific Machine they were issued/encrypted for, and CSR signing is effectively guarded behind TPM auth. This is defense in depth to protect against replay attacks where a decrypted token is exfiltrated from the requesting node.
Netboot and attestation handlers now identify the client only by the
direct TCP peer address and ignore X-Forwarded-For, X-Real-IP, and
Forwarded headers. Metalman binds host ports directly and is not
deployed behind a proxy.
The cached Machine now only locates the candidate by credential ID. The node-name check runs against the live Machine so informer lag after a nodeRef change cannot deny a CSR for the authorized name.
A revocation that fails to delete the object is now recorded as OpFailed so the deletion error reaches ExecutionResult.Err() and CombineResult(). Successful or unnecessary revocations remain OpSkipped.
CleanupPlan now plans the shared metalman support set exactly as Plan does, so the bootstrap grant left by an earlier release stays behind the admission restriction and is revoked if the restriction fails, even when every Site has metalman disabled. Identical shared operations dedupe across enabled and disabled Sites.
NodeRef changes during replacement cause stale-node completion timeout
internal/metalman/netboot/netboot.go:236
If spec.kubernetes.nodeRef.name changes after a virtual-media HostReplace captures its boot-media state but before first-boot config is fetched, this config uses the new name and the CSR approver accepts it. Completion still queries the old target.BootMedia.NodeName (internal/metalman/machineops/virtualmedia.go:456,628-638). If that old Node is absent, the replacement times out even though the new Node joined successfully. Use one consistent node identity for config generation, CSR authorization, and replacement completion, and add a regression test for a nodeRef edit during replacement.
Record the node name a bootstrap credential was issued for in
status.bootstrap.nodeName and have the machina CSR approver match the
kubelet CSR against it instead of the live nodeRef. For virtual-media
first boot, the media owner lookup pins the Machine's node name to the
name captured in the operation's boot media status, so the agent config,
the recorded credential binding, and HostReplace completion use the same
name even if spec.kubernetes.nodeRef changes mid-replacement.
Ensure check=True for the delete command to enforce error checking.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Metalman bootstrap tokens are now bound to the specific Machine they were issued/encrypted for, and CSR signing is effectively guarded behind TPM auth. This is defense in depth to protect against replay attacks where a decrypted token is exfiltrated from the requesting node.