Kconfig 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  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_CRB if TCG_TPM && ACPI
  14. select TCG_IBMVTPM if TCG_TPM && PPC_PSERIES
  15. select INTEGRITY_AUDIT if AUDIT
  16. help
  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.
  23. If your system has a TPM chip, then IMA also maintains
  24. an aggregate integrity value over this list inside the
  25. TPM hardware, so that the TPM can prove to a third party
  26. whether or not critical system files have been modified.
  27. Read <http://www.usenix.org/events/sec04/tech/sailer.html>
  28. to learn more about IMA.
  29. If unsure, say N.
  30. config IMA_KEXEC
  31. bool "Enable carrying the IMA measurement list across a soft boot"
  32. depends on IMA && TCG_TPM && HAVE_IMA_KEXEC
  33. default n
  34. help
  35. TPM PCRs are only reset on a hard reboot. In order to validate
  36. a TPM's quote after a soft boot, the IMA measurement list of the
  37. running kernel must be saved and restored on boot.
  38. Depending on the IMA policy, the measurement list can grow to
  39. be very large.
  40. config IMA_MEASURE_PCR_IDX
  41. int
  42. depends on IMA
  43. range 8 14
  44. default 10
  45. help
  46. IMA_MEASURE_PCR_IDX determines the TPM PCR register index
  47. that IMA uses to maintain the integrity aggregate of the
  48. measurement list. If unsure, use the default 10.
  49. config IMA_LSM_RULES
  50. bool
  51. depends on IMA && AUDIT && (SECURITY_SELINUX || SECURITY_SMACK)
  52. default y
  53. help
  54. Disabling this option will disregard LSM based policy rules.
  55. choice
  56. prompt "Default template"
  57. default IMA_NG_TEMPLATE
  58. depends on IMA
  59. help
  60. Select the default IMA measurement template.
  61. The original 'ima' measurement list template contains a
  62. hash, defined as 20 bytes, and a null terminated pathname,
  63. limited to 255 characters. The 'ima-ng' measurement list
  64. template permits both larger hash digests and longer
  65. pathnames.
  66. config IMA_TEMPLATE
  67. bool "ima"
  68. config IMA_NG_TEMPLATE
  69. bool "ima-ng (default)"
  70. config IMA_SIG_TEMPLATE
  71. bool "ima-sig"
  72. endchoice
  73. config IMA_DEFAULT_TEMPLATE
  74. string
  75. depends on IMA
  76. default "ima" if IMA_TEMPLATE
  77. default "ima-ng" if IMA_NG_TEMPLATE
  78. default "ima-sig" if IMA_SIG_TEMPLATE
  79. choice
  80. prompt "Default integrity hash algorithm"
  81. default IMA_DEFAULT_HASH_SHA1
  82. depends on IMA
  83. help
  84. Select the default hash algorithm used for the measurement
  85. list, integrity appraisal and audit log. The compiled default
  86. hash algorithm can be overwritten using the kernel command
  87. line 'ima_hash=' option.
  88. config IMA_DEFAULT_HASH_SHA1
  89. bool "SHA1 (default)"
  90. depends on CRYPTO_SHA1=y
  91. config IMA_DEFAULT_HASH_SHA256
  92. bool "SHA256"
  93. depends on CRYPTO_SHA256=y && !IMA_TEMPLATE
  94. config IMA_DEFAULT_HASH_SHA512
  95. bool "SHA512"
  96. depends on CRYPTO_SHA512=y && !IMA_TEMPLATE
  97. config IMA_DEFAULT_HASH_WP512
  98. bool "WP512"
  99. depends on CRYPTO_WP512=y && !IMA_TEMPLATE
  100. endchoice
  101. config IMA_DEFAULT_HASH
  102. string
  103. depends on IMA
  104. default "sha1" if IMA_DEFAULT_HASH_SHA1
  105. default "sha256" if IMA_DEFAULT_HASH_SHA256
  106. default "sha512" if IMA_DEFAULT_HASH_SHA512
  107. default "wp512" if IMA_DEFAULT_HASH_WP512
  108. config IMA_WRITE_POLICY
  109. bool "Enable multiple writes to the IMA policy"
  110. depends on IMA
  111. default n
  112. help
  113. IMA policy can now be updated multiple times. The new rules get
  114. appended to the original policy. Have in mind that the rules are
  115. scanned in FIFO order so be careful when you design and add new ones.
  116. If unsure, say N.
  117. config IMA_READ_POLICY
  118. bool "Enable reading back the current IMA policy"
  119. depends on IMA
  120. default y if IMA_WRITE_POLICY
  121. default n if !IMA_WRITE_POLICY
  122. help
  123. It is often useful to be able to read back the IMA policy. It is
  124. even more important after introducing CONFIG_IMA_WRITE_POLICY.
  125. This option allows the root user to see the current policy rules.
  126. config IMA_APPRAISE
  127. bool "Appraise integrity measurements"
  128. depends on IMA
  129. default n
  130. help
  131. This option enables local measurement integrity appraisal.
  132. It requires the system to be labeled with a security extended
  133. attribute containing the file hash measurement. To protect
  134. the security extended attributes from offline attack, enable
  135. and configure EVM.
  136. For more information on integrity appraisal refer to:
  137. <http://linux-ima.sourceforge.net>
  138. If unsure, say N.
  139. config IMA_APPRAISE_BUILD_POLICY
  140. bool "IMA build time configured policy rules"
  141. depends on IMA_APPRAISE && INTEGRITY_ASYMMETRIC_KEYS
  142. default n
  143. help
  144. This option defines an IMA appraisal policy at build time, which
  145. is enforced at run time without having to specify a builtin
  146. policy name on the boot command line. The build time appraisal
  147. policy rules persist after loading a custom policy.
  148. Depending on the rules configured, this policy may require kernel
  149. modules, firmware, the kexec kernel image, and/or the IMA policy
  150. to be signed. Unsigned files might prevent the system from
  151. booting or applications from working properly.
  152. config IMA_APPRAISE_REQUIRE_FIRMWARE_SIGS
  153. bool "Appraise firmware signatures"
  154. depends on IMA_APPRAISE_BUILD_POLICY
  155. default n
  156. help
  157. This option defines a policy requiring all firmware to be signed,
  158. including the regulatory.db. If both this option and
  159. CFG80211_REQUIRE_SIGNED_REGDB are enabled, then both signature
  160. verification methods are necessary.
  161. config IMA_APPRAISE_REQUIRE_KEXEC_SIGS
  162. bool "Appraise kexec kernel image signatures"
  163. depends on IMA_APPRAISE_BUILD_POLICY
  164. default n
  165. help
  166. Enabling this rule will require all kexec'ed kernel images to
  167. be signed and verified by a public key on the trusted IMA
  168. keyring.
  169. Kernel image signatures can not be verified by the original
  170. kexec_load syscall. Enabling this rule will prevent its
  171. usage.
  172. config IMA_APPRAISE_REQUIRE_MODULE_SIGS
  173. bool "Appraise kernel modules signatures"
  174. depends on IMA_APPRAISE_BUILD_POLICY
  175. default n
  176. help
  177. Enabling this rule will require all kernel modules to be signed
  178. and verified by a public key on the trusted IMA keyring.
  179. Kernel module signatures can only be verified by IMA-appraisal,
  180. via the finit_module syscall. Enabling this rule will prevent
  181. the usage of the init_module syscall.
  182. config IMA_APPRAISE_REQUIRE_POLICY_SIGS
  183. bool "Appraise IMA policy signature"
  184. depends on IMA_APPRAISE_BUILD_POLICY
  185. default n
  186. help
  187. Enabling this rule will require the IMA policy to be signed and
  188. and verified by a key on the trusted IMA keyring.
  189. config IMA_APPRAISE_BOOTPARAM
  190. bool "ima_appraise boot parameter"
  191. depends on IMA_APPRAISE
  192. default y
  193. help
  194. This option enables the different "ima_appraise=" modes
  195. (eg. fix, log) from the boot command line.
  196. config IMA_TRUSTED_KEYRING
  197. bool "Require all keys on the .ima keyring be signed (deprecated)"
  198. depends on IMA_APPRAISE && SYSTEM_TRUSTED_KEYRING
  199. depends on INTEGRITY_ASYMMETRIC_KEYS
  200. select INTEGRITY_TRUSTED_KEYRING
  201. default y
  202. help
  203. This option requires that all keys added to the .ima
  204. keyring be signed by a key on the system trusted keyring.
  205. This option is deprecated in favor of INTEGRITY_TRUSTED_KEYRING
  206. config IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY
  207. bool "Permit keys validly signed by a built-in or secondary CA cert (EXPERIMENTAL)"
  208. depends on SYSTEM_TRUSTED_KEYRING
  209. depends on SECONDARY_TRUSTED_KEYRING
  210. depends on INTEGRITY_ASYMMETRIC_KEYS
  211. select INTEGRITY_TRUSTED_KEYRING
  212. default n
  213. help
  214. Keys may be added to the IMA or IMA blacklist keyrings, if the
  215. key is validly signed by a CA cert in the system built-in or
  216. secondary trusted keyrings.
  217. Intermediate keys between those the kernel has compiled in and the
  218. IMA keys to be added may be added to the system secondary keyring,
  219. provided they are validly signed by a key already resident in the
  220. built-in or secondary trusted keyrings.
  221. config IMA_BLACKLIST_KEYRING
  222. bool "Create IMA machine owner blacklist keyrings (EXPERIMENTAL)"
  223. depends on SYSTEM_TRUSTED_KEYRING
  224. depends on IMA_TRUSTED_KEYRING
  225. default n
  226. help
  227. This option creates an IMA blacklist keyring, which contains all
  228. revoked IMA keys. It is consulted before any other keyring. If
  229. the search is successful the requested operation is rejected and
  230. an error is returned to the caller.
  231. config IMA_LOAD_X509
  232. bool "Load X509 certificate onto the '.ima' trusted keyring"
  233. depends on IMA_TRUSTED_KEYRING
  234. default n
  235. help
  236. File signature verification is based on the public keys
  237. loaded on the .ima trusted keyring. These public keys are
  238. X509 certificates signed by a trusted key on the
  239. .system keyring. This option enables X509 certificate
  240. loading from the kernel onto the '.ima' trusted keyring.
  241. config IMA_X509_PATH
  242. string "IMA X509 certificate path"
  243. depends on IMA_LOAD_X509
  244. default "/etc/keys/x509_ima.der"
  245. help
  246. This option defines IMA X509 certificate path.
  247. config IMA_APPRAISE_SIGNED_INIT
  248. bool "Require signed user-space initialization"
  249. depends on IMA_LOAD_X509
  250. default n
  251. help
  252. This option requires user-space init to be signed.