feat(security): add external secrets management#26155
Conversation
|
Too many files changed for review. ( |
b4185f6 to
f33c483
Compare
8fedead to
722338f
Compare
(cherry picked from commit 0f9c602) # Conflicts: # CHANGELOG.md
(cherry picked from commit 0f9c602) # Conflicts: # CHANGELOG.md
|
Hey @joshavant — just wanted to drop a thank you here. We built a macOS Keychain integration on top of the exec SecretRef provider for our app KatClaw (a native macOS frontend for OpenClaw). Our resolver binary reads and writes secrets to macOS Keychain using the Data Protection API. KatClaw users can toggle "Key Protection" on/off — all their API keys move to Keychain, and the config gets SecretRef objects pointing to the exec provider. The eager-resolve-to-snapshot design means the resolver only spawns once at startup to batch-resolve all keys, then everything runs from memory. Zero keychain prompts, clean round-trips. Really solid infrastructure to build on. Thanks for all the work on this. 🙏 |
Summary
Add external secrets management as an additive superset of existing credential behavior.
This branch introduces provider-based SecretRefs (
env,file,exec) for static credentials, eager in-memory runtime snapshot activation, strict startup fail-fast for unresolved required refs, and atomic reload with last-known-good fallback.Plaintext remains supported and default; refs are opt-in.
What ships
1. SecretRef contract + provider model
{ source, provider, id }.envfileexec2. Runtime activation model
SECRETS_RELOADER_DEGRADEDSECRETS_RELOADER_RECOVERED3. In-scope static secret fields
models.providers.<provider>.apiKeyskills.entries.<skillKey>.apiKeychannels.googlechat.serviceAccountchannels.googlechat.accounts.<accountId>.serviceAccountauth-profiles.jsonvalue refs:api_key.keyReftoken.tokenRef4. Resolver behavior + hardening
env: explicit var resolution with optional allowlist.file: secure path checks, timeout/maxBytes, and modes:json(JSON Pointer ids)singleValue(id must bevalue)exec: no-shell absolute command execution with fixed argv semantics, minimal env by default, timeout/no-output timeout, output-size limits, protocol-versioned JSON contract, and strict path checks.allowSymlinkCommandis required (for example Homebrew shim paths), with resolved-target validation.5. Gateway + CLI surfaces
secrets.reload.openclaw secrets reloadopenclaw secrets auditopenclaw secrets configureopenclaw secrets apply --from <plan.json>secrets configuresupports provider setup, SecretRef mapping, preflight, and optional immediate apply.6. Apply/audit workflow (replaces migrate flow)
secrets applyexecutes one-way ref migration for selected targets in a plan.auth-profiles, legacy staticauth.json, known.envlines) where applicable.7. Onboarding/auth UX updates
plaintext(default)ref8. Redaction + persistence safety
9. Documentation
docs/gateway/secrets.mddocs/cli/secrets.mdCompatibility guarantees
api_key,token,oauth); refs are value-level additions.Out of scope
Validation
Rollback / operational note