1 # SPDX-License-Identifier: GPL-2.0-only
2 # IBM Integrity Measurement Architecture
5 bool "Integrity Measurement Architecture(IMA)"
10 select CRYPTO_HASH_INFO
11 select TCG_TPM if HAS_IOMEM
12 select TCG_TIS if TCG_TPM && X86
13 select TCG_CRB if TCG_TPM && ACPI
14 select TCG_IBMVTPM if TCG_TPM && PPC_PSERIES
15 select INTEGRITY_AUDIT if AUDIT
17 The Trusted Computing Group(TCG) runtime Integrity
18 Measurement Architecture(IMA) maintains a list of hash
19 values of executables and other sensitive system files,
20 as they are read or executed. If an attacker manages
21 to change the contents of an important system file
22 being measured, we can tell.
24 If your system has a TPM chip, then IMA also maintains
25 an aggregate integrity value over this list inside the
26 TPM hardware, so that the TPM can prove to a third party
27 whether or not critical system files have been modified.
28 Read <https://www.usenix.org/events/sec04/tech/sailer.html>
29 to learn more about IMA.
35 bool "Enable carrying the IMA measurement list across a soft boot"
36 depends on TCG_TPM && HAVE_IMA_KEXEC
39 TPM PCRs are only reset on a hard reboot. In order to validate
40 a TPM's quote after a soft boot, the IMA measurement list of the
41 running kernel must be saved and restored on boot.
43 Depending on the IMA policy, the measurement list can grow to
46 config IMA_MEASURE_PCR_IDX
51 IMA_MEASURE_PCR_IDX determines the TPM PCR register index
52 that IMA uses to maintain the integrity aggregate of the
53 measurement list. If unsure, use the default 10.
57 depends on AUDIT && (SECURITY_SELINUX || SECURITY_SMACK || SECURITY_APPARMOR)
60 Disabling this option will disregard LSM based policy rules.
63 prompt "Default template"
64 default IMA_NG_TEMPLATE
66 Select the default IMA measurement template.
68 The original 'ima' measurement list template contains a
69 hash, defined as 20 bytes, and a null terminated pathname,
70 limited to 255 characters. The 'ima-ng' measurement list
71 template permits both larger hash digests and longer
72 pathnames. The configured default template can be replaced
73 by specifying "ima_template=" on the boot command line.
75 config IMA_NG_TEMPLATE
76 bool "ima-ng (default)"
77 config IMA_SIG_TEMPLATE
81 config IMA_DEFAULT_TEMPLATE
83 default "ima-ng" if IMA_NG_TEMPLATE
84 default "ima-sig" if IMA_SIG_TEMPLATE
87 prompt "Default integrity hash algorithm"
88 default IMA_DEFAULT_HASH_SHA1
90 Select the default hash algorithm used for the measurement
91 list, integrity appraisal and audit log. The compiled default
92 hash algorithm can be overwritten using the kernel command
93 line 'ima_hash=' option.
95 config IMA_DEFAULT_HASH_SHA1
97 depends on CRYPTO_SHA1=y
99 config IMA_DEFAULT_HASH_SHA256
101 depends on CRYPTO_SHA256=y
103 config IMA_DEFAULT_HASH_SHA512
105 depends on CRYPTO_SHA512=y
107 config IMA_DEFAULT_HASH_WP512
109 depends on CRYPTO_WP512=y
111 config IMA_DEFAULT_HASH_SM3
113 depends on CRYPTO_SM3_GENERIC=y
116 config IMA_DEFAULT_HASH
118 default "sha1" if IMA_DEFAULT_HASH_SHA1
119 default "sha256" if IMA_DEFAULT_HASH_SHA256
120 default "sha512" if IMA_DEFAULT_HASH_SHA512
121 default "wp512" if IMA_DEFAULT_HASH_WP512
122 default "sm3" if IMA_DEFAULT_HASH_SM3
124 config IMA_WRITE_POLICY
125 bool "Enable multiple writes to the IMA policy"
128 IMA policy can now be updated multiple times. The new rules get
129 appended to the original policy. Have in mind that the rules are
130 scanned in FIFO order so be careful when you design and add new ones.
134 config IMA_READ_POLICY
135 bool "Enable reading back the current IMA policy"
136 default y if IMA_WRITE_POLICY
137 default n if !IMA_WRITE_POLICY
139 It is often useful to be able to read back the IMA policy. It is
140 even more important after introducing CONFIG_IMA_WRITE_POLICY.
141 This option allows the root user to see the current policy rules.
144 bool "Appraise integrity measurements"
147 This option enables local measurement integrity appraisal.
148 It requires the system to be labeled with a security extended
149 attribute containing the file hash measurement. To protect
150 the security extended attributes from offline attack, enable
153 For more information on integrity appraisal refer to:
154 <http://linux-ima.sourceforge.net>
157 config IMA_ARCH_POLICY
158 bool "Enable loading an IMA architecture specific policy"
159 depends on (KEXEC_SIG && IMA) || IMA_APPRAISE \
160 && INTEGRITY_ASYMMETRIC_KEYS
163 This option enables loading an IMA architecture specific policy
164 based on run time secure boot flags.
166 config IMA_APPRAISE_BUILD_POLICY
167 bool "IMA build time configured policy rules"
168 depends on IMA_APPRAISE && INTEGRITY_ASYMMETRIC_KEYS
171 This option defines an IMA appraisal policy at build time, which
172 is enforced at run time without having to specify a builtin
173 policy name on the boot command line. The build time appraisal
174 policy rules persist after loading a custom policy.
176 Depending on the rules configured, this policy may require kernel
177 modules, firmware, the kexec kernel image, and/or the IMA policy
178 to be signed. Unsigned files might prevent the system from
179 booting or applications from working properly.
181 config IMA_APPRAISE_REQUIRE_FIRMWARE_SIGS
182 bool "Appraise firmware signatures"
183 depends on IMA_APPRAISE_BUILD_POLICY
186 This option defines a policy requiring all firmware to be signed,
187 including the regulatory.db. If both this option and
188 CFG80211_REQUIRE_SIGNED_REGDB are enabled, then both signature
189 verification methods are necessary.
191 config IMA_APPRAISE_REQUIRE_KEXEC_SIGS
192 bool "Appraise kexec kernel image signatures"
193 depends on IMA_APPRAISE_BUILD_POLICY
196 Enabling this rule will require all kexec'ed kernel images to
197 be signed and verified by a public key on the trusted IMA
200 Kernel image signatures can not be verified by the original
201 kexec_load syscall. Enabling this rule will prevent its
204 config IMA_APPRAISE_REQUIRE_MODULE_SIGS
205 bool "Appraise kernel modules signatures"
206 depends on IMA_APPRAISE_BUILD_POLICY
209 Enabling this rule will require all kernel modules to be signed
210 and verified by a public key on the trusted IMA keyring.
212 Kernel module signatures can only be verified by IMA-appraisal,
213 via the finit_module syscall. Enabling this rule will prevent
214 the usage of the init_module syscall.
216 config IMA_APPRAISE_REQUIRE_POLICY_SIGS
217 bool "Appraise IMA policy signature"
218 depends on IMA_APPRAISE_BUILD_POLICY
221 Enabling this rule will require the IMA policy to be signed and
222 and verified by a key on the trusted IMA keyring.
224 config IMA_APPRAISE_BOOTPARAM
225 bool "ima_appraise boot parameter"
226 depends on IMA_APPRAISE
229 This option enables the different "ima_appraise=" modes
230 (eg. fix, log) from the boot command line.
232 config IMA_APPRAISE_MODSIG
233 bool "Support module-style signatures for appraisal"
234 depends on IMA_APPRAISE
235 depends on INTEGRITY_ASYMMETRIC_KEYS
236 select PKCS7_MESSAGE_PARSER
237 select MODULE_SIG_FORMAT
240 Adds support for signatures appended to files. The format of the
241 appended signature is the same used for signed kernel modules.
242 The modsig keyword can be used in the IMA policy to allow a hook
243 to accept such signatures.
245 config IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY
246 bool "Permit keys validly signed by a built-in or secondary CA cert (EXPERIMENTAL)"
247 depends on SYSTEM_TRUSTED_KEYRING
248 depends on SECONDARY_TRUSTED_KEYRING
249 depends on INTEGRITY_ASYMMETRIC_KEYS
250 select INTEGRITY_TRUSTED_KEYRING
253 Keys may be added to the IMA or IMA blacklist keyrings, if the
254 key is validly signed by a CA cert in the system built-in or
255 secondary trusted keyrings. The key must also have the
256 digitalSignature usage set.
258 Intermediate keys between those the kernel has compiled in and the
259 IMA keys to be added may be added to the system secondary keyring,
260 provided they are validly signed by a key already resident in the
261 built-in or secondary trusted keyrings.
263 config IMA_BLACKLIST_KEYRING
264 bool "Create IMA machine owner blacklist keyrings (EXPERIMENTAL)"
265 depends on SYSTEM_TRUSTED_KEYRING
266 depends on INTEGRITY_TRUSTED_KEYRING
269 This option creates an IMA blacklist keyring, which contains all
270 revoked IMA keys. It is consulted before any other keyring. If
271 the search is successful the requested operation is rejected and
272 an error is returned to the caller.
275 bool "Load X509 certificate onto the '.ima' trusted keyring"
276 depends on INTEGRITY_TRUSTED_KEYRING
279 File signature verification is based on the public keys
280 loaded on the .ima trusted keyring. These public keys are
281 X509 certificates signed by a trusted key on the
282 .system keyring. This option enables X509 certificate
283 loading from the kernel onto the '.ima' trusted keyring.
286 string "IMA X509 certificate path"
287 depends on IMA_LOAD_X509
288 default "/etc/keys/x509_ima.der"
290 This option defines IMA X509 certificate path.
292 config IMA_APPRAISE_SIGNED_INIT
293 bool "Require signed user-space initialization"
294 depends on IMA_LOAD_X509
297 This option requires user-space init to be signed.
299 config IMA_MEASURE_ASYMMETRIC_KEYS
301 depends on ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
304 config IMA_QUEUE_EARLY_BOOT_KEYS
306 depends on IMA_MEASURE_ASYMMETRIC_KEYS
307 depends on SYSTEM_TRUSTED_KEYRING
310 config IMA_SECURE_AND_OR_TRUSTED_BOOT
312 depends on IMA_ARCH_POLICY
314 This option is selected by architectures to enable secure and/or
315 trusted boot based on IMA runtime policies.
317 config IMA_DISABLE_HTABLE
318 bool "Disable htable to allow measurement of duplicate records"
321 This option disables htable to allow measurement of duplicate records.