2. file_contexts文件: -定义:`file_contexts`文件用于定义文件上下文规则,即文件和目录在SELinux中的安全上下文。 -文件位置:通常位于`/etc/selinux/targeted/contexts/files/`目录下。 -内容:文件上下文规则描述了不同路径下文件的安全上下文,以及这些上下文与SELinux类型之间的映射关系。 3. property_contexts文件:...
(1)type log_data_file, file_type, data_file_type, core_data_file_type; 在file_contexts中定义安全上下文: (2)/data/syslog(/.*)? u:object_r:log_data_file:s0 在logpersist.te将allow语句改为: (3)allow logpersist log_data_file write; 然后在logpersist.te中单独将自定义的log_data_file减...
2.file_contexts - 位于 sepolicy 子目录中。该文件用于为文件分配标签,并且可供多种用户空间组件使用。在创建新政策时,请创建或更新该文件,以便为文件分配新标签。 3.genfs_contexts - 位于 sepolicy 子目录中。该文件用于为不支持扩展属性的文件系统(例如,proc 或 vfat)分配标签。此配置会作为内核政策的一部分...
-rw-r--r--. 1 root root unconfined_u:object_r:default_t:s0 0 Apr 14 19:00 file3 Make label changes permanent. To make the changes permanent and survive a reboot, use thesemanage fcontextcommand. The-aadds a record to the file/etc/selinux/targeted/contexts/files/file_contexts.local,...
/file_contexts //系统中所有file_contexts安全上下文 /seapp_contexts //app安全上下文 /property_contexts //属性的安全上下文 /service_contexts //service文件安全上下文 genfs_contexts //虚拟文件系统安全上下文 4. app在/data/data/文件的安全上下文设置过程 ...
安全上下文中最重要的部分就是第三列的type了,对于进程type被称为domain,type是整个SEAndroid中最重要的一个参量,所有的policy都围绕这一参量展开,所以为系统中每个文件标记上合适的type就显得极为重要了。在SEAndroid中关于安全上下文配置的核心文件主要是file_contexts、seapp_contexts和property_contexts 文件。
File contexts:部分显示了一些选定文件的SELinux上下文。可以通过将自己的自定义文件添加到/etc/sestatus.conf文件中。另外,如果指定的文件是符号链接,还会显示目标文件的上下文。 以下是/etc/sestatus.conf文件的默认设置。将自定义文件添加到[files]部分,将自定义的进程添加到[process]部分。
/etc/selinux/targeted/contexts/files/file_contexts.local 手动添加的规则 修改端口号的标签值 semanage port -a -t http_port_t -p tcp 8899 semanage port -l 查帮助 man semanage-port SElinux的布尔值 semanage boolean -l 查看所有的布尔值,只有root可以执行 ...
不适用:如果整个文件系统relabel,那么用此命令进行的设置将失效,除非使用semanage修改默认策略(Modifying security contexts in this manner will persist between reboots unless the complete filesystem is relabeled (see later). To make the security context changes permanent, even through a complete filesystem ...
│ ├── file_contexts│ ├── file.te│ ├── su.te│ ├── system_app.te│ ├── system_server.te│ ├── untrusted_app.te│ ├── priv_app.te│ └── zygote.te└── vendor ROM: selinux编译生成的策略文件sepolicy,8.0之前在boot.img中,8.0由于treble的原因,system和vendor...