Kubernetes Security Essentials: The Kubernetes Attack Surface
Kubernetes Security Essentials: The Kubernetes Attack Surface
Kubernetes
CONTENTS
∙ Conclusion
By every measure, today Kubernetes is the de facto standard for THE KUBERNETES ATTACK SURFACE
automating the deployment and management of cloud-native To understand how to protect a Kubernetes environment, it is
applications. Its adoption is transforming the ways in which informative to understand its relevant attack surface. The attack
organizations of every size, in every industry, develop and release surface within a Kubernetes cluster consists of three main areas that
software using technologies such as containers, microservices, must be protected:
and declarative APIs. In parallel, these new technologies and
1. The software supply chain for building the immutable
architectures give rise to broad security risks and challenges that artifacts used to deploy and run containers
organizations must protect against. Kubernetes introduces a new
2. Infrastructure components that must be provisioned and
threat environment — one that is as dynamic, fast-moving, and
configured to run Kubernetes
active as containerized applications themselves.
3. Deployed and running containers that make up individual
Kubernetes, with its breadth of cluster components and associated Kubernetes applications
1
Continuous Security for
Cloud-Native Applications
DevOps and Security teams can use a Ensure alignment between security and Leverage Kubernetes to seamlessly
common language and source of truth infrastructure to reduce application provide guardrails supporting developer
downtime velocity
Standardize on Kubernetes as your Leverage native controls for built-in Accelerate your pace of innovation while
common platform for declarative and security that works with Kubernetes, ensuring your applications comply with
continuous security not against it security policies
1. SECURING THE SOFTWARE Secrets should not be embedded in images since anyone with access
In Kubernetes environments, the software supply chain acts as a is built — would be able to view them in cleartext, and because it
centralized place to make any software changes for propagation into provides unnecessary exposure prior to when the secret needs to be
production environments. It also serves as a chokepoint where users used. In Kubernetes clusters, you can use Kubernetes secrets to pass
can incorporate security measures that have an outsized impact on this sensitive data to pods.
Handles pod scheduling and placement Compromise can lead to scheduling of • Restrict permissions on pod
across available worker nodes in clusters new pods or placement that increases specifications and apply RBAC
kube-scheduler by considering several parameters (e.g., risk to critical applications (non-sensitive to apply minimum privileges
available resources, affinity and anti- and sensitive workloads running on the
affinity rules, taints and tolerations) same node) • Configure to only serve HTTPS
Primary node agent that manages • Access to the kubelet is unauthenticated • Upgrade to latest version or apply
individual containers running in by default available patches
kubelet
pods and their state based on pod • Its API endpoints can be used to gain additional • Ensure strong authentication and
specifications access and privileges on nodes and pods authorization
Specify pod Pod Security Policy (PSP) Configure ingress and Apply a “default-deny-
requirements uses an admission controller egress traffic to and all” network policy that
A group of plugins Policies that from your applications isolates all pods; once in
before they can to set restrictions (limited
that govern and enable network by restricting pod-to- place, network policies
be deployed into to a subset of fields in
enforce what is isolation between pod traffic; requires a to enable Internet
a cluster; prevent pod manifests); they can
allowed to run pods network plugin that access and pod-to-pod
pods that don't be augmented by custom
within a cluster actually enforces traffic can be added as
meet the conditions validating admission
from deploying controllers. Network Policies needed.
process execution and network communication can be monitored Wei Lien Dang is Co-Founder and Chief
at the level of individual containers to determine potential Strategy Officer at StackRox. He is responsible
for leading initiatives related to technical evangelism and go-
indicators of compromise. Because containers are designed to be to-market. Previously, he held senior product management
declaratively configured and immutable, deviations from expected roles at Amazon Web Services, Splunk, CoreOS, and Bracket
Computing. Wei Lien holds an MBA with high distinction from
activity that are either anomalous or malicious are far easier to spot Harvard Business School and a BS in applied physics with
and remediate in Kubernetes environments by re-instantiating pods, honors from Caltech.
giving security operators a significant advantage in their analyses
and investigations.
CONCLUSION
Kubernetes is a powerful yet complex system that is rapidly
transforming how organizations build, ship, and run modern software
DZone, a Devada Media Property, is the resource software developers,
applications. Its benefits come with associated security demands that
engineers, and architects turn to time and again to learn new skills, solve
must be addressed to minimize risks and threats to your business. An software development problems, and share their expertise. Every day,
hundreds of thousands of developers come to DZone to read about the latest
effective approach to securing Kubernetes environments is based on technologies, methodologies, and best practices. That makes DZone the ideal
place for developer marketers to build product and brand awareness and
applying controls to secure the following key areas: drive sales. DZone clients include some of the most innovative technology
and tech-enabled companies in the world including Red Hat, Cloud Elements,
• The software supply chain used to build container images Sensu, and Sauce Labs.