By Paul-Emmanuel Raoul / skyper@skyplabs.net / @Skyper@fosstodon.org
Entry point for managing the cluster
One per master node
Official client: kubectl
Store cluster's configuration and state
Service discovery
Write access = root access on the whole cluster
Bridge between worker nodes and the cluster logic
One per worker node
Takes care of managing the pods
Has its own API
The default configuration is generally not secure
Large number of parameters
Easy to make a mistake
Referred as "API server" on the diagram
Role-Based Access Control
Since v1.8 released on 29th September 2017
Entity - Role - Resource
Least privilege
Port 8080 by default
Bypass authentication and authorisation checks
Deprecated in v1.10 released on 27th March 2018
Bypass authentication and authorisation checks
RBAC enabled = read-only access by default
Deprecated in v1.10 as well
Passphrase
Kubernetes doesn't support revocation lists
Remediation: external authentication provider
Enable client authentication
Secure peer-to-peer communications
Disable self-signed certificates
Restrict network communications
Kubernetes secrets are stored in etcd by default
Disable anonymous authentication
Disable the read-only port
One Kubelet instance per worker node
Consequently, subdivision of each instance's permissions
Only each instance's own pods
Only each instance's own node
HTTPS enabled by default
Bootstrapped with one-year-expiration certificates
Kubelet certificate rotation since v1.8 (beta)
Check the security of your cluster automatically
Checks your configuration files
Based on the CIS Kubernetes Benchmark
Vulnerability scanner
Scan a remote cluster or from a pod
Package manager for Kubernetes
Package = Chart
YAML files + template engine
Massively used
The default configuration is completely unsecure
Cluster admin by default
No authentication by default
Possibility to use Tiller from the inside of the cluster
One role per Tiller instance
Single whole-cluster-admin-privileged Tiller instances are pretty common
One Tiller instance per namespace / team / ...
Bind to localhost only (Helm CLI tool port forwards to the remote pod)
Tillerless
More RBAC-aware
No release date at the moment
In the meantime: helm template
Most Docker images run as root
Too many useless (and dangerous) packages installed
Presence of known vulnerabilities
List of known vulnerabilities (CVEs)
Static Analysis
Should be integrated to your CI/CD pipelines
Privilege passing secrets in files than via environment variables
Secrets can be exposed via your VCS repository (Git, ...)
Use private repositories
Encrypt the sensitive files (ex: git-crypt)
Keep only the strict minimum in your final image
If you need to build something: multi-stage builds
Use FROM scratch when possible
Add a label with the version number
Add tags (linked with Git tags)
Used to define privileges and access control at runtime
Example: run as non-root
Breaks up root privileges into smaller groups of privileges
Example: bind to a port lower than 1024
Define a CPU and memory limit
Lower the impact of potentiel (D)DOS