禁用selinux有什么用(安卓彻底禁用selinux)

禁用selinux有什么用(安卓彻底禁用selinux)

扫码添加渲大师小管家,免费领取渲染插件、素材、模型、教程合集大礼包!

大家好,今天来介绍禁用selinux有什么用的问题,以下是渲大师小编对此问题的归纳和整理,感兴趣的来一起看看吧!

安卓关闭selinux好处

安卓关闭selinux好处渗厅含是安全。
安卓关闭selinux是对系统的安全运行起到很好的作用,是很安全丛笑的。
SeLinux全称是伏燃Security-EnhancedLinux即安全增强型Linux,它是一个Linux内核模块。

安卓关闭selinux好处

你好朋友
1. 禁止selinux

1.1 在内核中关闭selinux编译选项CONFIG_SECURITY_SELINUX
1.2 还可以在system.prop中定义ro.boot.selinux=disable
这两种方法都可以禁用selinux,也可以设置成ro.boot.selinux=permissive
宽容模式
1.3 可以通过setenforce 1 开启陪扮升enforce模式,setenforce 0 为permissive模式
getenforce获取当前模式

2. 所有安全策略最终编译成sepolicy文件放在root目录下,init进程启动后会读取/sepolicy策略文件,并通过/sys/fs/selinux/load节点
把策略文件内容写入内核

3 安全上下文存放root目录
/缺宽etc/security/mac_permissions.xml
/file_contexts //系统中所有file_contexts安全上下文
/seapp_contexts //app安全上下文
/property_contexts //属性的安全上下文
/service_contexts //service文件安全上下文

genfs_contexts //虚拟文件系统安全上下文

4. app在/data/data/文件的安全上下文设置过程
1. 根据uid,pkgname,seinfo在seapp_contexts中匹配.
2. 根据匹配到的contexts,重新设置给相对应文件

5. 系统中所有的object class 定义在external/sepolicy/security_classes中.
object class使用在allow语句中,object class所具有的操作定义在external/sepolicy/access_vectors
文件中

6 allow语句
allow语句用来权限设置
rule_name source_type target_type : class perm_set

rule_name : 有allow,neverallow
source_type : 权限主体,表示source_type对target_type有perm_set描述的权限
如:
allow zygote init:process sigchld
允许zygote域里面的进程可对init域的进程发送sigchld信号

typeattribute表示把属性和type关联起来

7 role定义
Android系统中的role定义在external/sepolicy/roles中,
目前只定义了r

8 socket 使用
以/data/misc/wifi/sockets/wlan0 socket来说明使用方法
1. 定义socket type
type wpa_socket ,file_type
2. 指定安全上下文
/data/misc/wifi/sockets(/.*)? u:object_r:wpa_socket:s0
给/data/misc/wifi/sockets目录下所有的文件统一指定安全上下文为wpa_socket
3.声明socket使用权限
在进程te中使用unix_socket_send(clientdomain, wpa, serverdomain)即可建立socket连接

9 binder使用
在使用binder 进程的te中根据情况使用如下宏:
binder_use(domain)//允许domain域中的进程使用binder通信
binder_call(clientdomain, serverdomain) //允许clientdomain和serverdomain域中的进程通信
binder_service(domain) //标志domain为service端

10 文件的使用
以/dev/wmtWifi来说明:
1.定义type
type wmtWifi_device dev_type //dev_type用来标志/dev/下的文芦老件
2.给/dev/wmtWifi指定完全上下文
/dev/wmtWifi(/.*)? u:object_r:wmtWifi_device:s0

3.进程权限设置
在进程te文件中allow权限
allow netd wmtWifi_device:chr_file { write open };

11 property 属性设置
以蓝牙的各种属性来说明
1.定义type
type bluetooth_prop, property_type;
2 设置安全上下文
bluetooth. u:object_r:bluetooth_prop:s0
3 进程权限设置
allow bluetooth bluetooth_prop:property_service set;

5 专业词汇
MLS :Multi-Level Security
RBAC :Role Based Access Control
DAC :Discretionary Access Control
MAC :Mandatory Access Control
TEAC :Type Enforcement Accesc Control
望采纳祝你好运

为什么要关闭 SElinux

SElinux是Linux系统里面的安全机制腔正州,如果不管的话可能造成清渣各种外部的连接不成功,比如ftp啊telnet啊,ssh啥的,伍蔽很麻烦的

SElinux是什么安卓打开了SELinux有什么用

如果要bai恢复运行SELinux则可以运行
# setenforce
1
这条命令会把SELinux设定du成Enforcing模式
2.把SELinux永久设zhi定为Permissive模式
这里需要讲一下daoPermissive和Enforcing模式的肆滚卖区别。
SELinux有三种模式:Enforcing, Permissive and Disable.
Enforcing模式就是应用SELinux所设定的Policy,
所有违反Policy的规则(Rules)都会被SELinux拒绝
Permissive和Enforcing的区别就在于它还是会遵循SELinux的Policy,但是对于违反规则的操作只会予以记录而并不会拒绝操作
Disable 顾名思义就是完全禁用SELinux
如果要永久设定为Permissive模式,我们就要修改SELinux的配置文件
/裂逗etc/sysconfig/selinux (在备腔RHEL5下这是一个symbolic link to /etc/selinux/conf)
# 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 - SELinux is fully disabled.
SELINUX=enforcing
#
SELINUXTYPE= type of policy in use. Possible values are:
# targeted -
Only targeted network daemons are protected.
# strict -
Full SELinux protection.
SELINUXTYPE=targeted
修改SELINUX=permissive,然后重新启动就可以了

分享到 :
相关推荐

.in域名注册优势

.in域名是印度的通用顶级域名。属国别域名。从全球角度看。印度人口排名仅次于中国。高...

服务器的硬件配置怎么选择(服务器的硬件配置怎么选择的)

服务器硬件配置选择的方法:1。Web服务器。对硬件要求不高。选择2颗4核。8G内存。...

抗ddos防火墙(防火墙防ddos)

CC攻击其实也是DDOS的其中一种,CC攻击的原理是利用大量的代理ip,不停的向网站...

香港CN2线路VPS好在哪(vps 香港 cn2)

CN2是中国电信下一代承载网。作为“精品网络项目”被提出来。...

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注