selinux 策略使用到的宏

init_daemon_domain 

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条规则

1 允许 initrc_t 有执行 httpd_exec_t 

  allow initrc_t httpd_exec_t : file { execute read getattr };

2 允许 域 initrc_t 进程转换到 httpd_t

  allow initrc_t httpd_t : process transition;

3  执行文件httpd_exec_t 有到httpd_t 的entrypoint

 allow httpd_t httpd_exec_t : file entrypoint;

 

而使用selinux refpolicy中宏简化的规则的书写, 把重要的逻辑着重在安全的概念上

 

类似的有

files_config_file

 

在旧版中有些宏不能用

如自定义一个端口

type my_ssdp_port_t;
typeattribute my_ssdp_port_t port_type; # 一定要加上这个属性
#否则 semange 不忍 my_ssdp_port_t 类型

 

 

 

 

 

 

posted on 2014-07-05 22:06  kwingmei  阅读(1242)  评论(0编辑  收藏  举报

导航