feat(enterprise): hosted action control and one-command node adoption - #449
Closed
TeoSlayer wants to merge 6 commits into
Closed
feat(enterprise): hosted action control and one-command node adoption#449TeoSlayer wants to merge 6 commits into
TeoSlayer wants to merge 6 commits into
Conversation
…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>
| if err != nil { | ||
| fatalf("resolve executable: %v", err) | ||
| } | ||
| if err := syscall.Exec(executable, os.Args, os.Environ()); err != nil { |
|
|
||
| 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) |
| 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) |
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. |
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
Verification