Onam

What is KSPM (Kubernetes Security Posture Management)?

In short

KSPM (Kubernetes Security Posture Management) is the continuous assessment of Kubernetes clusters for misconfigurations and risky permissions. It reads cluster state through the Kubernetes API and checks RBAC, pod security settings, network policies, secrets and control-plane configuration against baselines such as the CIS Kubernetes Benchmark, then reports what is wrong and how to fix it.

KSPM at a glance

QuestionAnswer
What does KSPM stand for?Kubernetes Security Posture Management
What does it check?RBAC, pod security context, network policy, secrets handling, admission control, control-plane and node configuration
How does it see the cluster?Through the Kubernetes API with a read-only credential, plus node configuration where a benchmark asks for it
What does it measure against?CIS Kubernetes Benchmark, CIS EKS / AKS / GKE benchmarks, NSA/CISA Kubernetes Hardening Guidance, Pod Security Standards
What does it not do?Detect a live attack inside a running pod — that is runtime protection (CWPP)
Where does it fit?One component of a CNAPP, next to CSPM, CWPP and CIEM

Why Kubernetes needs its own posture management

A cloud posture tool reads the cloud provider's API. It can tell you an EKS cluster exists, which VPC it sits in, and whether its endpoint is public. It cannot tell you that a ServiceAccount inside that cluster is bound to cluster-admin, that a pod runs as UID 0 with the host filesystem mounted, or that no NetworkPolicy exists so every pod can reach every other pod.

Those objects live inside the cluster, behind the Kubernetes API — a different control plane with its own authentication, its own object model and its own failure modes. The cloud provider does not see them, so cloud posture management does not either.

That gap is where KSPM sits. It is not CSPM applied to Kubernetes; it is a separate evaluation against a separate API.

How KSPM works

  1. Connect. A read-only identity in the cluster — typically a ServiceAccount whose role allows get, list and watch on the objects being assessed.
  2. Inventory. Enumerate namespaces, workloads (Deployments, DaemonSets, StatefulSets, Jobs, Pods), RBAC objects, Services and Ingresses, NetworkPolicies and admission webhooks.
  3. Evaluate. Test every object against a baseline — CIS, Pod Security Standards, or your own policy.
  4. Prioritise. Rank findings by context: is the workload exposed, what can its ServiceAccount reach, does it run privileged?
  5. Remediate. Fix the manifest or Helm chart at source, not the live object, or the next deploy reverts the fix.
  6. Prevent and repeat. Add admission policy so the same violation cannot be deployed again, and re-evaluate continuously — clusters change with every deploy.

KSPM checklist: what KSPM checks

AreaTypical findings
RBACClusterRoleBindings granting cluster-admin, wildcard verbs or resources, subjects with escalate, bind or impersonate, broad get secrets or create pods/exec
Workload security contextPrivileged containers, hostPID, hostIPC and hostNetwork, running as root, writable root filesystem, added Linux capabilities, missing seccomp profile
NetworkNo default-deny NetworkPolicy, Services exposed via LoadBalancer or NodePort without restriction, dashboards reachable from outside
SecretsSecrets in environment variables, Secrets not encrypted at rest in etcd, ServiceAccount tokens auto-mounted where unused
Admission and supply chainNo admission control, Pod Security Admission not enforced, images from untrusted registries, :latest tags, unsigned images
Control plane and nodesAnonymous auth enabled, kubelet read-only port open, audit logging off, outdated Kubernetes version
Resource hygieneNo CPU or memory limits, workloads in the default namespace, missing liveness and readiness probes

KSPM vs CSPM

KSPMCSPM
API it readsKubernetes API serverCloud provider API
Sees a cluster asHundreds of objects — pods, roles, bindings, policiesOne resource — an EKS, AKS or GKE cluster
Typical findingscluster-admin bindings, privileged pods, no NetworkPolicyPublic cluster endpoint, control-plane logging off, over-broad node IAM role, no envelope encryption for Secrets
Usual baselineCIS Kubernetes Benchmark, Pod Security StandardsCIS AWS / Azure / GCP Foundations Benchmarks
Who usually fixes itPlatform and application teams, in manifests and Helm chartsCloud and infrastructure teams, in Terraform or the console

Managed Kubernetes settings straddle both. The CIS EKS, AKS and GKE benchmarks exist for exactly that reason: they cover the cloud-side cluster settings and the in-cluster policies together, and drop the control-plane checks the provider now owns. You need both views — a cluster can be perfectly configured at the cloud layer and unsafe inside. See What is CSPM? for the cloud side.

KSPM vs CWPP vs container image scanning

