Add M8.2 environment isolation and World0 protection

Per-environment platform layers (dev, stage, world0) with restricted pod
security, quotas, limit ranges, default-deny networking and token-less
service accounts, applied by an administrator rather than Argo. A native
ValidatingAdmissionPolicy denies deleting World0 data, identity and Argo
objects to every requester without the break-glass group. Stage and
World0 Argo projects are scoped to one namespace, World0 blocks
automated sync, and a cleanup tool refuses World0. An offline policy
check runs as a new CI suite; a live verification script uses only
can-i, reads and server dry runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-09-29 12:43:58 -04:00
co-authored by Claude Opus 5.5
parent 18708340c3
commit df0c4f4efb
28 changed files with 953 additions and 2 deletions
+74
View File
@@ -0,0 +1,74 @@
# AEvolution environments (M8.2)
The decision is recorded in ADR-0069. This runbook applies the platform layer,
creates the per-environment references, and verifies isolation. Every step is
manual, and none is performed by Argo CD.
## Environments
| | dev | stage | world0 |
|---|---|---|---|
| Namespace | `evolution-dev` (exists) | `evolution-stage` | `evolution-world0` |
| Purpose | Development | Clone, migration and soak rehearsal | Persistent world (launch gated by M8.8) |
| Protected by admission | No | No | Yes |
| Cleanup tool | Allowed | Allowed | Refused |
| AppProject / Application | `aevolution-dev` (live, manual) | `deploy/argocd/stage/*.example` | `deploy/argocd/world0/*.example` (deny window) |
| Database | Its own database and logins on the AEvolution PostgreSQL VM | Its own | Its own |
| World IDs | Development range | Clone targets (ADR-0067) | World0's own; never reused elsewhere |
## Secret references (created by an operator, never committed)
Each namespace gets its own Secrets, with environment-specific values:
- `harbor-pull`: a pull-only Harbor robot (docker-registry type).
- `evolution-postgres-migrator`: the migrator/owner login for that environment's
database.
- `evolution-postgres-runtime`: the runtime login, a member of that environment's
NOLOGIN runtime group (ADR-0060).
- `aevolution-db`: connection settings (host, address, port, database, TLS mode
and root certificate). Mount it as files. The adapter reads a password file,
never `PGPASSWORD`.
A World0 credential must never exist in the dev or stage namespaces, and no dev or
stage credential may reach the World0 database. Rotate by replacing the Secret and
restarting the consumer.
## Apply (cluster administrator)
```sh
# 1. Platform guardrails, per environment (dev adds labels, quota and policies to
# the existing namespace; its completed proof Job already complies).
kubectl apply -k deploy/kubernetes/platform/dev
kubectl apply -k deploy/kubernetes/platform/stage
kubectl apply -k deploy/kubernetes/platform/world0 # an empty, protected namespace
# 2. World0 admission protection (validate first, then apply).
kubectl apply --dry-run=server -f deploy/kubernetes/platform/admission/
kubectl apply -f deploy/kubernetes/platform/admission/
# 3. Projects (resolve the Application paths only when M8.4 adds workloads).
kubectl apply -f deploy/argocd/stage/project.yaml.example
kubectl apply -f deploy/argocd/world0/project.yaml.example
# 4. Verify: reads, can-i and server dry runs only.
bash tools/ops/verify-isolation.sh
```
Create the Secrets listed above in each namespace before any workload syncs.
## Break-glass
To delete World0 data or identity on purpose:
1. Record the operation and its approval.
2. Use a credential whose groups include `aevolution:world0-break-glass`, for
example a short-lived client certificate with that organization.
3. Take and verify a backup first (M8.7).
Removing the admission policy itself is the break-glass of last resort. It needs
cluster-admin and must be recorded the same way. Never test by deleting World0: the
verify script uses server-side dry runs.
## Residual risks
- **`default` AppProject.** It still allows every destination, so its applications
(other projects, two with automated prune) can create objects in AEvolution
namespaces. Admission denies only World0 deletions. Recommended: restrict
`default`, or move those applications to scoped projects.
- **World0 volumes.** `local-path` provisions volumes with Delete. Patch each World0
PV to `Retain` when it is bound, and the policy then keeps it there. Volumes stay
node-local until M8.3.