Kubernetes security explained simply is this: it is the practice of protecting a Kubernetes cluster, the workloads running in it, and the data they touch, against attackers who exploit misconfiguration more often than clever new tricks. The central question is whether Kubernetes is secure by default, and the short answer is no: it is powerful and flexible, and that flexibility means security depends on the choices made when the cluster is set up and run.
Kubernetes, often shortened to K8s, is the open-source system for running containers at scale, first released by Google as open source in 2014, with version 1.0 following in 2015 and graduation from the Cloud Native Computing Foundation in 2018. It schedules containers across machines, restarts them when they fail, and manages networking and storage for them. This guide explains where the risks sit, which controls matter most, and how to keep a cluster safe without slowing the teams that use it.
Key takeaways
- Kubernetes is not secure by default: most cluster breaches come from misconfiguration, not new attacks.
- The control plane is the most valuable target, so access to it must be tightly limited.
- Every workload should run with the least privilege it needs, and nothing more.
- Secrets, images and the software supply chain need the same care as the cluster itself.
- Security is ongoing: clusters must be patched, audited and reviewed as they change.
What Kubernetes security covers
A Kubernetes cluster has several layers, and security has to cover all of them. At the bottom are the machines that run the cluster, whether they are servers you own or virtual machines in the cloud. Above them sits the control plane, the set of components that decides where workloads run and keeps the cluster in its desired state. Then come the workloads themselves: the containers, the networks between them, and the storage they use.
Each layer has its own risks. A machine with an unpatched operating system can be compromised regardless of how well the cluster above it is configured. A control plane left open to the internet can be reached by anyone who finds it. A container running with too much privilege can escape and affect the machine beneath it. Good security means checking every layer, because an attacker only needs one weak one.
The main risks in a cluster
An exposed control plane. The Kubernetes API server is the front door to the cluster, and it must never be reachable by the public without strong authentication. Clusters have been compromised because the API server was left open, or because a weak credential was all that stood between an attacker and full control. The API server should be reachable only from trusted networks, and every request to it should be authenticated.
Over-privileged workloads. Containers that run as root, or with broad permissions, can do far more damage if they are compromised. A container that can reach the host machine’s resources can potentially escape its isolation and affect other workloads on the same machine. Running containers as a non-root user, and removing capabilities they do not need, limits what an attacker can do with a single compromised workload.
Secrets in the open. Passwords, tokens and keys are called secrets in Kubernetes, and they are often the prize an attacker is after. Secrets stored in plain text, committed to version control, or mounted into every container whether they are needed or not, create easy wins for attackers. Secrets should be stored securely, given only to the workloads that need them, and rotated when staff leave or a leak is suspected.
Untrusted images. Containers run from images, and an image that contains a vulnerable or malicious component brings that risk into the cluster. Images pulled from public registries without checking, or old images that have never been updated, are a common source of trouble. Checking images for known vulnerabilities before they are deployed, and keeping them up to date, closes this gap. Our guide to supply chain attacks explains how attackers target the software a team depends on, and why the build and packaging steps deserve the same care as the cluster.

