init_daemon_domain linux
init_daemon_domain(httpd_t, httpd_exec_t)
Defines a transition rule that says
Init Scripts executing apps labeled httpd_exec_t should transition to httpd_t.
initrc_t -> httpd_exec_t -> httpd_t安全
包含了3条规则app
1 容许 initrc_t 有执行 httpd_exec_t dom
allow initrc_t httpd_exec_t : file { execute read getattr };进程
2 容许 域 initrc_t 进程转换到 httpd_tip
allow initrc_t httpd_t : process transition;get
3 执行文件httpd_exec_t 有到httpd_t 的entrypointit
allow httpd_t httpd_exec_t : file entrypoint;io
而使用selinux refpolicy中宏简化的规则的书写, 把重要的逻辑着重在安全的概念上file
相似的有
files_config_file
在旧版中有些宏不能用
如自定义一个端口
type my_ssdp_port_t;typeattribute my_ssdp_port_t port_type; # 必定要加上这个属性#不然 semange 不忍 my_ssdp_port_t 类型