You could have Docker and Kubernetes installed on the same host and allow the user to access both binaries. A malicious user can potentially bypass Kubernetes security (e.g. PodSecurityPolicies), by avoiding the use of kubectl
to deploy containers. Instead, the user can directly interact with the Docker (e.g. docker
command) or runc
binaries to directly deploy containers.
This will pose a security risk as the user can run vulnerable and risky containers. What are the best practices in real life to ensure that this does not happen?
Some options include employing a level of MAC restrictions to only allow the user to interact with kubectl
but was wondering what are more efficient ways, especially in real life?
Appendix
*There are also several levels of abstraction related to containers which can bypass the security controls in higher layers:
- Kubernetes (kubectl)
- Docker (docker)
- Container Daemon (containerd)
- runc*