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/has.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 secrets/has.sh (limited to 'secrets/has.sh') diff --git a/secrets/has.sh b/secrets/has.sh new file mode 100755 index 0000000..6748754 --- /dev/null +++ b/secrets/has.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +set -euo pipefail + +if [[ "$#" -gt 0 && ("$1" == "-h" || "$1" == "--help") ]]; then + cat < exists and this machine is one of its bucket's readers (in +the old store: if the old key is here). Decrypts nothing and prints nothing. + +Usage: + has + has / + has -h|--help +EOF + exit 0 +fi + +this_dir="$(cd "$(dirname "$0")" && pwd)" +szecret_quiet=1 +source "${this_dir}/common.sh" + +[[ "$#" -ge 1 ]] || exit 1 + +file="$(find_secret "$1" 2>/dev/null)" || exit 1 + +if [[ -n "${store}" && "$(dirname "${file}")" == "${store}" ]]; then + [[ -n "${private_key}" && -r "${private_key}" ]] +else + is_reader "$(dirname "${file}")" +fi -- cgit v1.2.3