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/put-local.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'secrets/put-local.sh') diff --git a/secrets/put-local.sh b/secrets/put-local.sh index cba71c6..5510df6 100755 --- a/secrets/put-local.sh +++ b/secrets/put-local.sh @@ -7,7 +7,9 @@ if [[ "$#" -gt 0 && ("$1" == "-h" || "$1" == "--help") ]]; then put-local: Store a secret in a localized store Encrypts data from stdin and stores it in a localized store. The store name -is read from the .szecret metadata file in the file's directory. +is read from the .szecret metadata file in the file's directory. In a +repository bucket (kind=bucket), it is encrypted to the bucket's readers and +the admins. Usage: put-local @@ -42,6 +44,14 @@ file_path="$1" target_dir="$(dirname "${file_path}")" metadata_file="${target_dir}/.szecret" +# A repository bucket: its readers and the admins, as put does. +if is_bucket_dir "${target_dir}"; then + set="$(bucket_set "${target_dir}")" || exit 1 + age_version_ok + encrypt_to "${file_path}" "${set}" + exit 0 +fi + # Read store name and pubkey from metadata if ! read_local_metadata "${metadata_file}"; then >&2 echo "ERROR: No .szecret metadata in ${target_dir}" -- cgit v1.2.3