Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 23. Enhancing security with the kernel integrity subsystem
You can improve the security of your system by using components of the kernel integrity subsystem. Learn more about the relevant components and their configuration.
23.1. The kernel integrity subsystem Link kopierenLink in die Zwischenablage kopiert!
The integrity subsystem protects system integrity by detecting file tampering and denying access according to the loaded policy. It also collects access logs so that a remote party can verify system integrity through remote attestation. The kernel integrity subsystem includes the Integrity Measurement Architecture (IMA) and the Extended Verification Module (EVM).
- Integrity Measurement Architecture (IMA)
IMA maintains the integrity of file content. It includes three features that you can enable through an IMA policy:
-
IMA-Measurement
: Collect the file content hash or signature and store the measurements in the kernel. If a TPM is available, each measurement extends a TPM PCR, which enables remote attestation with an attestation quote. -
IMA-Appraisal
: Verify file integrity by comparing the calculated file hash with a known good reference value or by verifying a signature stored in the security.ima attribute. If verification fails, the system denies access. -
IMA-Audit
: Store the calculated file content hash or signature in the system audit log.
-
- Extended Verification Module (EVM)
-
The EVM protects file metadata, including extended attributes related to system security such as
security.ima
andsecurity.selinux
. EVM stores a reference hash or HMAC for these security attributes insecurity.evm
and uses it to detect if the file metadata has been changed maliciously.
23.2. Enabling kernel’s runtime integrity monitoring through IMA-signature based appraisal Link kopierenLink in die Zwischenablage kopiert!
Starting from RHEL 9, all package files are signed per file and users can make sure only authorized package files are accessed by enabling the signature-based IMA appraisal.
Enable the signature-based IMA appraisal:
ima-setup --policy=/usr/share/ima/policies/01-appraise-executable-and-lib-signatures
ima-setup --policy=/usr/share/ima/policies/01-appraise-executable-and-lib-signatures
This command:
-
Stores package file signature in
security.ima
for all installed packages. -
Includes the
dracut
integrity module to load the IMA code signing key to kernel. -
Copies the policy to
/etc/ima/ima-policy
so systemd loads it at boot time.
Verification
-
The
ip
command can be successfully executed. If
ip
is copied to/tmp
, by default, it loses itssecurity.ima
and thereforeip
command is not executed.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
If the sample policy 01-appraise-executable-and-lib-signatures
does not meet your requirements, you can create and use a custom policy.
23.3. Enabling remote attestation with IMA measurement Link kopierenLink in die Zwischenablage kopiert!
You can enable remote attestation with IMA measurement to verify the integrity of your system. To use remote attestation with a tool such as Keylime
, you must enable IMA-Measurement. A signed measurement policy is available at /usr/share/ima/policies/02-keylime-remote-attestation
. Deploy and run the sample policy that meets your requirements.
Prerequisites
-
A signed measurement policy is available at
/usr/share/ima/policies/02-keylime-remote-attestation
.
Procedure
Deploy the policy:
cp --preserve=xattr /usr/share/ima/policies/02-keylime-remote-attestation /etc/ima/ima-policy
# cp --preserve=xattr /usr/share/ima/policies/02-keylime-remote-attestation /etc/ima/ima-policy
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Load the policy:
echo /etc/ima/ima-policy > /sys/kernel/security/integrity/ima/policy
# echo /etc/ima/ima-policy > /sys/kernel/security/integrity/ima/policy
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
If the sample policy does not meet your requirements, or if you want to ensure that only signed IMA policies are loaded for security reasons, see Deploying a custom signed IMA policy for UEFI systems.
Verification
Verify that the policy is loaded:
cat /sys/kernel/security/integrity/ima/policy
# cat /sys/kernel/security/integrity/ima/policy
Copy to Clipboard Copied! Toggle word wrap Toggle overflow