我正在调查使用 Docker 的内核安全性。我正在测试 seccomp,它在 Debian 和 Ubuntu 上运行良好,但在 Kali Linux 上不起作用。
例子:
我创建了一个sec.json
使用以下内容调用的简单 json 文件:
{
"defaultAction": "SCMP_ACT_ALLOW",
"syscalls": [
{
"name": "mkdir",
"action": "SCMP_ACT_ERRNO"
}
]
}
假设使用 seccomp 运行容器,并且此文件将导致您无法mkdir
在容器内使用命令。这是 docker 运行命令:
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 上不起作用?谢谢。