Description
We should make Flux conform to the Kubernetes restricted pod security standard and update the documentation to reflect this.
Patch the deployment spec for:
- source-controller
- kustomize-controller
- helm-controller
- notification-controller
- image-reflector-controller
- image-automation-controller
From Ada Logics
The deployments of the Flux controllers lack container security options that mitigate privilege escalation risks. These are hardening options that we recommend using, and Flux already
makes use ofallowPrivilegeEscalation: falseon all of its controllers. However, in addition to theallowPrivilegeEscalationoption Flux could harden its containers by:
- Dropping all Linux capabilities and enabling those needed
- Filtering syscalls by way of Seccomp
Docker drops many Linux capabilities by default but keeps others for convenience. Flux can harden its containers by having Docker drop all privileges a root user’s process can perform on a system and enabling only those needed. See here for details.
Seccomp filtering is a way of limiting the available system calls and as of v1.19 Kubernetes has support for specifying seccomp policies through the use of
seccompProfilein thesecurityContextof pods. Please see here for details.Recommendation
Ensure that the pod deployed by Flux has appropriate hardening applied through the use of dropping Linux capabilities and syscall filtering.