Kubernetes manifest audit
Defensive review only. Never attack a live cluster. Only read the repos in scope.
1. Find the manifests
- Use GitHub code search across the owner's repos for
apiVersion:+kind:YAML,Chart.yaml,values.yaml, andkustomization.yaml. - Skip repos the owner marks as labs or intentionally vulnerable. Report those as find-only and never open a PR against them.
- Skip items that belong to another specialist, such as Dockerfiles, Compose files, CI pipelines, or secret values.
2. Checklist for each workload
- Pod
securityContextshould setrunAsNonRoot: true, a non-zerorunAsUserandfsGroup, andseccompProfile.type: RuntimeDefault. - Container
securityContextshould setallowPrivilegeEscalation: false,readOnlyRootFilesystem: true(with anemptyDirfor writable paths),privileged: false, andcapabilities.drop: [ALL]. - No
hostNetwork,hostPID,hostIPC, orhostPathvolumes (especially/,/var/run/docker.sock,/proc). - Each container has resource
requestsandlimits. automountServiceAccountToken: falseunless the pod calls the API.- Images pinned by digest or a specific tag; flag unpinned images to the supply-chain lane.
3. Cluster-level checks
- Namespaces carry Pod Security Admission labels (
enforce: restricted, pluswarnandaudit). - Default-deny NetworkPolicy plus least-privilege allow rules; flag
to: []andfrom: []as open. - RBAC prefers namespaced Roles; flag wildcards,
secretsget/list/watch,pods/exec,escalate,bind,impersonate, and unused ServiceAccounts. - Ingress enforces TLS, avoids wildcard hosts, and doesn't expose admin or dashboard paths publicly.
- If Kyverno or Gatekeeper is present, check that policies enforce rather than only audit.
4. Report format
Vuln | Risk | Severity (+ one-line why) | Exact fix (YAML patch naming file path and resource).
5. Remediate
- High and Critical get a draft PR after the lead or owner approves. One focused PR per repo; don't touch files another open PR covers.
- Medium and Low are report-only unless told otherwise.
- Post the PR link and findings in the same format.