Implement lab7 mTLS, scoped OpenBao secrets and worker compromise experiment

This commit is contained in:
2026-11-13 01:12:35 +03:00
parent 20afc2c790
commit 46806a5c37
120 changed files with 10228 additions and 74 deletions
+15
View File
@@ -0,0 +1,15 @@
"""Stop the real process selected by X-Instance-Id; do not stop any dependency."""
import json
import os
from concurrent.futures import ThreadPoolExecutor
from stack import ROOT, docker, instance, replicas
target=os.environ['TARGET_INSTANCE_ID']
before=replicas()
with ThreadPoolExecutor(max_workers=2) as pool:
matches=[cid for cid,alias in zip(before,pool.map(instance,before)) if alias==target]
assert len(matches)==1,'Target does not uniquely identify a running API'
# Immediate process crash, without adding a graceful-drain delay to the fault.
docker('kill','--signal','KILL',matches[0])
assert docker('inspect','--format','{{.State.Running}}',matches[0])=='false'
(ROOT/'evidence').mkdir(exist_ok=True)
(ROOT/'evidence/stop-one.json').write_text(json.dumps({'target_instance':target,'stopped_container':matches[0],'before_containers':before,'after_running_containers':replicas()},indent=2)+'\n',encoding='utf-8')