目的
了解保护docker.sock的选项。
背景
就像在那些文章中一样,授予访问docker.sock的风险。
但是在某些情况下,我们需要部署一个Pod,这样需要通过套接字与docker守护进程进行通信以进行监视或控制。例如datadog,它通过hostPath mount来安装套接字。
选件
OpenShift需要显式授予SCC,例如对访问运行该Pod的服务帐户的hostaccess,以使Pod使用hostPath,但这是OpenShift专有的。
我想可以使用SELinux,以便访问docker socker的所有pod都必须具有特定标签。
题
我想知道我对SELinux标签的理解是否有效,还有哪些其他选项可用。
引用文献
RHEL的声明
volume-mounting the docker socket into a container is unsupported by Red Hat. This means that while it is entirely possible to do so (as with any other volume mount), Red Hat is unable to assist with configurations using this setup, problems that arise because of this setup or the security implications/concerns surrounding this setup.
最佳答案
如果要保护对Docker套接字的访问,this docker documents是一个好的开始。
关于security - 固定Docker套接字的选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48475616/