2.0 KiB
2.0 KiB
Phase 1 — atlas core
~4 days. Every surface depends on this. RED → GREEN → REFACTOR.
RED (write tests first, confirm they fail)
redact_test.go— golden test: serialized snapshot contains none of the denied fields, run against a fixture captured from the real clusterrbac_test.go— atlas ServiceAccount receives 403 onget secretsin every namespacesnapshot_test.go— an informer event produces the expected delta
GREEN
- ClusterRole: verbs
get,list,watchonly, explicit resource list — nosecrets, no*, no wildcard apiGroups - client-go informers: kube API (nodes, namespaces, workloads), Argo CD
ApplicationCRs - Reducer: informer events → in-memory snapshot, redacted at write time
- DTO construction — allowlist only. Emitted: name, namespace, kind, phase, ready counts, restart count, age, node name, health status, sync status, sync wave, explicit label subset. Never emitted: container env/args, image digests/tags,
spec.source.repoURL,spec.source.path, annotations, pod IPs, cluster IPs, Secret names,status.conditions[].message, node internal IPs - Redis publish (snapshot deltas →
kmsvc-redis-master.sqs:6379) - NetworkPolicy on atlas: egress restricted to kube API,
prometheus-operated.monitoring,reasoning-predictor.llm-serving,kmsvc-redis-master.sqs; ingress fromingress-nginxonly - Container hardening:
runAsNonRoot, read-only root filesystem, all capabilities dropped,seccompProfile: RuntimeDefault
REFACTOR
- Run
simplifyskill pass on reducer/DTO code - Confirm no
_ =on errors, no naked returns, every upstream call carries acontext.Context(go-error-handling, go-context skills)
Verify
kubectl auth can-i get secrets --as=system:serviceaccount:portfolio:atlas # no
go test ./... -run TestRedact -v
go test ./... -run TestRBAC -v
go test ./... -run TestSnapshot -v
Next: 03-phase2-topology.md