1e41f4b71Sopenharmony_ci# Security Overview 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci 4e41f4b71Sopenharmony_ciThe OpenHarmony security subsystem provides security capabilities that allow for trustworthy applications and devices and permission management. This subsystem has the following modules: 5e41f4b71Sopenharmony_ci 6e41f4b71Sopenharmony_ci 7e41f4b71Sopenharmony_ci- Application signature verification 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ci The system uses the application signature and profile to ensure that all applications come from a known and approved source and have not been tampered with. For a debug application, APIs are provided to verify whether the Unique Device Identifier (UDID) of the application matches that of the device. The application can be installed on the device only when the UDIDs match. 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ci- Application permission management 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci Application permissions determine what system resources and capabilities an application can access. During application development, you need to declare the permissions required by your application in the application configuration file. Permissions include system_grant permissions (which need to be registered during the application installation) and user_grant permissions (which involve sensitive information and must be granted by the user). 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci- Inter-process communication (IPC) authentication 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ci The caller that attempts to invoke the APIs provided by system services through IPC must be authenticated. The system ability (SA) registered with the System Ability Manager (Samgr) can expose APIs to other processes through IPC, with access policies configured. When other processes attempt to call these APIs, the IPC authentication will be triggered. If the processes do not have the required permission, the access request will be rejected. 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci- DSLM 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ci The Device Security Level Management (DSLM) module is introduced to manage the security levels of OpenHarmony devices. When different types of user data are transferred or processed in OpenHarmony distributed services, the DSLM APIs can be called to obtain the security levels of related devices for subsequent processing. 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ci- HUKS 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ci OpenHarmony Universal Keystore (HUKS) provides system-level key management capabilities, ensuring secure management and use of keys throughout their entire lifecycle (generation, storage, use, and destruction). Applications can call the APIs provided by the HUKS module to perform operations on keys. In addition, the keys in plaintext must be used in a trusted execution environment (TEE). 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci- OpenHarmony SELinux 28e41f4b71Sopenharmony_ci 29e41f4b71Sopenharmony_ci OpenHarmony Security-Enhanced Linux (SELinux) provides mandatory access control (MAC) capabilities for system resources such as files, parameters, SAs, and the HDF based on the system architecture characteristics and SELinux. 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ci 32e41f4b71Sopenharmony_ci## Basic Concepts 33e41f4b71Sopenharmony_ci 34e41f4b71Sopenharmony_ciBefore you get started, it is helpful to understand the following basic concepts: 35e41f4b71Sopenharmony_ci 36e41f4b71Sopenharmony_ci- Samgr 37e41f4b71Sopenharmony_ci 38e41f4b71Sopenharmony_ci Samgr manages SAs. For details, see the SA Framework development guidelines. 39e41f4b71Sopenharmony_ci 40e41f4b71Sopenharmony_ci- BMS 41e41f4b71Sopenharmony_ci 42e41f4b71Sopenharmony_ci Bundle Manager Service (BMS) manages application installation, uninstallation, and data on the system. 43e41f4b71Sopenharmony_ci 44e41f4b71Sopenharmony_ci- Profile 45e41f4b71Sopenharmony_ci 46e41f4b71Sopenharmony_ci The profile in this document refers to HarmonyAppProvision, which is in JSON format. 47e41f4b71Sopenharmony_ci 48e41f4b71Sopenharmony_ci- Debug application 49e41f4b71Sopenharmony_ci 50e41f4b71Sopenharmony_ci A debug application is a Harmony Ability Package (HAP) that is signed with a debug certificate and profile obtained from AppGallery. 51e41f4b71Sopenharmony_ci 52e41f4b71Sopenharmony_ci- Release application 53e41f4b71Sopenharmony_ci 54e41f4b71Sopenharmony_ci A release application is a HAP that is signed with a release certificate and profile obtained from AppGallery, and formally released on AppGallery. 55e41f4b71Sopenharmony_ci 56e41f4b71Sopenharmony_ci- OpenHarmony self-signed application 57e41f4b71Sopenharmony_ci 58e41f4b71Sopenharmony_ci A self-signed application is an application that is signed with the signing certificate and profile issued based on the open-source root CA certificate and a key provided by OpenHarmony. 59e41f4b71Sopenharmony_ci 60e41f4b71Sopenharmony_ci 61e41f4b71Sopenharmony_ci## Constraints 62e41f4b71Sopenharmony_ci 63e41f4b71Sopenharmony_ci- Only the signatures of the AppGallery debug and release applications and OpenHarmony self-signed applications can be verified. 64e41f4b71Sopenharmony_ci 65e41f4b71Sopenharmony_ci- The signature verification of a debug application is successful only when the device UDID matches the one in the application UDID list contained in the profile. 66