Skip to main content

Stage 8: Command Module (security)

Status: not implemented
  • stages/stage8/ holds a status placeholder only. The roadmap says Stage 8 is rebuilt from scratch on the verified Stage 7 Helm baseline.
  • Nothing on this page is an Apollo11 manifest. Do not assemble a stage from older branches.
  • Source: README.md and the Stage 8 / "Implementation and trust policy" sections of ROADMAP.md.
  • Concepts: Identity and authorization · Admission and runtime · Network policy · Secrets and supply chain

Where we left off​

Stage 7 runs, scales and can be observed, but it trusts everything:

  • Any Pod can talk to any Pod. The frontend can open a connection to booking-db directly. Nothing stops it.
  • Containers run with the image's defaults. They may run as root, write to their own filesystem, and keep every Linux capability.
  • Secrets are plain Kubernetes Secrets in the chart. They're base64, rendered from values, and readable by anyone who can read Secrets in the namespace.
  • Any image can run. Nothing checks where an image came from, or whether it has known vulnerabilities.
  • One thing was done right early: Stage 1 turned off ServiceAccount token automount, and Stage 7's chart still does. Apps have identities but no API access.

What changes in this stage (planned)​

ConcernStage 7Stage 8 (planned)Why it's better
Who may call the Kubernetes APINo tokens mounted; no RolesRBAC Roles and RoleBindings, only where a workload needs API accessLeast privilege you can prove with kubectl auth can-i
What a container may doImage defaultsrunAsNonRoot, seccomp RuntimeDefault, dropped capabilities, read-only root filesystemA compromised process can do far less
Pod-to-Pod trafficAll allowed (kindnet doesn't enforce policy)Calico CNI + default-deny NetworkPolicies with explicit allowsOnly booking can reach booking-db
SecretsKubernetes Secret from Helm valuesVault + External Secrets OperatorThe source of truth is outside Git and can be rotated
Rotated secret reaches the appNever: Pods keep the env value from start-upReloader rolls opted-in DeploymentsA rotation takes effect without a manual rollout restart
What may be deployedAnythingKyverno admission policies (audit first, then enforce)Bad manifests are rejected at the API server
Image trustWhatever tag is in valuesTrivy scan in CI, Cosign signatures checked at admissionOnly scanned, signed images run

Why in this order​

  1. Workload identity and hardening first. They need no new infrastructure, just chart fields. They also shrink what every later control has to defend.
  2. Then the network. NetworkPolicy objects do nothing until the CNI enforces them. So the CNI changes from kindnet to Calico before any policy is written.
  3. Then secrets. Vault and ESO add moving parts: bootstrap, sync, rotation, failure. Hardened, policy-limited Pods are a safer place to deliver real secrets to. Reloader comes with them, because a rotation that no Pod picks up has not rotated anything (Delivery is not restart).
  4. Then admission and supply chain last. Enforcement can block your own deploys. You turn it on only when the earlier controls are stable, and in audit mode before enforce.

What the stage must prove before it counts​

ControlEvidence the stage must show
RBACkubectl auth can-i answers yes for the one needed verb and no for the rest
Hardeningtouch /x fails inside a container; id shows a non-root UID
NetworkPolicyOne allowed path works and one blocked path fails, both tested
External secretsBootstrap, sync, rotation, a failure, and recovery
ReloaderWith the annotation removed, a rotated Secret leaves the old value inside a running Pod. With it restored, a new ReplicaSet rolls out and old tokens are rejected
Admission + signingAn unsigned image is rejected, and a signed one is admitted

See where Stage 7 stands today​

These read-only commands run against the repo, with no cluster needed:

grep -n "automountServiceAccountToken" stages/stage7/helm/apollo11/templates/config/serviceaccount.yaml | head -3
grep -R -n -E "runAsNonRoot|seccompProfile|readOnlyRootFilesystem|allowPrivilegeEscalation" \
stages/stage7/helm/apollo11/templates/apps stages/stage7/helm/apollo11/templates/ui || echo "no hardening fields in Stage 7"
cat stages/stage8/README.md
  • Automount is off: that control carried forward from Stage 1.
  • The hardening grep finds nothing in the Pod specs. Since Stage 5 the images themselves run as a non-root user (USER 10001:10001; the frontend as NGINX's UID 101), so id inside a container already shows a non-root UID. Nothing enforces it, though: no runAsNonRoot (a root image would start just the same), no read-only root filesystem (the process can still write anywhere the image's file permissions allow), no seccomp profile, no dropped capabilities. Stage 8 adds the enforcement.
  • With a cluster up, kubectl get pods -n kube-system shows kindnet and no Calico, so no NetworkPolicy would be enforced.

The journey so far​

ConcernStage 1Stage 7Stage 8 (planned)
Workload identityServiceAccount per workload, no tokensame+ RBAC where needed
Container privilegesimage defaultsimage defaultshardened securityContext
Networkflatflatdefault-deny + allow-list
SecretsSecret in GitSecret from Helm valuesVault + ESO
Secret rotation reaches Podsmanual restartmanual restartReloader
AdmissionnonenoneKyverno, Cosign

You should now be able to explain​

  • Which security gaps the Stage 7 platform has, and which control from Stage 1 survived.
  • Why NetworkPolicy needs an enforcing CNI before any policy means anything.
  • Why hardening comes before secrets, and admission comes last.
  • Why a rotated Secret needs Reloader, and when a Helm checksum annotation is enough.
  • Why a planned control can't be claimed until a stage shows its evidence.

Next: Stage 9 (planned) takes the platform to the cloud.