Stage 6, Part 5 of 9, RBAC, ServiceAccounts & Security
Text
PART 5: ARCHITECTURE & STRATEGY
23. Zero-Trust Kubernetes Architecture
text
┌─────────────────────────────────────────────────────────────┐
│ ZERO-TRUST ARCHITECTURE │
│ │
│ Identity │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ • OIDC for humans │ │
│ │ • SPIFFE/SPIRE for workloads │ │
│ │ • IRSA/Workload Identity for cloud │ │
│ │ • Bound ServiceAccount tokens (short-lived) │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
│ Authorization │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ • RBAC (least privilege) │ │
│ │ • ValidatingAdmissionPolicy (CEL) │ │
│ │ • Kyverno/OPA for complex policies │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
│ Network │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ • Default-deny NetworkPolicies │ │
│ │ • mTLS between all services (Istio, Linkerd) │ │
│ │ • Egress restrictions │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
│ Runtime │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ • Non-root, read-only rootfs │ │
│ │ • Drop ALL capabilities │ │
│ │ • seccomp RuntimeDefault │ │
│ │ • PSA restricted │ │
│ │ • Falco/Tetragon detection │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
│ Supply Chain │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ • Signed images (cosign) │ │
│ │ • Verified at admission │ │
│ │ • SBOM generated │ │
│ │ • SLSA provenance │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
│ Data │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ • Encryption at rest (etcd) │ │
│ │ • External secrets (Vault, ESO) │ │
│ │ • Audit logging to SIEM │ │
│ └─────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
24. Multi-Tenant Security Architecture
| Isolation Level | Mechanism |
| Soft | Namespaces + RBAC + NetworkPolicy + Quotas |
| Medium | Above + Pod Security Standards (restricted) |
| Hard | vCluster or separate clusters |
| Strongest | Separate clusters, separate cloud accounts |
Namespace Isolation Checklist
- □ RBAC: Namespace-scoped roles
- □ NetworkPolicy: Default deny
- □ ResourceQuota: Per-namespace limits
- □ LimitRange: Default limits
- □ PodSecurity: Restricted
- □ ServiceAccounts: Per-workload
- □ Secrets: Namespace-scoped
- □ Image policy: Verified images
25. Compliance & Security Frameworks
| Framework | K8s Requirement |
| PCI-DSS | RBAC, audit logs, encryption, network segmentation |
| HIPAA | Audit trails, access controls, encryption |
| SOC2 | Change management, monitoring, incident response |
| GDPR | Data residency, access controls, right to erasure |
| FedRAMP | FIPS 140-2, SELinux, no privileged, STIG |
CIS Kubernetes Benchmark (Key Items)
- □ Anonymous auth disabled
- □ RBAC enabled
- □ Client cert auth for admins
- □ Audit logging enabled
- □ etcd encryption at rest
- □ No privileged containers
- □ No root in containers
- □ PSA restricted
- □ NetworkPolicies default deny
- □ Image policy enforced
1:1 copy of the class Google Doc, code in code blocks.