security - 固定Docker套接字的选项

标签 security docker openshift

目的

了解保护docker.sock的选项。

背景

就像在那些文章中一样,授予访问docker.sock的风险。

  • Don't expose the Docker socket (not even to a container)
  • Access Docker socket within container

  • 但是在某些情况下,我们需要部署一个Pod,这样需要通过套接字与docker守护进程进行通信以进行监视或控制。例如datadog,它通过hostPath mount来安装套接字。

    选件

    OpenShift需要显式授予SCC,例如对访问运行该Pod的服务帐户的hostaccess,以使Pod使用hostPath,但这是OpenShift专有的。

    我想可以使用SELinux,以便访问docker socker的所有pod都必须具有特定标签。



    我想知道我对SELinux标签的理解是否有效,还有哪些其他选项可用。

    引用文献
  • Hardening Docker containers and hosts against vulnerabilities: a security toolkit


  • 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/

    相关文章:

    javascript - spoofer.js : An unexpected error has occurred, 我应该担心吗?

    ruby - Sinatra::Reloader 未重新加载 Docker 容器中的文件

    使用外部文件构建 Docker

    linux - 如何更改 openshift 容器平台中的权限?

    openshift - 如何在 OPENSHIFT 上执行应用程序/服务器配置更改而无需重建镜像?

    java - 拒绝 j_security_check 上的 GET 方法

    android - 生物认证实现

    .net - Microsoft Security 应用程序 block 的替代方案?

    python - docker/matplotlib : RuntimeError: Invalid DISPLAY variable

    kubernetes - Openshift vs Rancher有什么区别?