Security

Kubernetes Penetration Testing: Methodology, Attack Paths, Checklist, and Tools

ShamOctober 5, 20268 min read

Published by OraSec

Kubernetes Penetration Testing

Kubernetes penetration testing is an authorized, hands-on assessment that finds the cluster weaknesses a real attacker would use. It covers the control plane, RBAC, Secrets, pod settings, and network rules, then shows how those issues connect. A scanner lists misconfigurations one by one. A tester shows which ones chain into a real attack path, which is the difference between a pentest and a vulnerability scan.

What is Kubernetes penetration testing?

An authorized test that attacks your Kubernetes cluster to find exploitable weaknesses before attackers do.

Why is Kubernetes penetration testing important?

Small Kubernetes misconfigurations add up, and one broad permission can turn a single pod into cluster access.

How do you perform a Kubernetes penetration test?

Agree on scope and authorization, map exposed services, test from realistic footholds, chain weaknesses, then report and retest.

What tools are used for Kubernetes penetration testing?

kubectl, kube-bench, Kubescape, Trivy, KubiScan, kubeletctl, and Peirates, combined with manual testing.

How often should Kubernetes clusters be tested?

There is no fixed rule. Test before go-live, after major changes, and on a risk-based cycle.

Key Takeaways

  • Most Kubernetes findings are configuration choices, not software vulnerabilities.
  • The real risk is how misconfigurations chain, from one pod to a node, the cluster, or the cloud account.
  • Secrets are stored unencrypted in etcd by default unless encryption at rest is configured.
  • Assumed-breach testing from inside a pod shows what an ordinary application bug could lead to.
  • Scanners give continuous coverage, but a tester confirms what is actually exploitable.

What Is Kubernetes Penetration Testing?

Kubernetes penetration testing goes further than a configuration review. Instead of only listing settings, the tester shows their effect: for example, that a service account can read a Secret it shouldn't, and that the Secret opens a production database. A typical scope covers four layers:

  • Control plane: the API server, authentication, admission control, and, on self-managed clusters, etcd.
  • Nodes: the kubelet, the container runtime, and the host operating system.
  • Workloads: pods, service accounts, container images, Secrets, and ConfigMaps.
  • Network: ingress, services, network policies, and routes out to the cloud provider.

On Amazon EKS, Azure AKS, and Google GKE, the provider runs the control plane, so testing focuses on what you configure: access, RBAC, workloads, nodes, and networking. Each provider also sets its own rules for what you may test in the cloud. Every test needs written authorization, an agreed scope, and compliance with applicable laws and contracts.

Kubernetes Penetration Testing Methodology

Kubernetes testing follows the same phases as any penetration test. Most tests combine an external view with no credentials and an assumed-breach view that starts from a single pod or a low-privilege account. The assumed-breach view matters because a cluster compromise can start with an ordinary application bug, not only an exposed control plane.

1. Reconnaissance and Enumeration

From outside, the tester maps what is reachable: the API server, the kubelet on each node, etcd on self-managed clusters, and dashboards or monitoring tools exposed through ingress. The key question is whether any of them accept unauthenticated requests or grant more than they should. From inside a pod, the tester reviews what the pod already holds: its environment, its mounted service account token, and what that identity is allowed to do. Checking effective permissions early, without making changes, shows where the real opportunities are, the same expansion attackers attempt after they buy or steal initial access.

2. Common Kubernetes Misconfigurations

Most findings are configuration choices rather than software vulnerabilities. The ones we check first: exposed or improperly secured endpoints (API servers, kubelets, or dashboards that allow access through weak authentication, anonymous access, or loose authorization); over-broad RBAC with wildcard rules or cluster-wide bindings; over-privileged pods that run as root or privileged, share host namespaces, or mount sensitive host paths; readable Secrets that too many identities can reach; flat networking with no network policies; and outdated components with known CVEs. The Kubernetes documentation on Secrets is clear that Secrets are stored unencrypted in etcd by default, and that anyone who can create a pod in a namespace can use that access to read any Secret in it. Base64 is encoding, not encryption.

3. Common Kubernetes Attack Paths

Misconfigurations become serious when they connect. The paths we look for most often: pod to node, where an over-privileged container gains host-level access and exposes other workloads on the same node; pod to cloud, where a compromised pod reaches the cloud metadata service and obtains node credentials if identities aren't isolated; token to cluster, where a service account that can read Secrets or create workloads is used to expand access; and RBAC escalation, where verbs such as bind, escalate, or access to the kubelet's nodes/proxy sub-resource let a limited account gain more. The pod-to-cloud path mirrors the SSRF-to-credentials chain testers see in web apps. The tester's job is to prove which paths exist in your cluster, not to assume them.

Also Read: SSRF Vulnerability: How Attackers Steal Cloud Credentials

4. RBAC and Service Account Testing

