目录

Access Control Overview

Access control is a mechanism that restricts applications from accessing system resources. By default, applications can have only limited access to system resources. However, to provide extended features, an application may need to access excess system data or functions.

To prevent improper or malicious use of data or functions, the system provides a variety of access control mechanisms, including the application sandbox, application permissions, and secure access mechanism.

Application Sandbox

All applications running on the system are deployed in independent sandbox directories, which isolate the data of different applications and prevent improper application behavior, such as unauthorized data access between applications and device tampering.

The application sandbox ensures that only the intended application can access the in-application data, while also restricting the scope of data accessible to the application. For details, see Application Sandbox Directory.

Application Permissions

The system has process domain and data domain labels set based on the Ability Privilege Level (APL) of an application, and uses the access control mechanism to restrict the data accessible to each application. This minimizes the risks of application data leakage.

Applications of different APLs are assigned permissions at different levels. The strict hierarchical permission management provides robust defense against malicious attacks and ensures system security and reliability. In addition to system resources (such as Contacts) and system capabilities (such as Camera and Microphone), some kernel resources (such as executable anonymous memory) are also protected by permissions. These permissions are called KernelPermissions.

For more information, see Application Permission Management Overview.

Secure Access Mechanism

HarmonyOS provides a secure access mechanism to redefine the way for applications to obtain privacy data. Instead of managing permissions, users only need to manage data and access system data as required. For example, when a user wants to change a profile photo on a social platform, the application can only use the photo selected by the user instead of accessing the Gallery. The system grants the photo access permission based on the photo scope selected by the user to isolate the user's privacy data from the application, safeguarding user privacy.

Specifically, the secure access mechanism is implemented by system Pickers and security components, which allow an application to temporarily access a restricted resource without requesting the permission from the user. This mechanism implements precise permission control while better protecting user privacy.

Emulator Support

This module is supported on the Emulator.