TLS Everywhere (between every component on the master, between Kubelet and API server)
Autoscaling: we should scale k8s instances, but shouldn’t include tls key into the image
Kubelet TLS bootstrapping documentation (didn’t read): add low-permissions keys to generate a proper key, auto-approve.
Enable RBAC with least privilege, disable ABAC, monitor logs
Use Third-party Auth for API Server: Google, Github, Dex (OpenID Connect Identity), … Single point to add/remove members, add/revoke permissions, 2FA, etc.
Separate and Firewall your etcd Cluster Ability to write to etcd = have root on entire cluster. etcd should be on separate nodes, TLS certificates to work with it, firewall rules to allow access from API server only
Rotate Encryption Keys. Some keys are rotated automatically (kubelet certs), but not all
WORKLOADS
Use Linux Security Features (SELinux, AppArmor, seccomp-bpf, …) and PodSecurityPolicies PodSecurityPolicy = cluster-level resource, that controls security aspects of pod spec.
Run containers as a Non-Root User. Run as a Root in the container => you have root permissions on host. Container breakouts is needed, but risk is higher.
Use Network Policies (restrict all pod-to-pod traffic)
Scan Images and Run IDS (Intrusion Detection Systems). Admission controller gates - to check the Deployment/Pod/… Check content, mutate content. A lot of open-source scanners that prevent releasing containers with known vulnerabilities https://github.com/coreos/clair https://github.com/aquasecurity/microscanner Zero-day vulnerabilities - will alway exists, IDS should be added. Detects unusual behaviours in a container, pause or kills it: https://sysdig.com/product/secure/