Zum Hauptinhalt springen
LIVE Intel Feed
"Not a Pentest" Notice: This guide is for hardening your own Kubernetes infrastructure. No attack tools.

Kubernetes Security Hardening 2026

Kubernetes is the most widely used container orchestration platform — and one of the most complex attack targets. Misconfigured RBAC bindings, missing network policies and insecure images cost production clusters traffic, data and availability every day.

This pillar guide covers all core areas: RBAC, Network Policies, Pod Security, Secrets Management, Supply Chain and Compliance. With copy-paste examples and runbook links for every step.

TL;DR — Kubernetes Security Checklist

✅ RBACLeast-privilege for all service accounts
✅ Network PoliciesDefault-deny + explicit rules
✅ Pod SecurityRestricted PSA on all production namespaces
✅ SecretsNo plaintext in YAML — Vault or Sealed Secrets
✅ Image SigningSigned images only via admission webhook
✅ RuntimeFalco or Tetragon for anomaly detection
✅ Audit LoggingAPI server audit log to external sink
✅ CIS BenchmarkRun kube-bench regularly
✅ etcd EncryptionEncryption at rest for secrets
✅ Network SegmentationIngress controller with WAF

1. RBAC — Role-Based Access Control

RBAC is the foundation of any Kubernetes security setup. The goal: every service account and every user has exactly the permissions needed for their task — nothing more.

# WRONG — cluster-admin for workload
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
roleRef:
name: cluster-admin # ❌ NIE für Workloads
# CORRECT — Least-Privilege Role
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: my-app
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list"] # ✅ nur lesen

Common RBAC Mistakes

  • • Granting cluster-admin to CI/CD pipelines or operators
  • • Wildcard verbs (*) instead of explicit get/list/watch
  • • Service accounts without role bindings — they inherit default permissions
  • • No regular audits (kubectl auth can-i --list)

2. Network Policies — Default-Deny First

Without network policies, every pod can communicate with every other pod in the cluster. Set default-deny rules as a baseline, then add explicit allow rules.

# Default-Deny for all namespaces
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny-all
namespace: production
spec:
podSelector: {} # alle Pods
policyTypes:
- Ingress
- Egress
# Explicitly allow: Frontend → Backend
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-frontend-to-backend
spec:
podSelector:
matchLabels:
app: backend
ingress:
- from:
- podSelector:
matchLabels:
app: frontend
ports:
- port: 8080

3. Pod Security Admission (PSA)

PodSecurityPolicy was removed in K8s 1.25. The replacement is Pod Security Admission — namespace-level labels control the allowed security contexts.

# Set namespace to restricted
kubectl label namespace production \
pod-security.kubernetes.io/enforce=restricted \
pod-security.kubernetes.io/enforce-version=latest \
pod-security.kubernetes.io/warn=restricted \
pod-security.kubernetes.io/audit=restricted

privileged

No restrictions — ONLY for system namespaces

baseline

Blocks known privilege escalations

restricted

Maximum restriction — target for all production workloads

4. Secrets Management

Kubernetes Secrets are base64-encoded by default — not encrypted. Three protection layers are needed: encryption at rest, external secrets store and no secrets in Git.

1
etcd Encryption at Rest
Enable EncryptionConfiguration with AES-CBC or Secretbox in API server configuration.
2
External Secrets Store
HashiCorp Vault with External Secrets Operator or Sealed Secrets (Bitnami) for secure secret rotation.
3
Git Secrets Scanning
Gitleaks or detect-secrets as pre-commit hook and in the CI/CD pipeline.

5. Supply Chain Security

Compromised images are one of the most common attack vectors. Only images from verified sources should enter the cluster.

Image Signing with Cosign

cosign sign --key cosign.key my-image:tag after every build. Admission webhook verifies signature before deploy.

Vulnerability Scanning with Trivy

trivy image --exit-code 1 --severity HIGH,CRITICAL my-image:tag in the CI pipeline. Block deploy on findings.

SBOM Generation

syft my-image:tag -o spdx-json > sbom.json — full dependency list for compliance and audit.

Admission Webhook (Kyverno)

ClusterPolicy that only accepts signed images from allowed registries. Unsigned = blocked.

6. Runtime Protection

Static scans and admission checks catch configuration errors. Runtime security detects attacks at runtime — privilege escalation, unexpected shell executions, file modifications.

Falco

# Shell in Container ausgeführt — kritischer Alert
- rule: Terminal shell in container
desc: A shell was used in a container
condition: container and shell_procs and proc.tty != 0
output: Shell in container (user=%user.name container=%container.name)
priority: WARNING

Falco monitors system calls and sends alerts to Slack, PagerDuty or a SIEM. No agent inside the container needed — runs as DaemonSet.

7. Compliance & CIS Benchmark

CISAreaCheckkube-bench
1.1API Serveranon-auth=false, audit-log enabled✅
1.2API Server AuthRBAC enabled, node auth✅
2.1etcdTLS, peer auth✅
3.1Control PlaneKubelet auth, cert rotation✅
4.2Kubeletanon=false, read-only=false✅
5.1RBACNo cluster-admin wildcard✅
5.2Pod SecurityPSA restricted on prod✅
5.7Network PoliciesDefault-deny in all NS✅
# Run kube-bench (as job in cluster)
kubectl apply -f https://raw.githubusercontent.com/aquasecurity/kube-bench/main/job.yaml
kubectl logs job/kube-bench

Kubernetes Security FAQ

What is the most important first step in securing Kubernetes?

Configure RBAC correctly: least-privilege for all service accounts, no cluster-admin bindings for workloads, regular role audits.

How do I test my Kubernetes Network Policies?

Use kubectl exec into a test pod and curl/netcat to other services. Blocked connections MUST produce a timeout. Use cilium-connectivity-test for automated tests.

What is Pod Security Admission and how do I enable it?

PSA replaces PodSecurityPolicy (removed since K8s 1.25). Set a label on the namespace: kubectl label namespace my-ns pod-security.kubernetes.io/enforce=restricted

Which CIS Kubernetes Benchmark checks are most important?

CIS 1.1 (API Server), CIS 4.2 (Kubelet), CIS 5.1 (RBAC). Tools: kube-bench runs directly on the node and gives Pass/Fail per check.

How do I secure the Kubernetes supply chain?

Image signing with Cosign/Sigstore, admission webhook that only allows signed images (Connaisseur or Kyverno), SBOM generation per image with Syft.

Further Resources

🔒 Quantum-Resistant Mycelium Architecture
🛡️ Kuratierte Runbooks – EU-gehostet in Frankfurt
🌐 Zero Known Breaches – Powered by Living Intelligence
🏛️ DSGVO Art. 25 & 32 • SOC 2 & ISO 27001 in Vorbereitung
⚡ Real-Time Global Mycelium Network – 347 Bedrohungen in 60 Minuten
🧬 Trusted by SecOps Leaders worldwide