Files
nixos-core/tests/security
kiskaadee 0d9a2ce511 fix(gitops): enforce deployments.yaml as sole registry authority and remove dynamic discovery
Closes an admission authority bypass in the webhook continuous deployment engine by
strictly requiring targets to be registered in Core/config/deployments.yaml.

Previously, `get_trusted_repository_mapping()` attempted to load `deployments.yaml`
in Step 1, but unconditionally fell back to Step 2 (scanning all directories in
`~/Sites` with an `app.yaml`). This allowed unapproved workloads or experimental
directories to receive automated webhook deployment authority simply by existing on
disk, and failed open when `deployments.yaml` was missing or malformed.

- Remove dynamic `SITES_DIR` directory scanning from `get_trusted_repository_mapping()`.
- Enforce `deployments.yaml` as the sole authority, failing closed with an empty
  mapping if the registry is missing, unreadable, or malformed.
- Update admission test fixtures to explicitly declare registered repositories.
- Add regression tests verifying rejection of unregistered `~/Sites` directories
  and fail-closed behavior on corrupted/missing registry configurations.
- Update `todo.txt` task tracking.

Part of Pre-P4 Security Gate (Milestone P4 readiness).
2026-10-15 01:28:47 -05:00
..