[root@study ~]#
sesearch [
-
A] [
-
s
主体
类别
] [
-
t
标类别
] [
-
b
]
选项
参数
-
A
:列出后面
据中,允
取或放行』的相
关数
-
t
:后面
要½
类别
,例如
-
t httpd_t
-
b
:后面
要½
SELinux
规则
,例如
-
b httpd_enable_ftp_server
范例一:找出
crond_t
这个
主体
½
程能
够读
取的
文件
SELinux type
[root@study ~]#
sesearch
-
A
-
s crond_t | grep spool
allow
crond_t system_cron_spool_t
: file
{ ioctl read write create getattr ..
allow
crond_t system_cron_spool_t : dir
{ ioctl read getattr lock search op..
allow
crond_t user_cron_spool_t : file
{ ioctl read write create getattr se..
allow
crond_t user_cron_spool_t : dir
{ ioctl r
ead write getattr lock add_n..
allow
crond_t user_cron_spool_t : lnk_file
{ read getattr } ;
# allow
后面½主体
½
程以及
文件
SELinux type
,上面的
据是
取出
的,
#
意思是
crond_t
可以
system_cron_spool_t
文件
/
录类
型~等等!
范例二:找出
crond_t
是否能
够读
/etc/cron.d/checktime
这个
自定
的配置文件?
[root@study ~]#
ll
-
Z /etc/cron.d/checktime
-
rw
-
r
--
r
--
. root root unconfined_u:object_r:
admin_home_t
:s0 /etc/cron.d/checktime
#
两个
,一
SELinux type
admin_home_t
,一
文件
(file)
[root@study ~]#
sesearch
-
A
-
s crond_t | grep admin_home_t
allow domain admin_home_t : dir { getattr search open } ;
allow domain admin_home_t : lnk_file { read getattr } ;
allow crond_t admin_home_t : dir { ioctl read getattr lock search open } ;
allow crond_t admin_home_t : lnk_file { read getattr }
;
#
看!看仔
然有
crond_t admin_home_t
存在,但是
体的信息,
#
针对
某些
规则
找~所以
是不确定
checktime
能否被
取。但是,基本上就是
SELinux
# type
问题
~因此才
会无
取的!
所以,现在我们知道
/etc/cron.d/checktime
这个我们自己复制过去的文件会没有办法被读取的原因,
就是因为
SELinux type
错误啦!
根本就无法被读取~好~那现在我们来查一查,那
getsebool -a
面看到的
httpd_enable_homedirs
到底是什么?又是规范了哪些主体½程能够读取的
SELinux type
呢?
[root@study ~]#
semanage boolean
-
l | grep httpd_enable_homedirs
SELinux boolean State Default Description
httpd_enable_homedirs (off , off) Allow httpd to enable hom
edirs
# httpd_enable_homedirs
的功能是允
httpd
½
程去
取用
家目
的意思~
[root@study ~]#
sesearch
-
A
-
b httpd_enable_homedirs
范例三:列出
httpd_enable_homedirs
这个规则当
中,主体
½
程能
够读
取的
文件
SELinux type
Found 43 semantic av rules: