The company has submitted for discussion in the Linux kernel developers' mailing list the code of the LSM module implementing the IPE (Integrity Policy Enforcement) mechanism, which extends existing mandatory access control systems. Instead of being tied to labels and paths, in IPE the decision to allow or deny an operation is based on the constant properties of the system component with which the operation is performed. The module allows for the definition of an overall integrity policy for the entire system, indicating which operations are permissible and how to verify the authenticity of components.
IPE aims to create fully verifiable systems, whose integrity is confirmed from the initial bootloader and kernel to the final executable files, configurations, and loaded files. For example, IPE can specify which executable files are allowed to run, considering their compliance with a reference version using cryptographic hashes provided by the dm-verity system. In the event of a file being changed or replaced, IPE can block the operation or log the integrity violation.
The proposed mechanism can be applied in firmware for embedded devices, where all software and settings are specifically compiled and provided by the owner; for instance, in Microsoft data centers, IPE is used in equipment for firewalls. Unlike other integrity verification systems, such as IMA, IPE is independent of metadata in the file system — all properties determining the permissibility of operations are stored directly in the kernel.
Rules are defined in text format using key-value pairs. The basic ones are the key "op", which defines the operation to which the rule applies (e.g., op=EXECUTE will trigger when an execution attempt is made), and "action", which determines the action (e.g., "action=DENY" to block). Rules are tied to properties provided by external subsystems such as dm-verity and fs-verity.
For example, the rules op=EXECUTE boot_verified=TRUE action=ALLOW op=EXECUTE dmverity_signature=FALSE action=DENY op=EXECUTE fsverity_digest=sha256:401fce…0dec146938 action=DENY will only allow booting from a verified partition, prohibit the execution of files from partitions without signatures in dm-verity, and selectively deny the execution of the file with the hash "401fce…0dec146938".
The initial set of boot rules is defined using the SECURITY_IPE_BOOT_POLICY setting and is included in the kernel build, while additional rules are added as needed via the file /sys/kernel/security/ipe/new_policy. The rules provided are encrypted using the certificate defined in SYSTEM_TRUSTED_KEYRING.
In general-purpose systems, it is recommended to apply IPE in conjunction with the DIGLIM mechanism developed by Huawei. DIGLIM is implemented using eBPF and allows for easy integrity checks at the file level in standard distributions without requiring their redesign (presented as a Secure Boot variant that operates at the application level). The essence of DIGLIM is to maintain a pool of checksum verifications for files and metadata, providing access to executable files only if their hash is present in the pool. The list of hashes can be obtained from the RPM package manager or manually generated by the user.
Source: opennet.ru