These three get used interchangeably and are not the same thing.

  • Container image scanning looks at the image: which packages it contains and which have known CVEs. It answers is this artefact vulnerable?
  • KSPM looks at the cluster: how workloads are configured, who can do what, what can talk to what. It answers is this cluster configured safely?
  • CWPP looks at the running workload: vulnerabilities inside it, process behaviour, runtime detection. It answers is this workload exploitable, and is something happening right now?

A vulnerable image (scanning) running as root (KSPM) that starts a reverse shell (CWPP) is one incident described by three tools. Treating any one of them as the whole picture is the common mistake.

CIS Kubernetes Benchmark, NSA/CISA hardening and Pod Security Standards

CIS Kubernetes Benchmark. Published by the Center for Internet Security, it is the baseline auditors recognise. Its recommendations are grouped into control-plane components, etcd, control-plane configuration, worker nodes, and policies (RBAC, Pod Security, network policy, Secrets). For managed services, use the CIS EKS, AKS or GKE benchmark instead — the provider runs the control plane, so those versions keep the checks you can still act on.

NSA/CISA Kubernetes Hardening Guidance. Published jointly by the US National Security Agency and the Cybersecurity and Infrastructure Security Agency. Its themes map cleanly onto KSPM: scan containers and pods for vulnerabilities and misconfiguration, run them with least privilege, separate networks with network policy, use strong authentication and authorisation, enable audit logging, and review configuration regularly.

Pod Security Standards. Kubernetes' own three-level policy — Privileged, Baseline and Restricted — enforced by the built-in Pod Security Admission controller through namespace labels. Most clusters should aim for Baseline everywhere and Restricted for application namespaces.

NIST SP 800-190 (Application Container Security Guide) is a common addition for regulated environments once the CIS baseline is clean.

Admission control: from finding problems to preventing them

KSPM reports what is already running. Admission control decides what is allowed to run. A mature programme uses both: KSPM finds the existing violations, and admission policy stops new ones from being deployed.

  • Pod Security Admission — built in, enforces the Pod Security Standards per namespace, with enforce, audit and warn modes.
  • ValidatingAdmissionPolicy — built-in policies written in CEL, without running a webhook.
  • Policy engines — Kyverno and OPA Gatekeeper, for policies the built-ins cannot express, such as allowed registries or required labels.

Roll new policies out in audit or warn first, fix what they report, then switch to enforce. A good KSPM check is simply: does this cluster have admission control at all, and is it enforcing or only auditing?

Why RBAC is the part that matters most

Image CVEs get the attention because there is a number attached to them. But the finding that most often converts a container compromise into a cluster compromise is an over-permissive ServiceAccount.

The chain is short and well-worn: a pod is compromised through the application, its ServiceAccount token is auto-mounted at a known path, that token is bound to a role with broad verbs, and the attacker now speaks to the API server with those permissions. Nothing in that sequence requires a CVE.

This is why KSPM findings should be read as a graph rather than a list. Which subjects can reach which resources, and what does that let them do next? is a more useful question than how many High findings do we have? Kubernetes RBAC is an entitlement problem — the same question CIEM answers for cloud IAM.

KSPM examples: three findings and their fixes

1. The default ServiceAccount is bound to cluster-admin. Every pod in the namespace that does not name a ServiceAccount inherits full control of the cluster. Fix: bind a namespaced Role with only the verbs the workload uses, and stop mounting the token where it is not needed.

apiVersion: v1
kind: ServiceAccount
metadata:
  name: default
  namespace: payments
automountServiceAccountToken: false

2. A pod runs privileged with the host filesystem mounted. A container escape becomes a node compromise. Fix: drop privilege in the security context and enforce the Restricted Pod Security Standard on the namespace.

securityContext:
  runAsNonRoot: true
  allowPrivilegeEscalation: false
  readOnlyRootFilesystem: true
  capabilities:
    drop: ["ALL"]
  seccompProfile:
    type: RuntimeDefault

3. A namespace has no NetworkPolicy. Every pod can reach every other pod in the cluster. Fix: apply a default-deny policy, then allow only the flows the application needs.

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: default-deny
  namespace: payments
spec:
  podSelector: {}
  policyTypes: ["Ingress", "Egress"]

Where KSPM fits with cloud posture

A Kubernetes cluster is not an island. It runs on cloud infrastructure, its nodes have instance roles, and its workloads assume cloud identities through mechanisms like IRSA, EKS Pod Identity or GKE Workload Identity.

