
Securing Your Kubernetes Cluster on EKS: A Practical Checklist
A layered approach to EKS security — covering IAM/RBAC, IRSA, image scanning, default-deny NetworkPolicies, and moving secrets out of native Kubernetes Secrets.
Securing Your Kubernetes Cluster on EKS: A Practical Checklist
Getting an app running on EKS is exciting — but a default cluster configuration is not a secure one. Kubernetes ships with sensible defaults for getting started, not for locking things down. This article walks through the security layers that matter most, in the order you'd typically address them after your first successful deployment.
Think in Layers
Kubernetes security isn't one setting — it's a stack of independent layers, each closing off a different kind of risk:
- Identity and access — who can talk to the cluster, and what can they do?
- Workload isolation — what can a Pod see and reach once it's running?
- Supply chain — can you trust the images you're running?
- Network boundaries — can Pods talk to things they shouldn't?
- Secrets handling — where do sensitive values actually live?
Each layer is worth addressing independently — a strong setup in one area doesn't compensate for a weak one elsewhere.
1. Identity and Access: IAM and RBAC
EKS ties together two separate permission systems, and mixing them up is the most common early confusion:
- AWS IAM controls who can call the EKS API itself (create/delete clusters, describe resources).
- Kubernetes RBAC controls what an authenticated user or service account can do inside the cluster (get Pods, create Deployments, read Secrets).
The
aws-auth ConfigMap (or, in newer clusters, EKS access entries) maps IAM identities to Kubernetes RBAC roles. A common early mistake is granting broad cluster-admin access to every IAM user who needs any cluster access at all. Instead, define least-privilege Roles scoped to specific namespaces:apiVersion: rbac.authorization.k8s.io/v1kind: Rolemetadata: namespace: team-a name: developerrules: - apiGroups: ["", "apps"] resources: ["pods", "deployments", "services"] verbs: ["get", "list", "watch", "create", "update"]
Bind it to a specific user or group with a
RoleBinding , scoped to that one namespace — not a ClusterRoleBinding , which would apply everywhere.2. Workload Isolation: Namespaces, Service Accounts, and IRSA
Every Pod runs with a Service Account, and by default it's the namespace's
default account with minimal but nonzero permissions. Two habits matter here:- Give workloads their own Service Accounts rather than sharing the default one, so permissions can be scoped per-application.
- Use IRSA (IAM Roles for Service Accounts) so a Pod that needs to call S3 or DynamoDB gets a narrowly scoped IAM role — not broad permissions inherited from the EC2 node itself. Without IRSA, every Pod on a node can potentially use whatever IAM role the node has, which is far too broad in a multi-tenant cluster.
Also apply a Pod Security Standard (Kubernetes' built-in replacement for the deprecated PodSecurityPolicy) to block obviously risky configurations, like containers running as root or requesting privileged mode:
apiVersion: v1kind: Namespacemetadata: name: team-a labels: pod-security.kubernetes.io/enforce: baseline
3. Supply Chain: Trusting Your Images
A Kubernetes cluster is only as secure as the containers it runs. Basic hygiene:
- Scan images for known vulnerabilities before deployment — Amazon ECR has built-in scanning you can enable per repository.
- Avoid
latesttags in production; pin specific image digests so a Deployment can't silently pull a different image than the one you tested.
- Restrict which registries Pods can pull from, so a compromised or malicious image can't be introduced from an untrusted source. Admission controllers like Kyverno or OPA Gatekeeper can enforce this as a cluster-wide policy.
4. Network Boundaries: Default-Deny with NetworkPolicies
By default, every Pod in a cluster can reach every other Pod. In a multi-tenant or multi-team cluster, this is rarely what you want. A common, effective pattern is default-deny, then explicitly allow what's needed:
apiVersion: networking.k8s.io/v1kind: NetworkPolicymetadata: name: default-deny namespace: team-aspec: podSelector: {} policyTypes: - Ingress - Egress
apiVersion: networking.k8s.io/v1kind: NetworkPolicymetadata: name: allow-frontend-to-backend namespace: team-aspec: podSelector: matchLabels: app: backend ingress: - from: - podSelector: matchLabels: app: frontend policyTypes: - Ingress
Note that NetworkPolicies require a CNI plugin that supports enforcement — the default Amazon VPC CNI needs this capability enabled, so confirm it's active before relying on policies to actually restrict traffic.
5. Secrets: Don't Rely on Kubernetes Secrets Alone
Kubernetes Secrets are only base64-encoded, not encrypted, by default — anyone with API access to read a Secret object can trivially decode it. Two improvements are worth making early:
- Enable envelope encryption for Secrets at rest using AWS KMS, so Secrets are actually encrypted in etcd, not just obscured.
- For sensitive application secrets (database passwords, API keys), consider AWS Secrets Manager or Parameter Store combined with the Secrets Store CSI Driver, which mounts secrets directly into Pods without ever storing them as native Kubernetes Secret objects.
Putting It Together: A Rollout Order
If you're hardening an existing cluster rather than starting from scratch, this order tends to cause the least disruption:
- Audit and tighten RBAC bindings — remove unused
cluster-admingrants first.
- Move workloads to dedicated Service Accounts and add IRSA where AWS API access is needed.
- Enable image scanning and pin image digests for production workloads.
- Roll out default-deny NetworkPolicies namespace by namespace, watching for broken traffic before expanding.
- Migrate sensitive secrets out of native Kubernetes Secrets into Secrets Manager or Parameter Store.
Final Thoughts
None of these layers require exotic tooling — they're mostly AWS and Kubernetes features that are simply off by default. The mental model worth keeping is: assume a Pod will eventually be compromised, and ask what it could reach from there. Each layer above exists to shrink that blast radius, one boundary at a time.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article