Start with the Basics
Before implementing advanced security measures, cover the fundamentals:
RBAC Configuration
Default Kubernetes RBAC is permissive. Implement least-privilege access:
Avoid cluster-admin for day-to-day operationsUse namespace-scoped roles where possibleAudit who has access to what regularlyNetwork Policies
By default, all pods can communicate with all other pods. Network policies restrict this:
Start with deny-all, then allow specific trafficApply policies per namespaceTest policies in non-production firstPod Security Standards
Replace the deprecated PodSecurityPolicy with Pod Security Standards:
Privileged: No restrictions (avoid in production)Baseline: Prevents known privilege escalationsRestricted: Hardened configurationImage Security
Container images are a common attack vector.
Practical measures:
Use specific image tags, not "latest"Scan images for known vulnerabilitiesUse minimal base images (distroless, Alpine)Sign images and verify signaturesScanning alone isn't enough. Have a process for addressing findings.
Secrets Management
Kubernetes secrets are base64-encoded, not encrypted at rest by default.
Options:
Enable encryption at rest in etcdUse external secret management (HashiCorp Vault, cloud provider solutions)Avoid storing secrets in Git (use sealed-secrets or external-secrets operator)Runtime Security
Detecting anomalies in running containers:
Falco for runtime threat detectionRead-only root filesystems where possibleResource limits to prevent resource exhaustion attacksSupply Chain Security
Know what's running in your cluster:
SBOM (Software Bill of Materials) for your imagesAdmission controllers to enforce policiesRegular audits of third-party dependenciesPrioritization
Not everything needs to be done immediately. Prioritize by risk:
High priority: RBAC, network policies, image scanning
Medium priority: Pod security standards, secrets encryption
Lower priority: Runtime security (after basics are solid)
Common Mistakes
Security theater: Implementing tools without understanding what they protect againstAlert fatigue: Too many alerts lead to ignored alertsOne-time audits: Security requires ongoing attention, not periodic reviews