Repository navigation
feat(agent): add fog-agent enrollment (POST /agent/v1/enroll, tokens, approvals) - #186
Merged
Merged
Conversation
… approvals) A fog-agent enrolls with fog-node exactly as with FOG 1.6: it sends a CSR and its identity, waits while pending, and collects a certificate when an admin approves it, or at once with a valid enroll token or in the deploy window. Statuses, JSON keys and reasons match 1.6, so one agent binary serves both servers. - POST /agent/v1/enroll (public): the 1.6 state machine (200 issued, 202 pending, 403 denied, 426 protocol, 400 csr, 503 signing); host resolution by SMBIOS then MAC; pending hosts as 1.6 creates them. - Enroll tokens: stored as sha256 only; a use is reserved atomically and given back if signing fails. - Admin JSON routes: list enrollments, approve/deny, list/mint/revoke tokens, each with its host permission and apiCsrfGuard. - Host gets server-owned agent fields (agentFingerprint, agentNotAfter, agentVersion, agentCheckin, agentId); create, update, save and the edit page cannot write them. Indexes are made at bootstrap. - The public route caps the CSR (16384 chars) and stores only the contract's identity keys, each capped. - An approved certificate is handed over once even if its host was deleted since, as 1.6 does; the agent then re-enrolls. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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
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
fog-agent enrolls with fog-node exactly as with FOG 1.6, so one agent binary serves both servers. Builds on the agent PKI (#184) and the root guard (#185).
POST /agent/v1/enroll(public): the 1.6 state machine. 200 issued, 202 pending (retry_after300), 403 denied, 426 protocol, 400 csr, 503 signing; reasonsunknown-host,known-host-no-agent,rebind,identity-conflict,reissue,no-mac. Host resolution: SMBIOS (guid/serial/asset, 1.6 placeholder list), then MAC. Pending hosts are created as 1.6 creates them.GET /api/v1/agent/enrollments,POST /api/v1/agent/enrollment/:id/approve|deny,GET /api/v1/agent/tokens,POST /api/v1/agent/token,DELETE /api/v1/agent/token/:id. Each checks its host permission and carriesapiCsrfGuard.agentFingerprint,agentNotAfter,agentVersion,agentCheckin,agentId); create, update, save and the edit page cannot write them. Indexes are made at bootstrap (no migration).csr_pemat 16384 characters and stores only the contract's identity keys, each capped; text fields are cut to the 1.6 column widths.Real fog-agent, end to end
fog-agent built from
fog-agentat dbdf5bd, this branch lifted on :1340 with its own database and pki:Verification
npm test: 326 passing (67 new).npm run test:install: all checks pass.Reviews (opus): spec clean after round 2 (fixed the deleted-host collection path); standards findings fixed (size limits, token hash in one place, shared leaf parsing, named caps).
🤖 Generated with Claude Code