Establish scoped KeyCape factor custody and verified automatic renewal
Assistant: codex Assistant-Model: gpt-6-astra Assistant-Session: 01a092fe-13b1-7f12-ac74-7d258af4d79c
This commit is contained in:
parent
b75729b799
commit
2e2c31d237
22 changed files with 1169 additions and 1 deletions
16
scripts/keycape_factor_eso_metadata.py
Normal file
16
scripts/keycape_factor_eso_metadata.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import json,os,sys
|
||||
from pathlib import Path
|
||||
from keycape_factor_metadata import call,normalized,policy_text
|
||||
NAME="workload-kv-read-keycape-factor-read"
|
||||
OLD='# Exact-path JWT delivery; no issuer password or sibling paths.\npath "platform/data/workloads/net-kingdom/keycape-factor-read" {\n capabilities = ["read"]\n}\npath "platform/metadata/workloads/net-kingdom/keycape-factor-read" {\n capabilities = ["read"]\n}\n\n# ESO validates its own short-lived workload session.\npath "auth/token/lookup-self" {\n capabilities = ["read"]\n}\n'
|
||||
NEW=Path(__file__).resolve().parents[1].joinpath("openbao/policies/"+NAME+".hcl").read_text()
|
||||
fd=os.open(sys.argv[1],os.O_WRONLY|os.O_CREAT|os.O_EXCL,0o600)
|
||||
result={"success":False}
|
||||
try:
|
||||
current=policy_text(call("policy","read","-format=json",NAME))
|
||||
if normalized(current) not in (normalized(OLD),normalized(NEW)):raise RuntimeError()
|
||||
call("write","-format=json","sys/policies/acl/"+NAME,"-",payload={"policy":NEW})
|
||||
if normalized(policy_text(call("policy","read","-format=json",NAME)))!=normalized(NEW):raise RuntimeError()
|
||||
result={"success":True,"change":"ESO self-session lookup and revocation only","secret_values_read":False}
|
||||
finally:
|
||||
os.write(fd,json.dumps(result).encode());os.close(fd)
|
||||
Loading…
Add table
Add a link
Reference in a new issue