【问题标题】:Docker seccomp not working on KaliDocker seccomp 无法在 Kali 上运行
【发布时间】:2017-05-06 11:43:45
【问题描述】:

我正在调查使用 Docker 的内核安全性。我正在测试 seccomp,它在 Debian 和 Ubuntu 上运行良好,但在 Kali Linux 上不运行。

例子:

我创建了一个名为 sec.json 的简单 json 文件,内容如下:

{
    "defaultAction": "SCMP_ACT_ALLOW",
        "syscalls": [
                {
                    "name": "mkdir",
                    "action": "SCMP_ACT_ERRNO"
                }
            ]
}

假设使用 seccomp 运行容器,并且此文件将导致您无法在容器内使用 mkdir 命令。这是 docker run 命令:

docker run --rm -ti --security-opt seccomp=/path/to/sec.json ubuntu:xenial sh

正如我所说,它在 Debian 和 Ubuntu 上运行良好,但在 Kali Linux 上我得到了这个错误:

docker: Error response from daemon: linux seccomp: seccomp profiles are not supported on this daemon, you cannot specify a custom seccomp profile.

我的 docker-engine 版本是 17.05.0-ce,我的内核是 4.9.0-kali3-amd64 #1 SMP Debian 4.9.18-1kali1 (2017-04-04) x86_64 GNU/Linux。我对此进行了谷歌搜索,这很奇怪。如果您可以检查,则假设支持 seccomp:

cat /boot/config-`uname -r` | grep CONFIG_SECCOMP=

我得到了结果:

CONFIG_SECCOMP=y

所以应该是支持的。我错过了什么或者对此的解释在 Kali 上不起作用?谢谢。

【问题讨论】:

    标签: security docker linux-kernel kernel seccomp


    【解决方案1】:

    好的,我找到了这篇文章。我会试着回答自己:

    https://github.com/moby/moby/issues/26497

    很相似。我检查了我的 docker info 输出,在 Ubuntu 和 Debian 上我有 Security Options: seccomp 而我在 Kali 上什么都没有。

    可能的解释是包含所需库的libseccomp2 包太旧。也许如果 Kali 工作人员更新了库,它可能会被支持。

    【讨论】:

      【解决方案2】:

      使用

      echo 'apt::sandbox::seccomp "false";' > /etc/apt/apt.conf.d/999seccomp

      应该可以的。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-08-13
        • 2017-03-14
        • 1970-01-01
        • 2018-10-26
        • 2019-06-01
        • 1970-01-01
        相关资源
        最近更新 更多