美文网首页容器安全
容器安全之设置docker文件的所有权为root:root

容器安全之设置docker文件的所有权为root:root

作者: 微凉哇 | 来源:发表于2021-12-09 20:42 被阅读0次

隐患分析

docker.service文件包含可能会改变Docker守护进程行为的敏感参数。
因此,它应该由root拥有和归属,以保持文件的完整性。

审计方式

$ systemctl show -p FragmentPath docker.service|sed "s/FragmentPath=//"|xargs -n1 ls -l

返回值应为

-rw-r--r-- 1 root root 1157 Apr 26 08:04 /etc/systemd/system/docker.service

修复建议

若所属用户非root:root,修改授权

$ systemctl show -p FragmentPath docker.service|sed "s/FragmentPath=//"|xargs -n1 chown root:root

参考文档

相关文章

网友评论

    本文标题:容器安全之设置docker文件的所有权为root:root

    本文链接:https://www.haomeiwen.com/subject/uyoyaltx.html