SELinux模塊位於/usr/share/selinux/targeted/
目錄中。
您必須猜測(稍後會詳細介紹)它可能是哪個文件。
# cp /etc/selinux/targeted/modules/active/modules/cdrecord.pp /tmp
# file cdrecord.pp
cdrecord.pp: bzip2 compressed data, block size = 900k
# bunzip2 cdrecord.pp
bunzip2: Can't guess original name for cdrecord.pp -- using cdrecord.pp.out
# dnf install checkpolicy
...
# sedismod cdrecord.pp.out
Reading policy...
libsepol.policydb_index_others: security: 0 users, 3 roles, 42 types, 3 bools
libsepol.policydb_index_others: security: 1 sens, 1024 cats
libsepol.policydb_index_others: security: 51 classes, 0 rules, 0 cond rules
libsepol.policydb_index_others: security: 0 users, 3 roles, 42 types, 3 bools
libsepol.policydb_index_others: security: 1 sens, 1024 cats
libsepol.policydb_index_others: security: 51 classes, 0 rules, 0 cond rules
Binary policy module file loaded.
Module name: cdrecord
Module version: 2.6.0
Select a command:
1) display unconditional AVTAB
2) display conditional AVTAB
3) display users
4) display bools
5) display roles
6) display types, attributes, and aliases
7) display role transitions
8) display role allows
9) Display policycon
0) Display initial SIDs
a) Display avrule requirements
b) Display avrule declarations
c) Display policy capabilities
l) Link in a module
u) Display the unknown handling setting
F) Display filename_trans rules
f) set output file
m) display menu
q) quit
Command ('m' for menu): 6
...
staff_cdrecord_t [1]: alias for type cdrecord_t flags:0
...
讓我們說staff_cdrecord_t
是我們感興趣的那個。歡呼!
現在只需查詢該軟件包提供的:
# rpm -qf /etc/selinux/targeted/modules/active/modules/cdrecord.pp
selinux-policy-targeted-3.13.1-105.20.fc21.noarch
所以,唯一的問題是你查詢從/etc/selinux/targeted/modules/active/modules/
什麼文件。那麼你要麼必須一個接一個地去(除非有人知道某種方式,這是腳本化的),或者你必須使用常識。當我尋找staff_cdrecord_t時,我會從cdrecord.pp開始。
謝謝!這有很大幫助。我解壓縮了所有的模塊,然後使用如下命令檢查每個模塊:printf「6 \ nq \ n」| sedismod whatever.pp.out –