SEAndroid 记录

来源:互联网 发布:python numpy 教程 pdf 编辑:程序博客网 时间:2024/05/03 10:50

LSM: Linux Security Module

对应目录 :

external/sepolicy/

/device/mediatek/common/sepolicy

class 定义 :security_classes

每个class可用的权限定义:access_vectors

常用的权限宏定义:global_macros

ANDROID中的attribute定义:attribute


object_r  角色名字定义

type域定义 :file_contexts

app所属域定义:seapp_contexts


type 命令格式:

type type_id[alias  alisas_id, ] [attribute_id]  

[ ]中为可选   如:type shell, domain

其中domain由  attribute domain定义  类似于type A 属于group domain组的意思 


type A_t  attribute_test

type B_t  attribute_test

写一个allow语句:  allow attribute_test  C_t:file {read write};

编译后则会生成如下两条:

allow A_t C_t:file {read write};

allow B_t C_t:file {read write};


TE的完整格式为:

rule_name source_type target_type : class perm_set


rule_name:

allow    allowaudit:记录权限     dontaudit:不记录某些权限  neverallow :不允许



当遇到SEAndroid权限问题时LOG:

avc denied。。。。

0 0
原创粉丝点击