From 8f818a64f2f0f3a833fc842d52a675358ec64c9c Mon Sep 17 00:00:00 2001 From: Igor Soarez Date: Wed, 18 Nov 2026 14:02:09 +0000 Subject: szecret: buckets beside the old store -- get/has/put/mv/rekey/list/check/enrol, admins from SZECRET_ADMINS_COMMAND; rotate retired (fleet hardening 12) A bucket is a directory of secrets with one set of readers: its recipients file plus the admins, the full set recorded in .szecret by rekey. put refuses when the readers or admins drift from that set, or with no admins; a plain put of a new name goes to admin-only, one still in the old store is rewritten there. The old store keeps working throughout. link/claude.sh leaves out an MCP server whose secret is in a bucket this host doesn't read. Design: cloud-setup docs/proposal-secret-roles.md. --- secrets/list.sh | 79 +++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 63 insertions(+), 16 deletions(-) (limited to 'secrets/list.sh') diff --git a/secrets/list.sh b/secrets/list.sh index bf087e3..39b17ff 100755 --- a/secrets/list.sh +++ b/secrets/list.sh @@ -4,20 +4,17 @@ set -euo pipefail if [[ "$#" -gt 0 && ("$1" == "-h" || "$1" == "--help") ]]; then cat </, one a line + list --all every bucket, read here or not list -h|--help -The command will: -1. List all .age files in the store directory -2. Remove the .age extension from filenames -3. Display the secret names in columns - -Note: Only shows secret names, not their values. +Only names, never values. The old store counts as readable while the old key +is here. EOF exit 0 fi @@ -25,12 +22,62 @@ fi this_dir="$(cd "$(dirname "$(realpath "$0")")" && pwd)" source "${this_dir}/common.sh" -maybe_column() { - if [ -t 1 ]; then - column - else - cat +all="" +names_only="" +while [[ $# -gt 0 ]]; do + case "$1" in + --all) all=1 ;; + --names) names_only=1 ;; + *) die "usage: szecret list [--names] [--all]" ;; + esac + shift +done + +secrets_in() { + local f + for f in "$1"/*.age; do + if [[ -e "${f}" ]]; then + basename "${f}" .age + fi + done | LC_ALL=C sort +} + +# Each bucket shown, then the old store, as "