feat: adopt security zones and explicit workload refs
Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a0291a-1e87-7151-9934-fcbfe3f65eb1
This commit is contained in:
parent
12c637cbf2
commit
7ce58ae638
52 changed files with 1547 additions and 658 deletions
|
|
@ -1,13 +1,13 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Readiness gate for the flex-auth ``policy.enabled`` flip (WARDEN-WP-0031).
|
||||
"""Readiness gate for the zone-aware flex-auth caller identity.
|
||||
|
||||
flex-auth deployed ``flex-auth-ops-warden`` (FLEX-WP-0016) in ``callerAuth.mode:
|
||||
warn``: it authenticates the caller with a Kubernetes TokenReview and binds
|
||||
``resource.system: ops-warden`` to ``system:serviceaccount:ops-warden:ops-warden``,
|
||||
but a caller that sends no ``Authorization`` header only produces a
|
||||
``caller authentication warning`` and is still served. That pin cannot move to
|
||||
``enforce`` — and therefore ``policy.enabled: true`` cannot be set — until
|
||||
ops-warden's calling side actually presents a token.
|
||||
``enforce`` until ops-warden's calling side actually presents a token. The
|
||||
former repo-wide ``policy.enabled`` switch is retired by WARDEN-WP-0032.
|
||||
|
||||
This script asserts the calling side *without* flipping anything:
|
||||
|
||||
|
|
@ -57,9 +57,7 @@ def run_checks(config_path: Optional[Path], url: Optional[str]) -> List[Check]:
|
|||
return [("fail", "warden.yaml", str(e))]
|
||||
|
||||
policy = cfg.policy
|
||||
checks.append(
|
||||
("ok", "warden.yaml", f"loaded; policy.enabled={str(policy.enabled).lower()}")
|
||||
)
|
||||
checks.append(("ok", "warden.yaml", "loaded; security-zones_v0.1 profile"))
|
||||
|
||||
mode = policy.caller_auth.mode
|
||||
if mode == "none":
|
||||
|
|
@ -84,12 +82,12 @@ def run_checks(config_path: Optional[Path], url: Optional[str]) -> List[Check]:
|
|||
)
|
||||
|
||||
target = url or policy.flex_auth_url
|
||||
if url is None and not policy.enabled:
|
||||
if target is None:
|
||||
checks.append(
|
||||
(
|
||||
"skip",
|
||||
"live /v1/check",
|
||||
f"policy.enabled=false; pass --url to smoke {target} anyway",
|
||||
"policy.flex_auth_url is absent; pass --url to run the live smoke",
|
||||
)
|
||||
)
|
||||
return checks
|
||||
|
|
@ -188,13 +186,13 @@ def main() -> int:
|
|||
if failed:
|
||||
print(
|
||||
f"\nNOT READY — {len(failed)} check(s) failed. "
|
||||
"Do not ask flex-auth to enforce, and do not set policy.enabled: true."
|
||||
"Do not ask flex-auth to enforce caller authentication."
|
||||
)
|
||||
return 1
|
||||
print(
|
||||
"\nREADY — the calling side presents an identity. Next: tell flex-auth to set "
|
||||
"callerAuth.mode: enforce on flex-auth-ops-warden, re-run this check, then set "
|
||||
"policy.enabled: true with fail_closed: true."
|
||||
"callerAuth.mode: enforce on flex-auth-ops-warden and re-run this check. "
|
||||
"Zone-specific PEP failure modes already replace the retired global switches."
|
||||
)
|
||||
return 0
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue