Repository navigation
[M1.2c1] Persist validated agent credentials atomically - #32
Merged
Merged
Conversation
3 of 4 tasks
samuelmbabhazi
force-pushed
the
feat/m1.2b2-agent-gateway
branch
from
November 5, 2026 13:35
24806b7 to
60615f9
Compare
samuelmbabhazi
force-pushed
the
feat/m1.2c1-agent-credentials
branch
from
November 5, 2026 13:36
a4ce5a7 to
f043040
Compare
samuelmbabhazi
force-pushed
the
feat/m1.2b2-agent-gateway
branch
from
November 5, 2026 14:23
60615f9 to
34bbf2a
Compare
samuelmbabhazi
changed the base branch from
feat/m1.2b2-agent-gateway
to
main
November 5, 2026 14:24
samuelmbabhazi
force-pushed
the
feat/m1.2c1-agent-credentials
branch
from
November 5, 2026 14:25
f043040 to
5465689
Compare
samuelmbabhazi
added a commit
that referenced
this pull request
Nov 5, 2026
Implements M1.2c2: the Go agent can enroll and rotate its Ed25519 key/certificate through the TLS gateway. Depends on #32 and targets its branch. Before sending a join token, a payload-free TLS probe verifies the installation CA fingerprint, server chain, hostname and validity. Enrollment then uses standard TLS verification against that pinned root. The gateway now includes its public CA chain in its server handshake. Returned credentials are bound to the same CA and exact node/organization identity; renewal rotates both key and certificate. Unary calls have a 30-second deadline and 64 KiB message limits. Remote error text is sanitized to avoid token echoing. Validation: real TLS/gRPC Go tests with race detection; wrong pin, rogue CA, hostname mismatch, expired server, oversized request and token-echo tests; golangci-lint; pnpm lint; real PostgreSQL/TLS integration suite. Existing Go gRPC dependencies are now declared directly in the agent module. Security: the bootstrap-only `InsecureSkipVerify` is paired with a mandatory custom verifier that performs chain, hostname, validity and pin checks. It carries no application data. All RPCs use normal TLS verification. Missing pins are allowed only in explicit development mode, consistent with existing configuration. - [x] M1.2c2 acceptance tests - [x] No shell invocation, secret logging or extra database writes - [x] Specification and threat model updated - [ ] CI and maintainer review The daemon connection loop and gateway streaming remain in M1.2c3/c4. No merge requested.
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.
Implements the first part of M1.2c: node keys and credentials that remain coherent across enrollment and renewal. Depends on #31; this PR intentionally targets its branch.
The agent generates Ed25519 keys and signed CSRs, validates the key/certificate pair against the installation CA and exact tenant/node SPIFFE identity, and persists one atomic credential generation. Loading rejects symlinks, loose permissions, oversized files, mismatched identities and invalid certificates. The private key uses the redacting Secret wrapper and is exposed only at TLS and explicit persistence boundaries.
Validation: Go tests with the race detector, golangci-lint, TypeScript lint/typecheck and unit tests, protobuf lint/format. Regression tests cover forged identities, substituted keys/CAs, failed replacements, secret formatting and file permissions. No new dependencies, remote actions or database writes. Plan, specification and threat model updated.
M1.2c remains open for enrollment, streaming and reconnect/renewal scheduling. No merge requested.