user_u-: 普通用户登录系统后预设;
system_u-:开机过程中系统进程的预设;
root-: root登录后预设;
在targeted policy中users不是很重要;
在strict policy中比较重要,的有预设的selinuxusers都以 "_u"结尾,root除外。
2.role
文件与目录的role,通常是object_r;
程序的role,通常是system_r;
用户的role,targetedpolicy为system_r;
strict policy为sysadm_r,staff_r,user_r
用户的role,类似于系统中的GID,不同的角色具备不同的权限;用户可以具备多个role;但是同一时间内只能使用一role;
role是RBAC的基础;
3.type
type:用来将主体与客体划分为不同的组,组每个主体和系统中的客体定义了一个类型;为进程运行提供最低的权限环境。
当一个类型与执行的进程关联时,该type也称为domain,也叫安全上下文。
域或安全上下文是一个进程允许操作的列表,决字一个进程可以对哪种类型进行操作。
1.1.3 SElinux配置文件
vi/etc/selinux/config
# This filecontrols the state of SELinux on the system.
# SELINUX= cantake one of these three values:
# enforcing -SELinux security policy is enforced.
# permissive -SELinux prints warnings instead of enforcing.
# disabled -SELinux is fully disabled.
SELINUX=enforcing
#SELINUX=disabled
# SELINUXTYPE=type of policy in use. Possible values are:
# targeted -Only targeted network daemons are protected.
# strict -Full SELinux protection.
SELINUXTYPE=targeted
#SELINUX有「disabled」「permissive」,「enforcing」3种选择。
1.模式的设置
enforcing:强制模式,只要selinu