feat(fleetnode): enroll nodes without miner signing keys#477
Draft
ankitgoswami wants to merge 1 commit into
Draft
feat(fleetnode): enroll nodes without miner signing keys#477ankitgoswami wants to merge 1 commit into
ankitgoswami wants to merge 1 commit into
Conversation
🔐 Codex Security Review
Review SummaryOverall Risk: LOW Findings[LOW] Optional Legacy Key Field Now Accepts Arbitrary Bytes
NotesNo auth bypass, SQL injection, command injection, pool-hijack, plugin trust-boundary, frontend, infrastructure, or Rust ASIC plugin issues were evident in the reviewed diff. I attempted the touched Go test packages, but the environment is read-only and Generated by Codex Security Review | |
a0633c2 to
4f8863d
Compare
223c620 to
9142fcf
Compare
0897894 to
10ef01c
Compare
9142fcf to
e0f8d8a
Compare
46d3000 to
60df615
Compare
040835c to
07bd80d
Compare
1239c48 to
298076a
Compare
07bd80d to
ede8e5f
Compare
a8d834e to
4cb6a53
Compare
4a54f48 to
b301110
Compare
4cb6a53 to
1193bc2
Compare
1193bc2 to
23e0fcc
Compare
b301110 to
e8b95c4
Compare
23e0fcc to
4e5a507
Compare
e8b95c4 to
d4a2e54
Compare
4e5a507 to
f524067
Compare
d4a2e54 to
890ed98
Compare
f524067 to
65dd2a6
Compare
890ed98 to
03b64ba
Compare
65dd2a6 to
00dafce
Compare
03b64ba to
0094f07
Compare
00dafce to
780b195
Compare
0094f07 to
bdad85e
Compare
780b195 to
92a985a
Compare
bdad85e to
6e4f9aa
Compare
92a985a to
363b79d
Compare
6e4f9aa to
ce4e79c
Compare
363b79d to
49b1daa
Compare
ce4e79c to
73308a9
Compare
d40c0f6 to
4902877
Compare
73308a9 to
df76b7a
Compare
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.
Summary
Phase 2 makes new fleet-node enrollments credentials-only: the node registers with its identity key and no longer generates, sends, or persists a miner-signing keypair. The legacy proto field, database column, and state fields remain in place for the phase-3 cleanup, but new registrations store an empty byte slice for the retained
miner_signing_pubkeycolumn.Stack: #471 -> #480 -> this PR. The diff here is relative to #480, which provides the server-side default-password remediation safety boundary. #482 is a sibling PR stacked on #480 for the Fleet UI remediation UX and is not required to review this fleet-node enrollment cleanup. Deleting the legacy field/column/state definitions is intentionally out of scope and belongs to phase 3.
Deployment note: ship the phase-1 proto plugin binary into fleet-node plugin directories before relying on this in environments where edge discovery must use the v2 credentials flow.
How it works
During enrollment, the fleet node generates only its identity keypair and sends
RegisterRequestwithoutminer_signing_pubkey. Gateway validation now allows that field to be omitted while still requiring the identity public key.The enrollment service normalizes a missing miner-signing public key to empty bytes before inserting the fleet node, preserving the existing
BYTEA NOT NULLschema without a migration. The saved fleet-node state keeps retained miner-signing fields empty, and plugin pairing startup tolerates the missing legacy key. Legacy asymmetric-auth pairing now returns an explicit error when no node signing key exists, while credentials-capable/basic-auth pairing continues to use supplied or discovered credentials.Diagrams
flowchart TD P["fleetnode pairing startup"] --> K{"miner-signing key present?"} K -->|"yes"| L["legacy asymmetric auth can run"] K -->|"no"| C{"driver supports credentials?"} C -->|"yes"| B["basic-auth pairing continues"] C -->|"no"| E["explicit legacy key error"]Areas of the code involved
proto/fleetnodegateway/v1and generated outputsRegisterRequest.miner_signing_pubkeywhile retaining the fieldserver/internal/fleetnode/bootstrapserver/internal/domain/fleetnode/enrollmentNOT NULLdatabase shape without a migrationserver/cmd/fleetnodeKey technical decisions & trade-offs
Testing & validation
cd server && ../bin/go test ./internal/fleetnode/bootstrapcd server && ../bin/go test ./cmd/fleetnodecd server && ../bin/go test ./internal/domain/fleetnode/enrollment -run TestRegisterFleetNode_NormalizesMissingMinerSigningPubkeyToEmptyBytescd server && ../bin/go test ./internal/handlers/fleetnode/gateway -run TestRegisterRequestValidationbin/buf lintcd client && npm run format:checkgit diff --check