fix(pilotctl): pass admin token via env to avoid /proc/cmdline leak (PILOT-290)#195
fix(pilotctl): pass admin token via env to avoid /proc/cmdline leak (PILOT-290)#195matthew-pilot wants to merge 1 commit into
Conversation
…PILOT-290) The --admin-token flag was passed to the daemon subprocess as a command-line argument, exposing the secret in /proc/<pid>/cmdline and ps aux for the lifetime of the daemon. Now pilotctl passes PILOT_ADMIN_TOKEN via the subprocess environment instead, and the daemon reads PILOT_ADMIN_TOKEN as a fallback when --admin-token is not set on the command line. Closes PILOT-290
|
🤖 Hank — CI status Classification: The build/test failure is a genuine code defect:
@matthew-pilot — fix or comment. Auto-classified at 2026-06-02T09:57:00Z. Re-runs on next push or check completion. |
📊 PR Status — #195 PILOT-290
CI Checks (7/9 passing)
CanaryDispatched (canary-notify triggered). Check canary status. JiraPILOT-290 — Last activityCreated 2026-05-30 12:50 UTC (~3h ago). hank-pilot CI comment at 12:59. |
🔍 PR Explanation — #195 PILOT-290What this doesMoves the The problemThe pilotctl daemon-starter previously passed The fix (3 files, +33/−15)1.
2.
3.
ScopeSmall, focused change. No protocol or API change. Backward compatible — the |
🤖 PR Status CheckPR #195: fix(pilotctl): pass admin token via env to avoid /proc/cmdline leak (PILOT-290) matthew-pr-worker • 2026-05-31T08:36:00Z |
🤖 PR Explanationfix(pilotctl): pass admin token via env to avoid /proc/cmdline leak (PILOT-290) SummaryWhat failedThe Why this fix
Changes+33/−15 lines across 3 file(s):
Files Changed
matthew-pr-worker • 2026-05-31T08:36:00Z |
📊 PR Status — PILOT-290PR State: OPEN · Not draft · Canary: ❌ failed (cancelled) — canary-failed label applied Jira PILOT-290: TO DO · Labels:
Last operator activity: Jira updated 2026-05-31 16:22 EEST (Teodor Calin), PR updated 2026-05-31 18:04 UTC ⚡ Fix: token now passed via PILOT_ADMIN_TOKEN env var instead of argv. Canary cancelled — needs operator investigation before merge. |
What failed
The
--admin-tokenflag was passed to the daemon subprocess as a command-line argument, exposing the secret in/proc/<pid>/cmdlineandps auxfor the lifetime of the daemon.Why this fix
cmd/pilotctl/main.go): No longer adds--admin-tokentodaemonArgs. Instead passesPILOT_ADMIN_TOKENvia the subprocess environment in both foreground (syscall.Exec) and forked (exec.Command) paths.cmd/daemon/main.go): ReadsPILOT_ADMIN_TOKENas a fallback when--admin-tokenis not set on the command line (same pattern asPILOT_REGISTRY/PILOT_BEACON).The flag still works when passed directly (e.g. for manual daemon invocation), but pilotctl no longer leaks it via argv.
Verification
Closes PILOT-290