Skip to content

feat(enterprise): hosted action control and one-command node adoption - #449

Closed
TeoSlayer wants to merge 6 commits into
mainfrom
feat/hosted-node-adoption
Closed

feat(enterprise): hosted action control and one-command node adoption#449
TeoSlayer wants to merge 6 commits into
mainfrom
feat/hosted-node-adoption

Conversation

@TeoSlayer

Copy link
Copy Markdown
Collaborator

Summary

  • add signed hosted pre/post action enforcement and fleet/state control attachment
  • add one-time enrollment client with local trust and policy verification
  • auto-discover explicit managed attachments without changing unmanaged nodes
  • add headless control-agent and focused security/integration tests

Verification

  • go vet ./...
  • go test ./cmd/daemon ./cmd/pilotctl ./internal/enterprisecontrol
  • go test -short ./pkg/... ./cmd/... ./internal/...

teovl and others added 6 commits August 2, 2026 19:08
…unbind + test fixes

Preservation snapshot of uncommitted working-tree work (repo survey 2026-08-02).
WIP branch — do NOT push directly; split into reviewed PRs first. Build scratch
excluded via .gitignore.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…config-dir default)

L1: with fleet state sync enabled and state_directory empty, the scan root
defaulted to '.', the directory holding enterprise-control.json — so
scanFleetState shipped 256KB previews of any operator-added text file there to
the authority as signed telemetry. Fail closed: require state_directory to be
set explicitly and to be distinct from the config directory.

SECURITY_REVIEW_v1.14 L1.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…i-replay)

M2: a captured authority-signed restart/shutdown command could be replayed by a
compromised or MITM'd authority connection every poll — and after the restart
it caused — for up to its 24h TTL, because the daemon's result report goes to
the attacker (who drops it) so the authority's server-side de-duplication never
engages, yielding a fleet-wide shutdown/restart boot-loop. The signature is
replayed, not forged.

Persist a lifecycle guard (monotonic IssuedAt high-water + last command id) to
the enterprise-control state dir and refuse any lifecycle command at or below
it. The record is written BEFORE the daemon acts (and the write failing is
fatal to the action — fail closed), so it survives the syscall.Exec restart and
the replay is rejected on the next poll. Regression test covers replay, older
issue-time, newer command, and restart survival.

(Cert-pinning the authority channel — the other half of the MITM precondition —
remains a tracked enhancement; this idempotency record already breaks the
replay loop.)

SECURITY_REVIEW_v1.14 M2 (idempotency).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread cmd/control-agent/main.go
if err != nil {
fatalf("resolve executable: %v", err)
}
if err := syscall.Exec(executable, os.Args, os.Environ()); err != nil {
Comment thread cmd/control-agent/main.go

func appendEvidence(directory string, event evidenceEvent) error {
path := filepath.Join(directory, "control-events.jsonl")
file, err := os.OpenFile(path, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0o600)
Comment thread cmd/daemon/main.go
return
}
slog.Info("restarting daemon after graceful shutdown")
if err := syscall.Exec(executable, os.Args, os.Environ()); err != nil {
if err := enterpriseCertificateFile(path); err != nil {
fatalCode("invalid_argument", "%s: %v", label, err)
}
file, err := os.Open(path)
if err := os.MkdirAll(parent, 0o700); err != nil {
return "", err
}
if err := os.Chmod(parent, 0o700); err != nil {
}

func validateExecutablePlatform(path, wantOS, wantArch string) error {
f, err := os.Open(path)

func scanFleetStateFile(filename string, entry authority.FleetStateEntry, budget int) (authority.FleetStateEntry, error) {
entry.Kind = authority.FleetStateFile
file, err := os.Open(filename)
want = int64(budget)
}
contents := make([]byte, int(want))
file, err = os.Open(filename)
if err != nil {
return nil, err
}
if err := os.Chmod(backupRoot, 0o700); err != nil {
}

func hashFleetFile(filename string) (string, error) {
file, err := os.Open(filename)
@TeoSlayer

Copy link
Copy Markdown
Collaborator Author

Closing this public PR because the hosted federation and control-plane implementation belongs in the private platform repository. The managed client runtime is distributed as a checksum-pinned public release artifact; a future public SDK change must first decouple its interfaces from the private control packages so the OSS repository remains independently buildable and testable.

@TeoSlayer TeoSlayer closed this Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants