-
Notifications
You must be signed in to change notification settings - Fork 2
secrets
This documents how secrets are introduced into the environment and what sensitive material lives where.
This repository contains zero secrets. No passwords, tokens, API keys, or private key material are committed. Everything in the source state is safe to be public.
Secrets are introduced at runtime through one of three mechanisms:
-
Bitwarden CLI (
bw): for passwords, API keys, and other credentials - Environment variables: for tokens that vary per machine or session
- Manual setup: for one-time operations like SSH key generation or GPG key import
chezmoi is configured to use Bitwarden CLI as its secret manager. The config in .chezmoi.toml.tmpl:
[bitwarden]
command = "bw"This tells chezmoi to resolve bitwarden template function calls via the bw CLI at apply time.
Some templates now call the bitwarden template function, for example:
-
home/dot_config/wakatime/dot_wakatime.cfg.tmplreads the WakaTime API key from the Bitwarden itemwakatime-api-key -
home/dot_config/finicky.js.tmplreads the work Chrome profile suffix from the Bitwarden itemwork-domain
When those targets are rendered, chezmoi apply requires an unlocked Bitwarden session.
Bitwarden-backed targets fail during apply when the vault is not unlocked. The rest of the apply still succeeds. The workflow on a fresh machine is:
- Run the bootstrap (
install.sh/install.ps1): configs deploy, secret-dependent targets error or are skipped. - Log in and unlock:
bw login && export BW_SESSION=$(bw unlock --raw) - Re-apply:
chezmoi applyfills in the secret-backed targets.
The repo manages GnuPG config files under home/private_dot_gnupg/:
| Source file | Target | Contents |
|---|---|---|
private_gpg.conf |
~/.gnupg/gpg.conf |
Algorithm preferences, key display settings, smartcard options |
private_scdaemon.conf |
~/.gnupg/scdaemon.conf |
disable-ccid (uses the system CCID driver instead of GnuPG's built-in one) |
The private_ prefix ensures these files are deployed with 0600 permissions (owner read/write only).
- No keyrings (
pubring.kbx,trustdb.gpg) - No private keys
- No revocation certificates
- No
gpg-agent.conf(uses system defaults)
The gpg.conf enforces several security-relevant preferences:
-
SHA-512 as default digest:
personal-digest-preferences SHA512 SHA384 SHA256 -
AES-256 as default cipher:
personal-cipher-preferences AES256 AES192 AES -
High s2k iteration count:
s2k-count 65011712(strengthens passphrase-derived key stretching) -
No auto key retrieval:
auto-key-locate localandkeyserver-options no-auto-key-retrieveprevent unintended keyserver traffic -
Recipient anonymity:
throw-keyidsomits recipient key IDs from encrypted messages -
No passphrase caching:
no-symkey-cacheprevents gpg-agent from caching symmetric passphrases
Some tools expect secrets as environment variables. These are typically set in shell-local files that are not committed:
-
~/.config/opencode/mcp-atlassian.env: Atlassian API credentials for the MCP server (only on non-private machines) - Session-scoped variables like
BW_SESSION(Bitwarden unlock token)
After the initial setup, use chezmoi verify to check that managed files match the source state:
chezmoi verifyIf files have drifted (edited directly in ~/ instead of through chezmoi), chezmoi diff will show what changed and chezmoi apply will restore the source state.