Company exhibited for discussion on the Linux kernel developer mailing list, the code of the LSM module with the implementation of the mechanism IPE (Integrity Policy Enforcers), expanding existing mandatory access control systems. Instead of binding to labels and paths in IPE, the decision to allow or deny an operation is made based on the persistent properties of the system component on which the operation is performed. The module allows you to define a general integrity policy for the entire system, indicating which operations are allowed and how the authenticity of components should be verified.
IPE aims to create fully verifiable systems whose integrity is verified from the boot loader and kernel to the final executables, configuration and boot files. For example, using IPE, you can specify which executable files are allowed to run, taking into account their compliance with the reference version using cryptographic hashes provided by the dm-verity system. If a file is changed or replaced, IPE can block the operation or log the fact of a violation of integrity.
The proposed mechanism can be used in firmware for embedded devices, in which all software and settings are specially assembled and provided by the owner, for example, in Microsoft data centers, IPE is used in firewall equipment. What distinguishes IPE from other integrity checking systems, such as IMA, is its independence from metadata in the FS – all properties that determine the permissibility of operations are stored directly in the kernel.
Rules are specified in text form using key-value sets. The basic ones are the “op” key, which defines the operation to which the rule applies (for example, op=EXECUTE will work when trying to execute a process), and the “action” key, which defines the action (for example, “action=DENY” for blocking). Rules are bound 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 loading from a verified partition, will prohibit the launch of files from partitions for which there are no dm-verity verification hashes, and will also selectively prohibit the execution of a file with the hash “401fce…0dec146938”.
An initial set of boot rules is defined using the SECURITY_IPE_BOOT_POLICY setting and included as part of the kernel build, and other rules are added as needed through the file /sys/kernel/security/ipe/new_policy. The transmitted rules are encrypted using the certificate defined in SYSTEM_TRUSTED_KEYRING.
On general purpose systems it is proposed to use IPE in combination with the mechanism DIGLIM, developed by HUAWEI. DIGLIM is implemented using eBPF and allows you to easily implement integrity control at the level of individual files in regular distributions without requiring them to be redesigned (it is presented as a variant of Secure Boot that works at the application level). The essence of DIGLIM is to maintain a pool of verification hashes for files and metadata, and provide access to executable files only if its hash is present in the pool. The list of hashes can be obtained from the RPM package manager or manually generated by the user.
Thanks for reading: