secrets: .sandcastle/.env carries four real tokens against its own invariant — docker-inspect leak on host-mode runs #578
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#578
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Security gap —
.sandcastle/.envcarries four real tokens against its own invariant.env.example:1-11states the invariant: onlyCLAUDE_CODE_OAUTH_TOKENlives in.env(everything else = files undersecrets/, because sandcastle forwards every.envkey asdocker run -e— the documented 2026-07-11 docker-inspect leak vector).Reality on the dev host:
.sandcastle/.envcurrently holds realFORGEJO_TOKEN,MATTERMOST_BOT_TOKEN,DIGITALOCEAN_ACCESS_TOKEN, andOURCLOUD_LAB_DNS_TOKEN. CI runs are safe (run-swarm.sh:225-227overwrites.envfrom the example underGITHUB_ACTIONS) — but any host-mode run exposes all four todocker inspect.Fix (hands-on — genuinely ready-for-human)
secrets/files on every host carrying them (dev laptop, workstation, elitebook); scripts already read the file paths as fallback (notify-mattermost.sh:11-18etc.).envfiles for any other strays.envcontains keys beyond the allowlist (the same fail-closed pattern as the empty-secret check)Check each host's
.envbefore deleting lines — the workstation'srehearsal-env.shsources some of these for cron jobs; those consumers keep working offsecrets/paths but verify before cutting over.Done 2026-08-19 (Ben's session). Fleet state found + fixed:
.env. All four (FORGEJO_TOKEN,MATTERMOST_BOT_TOKEN,DIGITALOCEAN_ACCESS_TOKEN,OURCLOUD_LAB_DNS_TOKEN) moved tosecrets/files (0600);.envnow carries onlyCLAUDE_CODE_OAUTH_TOKEN(the documented exception) + non-secret config (FORGEJO_API,MATTERMOST_URL,MATTERMOST_CHANNEL_ID).secrets/files;.env= timeouts + drive knobs only). Session-runner clone's.env: clean..sandcastle/.envfiles on all three hosts grepped forTOKEN|SECRET|KEY|PASSkeys: nothing beyond the allowed exception remains.Caveat: the
lab-dnsskill reads only env/.env(no file fallback), so on the laptop it now needsOURCLOUD_LAB_DNS_TOKEN=$(cat .sandcastle/secrets/ourcloud_lab_dns_token)at invocation — file-fallback + the preflight allowlist guard filed as a follow-up.