Реализация на 5

This commit is contained in:
Grbisba
2026-11-18 11:36:21 +03:00
parent 20afc2c790
commit de4d471d80
255 changed files with 21516 additions and 124 deletions
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env python3
import json,subprocess,sys
from pathlib import Path
ROOT=Path(__file__).resolve().parents[1];sys.path.insert(0,str(ROOT/'scripts'));import security
before=json.loads(subprocess.check_output(['docker','inspect',security.compose('ps','-q','lb').stdout.strip()],text=True))[0]['Image']
subprocess.run([sys.executable,str(ROOT/'scripts/renew-leaf.py'),'lb'],check=True)
subprocess.run([sys.executable,str(ROOT/'scripts/wait-ready.py')],check=True)
security.probe('tls',target='https://api:8080/health/ready',material='lb-old',expect='deny')
security.probe('tls',target='https://api:8080/health/ready',material='lb')
after=json.loads(subprocess.check_output(['docker','inspect',security.compose('ps','-q','lb').stdout.strip()],text=True))[0]['Image'];assert before==after
(ROOT/'evidence/leaf-rotation.json').write_text(json.dumps({'image_unchanged':True,'old_leaf_rejected':True,'new_leaf_accepted':True,'verified_https_ready':True},indent=2)+'\n');print('PASS: leaf rotation without image rebuild and old-serial revocation')