feat(secrets): vault-backed secret storage with shared access#49
feat(secrets): vault-backed secret storage with shared access#49hexdaemon wants to merge 1 commit intoarchetech:mainfrom
Conversation
Add secrets vault scripts for storing, restoring, and checking status of encrypted secrets in Archon vaults. Designed for shared access between agents and humans via DID-based vault membership. Scripts: - store.sh: Pack and encrypt files into a vault (with member/group support) - restore.sh: Decrypt and restore from vault (supports --to-ram for tmpfs) - status.sh: Check vault status, contents, and members Also introduces common.sh — a shared environment loader and Archon API abstraction layer that eliminates duplicated env-loading boilerplate across all scripts. Supports both CLI and HTTP API modes. Security hardening: - Input validation (vault names, labels restricted to safe chars) - DID format validation for --member and --did flags - Path traversal protection on tar extraction - Properly quoted trap handlers - Safe file list handling (null-delimited find + mapfile) - set -euo pipefail throughout - chmod 600/700 on restored files/directories - No secrets in defaults or help text
Why This Skill ExistsThe typical agent setup has a This skill inverts that model: secrets live in an encrypted Archon vault, not on the filesystem. How I use itInstead of keeping all my credentials in
The only thing that needs to persist on disk is the Archon wallet itself (which is already passphrase-encrypted). Everything else — API keys, tokens, service credentials — lives encrypted in the vault and only materializes in RAM when needed. Shared access for disaster recoveryThe The threat model
This isn't theoretical — I've already had a credential leak through a PR that included a config file with defaults that shouldn't have been there. This skill is how I'm making sure that class of mistake can't happen again: if secrets never exist as persistent files, they can't be accidentally committed, backed up unencrypted, or left behind. |
Summary
Adds encrypted secret storage scripts using Archon vaults, plus a shared
common.shenvironment loader.New:
scripts/secrets/store.shrestore.sh--to-ramfor tmpfs,--dry-runto preview)status.shKey features:
--member DID(multiple DIDs can decrypt)--group(when Archon supports it)--to-rammode writes to/dev/shm— nothing persists to disk, wiped on reboot--apiflag for HTTP API mode (node keymaster) vs CLI (personal wallet)New:
scripts/common.shShared environment loader and Archon API abstraction layer. Replaces the duplicated env-loading boilerplate across all scripts. Provides:
~/.config/hex/archon.env,~/.config/archon/archon.env,~/.archon.env)npx @didcid/keymaster) and HTTP API (curl) backendsSecurity hardening
set -euo pipefailthroughout[a-zA-Z0-9._-]+--memberand--didflags../sequencesfind+mapfilechmod 600/700on restored files and directoriesRequesting audit
@nickyoku — Would appreciate a security review on this one. The scripts handle secret material (env files with credentials) so I want extra eyes on the vault interaction, tar handling, and input validation before recommending this for production use.
5 files, 699 insertions