Kubernetes Security

Securing clusters, workloads and supply chain

Definition

Kubernetes security covers protecting a cluster's control plane, nodes, workloads and container images – from authentication to network segmentation.

What for?

A cluster bundles many applications. Misconfigurations or vulnerable components (e.g. ingress controllers) could otherwise open access to all workloads and secrets.

Technical architecture

flowchart LR
  U[User / CI] -->|authn + RBAC| API[kube-apiserver]
  API --> ADM[Admission control - Pod Security, policies]
  ADM --> ETCD[(etcd - encrypted secrets)]
  API --> N[Nodes]
  N --> P[Pods - non-root, read-only FS]
  P -.->|NetworkPolicy| P2[Other pods]
  REG[Image registry - signed, scanned] --> N
  AUD[Audit logs] --- API

Core components

Authentication and RBAC
Every request to the API server is authenticated and limited to what is needed via role-based access control.
Admission control
Pod Security Standards and policies prevent e.g. privileged containers.
NetworkPolicies
Limit which pods may talk to each other and to the outside.
Secrets and etcd
Secrets are stored encrypted; access to etcd is tightly restricted.
Image security
Signed, scanned images from trusted registries.

Practical examples

  • A NetworkPolicy allows database connections only from the backend namespace.
  • An admission controller rejects pods that want to run as root.

Enterprise use cases

  • Tenant isolation in shared clusters
  • Patching vulnerable cluster components quickly
  • Proving security requirements in audits

Quiz

1. What does RBAC control in Kubernetes?

2. What are NetworkPolicies for?

3. What does the “restricted” Pod Security Standard prevent, among other things?

Related news

No related news yet.