eBook2025TheCompleteGuideToKubernetesSecurity
eBook2025TheCompleteGuideToKubernetesSecurity
Complete Guide
to Kubernetes Security
CROWDSTRIKE THE COMPLETE GUIDE | KUBERNETES SECURITY 2
Table of
Contents
Introduction 4
Conclusion 33
CROWDSTRIKE THE COMPLETE GUIDE | KUBERNETES SECURITY 4
Introduction
Kubernetes has become the de facto standard for container orchestration following
the rise in adoption of cloud-native technologies and DevOps practices. This is
something we can expect to remain true for a long time to come, especially since 84%
of organizations surveyed in the Cloud Native Computing Foundation (CNCF) Annual
Survey 2023 were using or evaluating Kubernetes, up from 81% in 2022.
With Kubernetes’ widespread adoption comes the need to ensure robust security
measures are in place to protect the infrastructure, applications and data it hosts.
The Red Hat 2024 State of Kubernetes security report revealed that two-thirds of
organizations experience delayed deployments due to Kubernetes security concerns.
Figure 1. The cloud-native stack — CNCF Cloud Native Security White Paper
• Kubernetes: kubernetes.io
• CrowdStrike: crowdstrike.com/platform/cloud-security/container-kubernetes/
CROWDSTRIKE THE COMPLETE GUIDE | KUBERNETES SECURITY 6
Chapter 1
Understanding
Kubernetes and Its
Place in Cloud-Native
Architecture
Exploring Cloud-Native Architecture:
Foundations and Benefits
In the rapidly evolving technology landscape, cloud-native architecture has emerged
as a pivotal paradigm, fundamentally transforming how applications are built, deployed
and managed. At its core, cloud-native architecture enables organizations to develop
resilient, scalable and agile applications. Unlike traditional monolithic architectures,
cloud-native approaches foster an environment where continuous integration and
continuous delivery (CI/CD) can thrive. This shift accelerates development cycles and
enhances operational efficiency and reliability.
CROWDSTRIKE THE COMPLETE GUIDE | KUBERNETES SECURITY 7
Figure 3. Containers are considered lightweight and portable, compared to virtual machines and
traditional deployment mechanisms – Kubernetes Overview
• Resilience and High Availability: Kubernetes inherently supports the resilience and
high availability needs of cloud-native applications. It continuously monitors the
health of containers and automatically replaces or restarts failed containers.
Kubernetes also supports rolling updates and rollbacks, allowing for seamless
application updates without downtime, which is crucial for maintaining availability
in a cloud-native environment.
CROWDSTRIKE THE COMPLETE GUIDE | KUBERNETES SECURITY 9
Despite its powerful capabilities, deploying and managing Kubernetes clusters can
be challenging, particularly from a security perspective. The distributed nature
of Kubernetes introduces complexities in securing communications between
microservices, managing access controls and protecting sensitive data. Additionally,
the dynamic nature of Kubernetes environments means security policies and practices
must continuously evolve to address emerging threats. The fundamental nature of
Kubernetes opens it up to various security risks, such as:
• Container Image Vulnerabilities: Containers are built from images that may
contain known vulnerabilities if not properly vetted. Additionally, traditional
“patching” workflows are not compatible with containers, where the container
image is meant to be immutable once it is deployed.
Ensuring that each component within the cluster is properly configured and secured
requires a deep understanding of both Kubernetes and cloud security principles.
CROWDSTRIKE THE COMPLETE GUIDE | KUBERNETES SECURITY 10
Chapter 2
Initial Entry Points for
Container Compromise
How might an attacker gain access to a container in the first place? Before delving into
Kubernetes security best practices, it’s important to understand the vectors for initial
access for container compromise. The MITRE ATT&CK® framework highlights three
common techniques attackers can use to compromise containers:
• External Remote Services: Attackers can leverage exposed Kubernetes services, and
some may not even require authentication. Examples include an exposed Docker API or
web application such as the Kubernetes dashboard.
• Valid Accounts: Valid cloud credentials can provide an attacker with the means to
bypass access controls and gain access to the cluster’s management layer undetected.
Valid cloud credentials can be obtained in various ways, such as through phishing or
exposure in a public code repository.
CROWDSTRIKE THE COMPLETE GUIDE | KUBERNETES SECURITY 11
Depending on how you choose to host your Kubernetes clusters, the default
configuration for the control plane API may change slightly. Many examples in the
following sections assume you are managing your Kubernetes cluster yourself (with
defaults lacking guardrails), but they still serve as a reminder to review your default
configurations no matter how your clusters are hosted.
CROWDSTRIKE THE COMPLETE GUIDE | KUBERNETES SECURITY 13
Chapter 3
Kubernetes Security
Aligned to the Cloud-
Native Application
Development Life Cycles
The Kubernetes platform offers built-in security functionalities — such as namespace
isolation, RBAC and network policies — that help enforce security boundaries and manage
permissions. These capabilities provide a good starting foundation for a secure cloud-native
environment (if configured properly), but they are not comprehensive solutions on their own,
as Kubernetes itself is not a security tool. The security of a Kubernetes cluster requires a
layered approach, addressing both the orchestrator and the applications it manages.
Security in Kubernetes is not a feature that can simply be toggled on or off. It requires a
continuous set of practices integrated across every level of the system and throughout the
software development life cycle (SDLC). This holistic approach is essential for maintaining a
secure and resilient Kubernetes environment.
CROWDSTRIKE THE COMPLETE GUIDE | KUBERNETES SECURITY 14
• API Server: This is the central communication hub. It authenticates users and
services, ensuring only authorized actions are allowed.
• Controller Manager: Monitors the cluster’s health and ensures that everything is
functioning as expected by aligning the current state with the desired state.
• etcd: A storage system that keeps all of the important information about the
cluster’s configuration and state.
• Scheduler: Decides which resources will be used for tasks, making sure
workloads are distributed efficiently across the cluster.
CROWDSTRIKE THE COMPLETE GUIDE | KUBERNETES SECURITY 15
Worker nodes
Worker nodes are the part of the Kubernetes cluster that handle all of the actual
processing and running of applications. They host your workloads and handle the
traffic between them. Key components include:
• Pods: These are the smallest building blocks in Kubernetes and contain the
application or service that runs within the cluster.
• Services: Help group together related pods and make them available over the
network, allowing them to communicate with each other.
• Kubelet: Ensures that the containers in each pod are running correctly and talks
to the control plane to manage workloads.
• Ingress: Manages how external traffic, like HTTP and HTTPS requests, reaches
services inside the cluster.
After examining each of the Kubernetes components, you can see how each part
plays a role in the security of the cluster. For instance, etcd stores sensitive cluster
data, and the API server allows fine-tuned authorization. However, misconfiguration of
any component (not to mention risk brought on by the supply chain) can expose your
environment to significant vulnerabilities, making it prone to various types of attacks.
We will now review the four phases of the cloud-native application development
lifecycle — Develop, Distribute, Deploy and Runtime — to understand how a lack of
security practices at each phase can facilitate either initial access or persistence for
an attacker in Kubernetes environments. The main goal of Chapter 3a and Chapter 3b
is to provide insight into how security gaps at each stage in the DevOps life cycle can
provide low-cost opportunities for attackers to wreak havoc.
Figure 7. The Caper Jones graph, which shows the percentage of defects introduced during each
phase of the development life cycle and how the cost to repair the defects goes from 1x when
coding to 640x in production — The Cost of a Kubernetes Repair in Development vs. Production
1
Gartner, 3 Essential Steps to Enable Security in DevOps, Daniel Betts, Manjunath Bhat, et al., 1 October 2024
https://www.gartner.com/document-reader/document/4145599?ref=TypeAheadSearch (Report accessible to Gartner subscriber only)
GARTNER is a registered trademark and service mark of Gartner, Inc. and/or its affiliates in the U.S. and internationally and is used herein
with permission. All rights reserved.
CROWDSTRIKE THE COMPLETE GUIDE | KUBERNETES SECURITY 17
Let’s explore a few example attacks that could be possible if security-focused checks are
not embedded ahead of deployment.
Example Attacks
Exploiting Infrastructure as Code (IaC) Misconfigurations
Figure 8. This example Terraform file includes AWS credentials directly in the code, which is a major
security risk. If the file is shared, stored in version control (like GitHub), or inadvertently exposed, the
secrets can be compromised, leading to unauthorized access to AWS resources.
Typosquatting
Let’s say we have an attacker, Alice, who publishes a malicious container image with a name
similar to a frequently used image in Kubernetes environments (for example, “ngnix” instead
of “nginx”). This container image is designed to deploy malware, and Alice publishes it to a
public container registry.
Should a developer accidentally build a container from a compromised base image, which
could contain a legitimate nginx server and malicious code, Alice could have the means
to successfully create a reverse shell. With shell access, Alice can further her attack in
a variety of ways. For example, she could target the CI/CD pipeline with a script that is
meant to modify configurations or insert additional malicious software into builds, infecting
all future builds with the malicious image. The compromised build pipeline can now
inadvertently push infected images to production.
Attackers can gain unauthorized access to source code repositories (e.g., GitHub,
GitLab) and inject malicious code into the application. This can lead to the deployment
of compromised applications within the Kubernetes environment. Techniques for
compromising source code repositories include exploiting weak passwords, gaining the
trust of the open-source community (as seen with CVE-2024-3094), phishing attacks to
steal credentials or exploiting vulnerabilities in the repository hosting service.
• Define and test security policies (e.g., Pod Security Standards) to ensure security
controls are enforced when deployed
• Define secure IaC configurations and integrate IaC scans into existing pre-deployment
DevOps workstreams
• Establish a code review process that involves both developers and platform engineers
to provide opportunities to double-check code prior to merging into the codebase
• Always run the latest stable version of Kubernetes or the latest stable version of your
preferred vendor’s Kubernetes distribution (e.g., Red Hat OpenShift or SUSE Rancher)
• Always verify the source of packages and container images before installing them
• Use strict naming policies and enforce them across the development and
operations teams to minimize the risk of typographical errors
• Employ automated tools to scan for and detect malicious packages; tools
like container image scanners can help identify known vulnerabilities and
suspicious behavior
• Scan container images and check the results against pipeline compliance rules to
prevent insufficiently patched applications from deploying to production
• Use minimized base container images that reduce the attack surface, such as
Google’s Distroless, Red Hat’s UBI Micro, Canonical’s Chiselled Ubuntu or empty
images when possible
• Digitally sign image content during build, and implement checkpoints for
validation before deployment
Although it may seem redundant to implement security checks right before deployment
and after, both phases are necessary. The former is a critical last effort to ensure
anything being deployed to production is going as intended; the latter is a fail-safe for
security weaknesses that might slip through to production. Unlike proactive hardening
measures, which aim to reduce risk before deployment, runtime security ensures the
system remains secure during operation.
The following example attacks become possible if there are security gaps within these
life cycle phases.
Example Attacks
Sidecar Container Injection
Pods are composed of one or more containers that share the same network namespace,
IP address and storage. A pod is meant to represent an instance of an application, but it
can also include sidecar containers. These are secondary containers that run alongside
the main application container to extend its functionality without altering the logic of the
main application container. They are typically leveraged for supplementary functionality
such as logging or metrics monitoring.
A fork bomb is a DoS attack where a process continually replicates itself to deplete
system resources, leading to a system crash. If an attacker gains shell access through
vulnerabilities in applications or services running on the pods, they have an opportunity
to perform a DoS attack.
The API server is the highest priority for an attacker to target, since it is the main function
used to control the Kubernetes platform. Attackers can search for publicly available,
unauthenticated kubelet APIs using freely available tools, such as Shodan. Since the
kubelet API is exposed on port 10250 by default, the following search query can be used
to search for servers listening on 10250 and return a 404 error without a URL path.
Figure 11. Shodan example search query for publicly available, unauthenticated kubelet APIs
If any IP addresses are returned with the above search query, an attacker can then query
the runningpods API to find a detailed list of the running containers.
Figure 12. Query runningpods API for a detailed list of running containers
• Define and apply secure Kubernetes network policies to restrict traffic and ensure
these policies are properly enforced with a network policy provider
• Avoid the use of tags and use the image sha256 hash instead
• Set namespaces to isolate Kubernetes resources (and block the usage of the
default namespace)
• Leverage projects such as the Open Policy Agent (OPA) to enforce centralized
policy management
• Apply security context to pods and containers with the principle of least privilege
• Block access to network ports and limit access to the Kubernetes API server
• Restrict service accounts used by applications and ensure they do not have
unnecessary permissions that could allow them to modify other pods or inject
sidecars
• Apply restrictive Pod Security Standards to limit what containers can do within
the cluster, and ensure only trusted and necessary containers are allowed to run
• Follow best practices for hardening your Kubernetes nodes, such as disabling
unused services, applying security patches, and using minimal and secure
base images
• Check for any changes or regressions that may have occurred in the
CI/CD pipeline
• Define resource limits and quotas for CPU and memory in your pod specifications to
prevent any single pod from consuming excessive resources
• Prevent containers from loading unwanted kernel modules by using a tool like SELinux
• Leverage an external storage plugin that can provide encryption at rest for volumes
• Design authentication mechanisms between cluster nodes and storage on the network
• Leverage an advanced container security solution that can monitor for any threats or
vulnerabilities at runtime
• Track runtime activity across pods in the same deployments to identify anomalies
CROWDSTRIKE THE COMPLETE GUIDE | KUBERNETES SECURITY 25
Chapter 4
Putting It All into
Practice: Building an
Effective Kubernetes
Security Program
Now that we’ve walked through what the Kubernetes attack surface looks like and we’ve
reviewed recommendations for securing Kubernetes clusters across the cloud-native
application life cycle, it’s time to discuss how to build a robust Kubernetes security
program that is evergreen, capable of spanning multiple teams and sustainable in
an ever-changing threat landscape. Kubernetes environments are characterized by
their scalability, frequent changes and use of numerous interconnected components,
which can create a broad attack surface. Hardening best practices are not sufficient
for full coverage.
To streamline visibility and drive alignment across teams, organizations should look
for a security solution that creates a common language between the DevOps and
security perspectives.
Figure 13. The Kubernetes dashboard in CrowdStrike Falcon® Cloud Security provides full visibility
into all Kubernetes clusters deployed in production
Leveraging existing DevOps toolchains for security ensures security measures are
scalable and adaptable and that they can keep pace with the rapid deployment cycles
typical of Kubernetes environments. By embedding security tools and practices directly
into the DevOps workflow:
• DevOps teams don’t have to context switch or disrupt their daily operations to bring
a security perspective to their work
• Security teams become closer to the tools and knowledge used for development
and deployment, which enhances their understanding of various security
risks detected
CROWDSTRIKE THE COMPLETE GUIDE | KUBERNETES SECURITY 27
Figure 14. CrowdStrike Falcon Cloud Security provides unified visibility with a single, lightweight
agent, illuminating security risks from code to control plane to cloud. Additionally, Falcon Cloud
Security captures relevant details, such as container start and stop, image and runtime information,
unidentified and rogue containers, and events generated inside containers.
CROWDSTRIKE THE COMPLETE GUIDE | KUBERNETES SECURITY 28
Figure 15. The CrowdStrike Falcon® platform processes trillions of events per week from millions
of endpoints worldwide. CrowdStrike’s intelligence team tracks 245+ threat actors, publishing
more than 800,000 indicators of compromise weekly. This constant flow of real-time data
enables CrowdStrike to detect and stop even the most advanced threats before they can
impact the organization.
CROWDSTRIKE THE COMPLETE GUIDE | KUBERNETES SECURITY 29
The traditional approach to cloud security relies on disparate tools from multiple
vendors. This forces administrators to toggle between cloud workload protection
(CWP), container image scanning, and other tools and screens to create a holistic
view of risk. The complexity created by a patchwork approach increases the likelihood
of visibility gaps and delays decision-making and response. Siloed tools provide a
fragmented view that lacks sufficient context to prioritize threats. Operations also
suffer, as having multiple tools generates an excessive number of alerts to investigate,
increases the potential for vulnerabilities and misconfigurations to go unnoticed, and
consumes more cycles to configure and maintain.
These inefficiencies add risk and drive up costs while making it harder to maintain
compliance and strengthen your Kubernetes security posture.
It’s important to look for a solution that integrates and automates security throughout
the cloud-native application life cycle. Manual efforts slow down security operations
and application delivery while increasing the potential for human error. Without
automated response, high volumes of alerts can delay decision-making among
resource-constrained security staff. A modern cloud security platform should do
more than tell administrators a problem exists — it should allow them to take steps
to address weaknesses.
CROWDSTRIKE THE COMPLETE GUIDE | KUBERNETES SECURITY 30
Figure 16. CrowdStrike possesses the breadth of knowledge and depth of skilled resources to meet
enterprises wherever they are in their cloud maturity journey.
CROWDSTRIKE THE COMPLETE GUIDE | KUBERNETES SECURITY 31
CrowdStrike Falcon
Cloud Security: Secure
Your Kubernetes
Clusters Across
the SDLC
CrowdStrike Falcon® Cloud Security delivers container, Kubernetes and host protection
from build to runtime in AWS, Azure and Google Cloud while ensuring security in every
step of the CI/CD pipeline. With Falcon Cloud Security, organizations can automate
security and detect and stop suspicious activity, zero-day attacks and risky behavior
to stay ahead of threats and reduce the attack surface. Falcon Cloud Security supports
CI/CD workflows, allowing you to secure workloads at the speed of DevOps without
sacrificing performance.
CROWDSTRIKE THE COMPLETE GUIDE | KUBERNETES SECURITY 32
• A complete security platform for Kubernetes and beyond: The Falcon platform
consolidates a wide range of point products used to protect and monitor
endpoints, cloud workloads, identity and data to provide end-to-end coverage
and eliminate complexity.
CROWDSTRIKE THE COMPLETE GUIDE | KUBERNETES SECURITY 33
Conclusion
Kubernetes presents unique security challenges due to its dynamic and distributed
nature, which involves managing numerous containers across different environments.
Additionally, the complexity of its architecture — including components like the API
server, etcd and kubelet — creates multiple potential attack surfaces that require
diligent configuration and monitoring. However, building a Kubernetes security
approach that aligns with the CNCF cloud-native application development life cycle
provides not only an opportunity for reducing significant risk within your Kubernetes
clusters but also effective protections in production. Although there are native
Kubernetes security features, it’s essential to adopt a solution that focuses on building
and innovating for the sole outcome of security. Falcon Cloud Security scales security
across your CI/CD pipelines by providing end-to-end protection with continuous
image scanning, illuminating every Kubernetes cluster and container with discovery
and mapping across public and private clouds, and automating testing for rapid
detection of common Kubernetes threats (e.g., misconfigurations, loose permissions
and vulnerable dependencies).
About CrowdStrike
CrowdStrike (Nasdaq: CRWD), a global cybersecurity leader, has redefined modern
security with the world’s most advanced cloud-native platform for protecting critical
areas of enterprise risk — endpoints and cloud workloads, identity and data.
Powered by the CrowdStrike Security Cloud and world-class AI, the CrowdStrike
Falcon® platform leverages real-time indicators of attack, threat intelligence, evolving
adversary tradecraft and enriched telemetry from across the enterprise to deliver hyper-
accurate detections, automated protection and remediation, elite threat hunting and
prioritized observability of vulnerabilities.