-
Notifications
You must be signed in to change notification settings - Fork 8.4k
sbx: document Linux keychain fallback for headless hosts #25232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,6 +61,36 @@ provider-specific details. | |
| identifier. Built-in agents declare a fixed set of services. Custom kits can | ||
| declare their own. The same `sbx secret set` flow works for both. | ||
|
|
||
| ### Where secrets are stored | ||
|
|
||
| The store backing `sbx secret set` depends on your operating system: | ||
|
|
||
| - macOS: the system Keychain. | ||
|
dvdksn marked this conversation as resolved.
|
||
| - Windows: the Windows Credential Manager. | ||
| - Linux: the Secret Service exposed by your desktop keyring, such as GNOME | ||
|
dvdksn marked this conversation as resolved.
|
||
| Keyring or KDE Wallet. | ||
|
|
||
| The Ubuntu package depends on GNOME Keyring, so a standard desktop install | ||
| needs no extra setup. | ||
|
|
||
| On Linux hosts without a running Secret Service — headless servers and some | ||
| WSL setups — `sbx` falls back to an encrypted file under your user config | ||
| directory `$XDG_CONFIG_HOME/com.docker.sandboxes`, which defaults to | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [LIKELY HIGH] Linux fallback path may use the wrong namespace Same issue as above: |
||
| `~/.config/com.docker.sandboxes` when `$XDG_CONFIG_HOME` is unset. The fallback | ||
| is automatic and needs no configuration. When you store a secret this way, | ||
| `sbx` prints a notice: | ||
|
|
||
| ```text | ||
| No keychain detected - this secret will be stored in an encrypted file on disk | ||
| ``` | ||
|
|
||
| The file is encrypted at rest and protected by `0700` directory permissions, | ||
| the same posture as `~/.docker/config.json`. This is weaker than an OS | ||
| keychain, which also mediates access per application. If you start a Secret | ||
| Service on the host later, `sbx` stores new secrets in the keychain again. For | ||
| more on running sandboxes without a desktop keyring, see | ||
| [Can I use Docker Sandboxes on headless Linux?](../faq.md#can-i-use-docker-sandboxes-on-headless-linux) | ||
|
|
||
| ### Store a secret | ||
|
|
||
| ```console | ||
|
|
@@ -303,9 +333,10 @@ The proxy reads the variable from your terminal session. See individual | |
|
|
||
| ## Best practices | ||
|
|
||
| - Use [stored secrets](#stored-secrets) over environment variables. The OS | ||
| keychain encrypts credentials at rest and controls access, while environment | ||
| variables are plaintext in your shell. | ||
| - Use [stored secrets](#stored-secrets) over environment variables. Stored | ||
| secrets are encrypted at rest in the OS keychain (or an encrypted file on | ||
| Linux hosts without a keychain), while environment variables are plaintext in | ||
| your shell. See [Where secrets are stored](#where-secrets-are-stored). | ||
| - Don't set API keys manually inside the sandbox. Sandbox agents are | ||
| pre-configured to use proxy-managed credentials. | ||
| - For Claude Code and Codex, OAuth is another secure option: the flow runs on | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[LIKELY HIGH] Linux fallback path may use the wrong namespace
Both new sections document the Linux credential fallback path as
$XDG_CONFIG_HOME/com.docker.sandboxes(defaulting to~/.config/com.docker.sandboxes), but every other Linux XDG path in the project uses the namespacesandboxes— notcom.docker.sandboxes. For example,troubleshooting.mdshows:The
com.docker.sandboxesnaming is macOS convention (reverse-DNS Application Support directories). If the actual Linux on-disk path is~/.config/sandboxes/(consistent with all other Linux paths), the documentation would mislead users looking for the encrypted fallback file.Please confirm the correct path against the implementation in docker/sandboxes#3231.