Overly permissive RBAC is a common source of Kubernetes privilege escalation. The tester maps which users, groups, and service accounts hold which roles, then looks for wildcard permissions, unnecessary cluster-admin bindings, bindings to unauthenticated users, and verbs that allow self-escalation. Default service accounts are a frequent weak spot, because pods receive an API token unless automounting is turned off.

5. Secrets and Sensitive Data Exposure

Here the tester follows where credentials live and who can reach them: Secrets in etcd, environment variables, mounted tokens, ConfigMaps, and credentials baked into container images. The question is not whether a Secret exists, but whether a realistic attacker position can read it and what it unlocks. Leaked tokens often travel far beyond the system they came from.

Must Read: How a Leaked GitHub Token Can Lead to Internal System Compromise

6. Pod and Container Security Testing

The tester reviews security contexts, root and privileged settings, Linux capabilities, host namespaces, and host path mounts, then checks what stops a risky pod from being deployed. PodSecurityPolicy was removed in Kubernetes 1.25 and replaced by Pod Security Admission, which enforces the Pod Security Standards at three levels: privileged, baseline, and restricted. The test confirms whether it, or an equivalent admission controller, is actually enforcing.

7. Network Security Testing

By default, a pod is non-isolated: all inbound and outbound connections are allowed until a NetworkPolicy selects it, and a NetworkPolicy has no effect unless the network plugin enforces it. The tester checks segmentation between namespaces, exposure of internal services, ingress configuration, and whether pods can reach the cloud metadata endpoint or the control plane.

Kubernetes Penetration Testing Checklist

Use this list to scope or review a test. It supports a tester's judgment rather than replacing it.

  1. Confirm written authorization, scope, rules of engagement, and the cloud provider's testing policy.
  2. Identify exposed API servers, kubelets, etcd endpoints, dashboards, and monitoring tools.
  3. Check whether any endpoint accepts unauthenticated or anonymous requests.
  4. Review RBAC for wildcards, cluster-admin bindings, and bindings to anonymous or unauthenticated groups.
  5. Check default service accounts and token automounting.
  6. Confirm Secrets encryption at rest and review who can read Secrets.
  7. Review pod security contexts for root, privileged mode, host namespaces, host paths, and capabilities.
  8. Confirm Pod Security Admission or an equivalent controller is enforcing.
  9. Check network policies and whether the network plugin enforces them.
  10. Confirm access to cloud metadata and the Kubernetes API is restricted to workloads that need it.
  11. Scan images and components for known vulnerabilities and end-of-life versions.
  12. Confirm audit logging records cluster activity.
  13. From an assumed-breach pod, map realistic paths to nodes, Secrets, other namespaces, and the cloud account.
  14. Retest after fixes.

Helpful for you: How to Prepare Your Organization for a Pentest

Kubernetes Penetration Testing Tools

No single tool covers a Kubernetes test. Testers combine scanners, RBAC analysis, and manual work:

  • kubectl: the standard Kubernetes client. Its permission checks show what an identity can do.
  • kube-bench: Aqua Security's open-source tool for checking a cluster against the CIS Kubernetes Benchmark.
  • Kubescape: an open-source Kubernetes security platform and CNCF project for scanning clusters, manifests, and pipelines.
  • Trivy: Aqua Security's open-source scanner for images, IaC, and clusters, covering vulnerabilities, misconfigurations, and secrets.
  • KubiScan: a CyberArk open-source tool that finds risky RBAC permissions.
  • kubeletctl: an open-source client for the kubelet API, used to check what an exposed kubelet allows.
  • Peirates: a Kubernetes penetration testing tool used, with authorization, to show how an attacker could escalate and pivot from a pod.

Tool status changes. kube-hunter is no longer under active development, and its maintainers point users to Trivy, while kubeaudit was archived in 2024. Each of these scanners reports settings in isolation, which is why a human tester still has to confirm what is actually exploitable.

Kubernetes Security Remediation Best Practices

Most fixes come down to reducing privilege and closing paths between workloads:

  • Lock down the control plane: restrict API server access to trusted networks or private endpoints, secure dashboards with strong authentication, and block anonymous access.
  • Apply least privilege: prefer namespaced Roles, avoid wildcards, and remove bindings to anonymous or unauthenticated groups.
  • Tighten service accounts: disable token automounting where pods don't call the API, and give each workload its own account.
  • Protect Secrets: enable encryption at rest, restrict read access, and keep credentials out of images and ConfigMaps.
  • Constrain pods: enforce Pod Security Admission, run as non-root, drop unneeded capabilities, and avoid privileged containers.
  • Segment the network: apply default-deny network policies and block pod access to the cloud metadata service where it isn't needed.
  • Patch and replace: keep Kubernetes and ingress controllers current. Ingress NGINX was retired on March 24, 2026, and no longer receives security patches, so anyone still using it should migrate to a supported ingress controller or Gateway API implementation.
  • Enable audit logging: record cluster activity so it can be reviewed.

