Last updated: April 26, 2026
Kubernetes is the orchestration layer for most modern Indian SaaS workloads. Default Kubernetes is dangerously permissive, and the gap between “running cluster” and “secure cluster” is wide. This article catalogues the 10 misconfigurations we routinely find on Indian production Kubernetes audits, the kubectl commands to detect each, and the remediation that closes them.
The mental model
Kubernetes is a permission system layered over a container runtime. Compromise can come from:
- Cluster-level (API server, etcd, kubelet)
- Workload-level (Pods, ServiceAccounts, RBAC)
- Container-level (image, runtime, capabilities)
- Network-level (NetworkPolicy, ingress, mesh)
Each layer has its own attack surface.
The 10 misconfigurations
1. Default ServiceAccount tokens auto-mounted
Every Pod gets a ServiceAccount token mounted at /var/run/secrets/kubernetes.io/serviceaccount/token by default. From a compromised container, this token authenticates as the SA — and if RBAC is permissive, the SA can do anything.
# From inside a compromised container:
TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
curl -H "Authorization: Bearer $TOKEN" -k https://kubernetes.default/api/v1/secrets
Mitigation: automountServiceAccountToken: false on Pods that don’t need API access.
2. Privileged containers
Containers with privileged: true have full host-device access, full kernel capabilities, and can mount any filesystem. Privileged container = host root.
kubectl get pods -A -o json | jq '.items[] | select(.spec.containers[].securityContext.privileged==true) | .metadata'
Mitigation: never use privileged. For specific needs (e.g. CSI drivers), use specific capabilities — SYS_ADMIN only if necessary, never --privileged.
3. hostPath / hostPID / hostNetwork volumes
Pods with hostPath: / can read and modify the host filesystem. hostNetwork: true shares the host network namespace, sometimes letting the Pod intercept other Pods’ traffic.
kubectl get pods -A -o json | jq '.items[] | select(.spec.volumes[]?.hostPath) | .metadata.name'
4. Cluster-admin RBAC granted broadly
cluster-admin role is the Kubernetes equivalent of root. Common over-grants:
- Default ClusterRoleBinding to
system:mastersgroup with cluster-admin - Custom binding granting cluster-admin to
:authenticatedgroup - ServiceAccounts in default namespace bound to cluster-admin
kubectl get clusterrolebindings -o json | jq '.items[] | select(.roleRef.name=="cluster-admin") | {name:.metadata.name, subjects}'
Audit every binding. Replace cluster-admin with scoped roles where possible.
5. Insecure API server / kubelet
API server should only accept TLS-authenticated requests. Kubelet should reject anonymous requests and enforce authorisation.
# Test API server anonymous access:
curl -k https://api-server/api/v1/pods
# Should return 401 Unauthorized; if it returns data, broken
# Test kubelet:
curl -k https://node:10250/pods
# Should return 401
6. Secrets stored unencrypted in etcd
By default, Kubernetes Secrets are base64-encoded but not encrypted in etcd. Anyone with etcd read access has every secret in plaintext.
kubectl get --raw "/api/v1/namespaces/default/secrets" | head
Mitigation: encrypt etcd at rest with a KMS provider (cloud-managed clusters do this; self-managed must configure).
7. NetworkPolicy not enforced
By default, every Pod can reach every other Pod. Lateral movement from one compromised Pod to the entire cluster is one curl call.
kubectl get networkpolicies -A
Empty result = no segmentation. Apply default-deny NetworkPolicy per namespace, then explicit allow rules for required traffic.
8. Container images from untrusted registries
Cluster pulls images from any registry by default. Compromised registries can serve malicious images.
kubectl get pods -A -o json | jq '.items[].spec.containers[].image' | sort -u
Audit image sources. Implement OPA Gatekeeper / Kyverno policies that allow-list registries.
9. Containers running as root
Most containers run as root by default — UID 0 inside the container, with its capabilities. Combined with hostPath mounts or kernel CVEs, this enables host compromise.
kubectl get pods -A -o json | jq '.items[] | select(.spec.securityContext.runAsNonRoot==null and .spec.containers[].securityContext.runAsNonRoot==null) | .metadata.name'
Set runAsNonRoot: true and runAsUser: <non-zero> on Pods.
10. Audit logging disabled
Without API server audit logs, you have no record of who did what. Most cloud-managed clusters log to cloud-native platforms; self-managed often skip it.
kubectl get --raw /healthz/log
# If audit not configured, no audit-policy file referenced
Detection — what mature defenders deploy
- Falco — runtime security; alerts on anomalous syscalls within containers (file access, process spawning, network connections).
- OPA Gatekeeper / Kyverno — admission control; rejects manifests that violate policy at apply time.
- Trivy / Grype — image vulnerability scanning in CI.
- kube-bench — CIS Kubernetes Benchmark scoring.
- kube-hunter / Peirates — offensive scanning of cluster configuration.
- API server audit logs shipped to SIEM; alert on suspicious patterns (sudden mass enumeration, unusual ServiceAccount activity).
How to find your next K8s misconfiguration
- Run
kube-benchon every node. Findings are your prioritised baseline. - Run
peiratesfrom inside a Pod. Demonstrates what a compromised workload can do. - Audit RBAC with
rbac-tool— visualises who can do what. - Check etcd encryption status; if not, prioritise.
- Look for default ServiceAccounts with non-default RBAC bindings.
Compliance angle
- SEBI CSCRF — container and orchestration platforms in scope for Q-RE / MII categorisation.
- RBI — cloud-native workloads carrying regulated data require equivalent identity and access hygiene.
- DPDP §8(5) — Kubernetes clusters processing personal data must implement reasonable security at every layer.
- CIS Kubernetes Benchmark — referenced in most audit frameworks.
The takeaway
Default Kubernetes is dangerously permissive. The 10 misconfigurations above account for ~80% of the findings on cluster audits. The remediation is largely declarative — manifest fixes, RBAC scoping, NetworkPolicy adoption, OPA enforcement. Run kube-bench and peirates against your own cluster this week. Whatever percentage shows non-compliant is your remediation backlog. The cost of skipping it: one compromised Pod becomes the entire cluster.
Get a cloud posture review
IAM hardening, public-exposure mapping, IaC review, K8s audit. We map your actual blast radius — not what a CSPM dashboard guesses at.