Load shell secrets from OpenBao instead of fish config #1

Open
opened 2026-11-11 21:48:30 +00:00 by ginjiruu · 0 comments
Owner

Why

Shell credentials (FORGEJO_API_TOKEN and similar) sit in fish config, a plain file that a dotfiles backup or commit can leak by accident. The current one is already dead. OpenBao is live with Kanidm login, so secrets should live there and be loaded into the shell, never written to config.

What

  • Storage: a personal KV path (e.g. user/ginjiruu/shell), keys = env var names. Mount and policy (readable only by my OIDC identity) go through a lab/iac PR, never by hand.
  • Loading (fish, in this repo): at login or on first use, if ~/.vault-token is valid, read the path and set -gx each key. If not logged in, skip quietly and print a hint to log in (vault-login.py). Nothing written to disk beyond the CLI's own short-lived token.
  • Lazy option, preferred where it fits: wrappers for fj and API calls fetch their token on demand instead of exporting everything into every shell.
  • Remove the plaintext token from fish config once loading works.

Dependencies

  • Works on the LAN today (OpenBao at https://10.10.1.21:8200, IP SAN).
  • Off-site use needs lab/iac#50 (host DNS) and lab/iac#51 (public endpoint).

Done when

  • KV path + policy merged in lab/iac
  • fish loads secrets from OpenBao, quiet no-op when not logged in
  • no credentials left in fish config or anything else tracked here
## Why Shell credentials (`FORGEJO_API_TOKEN` and similar) sit in fish config, a plain file that a dotfiles backup or commit can leak by accident. The current one is already dead. OpenBao is live with Kanidm login, so secrets should live there and be loaded into the shell, never written to config. ## What - **Storage:** a personal KV path (e.g. `user/ginjiruu/shell`), keys = env var names. Mount and policy (readable only by my OIDC identity) go through a lab/iac PR, never by hand. - **Loading (fish, in this repo):** at login or on first use, if `~/.vault-token` is valid, read the path and `set -gx` each key. If not logged in, skip quietly and print a hint to log in (`vault-login.py`). Nothing written to disk beyond the CLI's own short-lived token. - **Lazy option, preferred where it fits:** wrappers for `fj` and API calls fetch their token on demand instead of exporting everything into every shell. - Remove the plaintext token from fish config once loading works. ## Dependencies - Works on the LAN today (OpenBao at `https://10.10.1.21:8200`, IP SAN). - Off-site use needs lab/iac#50 (host DNS) and lab/iac#51 (public endpoint). ## Done when - [ ] KV path + policy merged in lab/iac - [ ] fish loads secrets from OpenBao, quiet no-op when not logged in - [ ] no credentials left in fish config or anything else tracked here
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ginjiruu/home-manager#1
No description provided.