Kconfig 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. # IBM Integrity Measurement Architecture
  2. #
  3. config IMA
  4. bool "Integrity Measurement Architecture(IMA)"
  5. select SECURITYFS
  6. select CRYPTO
  7. select CRYPTO_HMAC
  8. select CRYPTO_MD5
  9. select CRYPTO_SHA1
  10. select CRYPTO_HASH_INFO
  11. select TCG_TPM if HAS_IOMEM && !UML
  12. select TCG_TIS if TCG_TPM && X86
  13. select TCG_IBMVTPM if TCG_TPM && PPC_PSERIES
  14. help
  15. The Trusted Computing Group(TCG) runtime Integrity
  16. Measurement Architecture(IMA) maintains a list of hash
  17. values of executables and other sensitive system files,
  18. as they are read or executed. If an attacker manages
  19. to change the contents of an important system file
  20. being measured, we can tell.
  21. If your system has a TPM chip, then IMA also maintains
  22. an aggregate integrity value over this list inside the
  23. TPM hardware, so that the TPM can prove to a third party
  24. whether or not critical system files have been modified.
  25. Read <http://www.usenix.org/events/sec04/tech/sailer.html>
  26. to learn more about IMA.
  27. If unsure, say N.
  28. config IMA_KEXEC
  29. bool "Enable carrying the IMA measurement list across a soft boot"
  30. depends on IMA && TCG_TPM && HAVE_IMA_KEXEC
  31. default n
  32. help
  33. TPM PCRs are only reset on a hard reboot. In order to validate
  34. a TPM's quote after a soft boot, the IMA measurement list of the
  35. running kernel must be saved and restored on boot.
  36. Depending on the IMA policy, the measurement list can grow to
  37. be very large.
  38. config IMA_MEASURE_PCR_IDX
  39. int
  40. depends on IMA
  41. range 8 14
  42. default 10
  43. help
  44. IMA_MEASURE_PCR_IDX determines the TPM PCR register index
  45. that IMA uses to maintain the integrity aggregate of the
  46. measurement list. If unsure, use the default 10.
  47. config IMA_LSM_RULES
  48. bool
  49. depends on IMA && AUDIT && (SECURITY_SELINUX || SECURITY_SMACK)
  50. default y
  51. help
  52. Disabling this option will disregard LSM based policy rules.
  53. choice
  54. prompt "Default template"
  55. default IMA_NG_TEMPLATE
  56. depends on IMA
  57. help
  58. Select the default IMA measurement template.
  59. The original 'ima' measurement list template contains a
  60. hash, defined as 20 bytes, and a null terminated pathname,
  61. limited to 255 characters. The 'ima-ng' measurement list
  62. template permits both larger hash digests and longer
  63. pathnames.
  64. config IMA_TEMPLATE
  65. bool "ima"
  66. config IMA_NG_TEMPLATE
  67. bool "ima-ng (default)"
  68. config IMA_SIG_TEMPLATE
  69. bool "ima-sig"
  70. endchoice
  71. config IMA_DEFAULT_TEMPLATE
  72. string
  73. depends on IMA
  74. default "ima" if IMA_TEMPLATE
  75. default "ima-ng" if IMA_NG_TEMPLATE
  76. default "ima-sig" if IMA_SIG_TEMPLATE
  77. choice
  78. prompt "Default integrity hash algorithm"
  79. default IMA_DEFAULT_HASH_SHA1
  80. depends on IMA
  81. help
  82. Select the default hash algorithm used for the measurement
  83. list, integrity appraisal and audit log. The compiled default
  84. hash algorithm can be overwritten using the kernel command
  85. line 'ima_hash=' option.
  86. config IMA_DEFAULT_HASH_SHA1
  87. bool "SHA1 (default)"
  88. depends on CRYPTO_SHA1
  89. config IMA_DEFAULT_HASH_SHA256
  90. bool "SHA256"
  91. depends on CRYPTO_SHA256 && !IMA_TEMPLATE
  92. config IMA_DEFAULT_HASH_SHA512
  93. bool "SHA512"
  94. depends on CRYPTO_SHA512 && !IMA_TEMPLATE
  95. config IMA_DEFAULT_HASH_WP512
  96. bool "WP512"
  97. depends on CRYPTO_WP512 && !IMA_TEMPLATE
  98. endchoice
  99. config IMA_DEFAULT_HASH
  100. string
  101. depends on IMA
  102. default "sha1" if IMA_DEFAULT_HASH_SHA1
  103. default "sha256" if IMA_DEFAULT_HASH_SHA256
  104. default "sha512" if IMA_DEFAULT_HASH_SHA512
  105. default "wp512" if IMA_DEFAULT_HASH_WP512
  106. config IMA_WRITE_POLICY
  107. bool "Enable multiple writes to the IMA policy"
  108. depends on IMA
  109. default n
  110. help
  111. IMA policy can now be updated multiple times. The new rules get
  112. appended to the original policy. Have in mind that the rules are
  113. scanned in FIFO order so be careful when you design and add new ones.
  114. If unsure, say N.
  115. config IMA_READ_POLICY
  116. bool "Enable reading back the current IMA policy"
  117. depends on IMA
  118. default y if IMA_WRITE_POLICY
  119. default n if !IMA_WRITE_POLICY
  120. help
  121. It is often useful to be able to read back the IMA policy. It is
  122. even more important after introducing CONFIG_IMA_WRITE_POLICY.
  123. This option allows the root user to see the current policy rules.
  124. config IMA_APPRAISE
  125. bool "Appraise integrity measurements"
  126. depends on IMA
  127. default n
  128. help
  129. This option enables local measurement integrity appraisal.
  130. It requires the system to be labeled with a security extended
  131. attribute containing the file hash measurement. To protect
  132. the security extended attributes from offline attack, enable
  133. and configure EVM.
  134. For more information on integrity appraisal refer to:
  135. <http://linux-ima.sourceforge.net>
  136. If unsure, say N.
  137. config IMA_TRUSTED_KEYRING
  138. bool "Require all keys on the .ima keyring be signed (deprecated)"
  139. depends on IMA_APPRAISE && SYSTEM_TRUSTED_KEYRING
  140. depends on INTEGRITY_ASYMMETRIC_KEYS
  141. select INTEGRITY_TRUSTED_KEYRING
  142. default y
  143. help
  144. This option requires that all keys added to the .ima
  145. keyring be signed by a key on the system trusted keyring.
  146. This option is deprecated in favor of INTEGRITY_TRUSTED_KEYRING
  147. config IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY
  148. bool "Permit keys validly signed by a built-in or secondary CA cert (EXPERIMENTAL)"
  149. depends on SYSTEM_TRUSTED_KEYRING
  150. depends on SECONDARY_TRUSTED_KEYRING
  151. depends on INTEGRITY_ASYMMETRIC_KEYS
  152. select INTEGRITY_TRUSTED_KEYRING
  153. default n
  154. help
  155. Keys may be added to the IMA or IMA blacklist keyrings, if the
  156. key is validly signed by a CA cert in the system built-in or
  157. secondary trusted keyrings.
  158. Intermediate keys between those the kernel has compiled in and the
  159. IMA keys to be added may be added to the system secondary keyring,
  160. provided they are validly signed by a key already resident in the
  161. built-in or secondary trusted keyrings.
  162. config IMA_BLACKLIST_KEYRING
  163. bool "Create IMA machine owner blacklist keyrings (EXPERIMENTAL)"
  164. depends on SYSTEM_TRUSTED_KEYRING
  165. depends on IMA_TRUSTED_KEYRING
  166. default n
  167. help
  168. This option creates an IMA blacklist keyring, which contains all
  169. revoked IMA keys. It is consulted before any other keyring. If
  170. the search is successful the requested operation is rejected and
  171. an error is returned to the caller.
  172. config IMA_LOAD_X509
  173. bool "Load X509 certificate onto the '.ima' trusted keyring"
  174. depends on IMA_TRUSTED_KEYRING
  175. default n
  176. help
  177. File signature verification is based on the public keys
  178. loaded on the .ima trusted keyring. These public keys are
  179. X509 certificates signed by a trusted key on the
  180. .system keyring. This option enables X509 certificate
  181. loading from the kernel onto the '.ima' trusted keyring.
  182. config IMA_X509_PATH
  183. string "IMA X509 certificate path"
  184. depends on IMA_LOAD_X509
  185. default "/etc/keys/x509_ima.der"
  186. help
  187. This option defines IMA X509 certificate path.
  188. config IMA_APPRAISE_SIGNED_INIT
  189. bool "Require signed user-space initialization"
  190. depends on IMA_LOAD_X509
  191. default n
  192. help
  193. This option requires user-space init to be signed.