Repository navigation
fix(config): accept a management block with no trust_pem, and record why a SetManagement was refused - #422
Merged
Conversation
3 of 4 tasks
…why a SetManagement was refused A LINK enrollment makes the Fleet Manager call SetManagement with its manager_cn and a read-only operator surface. It sends no trust_pem on purpose: the operator CA is never pushed to a node. validateManagement required one, and since ApplyConfig validates before persisting, the node refused every link with management.trust_pem: required, which the manager reported as a masked error 1900. trust_pem authenticates nothing on the node: the manager connects with the node's own admin certificate, which the mTLS listener and AuthorizeAdmin check, and the field is only copied between the config and the protobuf. validateManagement now requires manager_cn only. The field stays in the schema, optional, documented as reserved and unused, and a stored value is kept. A failed SetManagement now records why in its audit entry (details.error, at most 256 bytes, cut at a character boundary), and Describe shows it after (failed). Closes #418 Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
Bugs5382
force-pushed
the
fix/418-link-trust-pem-optional
branch
from
November 17, 2026 20:57
861881f to
619835b
Compare
Contributor
Author
|
Summary of what this PR did:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What and why
Linking a running node to a FleetOS Manager fails at approval on v0.1.0-rc.2, for every node (#418). The manager's LINK approval calls
SetManagementwith itsmanager_cnand a read-only operator surface, and sends notrust_pemon purpose: the operator CA is never pushed to a node (cryptos-manager#146).validateManagementrequired atrust_pem, and sinceApplyConfigvalidates before it persists (#229), the node refused every link withconfig: management.trust_pem: required when management is set, which the manager reported as a masked error 1900. The regression test reproduces that exact error.This is the design approved on #418, with the trust check done first (the note is on the issue thread):
trust_pemauthenticates nothing on the node. The manager connects with the node's own admin certificate, which the mTLS listener andAuthorizeAdminpin,SetManagementis itself admin-gated, and the field is only copied between the config and the protobuf. So the production change is small:validateManagementrequiresmanager_cnonly.trust_pemstays in the schema, optional, and is documented as reserved and unused; a stored value is kept and a non-empty one is not rejected, so an existing node still loads.SetManagementrecords why in its audit entry (details.error: the status message, at most 256 bytes, cut at a character boundary), andDescribeshows it after(failed). Today the entry only says it failed, and the manager's error is masked, so the node's log was the only place to look and it had nothing to say.Closes #418
The other halves of #418 are their own issues, so this PR stays on the node: the manager logging the error behind 1900 is CryptOS-PKI/cryptos-manager#233, and the full-image suite step that links a node (which blocks the rc.3 tag) is CryptOS-PKI/cryptos-appliance#125.
No docs change: the docs already describe linking a running node as working; this makes it so.
Verification
How this was verified
Describetests failed before the change (the config rejected amanager_cnalone;DetailErrordidn't exist), and aConfigStore.Applyregression test failed with the production message,InvalidArgument ... node: Apply: validate: config: management.trust_pem: required when management is set. The oldTestValidate_Management, which asserted the requirement, is updated to the new contract. The audited-RPC tests (a refusedSetManagementrecords its reason; the reason is bounded) were written with the production change.gofmtclean,go vet ./...clean,golangci-lint run ./...0 issues,go test ./...passes on macOS arm64.SetManagementshould now succeed, and I have not seen that on a running pair yet.Before merging: add a closing comment summarizing what was actually done in this PR
(not just the checked boxes).