【发布时间】: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