The interesting failures cross that boundary in both directions: a pod that assumes a node role which can read a production bucket; a cloud IAM policy that grants access to the cluster's control plane. Evaluating cluster posture and cloud posture separately produces two correct reports that both miss the path between them. That is the argument for running KSPM inside a CNAPP rather than as a separate tool, and for attack path analysis across both layers.

KSPM best practices

  1. Connect read-only. Posture assessment needs get, list and watch, not write access.
  2. Baseline against CIS first. It is well understood, it is what auditors ask about, and it produces a finite list. Use the managed-service variant for EKS, AKS and GKE.
  3. Fix RBAC before image CVEs. It is less satisfying and it removes more real risk.
  4. Add a default-deny NetworkPolicy. Many clusters have none, and it is the single change that most reduces lateral movement.
  5. Fix at source. Change the manifest, Helm chart or Kustomize overlay; patching the live object is undone by the next deploy.
  6. Turn findings into admission policy. Every class of finding you fix twice should become a rule that blocks it.
  7. Re-evaluate continuously. Clusters change with every deploy; a quarterly audit describes a cluster that no longer exists.

KSPM tools

Open-source tools cover parts of the job well: kube-bench runs the CIS Kubernetes Benchmark checks on nodes, Kubescape (a CNCF project) scans clusters and manifests against CIS and NSA/CISA controls, and Polaris checks workload configuration best practices. Kyverno and OPA Gatekeeper handle the admission side.

Commercial KSPM is usually delivered as part of a CNAPP. When you compare options, ask: does it cover your managed and self-managed distributions, does it show RBAC as reachable paths rather than a list, does it connect a pod's identity to the cloud permissions it can assume, and does it re-evaluate continuously?

How Onam approaches Kubernetes posture

Onam treats Kubernetes as one of the seven environments its posture engine covers, alongside AWS, Azure, GCP, OCI, Alibaba Cloud and IBM Cloud. 824 of its 9,853 CSPM posture rules are Kubernetes rules, evaluated with the same finding format as the cloud rules, so a cluster finding and the cloud finding it connects to are read in one place. One honest limit: posture rules evaluate configuration — they do not, on their own, detect an attack in progress inside a pod.

Frequently asked questions

What is KSPM?

KSPM (Kubernetes Security Posture Management) continuously checks Kubernetes clusters for misconfigurations and risky permissions — RBAC bindings, pod security settings, network policies, secrets handling and control-plane configuration — against baselines such as the CIS Kubernetes Benchmark, and reports what to fix.

What is the difference between KSPM and CSPM?

CSPM reads the cloud provider's API and sees a Kubernetes cluster as one resource — its endpoint, logging and node roles. KSPM reads the Kubernetes API and sees the objects inside it — RBAC bindings, pod security context, network policy, admission control. A cluster can be perfectly configured at the cloud layer and unsafe inside, so you need both.

What is the difference between KSPM and CWPP?

KSPM checks how the cluster and its workloads are configured. CWPP protects the workloads themselves — vulnerabilities inside them and, where supported, runtime behaviour such as unexpected processes. KSPM answers 'is this cluster configured safely?'; CWPP answers 'is this workload exploitable, or under attack?'

Is KSPM part of CNAPP?

Yes. KSPM is usually delivered as one component of a cloud-native application protection platform (CNAPP), alongside CSPM, CWPP and CIEM, so cluster findings can be correlated with the cloud configuration and identities around them.

Does KSPM require an agent in the cluster?

Assessing Kubernetes objects does not — they are readable through the Kubernetes API with a read-only credential. Node-level checks in the CIS benchmark, such as kubelet file permissions, need access to the node itself. Runtime detection is a different capability and typically needs something running in the cluster.

What is the CIS Kubernetes Benchmark?

A set of secure-configuration recommendations for Kubernetes published by the Center for Internet Security, covering control-plane components, etcd, worker nodes and policies such as RBAC, Pod Security and network policy. Separate CIS benchmarks exist for EKS, AKS and GKE, where the provider manages the control plane.

What baseline should KSPM measure against?

Start with the CIS Kubernetes Benchmark, or the CIS EKS, AKS or GKE variant for managed clusters. Pod Security Standards, the NSA/CISA Kubernetes Hardening Guidance and NIST SP 800-190 are common additions once the CIS baseline is clean.

Which KSPM finding should be fixed first?

Usually an RBAC one. Over-permissive ServiceAccounts and ClusterRoleBindings are what turn a single compromised pod into cluster-wide access, and unlike image CVEs they cannot be resolved by a rebuild.

See it on your own cloud

Connect a read-only role for posture scanning. Your first findings arrive with the first scan — across seven clouds and your SaaS platforms.