Repository navigation
P0-GATE: redact node TLS material from read responses - #509
Merged
Merged
Conversation
dbNodeToProto no longer copies tls_ca_cert, tls_cert or tls_key into the UI-bound proto shape; wire fields stay declared and the Docker pool still reads stored material. UpdateNode treats empty TLS strings as unchanged so a redacted response cannot clear credentials or bump EndpointGeneration. Adds harmless response-shape and no-round-trip fixtures, ADR 0018 and governing knowledge updates.
ADR 0018 now distinguishes Replace TLS credentials from a named Clear TLS credentials action requiring an authenticated operator, nodes:update permission, target-name and confirmation-phrase checks, generation bump, cached-client invalidation and a redacted audit entry. Adds the server-side named action plus a harmless fixture proving ordinary edits and refusals never clear. Wire exposure remains a coordinated follow-up; PR510 UI ownership unchanged.
…ntime-track # Conflicts: # knowledge/decisions/adrs.md
…ntime-track # Conflicts: # knowledge/decisions/adrs.md
athNdev
marked this pull request as ready for review
November 18, 2026 03:46
…ntime-track # Conflicts: # knowledge/decisions/adrs.md
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.
P0-GATE only (Track C managed-node runtime)
This PR implements the reviewer-confirmed P0 source leak fix and its harmless fixtures. It deliberately contains no agent, transport, proto, enrollment or daemon-lifecycle work.
Changes
internal/rpc/services/node.go:dbNodeToProtono longer copiestls_ca_cert,tls_certortls_keyinto the UI-bound proto shape. Fields stay declared for wire compatibility; the Docker client pool still reads stored TLS material from the DB, so daemon auth is unchanged.UpdateNodetreats an empty TLS string as unchanged, not clear. A redacted read response echoed back by an edit form can no longer destroy stored credentials or bumpEndpointGeneration; a non-empty value still replaces credentials and invalidates cached pool clients.internal/rpc/services/node_redaction_test.go: redaction acrossCreateNode/GetNode/ListNodes, protojson wire output, formatted values and logs; stored bytes unchanged; no-round-trip proof including generation stability and genuine replacement.internal/rpc/node_redaction_test.go: generatedNodeServicethrough the real auth interceptor with a globalnodes/readprincipal, plus raw HTTP body inspection.Replace TLS credentials(non-emptyUpdateNode,nodes:update) is distinct from a namedClear TLS credentialsaction. The clear action requires an authenticated operator,nodes:update(notnodes:read), exact target-name and confirmation-phrase checks, a generation bump, cached-client invalidation and a redacted audit entry; it touches only one node's three TLS fields.internal/rpc/services/node_tls_reset.goplus_test.goprove ordinary edits and all refusals never clear, while the named action does.docs/adr/0018-node-response-redaction.md,knowledge/decisions/adrs.md(one Track C owner),knowledge/architecture/rpc-contract.md.Verification
go test ./internal/rpc/... -count=1— passgo test ./... -count=1— passgo vet ./...— passknowledge-lint -fixthen plain — pass (38/38 queries), with one pre-existing unrelatedinvariants/data-safetyre-verify warning.Limitations / coordination
web/carbon-panel/src/lib/components/node-settings.sveltechange is owned by the frontend lane writer and is not in this PR (orchestrator coordination). The server-side contract makes an echo of redacted fields harmless even before that UI lands; the UI must still stop displaying/sending empty TLS fields as real values.nodes/readstays redacted.node-settings.svelte, frontend lane writer): no clearing via empty TLS fields; the UI half and server half must both ship before P0-GATE is complete.Do not merge here: independent review and green CI required.