Chinaunix首页 | 论坛 | 博客
  • 博客访问: 89502
  • 博文数量: 11
  • 博客积分: 1498
  • 博客等级: 上尉
  • 技术积分: 180
  • 用 户 组: 普通用户
  • 注册时间: 2005-03-29 19:51
文章分类

全部博文(11)

文章存档

2008年(11)

我的朋友

分类: LINUX

2008-05-27 13:42:37

DAC:Discretionary access control    传统Linux采用的访问控制方法,主要通过user/group/other三种用户来实现
MAC:Mandatory access control     SELinux采用的方式,由security administrator也就是root来决定控制存取权限
每个process或者object上都有security context,包含identity:role:domain/type
Security Policy(targeted)中定义哪些操作需要哪些context权限
一些命令:
sestatus            查看SELinux启用状态
setenforce 0        将enforcing-->permissive  
setenforce 1        将permissive-->enforcing
getsebool httpd_disable_trans        查看httpd是否受到SELinux的保护,RHEL4:inactive受保护,active不受保护;RHEL5:off受保护,on不受保护
setsebool -P httpd_disable_trans=1    boolean值从inactive到active,使httpd不受到SELinux的保护
                    off-->on,使httpd不受保护
setsebool httpd_disable_trans=1        -P改配置文件,永久设置,没有-P临时设置
/etc/selinux/targeted/booleans        RHEL4中布尔值存放该文件中
/selinux/booleans                RHEL5该目录中能看到各个booleans命名的文件,内容为11|00
system-config-securitylevel        图形界面配置Firewall/SELinux,修改/etc/sysconfig/iptables和selinux
system-config-securitylevel-tui        文本界面配置Firewall/SELinux,修改/etc/sysconfig/iptables和selinux
system-config-selinux            图形配置SELinux的详细内容,booleans...
ps -Z    查看进程的context
ls -Z    查看文件的context
id -Z    产看用户的context
chcon -t user_home_t install.log    修改install.log的context为user_home_t的类型
runcon        使用特定的context来执行指令
runcon -t httpd_t cat /etc/passwd
grep avc /var/log/messages    看一些selinux相关信息
/var/log/audit/audit.log        SELinux日志

阅读(1249) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~