Securing the control plane
The control plane deserves the strongest protection because it controls everything else. Access should require strong authentication, and it should be limited to the people and systems that genuinely need it. Accounts used by automation should be scoped narrowly, so that a deployment tool can deploy applications but cannot change cluster-wide settings or read secrets it does not use.
Role-based access control, usually called RBAC, is the tool Kubernetes provides for this. RBAC lets you define roles that describe exactly what an account may do, and bind those roles to specific people or service accounts. The discipline is to start with no access and add only what is needed, rather than starting with broad access and hoping nobody abuses it. Regular reviews matter too, because access that was needed for a project last year may be unnecessary now.
Audit logging is the control plane’s memory. Kubernetes can record who did what and when, and those logs are invaluable when something goes wrong: they show whether a change was made by a person, by an automated tool, or by an account that should never have had the power to make it. Audit logs should be stored somewhere an attacker who compromises the cluster cannot easily alter or delete them. Our Kubernetes guide explains how the control plane and its components fit together, which makes it easier to see what needs protecting.
Securing workloads and secrets
Workloads should run with the least privilege they need. That means running as a non-root user, using a read-only file system where possible, and dropping capabilities the application does not use. These settings are set in the workload’s security context, and they cost little to apply once a team knows them. They are also the settings most often skipped when a team is in a hurry, which is exactly when they matter most.
Secrets deserve special care. Kubernetes stores secrets separately from ordinary configuration, but that only helps if teams use the feature properly. Secrets should never be written into container images or committed to version control, where they can be found by anyone with access to the repository. They should be mounted only into the workloads that need them, and access to read them should be limited to a small number of accounts. Where possible, teams use an external secrets manager so that secrets live in one well-guarded place rather than scattered across the cluster.
How the main controls compare
No single control makes a cluster safe on its own. RBAC limits who can act, network policies limit what workloads can reach, image scanning limits what runs, and audit logging records what happened. Each control covers a different gap, and a cluster that relies on only one of them is still exposed through the others. The table below shows how the main controls fit together.
| Control | What it protects | Main risk if missing | What good looks like |
|---|---|---|---|
| RBAC | Who can act on the cluster | Over-broad access is abused | Least privilege, reviewed regularly |
| Network policies | Traffic between workloads | Attackers move sideways freely | Only needed traffic is allowed |
| Image scanning | What runs in containers | Vulnerable code is deployed | Images are scanned and kept current |
| Secrets management | Passwords, tokens and keys | Credentials leak or are over-shared | Secrets reach only the workloads that need them |
| Audit logging | Record of cluster activity | Incidents cannot be investigated | Logs are kept where attackers cannot alter them |
Common mistakes, and how to avoid them
The most common mistake is leaving the cluster’s defaults in place. Default settings are designed to make Kubernetes easy to try, not safe to run in production. The API server, the dashboard and the default service accounts all need attention before a cluster holds real data. A checklist, applied to every new cluster, catches these issues far more reliably than memory.
The second mistake is giving service accounts too much power. Automated tools need access to do their jobs, and it is tempting to give them broad permissions so that nothing breaks. The safer approach is to give each tool the narrowest role that works, test it, and widen it only when a real need appears. Broad permissions granted for convenience are rarely reviewed later, and they become a quiet risk.
The third mistake is treating security as a one-off task. Clusters change constantly: new workloads arrive, old ones are removed, and new vulnerabilities are discovered in the software the cluster runs. A cluster that was secure when it was built can drift into danger within months. Regular patching, regular access reviews and regular scans are the habits that keep a cluster safe over time, and they need to be scheduled rather than left to chance.
Kubernetes security checklist
- Restrict access to the API server to trusted networks, with strong authentication for every account.
- Apply RBAC with least privilege, and review roles and bindings regularly.
- Run workloads as a non-root user, with a read-only file system where possible.
- Drop container capabilities the application does not need.
- Apply network policies so workloads can only reach the services they need.
- Scan container images for known vulnerabilities before deployment, and rebuild them regularly.
- Store secrets securely, mount them only where needed, and rotate them when in doubt.
- Turn on audit logging, and store the logs where an attacker cannot alter them.
- Patch Kubernetes, its components and the underlying machines on a regular schedule.
Frequently asked questions
Is Kubernetes secure by default?
No. Kubernetes is flexible by default, and many of its out-of-the-box settings favour ease of use over security. A cluster needs deliberate configuration, including RBAC, network policies and image controls, before it is safe to run real workloads.
What is the biggest Kubernetes security risk?
Misconfiguration is the most common cause of cluster compromises. Exposed API servers, over-privileged accounts and containers running as root are all configuration problems, and they are far more common than attacks on Kubernetes itself.
What is RBAC in Kubernetes?
Role-based access control is the system Kubernetes uses to decide who may do what in a cluster. Roles describe a set of permissions, and bindings attach those roles to users or service accounts. Used well, RBAC ensures every account has only the access its job requires.
How should secrets be handled in Kubernetes?
Secrets should be stored in Kubernetes secrets or an external secrets manager, never in images or version control. They should be mounted only into the workloads that need them, access to read them should be tightly limited, and they should be rotated when staff leave or a leak is suspected.
Do I need network policies in a small cluster?
Yes. Even a small cluster benefits from limiting which workloads can talk to each other, because an attacker who compromises one workload can otherwise move sideways to the rest. Network policies are cheap to apply and they contain the damage when something goes wrong.
How often should a cluster be patched?
On a regular schedule, and promptly when a serious vulnerability is announced. Kubernetes, its components and the underlying machines all need patching, and the work should be planned rather than left until a problem appears. Our guide to cloud security and our guide to zero trust for small teams cover the wider habits that keep cloud systems safe over time.
The bottom line
Kubernetes security explained in one line is this: lock down the control plane, give every account and workload only the access it needs, protect secrets and images, and keep patching and reviewing as the cluster changes. Kubernetes gives you the controls; keeping a cluster safe is the discipline of using them every day.







