security: verify staged-secret enforcement across 22 workstation checkouts
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 1s
Reject generated-only commits / generated-commit-guard (push) Successful in 7s
Python Tests / pytest (push) Successful in 25s

This commit is contained in:
codex 2026-10-12 17:48:43 +02:00
parent 2544b8703e
commit 355b6b9720
14 changed files with 949 additions and 16 deletions

View file

@ -6,12 +6,17 @@ The repo argument discovers the already-configured hook path; it is not a new
fleet routing or authority configuration.
"""
import argparse
import hashlib
import os
from pathlib import Path
import shlex
import subprocess
# Reviewed composition retains this guard and adds exact-scope secret scanning.
# CUST-WP-0080 / RMGR-WP-0021; unknown hooks still require owner integration.
SCANNED_HOOK_SHA256 = "d50cf763dc9814383c6886e30b6650bbbdcb49ddd78889082e3fda3626a2cbfd"
CHECKER = Path(__file__).with_name("check_generated_only_commit.py").resolve()
@ -30,7 +35,8 @@ def install(repo, execute=False):
if target.is_symlink():
raise ValueError("refuse redirected existing pre-commit hook")
if target.exists():
if target.read_text() != content:
if (target.read_text() != content
and hashlib.sha256(target.read_bytes()).hexdigest() != SCANNED_HOOK_SHA256):
raise ValueError("existing pre-commit hook differs; owner integration required")
return {"repo": str(repo), "hook": str(target), "status": "installed", "changed": False}
if execute: