Secure messenger with TLS identities, scoped OpenBao secrets and worker compromise experiments

This commit is contained in:
2026-12-02 17:29:35 +03:00
parent 20afc2c790
commit 047cef4c7f
128 changed files with 10569 additions and 49 deletions
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env python3
"""Compare publishable files with actual local private material, without printing values."""
import gzip,json,subprocess
from pathlib import Path
ROOT=Path(__file__).resolve().parents[1]
values=set()
def collect(v):
if isinstance(v,str) and len(v)>=12:values.add(v.encode())
elif isinstance(v,dict):
for item in v.values():collect(item)
elif isinstance(v,list):
for item in v:collect(item)
for p in (ROOT/'secrets/operator').glob('*.json'):
try:collect(json.loads(p.read_text()))
except ValueError:pass
for p in (ROOT/'secrets/operator').rglob('*.key'):values.add(p.read_bytes().strip())
files=subprocess.check_output(['git','ls-files','--cached','--others','--exclude-standard','-z'],cwd=ROOT).split(b'\0');bad=[]
for raw in files:
if not raw:continue
name=raw.decode();p=ROOT/name
if not p.is_file():continue
assert not name.startswith(('secrets/','certs/private/')) and p.suffix not in ['.key','.pem'], 'private file staged'
data=p.read_bytes()
if name.endswith('.gz'):data=gzip.decompress(data)
if any(v in data for v in values):bad.append(name)
assert not bad, 'private material found in '+str(bad)
print('PASS: publishable files contain no exact known local credentials/shares/private-key contents; no values printed')