1 # SPDX-License-Identifier: GPL-2.0-only 1 # SPDX-License-Identifier: GPL-2.0-only 2 # IBM Integrity Measurement Architecture 2 # IBM Integrity Measurement Architecture 3 # 3 # 4 config IMA 4 config IMA 5 bool "Integrity Measurement Architectu 5 bool "Integrity Measurement Architecture(IMA)" 6 select SECURITYFS 6 select SECURITYFS 7 select CRYPTO 7 select CRYPTO 8 select CRYPTO_HMAC 8 select CRYPTO_HMAC 9 select CRYPTO_SHA1 9 select CRYPTO_SHA1 10 select CRYPTO_HASH_INFO 10 select CRYPTO_HASH_INFO 11 select SECURITY_PATH !! 11 select TCG_TPM if HAS_IOMEM && !UML 12 select TCG_TPM if HAS_IOMEM << 13 select TCG_TIS if TCG_TPM && X86 12 select TCG_TIS if TCG_TPM && X86 14 select TCG_CRB if TCG_TPM && ACPI 13 select TCG_CRB if TCG_TPM && ACPI 15 select TCG_IBMVTPM if TCG_TPM && PPC_P 14 select TCG_IBMVTPM if TCG_TPM && PPC_PSERIES 16 select INTEGRITY_AUDIT if AUDIT 15 select INTEGRITY_AUDIT if AUDIT 17 help 16 help 18 The Trusted Computing Group(TCG) run 17 The Trusted Computing Group(TCG) runtime Integrity 19 Measurement Architecture(IMA) mainta 18 Measurement Architecture(IMA) maintains a list of hash 20 values of executables and other sens 19 values of executables and other sensitive system files, 21 as they are read or executed. If an 20 as they are read or executed. If an attacker manages 22 to change the contents of an importa 21 to change the contents of an important system file 23 being measured, we can tell. 22 being measured, we can tell. 24 23 25 If your system has a TPM chip, then 24 If your system has a TPM chip, then IMA also maintains 26 an aggregate integrity value over th 25 an aggregate integrity value over this list inside the 27 TPM hardware, so that the TPM can pr 26 TPM hardware, so that the TPM can prove to a third party 28 whether or not critical system files 27 whether or not critical system files have been modified. 29 Read <https://www.usenix.org/events/ 28 Read <https://www.usenix.org/events/sec04/tech/sailer.html> 30 to learn more about IMA. 29 to learn more about IMA. 31 If unsure, say N. 30 If unsure, say N. 32 31 33 if IMA << 34 << 35 config IMA_KEXEC 32 config IMA_KEXEC 36 bool "Enable carrying the IMA measurem 33 bool "Enable carrying the IMA measurement list across a soft boot" 37 depends on TCG_TPM && HAVE_IMA_KEXEC !! 34 depends on IMA && TCG_TPM && HAVE_IMA_KEXEC 38 default n 35 default n 39 help 36 help 40 TPM PCRs are only reset on a hard r 37 TPM PCRs are only reset on a hard reboot. In order to validate 41 a TPM's quote after a soft boot, th 38 a TPM's quote after a soft boot, the IMA measurement list of the 42 running kernel must be saved and re 39 running kernel must be saved and restored on boot. 43 40 44 Depending on the IMA policy, the me 41 Depending on the IMA policy, the measurement list can grow to 45 be very large. 42 be very large. 46 43 47 config IMA_MEASURE_PCR_IDX 44 config IMA_MEASURE_PCR_IDX 48 int 45 int >> 46 depends on IMA 49 range 8 14 47 range 8 14 50 default 10 48 default 10 51 help 49 help 52 IMA_MEASURE_PCR_IDX determines the T 50 IMA_MEASURE_PCR_IDX determines the TPM PCR register index 53 that IMA uses to maintain the integr 51 that IMA uses to maintain the integrity aggregate of the 54 measurement list. If unsure, use th 52 measurement list. If unsure, use the default 10. 55 53 56 config IMA_LSM_RULES 54 config IMA_LSM_RULES 57 bool 55 bool 58 depends on AUDIT && (SECURITY_SELINUX !! 56 depends on IMA && AUDIT && (SECURITY_SELINUX || SECURITY_SMACK || SECURITY_APPARMOR) 59 default y 57 default y 60 help 58 help 61 Disabling this option will disregard 59 Disabling this option will disregard LSM based policy rules. 62 60 63 choice 61 choice 64 prompt "Default template" 62 prompt "Default template" 65 default IMA_NG_TEMPLATE 63 default IMA_NG_TEMPLATE >> 64 depends on IMA 66 help 65 help 67 Select the default IMA measurement t 66 Select the default IMA measurement template. 68 67 69 The original 'ima' measurement list 68 The original 'ima' measurement list template contains a 70 hash, defined as 20 bytes, and a nul 69 hash, defined as 20 bytes, and a null terminated pathname, 71 limited to 255 characters. The 'ima 70 limited to 255 characters. The 'ima-ng' measurement list 72 template permits both larger hash di 71 template permits both larger hash digests and longer 73 pathnames. The configured default te !! 72 pathnames. 74 by specifying "ima_template=" on the << 75 73 >> 74 config IMA_TEMPLATE >> 75 bool "ima" 76 config IMA_NG_TEMPLATE 76 config IMA_NG_TEMPLATE 77 bool "ima-ng (default)" 77 bool "ima-ng (default)" 78 config IMA_SIG_TEMPLATE 78 config IMA_SIG_TEMPLATE 79 bool "ima-sig" 79 bool "ima-sig" 80 endchoice 80 endchoice 81 81 82 config IMA_DEFAULT_TEMPLATE 82 config IMA_DEFAULT_TEMPLATE 83 string 83 string >> 84 depends on IMA >> 85 default "ima" if IMA_TEMPLATE 84 default "ima-ng" if IMA_NG_TEMPLATE 86 default "ima-ng" if IMA_NG_TEMPLATE 85 default "ima-sig" if IMA_SIG_TEMPLATE 87 default "ima-sig" if IMA_SIG_TEMPLATE 86 88 87 choice 89 choice 88 prompt "Default integrity hash algorit 90 prompt "Default integrity hash algorithm" 89 default IMA_DEFAULT_HASH_SHA1 91 default IMA_DEFAULT_HASH_SHA1 >> 92 depends on IMA 90 help 93 help 91 Select the default hash algorithm u 94 Select the default hash algorithm used for the measurement 92 list, integrity appraisal and audit 95 list, integrity appraisal and audit log. The compiled default 93 hash algorithm can be overwritten u 96 hash algorithm can be overwritten using the kernel command 94 line 'ima_hash=' option. 97 line 'ima_hash=' option. 95 98 96 config IMA_DEFAULT_HASH_SHA1 99 config IMA_DEFAULT_HASH_SHA1 97 bool "SHA1 (default)" 100 bool "SHA1 (default)" 98 depends on CRYPTO_SHA1=y 101 depends on CRYPTO_SHA1=y 99 102 100 config IMA_DEFAULT_HASH_SHA256 103 config IMA_DEFAULT_HASH_SHA256 101 bool "SHA256" 104 bool "SHA256" 102 depends on CRYPTO_SHA256=y !! 105 depends on CRYPTO_SHA256=y && !IMA_TEMPLATE 103 106 104 config IMA_DEFAULT_HASH_SHA512 107 config IMA_DEFAULT_HASH_SHA512 105 bool "SHA512" 108 bool "SHA512" 106 depends on CRYPTO_SHA512=y !! 109 depends on CRYPTO_SHA512=y && !IMA_TEMPLATE 107 110 108 config IMA_DEFAULT_HASH_WP512 111 config IMA_DEFAULT_HASH_WP512 109 bool "WP512" 112 bool "WP512" 110 depends on CRYPTO_WP512=y !! 113 depends on CRYPTO_WP512=y && !IMA_TEMPLATE 111 114 112 config IMA_DEFAULT_HASH_SM3 115 config IMA_DEFAULT_HASH_SM3 113 bool "SM3" 116 bool "SM3" 114 depends on CRYPTO_SM3_GENERIC= !! 117 depends on CRYPTO_SM3=y && !IMA_TEMPLATE 115 endchoice 118 endchoice 116 119 117 config IMA_DEFAULT_HASH 120 config IMA_DEFAULT_HASH 118 string 121 string >> 122 depends on IMA 119 default "sha1" if IMA_DEFAULT_HASH_SHA 123 default "sha1" if IMA_DEFAULT_HASH_SHA1 120 default "sha256" if IMA_DEFAULT_HASH_S 124 default "sha256" if IMA_DEFAULT_HASH_SHA256 121 default "sha512" if IMA_DEFAULT_HASH_S 125 default "sha512" if IMA_DEFAULT_HASH_SHA512 122 default "wp512" if IMA_DEFAULT_HASH_WP 126 default "wp512" if IMA_DEFAULT_HASH_WP512 123 default "sm3" if IMA_DEFAULT_HASH_SM3 127 default "sm3" if IMA_DEFAULT_HASH_SM3 124 128 125 config IMA_WRITE_POLICY 129 config IMA_WRITE_POLICY 126 bool "Enable multiple writes to the IM 130 bool "Enable multiple writes to the IMA policy" >> 131 depends on IMA 127 default n 132 default n 128 help 133 help 129 IMA policy can now be updated multip 134 IMA policy can now be updated multiple times. The new rules get 130 appended to the original policy. Ha 135 appended to the original policy. Have in mind that the rules are 131 scanned in FIFO order so be careful 136 scanned in FIFO order so be careful when you design and add new ones. 132 137 133 If unsure, say N. 138 If unsure, say N. 134 139 135 config IMA_READ_POLICY 140 config IMA_READ_POLICY 136 bool "Enable reading back the current 141 bool "Enable reading back the current IMA policy" >> 142 depends on IMA 137 default y if IMA_WRITE_POLICY 143 default y if IMA_WRITE_POLICY 138 default n if !IMA_WRITE_POLICY 144 default n if !IMA_WRITE_POLICY 139 help 145 help 140 It is often useful to be able to re 146 It is often useful to be able to read back the IMA policy. It is 141 even more important after introduci 147 even more important after introducing CONFIG_IMA_WRITE_POLICY. 142 This option allows the root user to 148 This option allows the root user to see the current policy rules. 143 149 144 config IMA_APPRAISE 150 config IMA_APPRAISE 145 bool "Appraise integrity measurements" 151 bool "Appraise integrity measurements" >> 152 depends on IMA 146 default n 153 default n 147 help 154 help 148 This option enables local measuremen 155 This option enables local measurement integrity appraisal. 149 It requires the system to be labeled 156 It requires the system to be labeled with a security extended 150 attribute containing the file hash m 157 attribute containing the file hash measurement. To protect 151 the security extended attributes fro 158 the security extended attributes from offline attack, enable 152 and configure EVM. 159 and configure EVM. 153 160 154 For more information on integrity ap 161 For more information on integrity appraisal refer to: 155 <http://linux-ima.sourceforge.net> 162 <http://linux-ima.sourceforge.net> 156 If unsure, say N. 163 If unsure, say N. 157 164 158 config IMA_ARCH_POLICY 165 config IMA_ARCH_POLICY 159 bool "Enable loading an IMA architectu 166 bool "Enable loading an IMA architecture specific policy" 160 depends on (KEXEC_SIG && IMA) || IMA_A 167 depends on (KEXEC_SIG && IMA) || IMA_APPRAISE \ 161 && INTEGRITY_ASYMMETRIC_KEY 168 && INTEGRITY_ASYMMETRIC_KEYS 162 default n 169 default n 163 help 170 help 164 This option enables loading an IMA a 171 This option enables loading an IMA architecture specific policy 165 based on run time secure boot flags. 172 based on run time secure boot flags. 166 173 167 config IMA_APPRAISE_BUILD_POLICY 174 config IMA_APPRAISE_BUILD_POLICY 168 bool "IMA build time configured policy 175 bool "IMA build time configured policy rules" 169 depends on IMA_APPRAISE && INTEGRITY_A 176 depends on IMA_APPRAISE && INTEGRITY_ASYMMETRIC_KEYS 170 default n 177 default n 171 help 178 help 172 This option defines an IMA appraisal 179 This option defines an IMA appraisal policy at build time, which 173 is enforced at run time without havi 180 is enforced at run time without having to specify a builtin 174 policy name on the boot command line 181 policy name on the boot command line. The build time appraisal 175 policy rules persist after loading a 182 policy rules persist after loading a custom policy. 176 183 177 Depending on the rules configured, t 184 Depending on the rules configured, this policy may require kernel 178 modules, firmware, the kexec kernel 185 modules, firmware, the kexec kernel image, and/or the IMA policy 179 to be signed. Unsigned files might 186 to be signed. Unsigned files might prevent the system from 180 booting or applications from working 187 booting or applications from working properly. 181 188 182 config IMA_APPRAISE_REQUIRE_FIRMWARE_SIGS 189 config IMA_APPRAISE_REQUIRE_FIRMWARE_SIGS 183 bool "Appraise firmware signatures" 190 bool "Appraise firmware signatures" 184 depends on IMA_APPRAISE_BUILD_POLICY 191 depends on IMA_APPRAISE_BUILD_POLICY 185 default n 192 default n 186 help 193 help 187 This option defines a policy requiri 194 This option defines a policy requiring all firmware to be signed, 188 including the regulatory.db. If bot 195 including the regulatory.db. If both this option and 189 CFG80211_REQUIRE_SIGNED_REGDB are en 196 CFG80211_REQUIRE_SIGNED_REGDB are enabled, then both signature 190 verification methods are necessary. 197 verification methods are necessary. 191 198 192 config IMA_APPRAISE_REQUIRE_KEXEC_SIGS 199 config IMA_APPRAISE_REQUIRE_KEXEC_SIGS 193 bool "Appraise kexec kernel image sign 200 bool "Appraise kexec kernel image signatures" 194 depends on IMA_APPRAISE_BUILD_POLICY 201 depends on IMA_APPRAISE_BUILD_POLICY 195 default n 202 default n 196 help 203 help 197 Enabling this rule will require all 204 Enabling this rule will require all kexec'ed kernel images to 198 be signed and verified by a public k 205 be signed and verified by a public key on the trusted IMA 199 keyring. 206 keyring. 200 207 201 Kernel image signatures can not be v 208 Kernel image signatures can not be verified by the original 202 kexec_load syscall. Enabling this r 209 kexec_load syscall. Enabling this rule will prevent its 203 usage. 210 usage. 204 211 205 config IMA_APPRAISE_REQUIRE_MODULE_SIGS 212 config IMA_APPRAISE_REQUIRE_MODULE_SIGS 206 bool "Appraise kernel modules signatur 213 bool "Appraise kernel modules signatures" 207 depends on IMA_APPRAISE_BUILD_POLICY 214 depends on IMA_APPRAISE_BUILD_POLICY 208 default n 215 default n 209 help 216 help 210 Enabling this rule will require all 217 Enabling this rule will require all kernel modules to be signed 211 and verified by a public key on the 218 and verified by a public key on the trusted IMA keyring. 212 219 213 Kernel module signatures can only be 220 Kernel module signatures can only be verified by IMA-appraisal, 214 via the finit_module syscall. Enabli 221 via the finit_module syscall. Enabling this rule will prevent 215 the usage of the init_module syscall 222 the usage of the init_module syscall. 216 223 217 config IMA_APPRAISE_REQUIRE_POLICY_SIGS 224 config IMA_APPRAISE_REQUIRE_POLICY_SIGS 218 bool "Appraise IMA policy signature" 225 bool "Appraise IMA policy signature" 219 depends on IMA_APPRAISE_BUILD_POLICY 226 depends on IMA_APPRAISE_BUILD_POLICY 220 default n 227 default n 221 help 228 help 222 Enabling this rule will require the 229 Enabling this rule will require the IMA policy to be signed and 223 and verified by a key on the trusted 230 and verified by a key on the trusted IMA keyring. 224 231 225 config IMA_APPRAISE_BOOTPARAM 232 config IMA_APPRAISE_BOOTPARAM 226 bool "ima_appraise boot parameter" 233 bool "ima_appraise boot parameter" 227 depends on IMA_APPRAISE 234 depends on IMA_APPRAISE 228 default y 235 default y 229 help 236 help 230 This option enables the different "i 237 This option enables the different "ima_appraise=" modes 231 (eg. fix, log) from the boot command 238 (eg. fix, log) from the boot command line. 232 239 233 config IMA_APPRAISE_MODSIG 240 config IMA_APPRAISE_MODSIG 234 bool "Support module-style signatures 241 bool "Support module-style signatures for appraisal" 235 depends on IMA_APPRAISE 242 depends on IMA_APPRAISE 236 depends on INTEGRITY_ASYMMETRIC_KEYS 243 depends on INTEGRITY_ASYMMETRIC_KEYS 237 select PKCS7_MESSAGE_PARSER 244 select PKCS7_MESSAGE_PARSER 238 select MODULE_SIG_FORMAT 245 select MODULE_SIG_FORMAT 239 default n 246 default n 240 help 247 help 241 Adds support for signatures appende 248 Adds support for signatures appended to files. The format of the 242 appended signature is the same used 249 appended signature is the same used for signed kernel modules. 243 The modsig keyword can be used in t 250 The modsig keyword can be used in the IMA policy to allow a hook 244 to accept such signatures. 251 to accept such signatures. 245 252 >> 253 config IMA_TRUSTED_KEYRING >> 254 bool "Require all keys on the .ima keyring be signed (deprecated)" >> 255 depends on IMA_APPRAISE && SYSTEM_TRUSTED_KEYRING >> 256 depends on INTEGRITY_ASYMMETRIC_KEYS >> 257 select INTEGRITY_TRUSTED_KEYRING >> 258 default y >> 259 help >> 260 This option requires that all keys added to the .ima >> 261 keyring be signed by a key on the system trusted keyring. >> 262 >> 263 This option is deprecated in favor of INTEGRITY_TRUSTED_KEYRING >> 264 246 config IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_O 265 config IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY 247 bool "Permit keys validly signed by a !! 266 bool "Permit keys validly signed by a built-in or secondary CA cert (EXPERIMENTAL)" 248 depends on SYSTEM_TRUSTED_KEYRING 267 depends on SYSTEM_TRUSTED_KEYRING 249 depends on SECONDARY_TRUSTED_KEYRING 268 depends on SECONDARY_TRUSTED_KEYRING 250 depends on INTEGRITY_ASYMMETRIC_KEYS 269 depends on INTEGRITY_ASYMMETRIC_KEYS 251 select INTEGRITY_TRUSTED_KEYRING 270 select INTEGRITY_TRUSTED_KEYRING 252 default n 271 default n 253 help 272 help 254 Keys may be added to the IMA or IMA 273 Keys may be added to the IMA or IMA blacklist keyrings, if the 255 key is validly signed by a CA cert i !! 274 key is validly signed by a CA cert in the system built-in or 256 machine (if configured), or secondar !! 275 secondary trusted keyrings. 257 key must also have the digitalSignat << 258 276 259 Intermediate keys between those the 277 Intermediate keys between those the kernel has compiled in and the 260 IMA keys to be added may be added to 278 IMA keys to be added may be added to the system secondary keyring, 261 provided they are validly signed by 279 provided they are validly signed by a key already resident in the 262 built-in, machine (if configured) or !! 280 built-in or secondary trusted keyrings. 263 281 264 config IMA_BLACKLIST_KEYRING 282 config IMA_BLACKLIST_KEYRING 265 bool "Create IMA machine owner blackli 283 bool "Create IMA machine owner blacklist keyrings (EXPERIMENTAL)" 266 depends on SYSTEM_TRUSTED_KEYRING 284 depends on SYSTEM_TRUSTED_KEYRING 267 depends on INTEGRITY_TRUSTED_KEYRING !! 285 depends on IMA_TRUSTED_KEYRING 268 default n 286 default n 269 help 287 help 270 This option creates an IMA blacklis 288 This option creates an IMA blacklist keyring, which contains all 271 revoked IMA keys. It is consulted 289 revoked IMA keys. It is consulted before any other keyring. If 272 the search is successful the reques 290 the search is successful the requested operation is rejected and 273 an error is returned to the caller. 291 an error is returned to the caller. 274 292 275 config IMA_LOAD_X509 293 config IMA_LOAD_X509 276 bool "Load X509 certificate onto the ' 294 bool "Load X509 certificate onto the '.ima' trusted keyring" 277 depends on INTEGRITY_TRUSTED_KEYRING !! 295 depends on IMA_TRUSTED_KEYRING 278 default n 296 default n 279 help 297 help 280 File signature verification is base 298 File signature verification is based on the public keys 281 loaded on the .ima trusted keyring. 299 loaded on the .ima trusted keyring. These public keys are 282 X509 certificates signed by a trust 300 X509 certificates signed by a trusted key on the 283 .system keyring. This option enabl 301 .system keyring. This option enables X509 certificate 284 loading from the kernel onto the '. 302 loading from the kernel onto the '.ima' trusted keyring. 285 303 286 config IMA_X509_PATH 304 config IMA_X509_PATH 287 string "IMA X509 certificate path" 305 string "IMA X509 certificate path" 288 depends on IMA_LOAD_X509 306 depends on IMA_LOAD_X509 289 default "/etc/keys/x509_ima.der" 307 default "/etc/keys/x509_ima.der" 290 help 308 help 291 This option defines IMA X509 certif 309 This option defines IMA X509 certificate path. 292 310 293 config IMA_APPRAISE_SIGNED_INIT 311 config IMA_APPRAISE_SIGNED_INIT 294 bool "Require signed user-space initia 312 bool "Require signed user-space initialization" 295 depends on IMA_LOAD_X509 313 depends on IMA_LOAD_X509 296 default n 314 default n 297 help 315 help 298 This option requires user-space ini 316 This option requires user-space init to be signed. 299 317 300 config IMA_MEASURE_ASYMMETRIC_KEYS 318 config IMA_MEASURE_ASYMMETRIC_KEYS 301 bool 319 bool >> 320 depends on IMA 302 depends on ASYMMETRIC_PUBLIC_KEY_SUBTY 321 depends on ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y 303 default y 322 default y 304 323 305 config IMA_QUEUE_EARLY_BOOT_KEYS 324 config IMA_QUEUE_EARLY_BOOT_KEYS 306 bool 325 bool 307 depends on IMA_MEASURE_ASYMMETRIC_KEYS 326 depends on IMA_MEASURE_ASYMMETRIC_KEYS 308 depends on SYSTEM_TRUSTED_KEYRING 327 depends on SYSTEM_TRUSTED_KEYRING 309 default y 328 default y 310 329 311 config IMA_SECURE_AND_OR_TRUSTED_BOOT 330 config IMA_SECURE_AND_OR_TRUSTED_BOOT 312 bool 331 bool 313 depends on IMA_ARCH_POLICY 332 depends on IMA_ARCH_POLICY 314 help 333 help 315 This option is selected by architect 334 This option is selected by architectures to enable secure and/or 316 trusted boot based on IMA runtime po 335 trusted boot based on IMA runtime policies. 317 336 318 config IMA_DISABLE_HTABLE 337 config IMA_DISABLE_HTABLE 319 bool "Disable htable to allow measurem 338 bool "Disable htable to allow measurement of duplicate records" >> 339 depends on IMA 320 default n 340 default n 321 help 341 help 322 This option disables htable to allo 342 This option disables htable to allow measurement of duplicate records. 323 << 324 endif <<
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.