Yan*_*rez 10 security linux selinux
我需要了解与正在运行的系统的当前规则上的 selinux 类型相关的所有内容:
...以及任何其他信息。
是否有任何命令我可以用来查询该信息,或者我应该下载所有与 selinux 相关的“src”包,过滤掉未使用的模块并grep每个文件以获得该信息?必须有一种更简单的方法来做到这一点。
daw*_*wud 10
获取此信息的一些命令是(示例使用httpd_log_t):
seinfo
# seinfo -x --type=httpd_log_t /etc/selinux/default/policy/policy.26
httpd_log_t
file_type
non_security_file_type
logfile
Run Code Online (Sandbox Code Playgroud)sesearch
# sesearch --dontaudit -t httpd_log_t /etc/selinux/default/policy/policy.26 | head
Found 35 semantic av rules:
dontaudit run_init_t file_type : dir { getattr search open } ;
dontaudit staff_t non_security_file_type : file getattr ;
dontaudit staff_t non_security_file_type : dir { ioctl read getattr lock search open } ;
dontaudit staff_t non_security_file_type : lnk_file getattr ;
dontaudit staff_t non_security_file_type : sock_file getattr ;
dontaudit staff_t non_security_file_type : fifo_file getattr ;
dontaudit unconfined_t non_security_file_type : file getattr ;
dontaudit unconfined_t non_security_file_type : dir { ioctl read getattr lock search open } ;
dontaudit unconfined_t non_security_file_type : lnk_file getattr ;
Run Code Online (Sandbox Code Playgroud)semanage
# semanage fcontext -l | grep httpd_log_t
/etc/httpd/logs all files system_u:object_r:httpd_log_t:s0
/var/log/apache(2)?(/.*)? all files system_u:object_r:httpd_log_t:s0
/var/log/apache-ssl(2)?(/.*)? all files system_u:object_r:httpd_log_t:s0
/var/log/cacti(/.*)? all files system_u:object_r:httpd_log_t:s0
/var/log/cgiwrap\.log.* regular file system_u:object_r:httpd_log_t:s0
/var/log/horde2(/.*)? all files system_u:object_r:httpd_log_t:s0
/var/log/httpd(/.*)? all files system_u:object_r:httpd_log_t:s0
/var/log/lighttpd(/.*)? all files system_u:object_r:httpd_log_t:s0
/var/log/piranha(/.*)? all files system_u:object_r:httpd_log_t:s0
/var/www(/.*)?/logs(/.*)? all files system_u:object_r:httpd_log_t:s0
Run Code Online (Sandbox Code Playgroud)参考资料:RHEL6 SELinux 手册
| 归档时间: |
|
| 查看次数: |
35814 次 |
| 最近记录: |