设为首页 收藏本站
查看: 855|回复: 0

[经验分享] docker-selinux 改为 container-selinux

[复制链接]

尚未签到

发表于 2019-2-21 07:05:13 | 显示全部楼层 |阅读模式
  说明:
  Dan在2016年将docker-selinux相关的名字改为container-selinux,但是很多旧的资料和网上文章还是使用旧的名字,在工作这些资料中的名字会令人不解,本篇博客介绍了改名的原因以及名字的对应:
原名现名docker_t container_runtime_tdocker_exec_tcontainer_runtime_exec_tsvirt_lxc_net_tcontainer_tsvirt_sandbox_file_t;container_file_t  I have decided to change the docker SELinux policy package on github.com from docker-selinux to container-selinux
  https://github.com/projectatomic/container-selinux
  The main reason I did this was after seeing the following on twitter.   Docker, INC is requesting people not use docker prefix for packages on github.
  https://twitter.com/MacYET/status/775535642793086976

  Since the policy for container-selinux can be used for more container runtimes than just docker, this seems like a good>  I have modified all of the types inside of the policy to container_*.  For instance docker_t is now container_runtime_t and docker_exec_t is container_runtime_exec_t.
  I have taken advantage of the typealias capability of SELinux policy to allow the types to be preserved over an upgrade.
  typealias container_runtime_t alias docker_t;
  typealias container_runtime_exec_t alias docker_exec_t;
  This means people can continue to use docker_t and docker_exec_t with tools but the kernel will automatically translate them to the primary name container_runtime_t and container_runtime_exec_t.
  This policy is arriving today in rawhide in the container-selinux.rpm which obsoletes the docker-selinux.rpm.  Once we are confident about the upgrade path, we will be rolling out the new packaging to Fedora and eventually to RHEL and CentOS.
  Changing the types associated with container processes.
  Secondarily I have begun to change the type names for running containers.  Way back when I wrote the first policy for containers, we were using libvirt_lxc for launching containers, and we already had types defined for VMS launched out of libvirt.  VM's were labeled svirt_t.  When I decided to extend the policy for Containers I decided on extending svirt with lxc.
  svirt_lxc, but I also wanted to show that it had full network.  svirt_lxc_net_t.  I labeled the content inside of the container svirt_sandbox_file_t.
  Bad names...
  Once containers exploded on the seen with the arrival of docker, I knew I had made a mistake choosng the types associated with container processes.  Time to clean this up.  I have submitted pull requests into selinux-policy to change these types to container_t and container_file_t.
  typealias container_t alias svirt_lxc_net_t;
  typealais container_file_t alias svirt_sandbox_file_t;
  The old types will still work due to typealias, but I think it would become a lot easier for people to understand the SELinux types with simpler names.  There is a lot of documentation and "google" knowledge out there about svirt_lxc_net_t and svirt_sandbox_file_t, which we can modify over time.
  Luckily I have a chance at a do-over.
  
  原文: https://danwalsh.livejournal.com/75011.html


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-675019-1-1.html 上篇帖子: 简单的 docker SVG 动画(无聊之作) 下篇帖子: 『中级篇』Docker Compose到底是什么(38)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表