This is the core of vulnerability prioritization: prioritize by exploitability, not by count. One path from an exposed workload to cloud credentials matters more than a long list of low-impact warnings.

Real-World Kubernetes Attacks

In 2018, RedLock researchers found that Tesla's Kubernetes administration console was not password-protected. Attackers used it to reach credentials for Tesla's AWS environment and run cryptomining software. Tesla said the impact appeared limited to internally used engineering test cars.

In 2023, Aqua Nautilus reported openly accessible Kubernetes clusters tied to more than 350 organizations, open-source projects, and individuals, many exposed through anonymous access with privileges or misconfigured kubectl proxy settings. In 2025, Wiz disclosed the IngressNightmare vulnerabilities in the Ingress NGINX controller, rated 9.8, and estimated that about 43% of cloud environments were vulnerable.

The common thread is exposure and excess privilege, which is exactly what a penetration test looks for.

You May Also Like: Internet-Exposed OT

How OraSec Can Help

OraSec tests Kubernetes as part of our cloud security assessment, which includes container and cluster testing. We test EKS, AKS, GKE, and self-managed clusters from realistic starting points, including an assumed-breach view inside a pod, and focus on which weaknesses chain into access to your data or cloud account. Each finding comes with evidence, business impact, and practical remediation steps your platform team can act on. Once fixes are in, we retest to confirm they hold. The team's own research has produced published CVEs (CVE-2025-50847 through CVE-2025-50850).

Conclusion

Kubernetes gives teams speed and scale, and it gives attackers many settings to get wrong. The damage rarely comes from exotic exploits. It comes from exposed endpoints, broad permissions, readable Secrets, over-privileged pods, and flat networks connected into one path. A Kubernetes penetration test shows which of those an attacker could use and what to fix first. If you want to know what a skilled tester could reach in your clusters, talk to our team.

Frequently Asked Questions

Is Kubernetes penetration testing different from cloud penetration testing?

Yes. Cloud testing covers the whole account, while Kubernetes testing focuses on the cluster. They often run together, since cluster weaknesses can reach the cloud.

Can you test managed clusters like EKS, AKS, and GKE?

Yes. The provider secures the managed control plane, so testing covers what you configure, within each provider's published testing policy.

Will a Kubernetes penetration test disrupt production?

It's designed not to. We agree on testing windows and rules of engagement, and avoid destructive techniques unless they are explicitly authorized.

Do automated Kubernetes scanners replace a penetration test?

No. Scanners such as kube-bench, Kubescape, and Trivy find known issues, but a tester confirms exploitability and connects findings into attack paths.

What access do you need to test a cluster?

It depends on scope. External tests may start without credentials, while assumed-breach tests start from a low-privilege account or a single compromised pod.

How should we prepare for a Kubernetes penetration test?

Confirm scope and authorization, agree on starting points, provide required access, and share architecture notes and an inventory of clusters and namespaces.

Explore related services

Need hands-on help? Our security testing services put this research into practice.

Binance hack 2026

Binance Hack: What We Know About the $6.3 Billion Hot Wallet Theft

On October 29, 2026, attackers drained Binance hot wallets across multiple blockchains in what blockchain analytics firms call the largest crypto theft on record. Binance puts the impact at about $6.3 billion, with roughly $3 billion frozen, and says early findings point to a possibly compromised engineer's laptop, with no evidence of leaked private keys so far. Here's what happened, what's still unconfirmed, and what to check in your own environment. What happened at Binance? Attackers drain

·6 min read
Oracle E-Business Suite RCE (CVE-2026-101767): What to Do Now

Oracle E-Business Suite RCE (CVE-2026-101767): What to Do Now

CVE-2026-101767 is a critical flaw in Oracle E-Business Suite (EBS), rated CVSS 9.8. It lets an unauthenticated attacker send a crafted web request that triggers SQL injection and can be chained into full remote code execution. Oracle patched it in its October 20, 2026 Critical Patch Update, and attackers were already probing for it a week later. If you run EBS, this one needs attention now. What is CVE-2026-101767? An unauthenticated SQL injection in Oracle E-Business Suite that can be chain

·5 min read
Black October 2026: Every Major Vulnerability and Breach

Black October 2026: Every Major Vulnerability and Breach

October 2026 brought so many critical flaws and breaches at once that the security community started calling it "Black October." Two unauthenticated remote code execution bugs in PHP core, a CVSS 10.0 flaw in GitLab reaching back twelve years, an exploited SQL injection in Oracle E-Business Suite, Microsoft's largest-ever Patch Tuesday, and a ~20 million patient breach at Oracle Health all landed in the same few weeks. This roundup covers what broke, who's affected, and what to fix first. What

·6 min read