Linux secret-store probe runs secret-tool --version, which libsecret does not support, so the keyring is never detected
@margaretjgu is already working on this.
Since Sep 17, 2026.
Assessment
This issue has not been assessed yet.
Description
Linux secret-store probe runs secret-tool --version, which libsecret does not support, so the keyring is never detected
File at: https://github.com/elastic/cli/issues
Summary
On Linux, @elastic/cli never uses the Secret Service keyring even when libsecret's secret-tool is installed and a working D-Bus session with an unlocked keyring is present. Every command that stores a credential falls back to inline storage and prints:
Warning: No OS secret store is available; credentials will be written inline to the config file (chmod 0600).
Cause
LinuxSecretServiceStore.probe() in dist/config/secret-store.js runs:
_execSync('secret-tool --version', execOpts(2_000));
secret-tool has no --version option. It prints its usage text and exits 2, so the probe throws and the store is marked unavailable. The CLI then tries PassStore (pass version), which is usually absent, and ends on NoopStore.
$ secret-tool --version; echo "exit=$?"
usage: secret-tool store --label='label' attribute value ...
secret-tool lookup attribute value ...
secret-tool clear attribute value ...
secret-tool search [--all] [--unlock] attribute value ...
secret-tool lock --collection='collection'
exit=2
The put, lookup, and clear calls themselves work fine. Only the availability probe fails, so reads of an existing $(secret_service:...) reference succeed while writes never produce one.
Environment
@elastic/cli |
0.5.0 |
| OS | Ubuntu 24.04.5 LTS, GNOME keyring unlocked, DBUS_SESSION_BUS_ADDRESS set |
| libsecret-tools | 0.21.4-1build3 |
| Node | 22.22.3 |
Reproduction
sudo apt install libsecret-tools
printf x | secret-tool store --label=probe service probe account probe && echo "keyring works"
elastic config context add demo --cloud-url https://api.elastic-cloud.com --cloud-api-key "$KEY" --json
Expected secrets[0].storage to be secret_service. Actual: inline, plus the warning above.
Confirming the diagnosis
Placing a wrapper named secret-tool earlier on PATH that exits 0 for --version and otherwise execs the real binary makes the same command report "storage":"secret_service", writes $(secret_service:elastic-cli/demo:cloud.auth.api_key) into the config, and creates the keyring entry. Nothing else changes.
#!/usr/bin/env bash
[ "$1" = "--version" ] && { echo "secret-tool shim"; exit 0; }
exec /usr/bin/secret-tool "$@"
Suggested fix
Replace the --version probe with something secret-tool actually supports. Options, in order of preference:
- Check that the binary exists (
command -v secret-toolorwhich) and let a failedputtrigger the inline fallback. This matches how reads already behave. - Do a round trip:
secret-tool storea throwaway entry, thensecret-tool clearit. This also verifies the D-Bus session and unlocked keyring, which a binary check does not.
Note that secret-tool lookup on a missing item exits 1 and secret-tool search exits 0 even with no D-Bus session, so neither is a reliable availability signal on its own.
Impact
Every Linux user of the CLI is silently downgraded to plaintext credentials in ~/.elasticrc.yml, and the warning text tells them to install a store they may already have.
- Dominant language
- TypeScript
- Stars
- 43
- Forks
- 24
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 55
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from elastic/cli
-
cloud enhancement
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
copse-dev/agent-pane#2953 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·