Kconfig

CONFIG_IMA Integrity Measurement Architecture(IMA)

On

The Trusted Computing Group(TCG) runtime Integrity Measurement Architecture(IMA) maintains a list of hash values of executables and other sensitive system files, as they are read or executed. If an attacker manages to change the contents of an important system file being measured, we can tell.

If your system has a TPM chip, then IMA also maintains an aggregate integrity value over this list inside the TPM hardware, so that the TPM can prove to a third party whether or not critical system files have been modified. Read <https://www.usenix.org/events/sec04/tech/sailer.html> to learn more about IMA. If unsure, say N.

If IMA

CONFIG_IMA_KEXEC Enable carrying the IMA measurement list across a soft boot

On

TPM PCRs are only reset on a hard reboot. In order to validate a TPM's quote after a soft boot, the IMA measurement list of the running kernel must be saved and restored on boot.

Depending on the IMA policy, the measurement list can grow to be very large.

CONFIG_IMA_MEASURE_PCR_IDX PCR Index for Aggregate

IMA_MEASURE_PCR_IDX determines the TPM PCR register index that IMA uses to maintain the integrity aggregate of the measurement list. Most attestation tooling expects PCR 10.

The default is almost always what you want. Only change this if you know what you are doing.

Default template

Select the default IMA measurement template.

The original 'ima' measurement list template contains a hash, defined as 20 bytes, and a null terminated pathname, limited to 255 characters. The 'ima-ng' measurement list template permits both larger hash digests and longer pathnames. The configured default template can be replaced by specifying "ima_template=" on the boot command line.

CONFIG_IMA_NG_TEMPLATE ima-ng (default)

On

CONFIG_IMA_SIG_TEMPLATE ima-sig

Off
End of Default template

Default integrity hash algorithm

Select the default hash algorithm used for the measurement list, integrity appraisal and audit log. The compiled default hash algorithm can be overwritten using the kernel command line 'ima_hash=' option.

End of Default integrity hash algorithm

CONFIG_IMA_WRITE_POLICY Enable multiple writes to the IMA policy

On

IMA policy can now be updated multiple times. The new rules get appended to the original policy. Have in mind that the rules are scanned in FIFO order so be careful when you design and add new ones.

If unsure, say N.

CONFIG_IMA_READ_POLICY Enable reading back the current IMA policy

On

It is often useful to be able to read back the IMA policy. It is even more important after introducing CONFIG_IMA_WRITE_POLICY. This option allows the root user to see the current policy rules.

CONFIG_IMA_APPRAISE Appraise integrity measurements

On

This option enables local measurement integrity appraisal. It requires the system to be labeled with a security extended attribute containing the file hash measurement. To protect the security extended attributes from offline attack, enable and configure EVM.

For more information on integrity appraisal refer to: <http://linux-ima.sourceforge.net> If unsure, say N.

If IMA_APPRAISE

CONFIG_IMA_APPRAISE_BUILD_POLICY IMA build time configured policy rules

On

This option defines an IMA appraisal policy at build time, which is enforced at run time without having to specify a builtin policy name on the boot command line. The build time appraisal policy rules persist after loading a custom policy.

Depending on the rules configured, this policy may require kernel modules, firmware, the kexec kernel image, and/or the IMA policy to be signed. Unsigned files might prevent the system from booting or applications from working properly.

If IMA_APPRAISE_BUILD_POLICY

CONFIG_IMA_APPRAISE_REQUIRE_FIRMWARE_SIGS Appraise firmware signatures

On

This option defines a policy requiring all firmware to be signed, including the regulatory.db. If both this option and CFG80211_REQUIRE_SIGNED_REGDB are enabled, then both signature verification methods are necessary.

CONFIG_IMA_APPRAISE_REQUIRE_KEXEC_SIGS Appraise kexec kernel image signatures

On

Enabling this rule will require all kexec'ed kernel images to be signed and verified by a public key on the trusted IMA keyring.

Kernel image signatures can not be verified by the original kexec_load syscall. Enabling this rule will prevent its usage.

CONFIG_IMA_APPRAISE_REQUIRE_MODULE_SIGS Appraise kernel modules signatures

On

Enabling this rule will require all kernel modules to be signed and verified by a public key on the trusted IMA keyring.

Kernel module signatures can only be verified by IMA-appraisal, via the finit_module syscall. Enabling this rule will prevent the usage of the init_module syscall.

CONFIG_IMA_APPRAISE_BOOTPARAM ima_appraise boot parameter

On

This option enables the different "ima_appraise=" modes (eg. fix, log) from the boot command line.

CONFIG_IMA_APPRAISE_MODSIG Support module-style signatures for appraisal

On

Adds support for signatures appended to files. The format of the appended signature is the same used for signed kernel modules. The modsig keyword can be used in the IMA policy to allow a hook to accept such signatures.

CONFIG_IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY Permit keys validly signed by a built-in, machine (if configured) or secondary

On

Keys may be added to the IMA or IMA blacklist keyrings, if the key is validly signed by a CA cert in the system built-in, machine (if configured), or secondary trusted keyrings. The key must also have the digitalSignature usage set.

Intermediate keys between those the kernel has compiled in and the IMA keys to be added may be added to the system secondary keyring, provided they are validly signed by a key already resident in the built-in, machine (if configured) or secondary trusted keyrings.

CONFIG_IMA_LOAD_X509 Load X509 certificate onto the '.ima' trusted keyring

On

File signature verification is based on the public keys loaded on the .ima trusted keyring. These public keys are X509 certificates signed by a trusted key on the .system keyring. This option enables X509 certificate loading from the kernel onto the '.ima' trusted keyring.

If IMA_LOAD_X509

CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT

On

This option is selected by architectures to enable secure and/or trusted boot based on IMA runtime policies.

CONFIG_IMA_DISABLE_HTABLE Disable htable to allow measurement of duplicate records

On

This option disables htable to allow measurement of duplicate records.

CONFIG_IMA_KEXEC_EXTRA_MEMORY_KB Extra memory for IMA measurements added during kexec soft reboot

IMA_KEXEC_EXTRA_MEMORY_KB determines the extra memory to be allocated (in kb) for IMA measurements added during kexec soft reboot. If set to the default value of 0, an extra half page of memory for those additional measurements will be allocated.

CONFIG_IMA_STAGING Support for staging the measurements list

On

Add support for staging the measurements list.

It allows user space to stage the measurements list for deletion and to delete the staged measurements after confirmation.

Or, alternatively, it allows user space to specify N measurements records to stage internally, so that they can be immediately deleted.

On kexec, staging is aborted and any staged measurement records are copied to the secondary kernel.

CONFIG_IMA_INIT_LATE_SYNC Initialise IMA at late_initcall_sync

On

This option initialises IMA at late_initcall_sync for platforms where TPM device probing is deferred. When this option is enabled, modules that access files in the initramfs through usermode helper calls such as request_module() during initcall must not be built-in. Otherwise, IMA may miss file measurements for them.