Replies: 2 comments
|
I checked the rc.8 credential provider and agree that the current boundary should be made very explicit. Today the managed store is plaintext YAML, with useful surrounding controls: POSIX owner-only file/directory modes, strict parsing whose diagnostics never quote secret-bearing lines, atomic locked writes, value-free The remaining question should be split by threat:
I would keep the seam and implement a sibling provider. The provider contract should include value-free descriptions, per-operation resolution, non-interactive/headless behavior, fail-closed authentication errors, migration without argv/plaintext temp files, explicit secret-memory lifetime, and reference-only audit events. For an encrypted-file migration, an auth-tag mismatch should preserve ciphertext and fail closed rather than silently reset the store. A safe migration also has to preserve source precedence: an inherited environment value may still shadow the migrated record until restart. I published a source-backed threat matrix, current operating patterns, migration contract, incident response, and fifteen acceptance gates here: |
|
Support encrypting Owner-only file modes help on a personal laptop, but they don’t cover shared machines, backups, sync folders, or accidental Also worth documenting explicitly: what is encrypted vs what remains in process memory / logs after load. |
Uh oh!
There was an error while loading. Please reload this page.
Idea: Encrypt API keys at rest in
$DSH_HOME/.credentials.yamlSummary
dshcurrently persists provider API keys as plain text YAML in$DSH_HOME/.credentials.yaml(default~/.dsh/.credentials.yaml, or a project-local.dsh-home):The document is protected only by filesystem permissions (
0600file under a0700directory) and by keeping the resolved path out of the model's context. Any process running as the same OS user — including the harness's own tool processes (bash, filesystem tools) — can read the raw secret. The dsh-credentials-local README already acknowledges this: "That is discretion, not a boundary", and defers an OS-keychain provider as the stronger answer.Proposal: add at-rest encryption for the managed credentials document, so a key on disk is ciphertext, not the literal
sk-…secret.Why it matters
$DSH_HOME).sk-…string sitting unencrypted in a user-controlled directory is one badcataway from leakage.Reference example: H's
ARCHITECTURE.mdSee ARCHITECTURE.md → Configuration for a working example of the target model:
~/.h/store/api-keys.enc, AES-256-GCM encrypted.~/.h/.key(mode-restricted).localStorageand is never re-sent in agent request bodies.~/.h/.Proposal
Keep the existing credential seam (
settingscarry references;dsh-credentials-localowns values; consumers re-resolve per operation) and encrypt only the provider's managed store.Option A — at-rest encryption in
dsh-credentials-local(stopgap, CLI-first):$DSH_HOME/.key(0600).set/unset→ decrypt current document (or start empty) → patch → re-encrypt → atomic write (keep the existing writer-lock and hot-reload behavior).resolve/describe→ read → decrypt → serve; auth-tag failure fails loud at boot and warns-and-keeps-last-good on live reload (mirrors today's parse-failure policy).dshmigration step.Option B — OS-keychain provider (strongest, already named deferred work):
A sibling
dsh-credentials-*package backed by the OS keychain (libsecret / Keychain / Windows Credential Manager). A keychain store is a boundary the harness's own tool processes cannot read at all — the current README explicitly calls this out as the deferred answer.Option B is the correct end state; Option A is a cheap, cross-platform win in the meantime (protects backups, sync, and disk theft even though a same-UID process could still read the
.key).Trade-offs / open questions
.keyfile: simple, cross-platform, but still same-UID readable — protects at-rest copies, not same-UID processes. OS keychain: real boundary, but platform-specific and absent on headless Linux.versionfield. An encrypted store needs a format marker (and aSESSION_FORMAT_VERSION-style bump policy, though that's the session log — different mechanism here).dsh's "misconfiguration fails loud" rule better?env/project-env/user-envresolution and the read-only shadowing rule stay exactly as-is.Impact
dsh-credentials-local(encryption, key file, migration) and/or a new keychain provider package.docs/user/guide/providers.md, package READMEs (security boundary section must be rewritten).This is a discussion starter, not a design doc. Feedback welcome on Option A vs. B, the key-storage trade-off, and migration/failure semantics.
All reactions