容器安全之设置docker.socket文件权限为644或更多限
2021-12-06 本文已影响0人
微凉哇
描述
验证docker.socket文件权限是否正确设置为644或更多限制
隐患分析
docker.socket文件包含可能会改变Docker远程API行为的敏感参数。
因此,它应该拥有root权限,以保持文件的完整性。
审计方式
[root@localhost ~]# systemctl show -p FragmentPath docker.socket|sed "s/FragmentPath=//"|xargs -n1 stat -c %a
644
修复建议
若权限非644,修改授权
$ systemctl show -p FragmentPath docker.socket|sed "s/FragmentPath=//"|xargs -n1 chmod 644
参考文档
- Docker容器最佳安全实践白皮书(V1.0)
- Docker官方文档