harmony 鸿蒙Configuring an OpenHarmony SELinux Policy for a Parameter
Configuring an OpenHarmony SELinux Policy for a Parameter
Scenario
To implement access control for a system parameter, you can configure an SELinux label for the parameter. For details about the parameter definition, see Parameter Management.
Procedure
Define the mappings between parameters and labels in the parameter_contexts file. If a parameter name ends with a dot (.), the parameter is a wildcard parameter. Otherwise, the parameter is a fixed parameter.
The following is an example of the mapping between a label and a wildcard parameter. The label for parameters starting with init.svc. is u:object_r:init_svc_param:s0.
init.svc. u:object_r:init_svc_param:s0
The following is an example of the mapping between a label and a fixed parameter. The label for the parameter const.secure is u:object_r:secure_param:s0.
const.secure u:object_r:secure_param:s0
The wildcard parameters are labelled by the best match prefix. For example, the paramter_contexts file contains the following mappings:
init. u:object_r:init_param:s0
init.svc. u:object_r:init_svc_param:s0
Then, - The label of the init.a parameter is u:object_r:init_param:s0. - The label of the init.svc parameter is u:object_r:init_param:s0. - The label of the init.svc.a parameter is u:object_r:init_svc_param:s0.
For example, to assign the label init_svc_param for parameters prefixed with init.svc., do as follows:
Add the parameter-label mapping in the parameter_contexts file.
init.svc. u:object_r:init_svc_param:s0
Add init_svc_param in type.te to make the label valid.
type init_svc_param, parameter_attr;
你可能感兴趣的鸿蒙文章
harmony 鸿蒙AI Framework Development Guide
harmony 鸿蒙Neural Network Runtime Device Access
harmony 鸿蒙Application Privilege Configuration
harmony 鸿蒙Setting Up a Development Environment
harmony 鸿蒙Development Guidelines
harmony 鸿蒙Application Framework Overview
harmony 鸿蒙ArkCompiler Development
harmony 鸿蒙Window Title Bar Customization Development (ArkTS)
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