一,SElinux简介
SELinux(Security Enhanced Linux)是一种基于 域-类型 模型(domain-type)的强制访问控制(MAC)安全系统,它由NSA编写并设计成内核模块包含到内核中,相应的某些安全相关的应用也被打了SELinux的补丁,最后还有一个相应的安全策略。任何程序对其资源享有完全的控制权。假设某个程序打算把含有潜在重要信息的文件扔到/tmp目录下,那么在DAC情况下没人能阻止他。SELinux提供了比传统的UNIX权限更好的访问控制
二,SELinux三个模式
Enforcing 强制
SELinux 策略强制执行,基于 SELinux 策略规则授予或拒绝主体对目标的访问
Permissive 宽容
SELinux 策略不强制执行,不实际拒绝访问,但会有拒绝信息写入日志
Disabled 禁用
完全禁用SELinux
三,查看与修改
查看
sestatus -v//查看当前模式
修改
# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted