evm 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. What: /sys/kernel/security/evm
  2. What: /sys/kernel/security/*/evm
  3. Date: March 2011
  4. Contact: Mimi Zohar <[email protected]>
  5. Description:
  6. EVM protects a file's security extended attributes(xattrs)
  7. against integrity attacks. The initial method maintains an
  8. HMAC-sha1 value across the extended attributes, storing the
  9. value as the extended attribute 'security.evm'.
  10. EVM supports two classes of security.evm. The first is
  11. an HMAC-sha1 generated locally with a
  12. trusted/encrypted key stored in the Kernel Key
  13. Retention System. The second is a digital signature
  14. generated either locally or remotely using an
  15. asymmetric key. These keys are loaded onto root's
  16. keyring using keyctl, and EVM is then enabled by
  17. echoing a value to <securityfs>/evm made up of the
  18. following bits:
  19. === ==================================================
  20. Bit Effect
  21. === ==================================================
  22. 0 Enable HMAC validation and creation
  23. 1 Enable digital signature validation
  24. 2 Permit modification of EVM-protected metadata at
  25. runtime. Not supported if HMAC validation and
  26. creation is enabled (deprecated).
  27. 31 Disable further runtime modification of EVM policy
  28. === ==================================================
  29. For example::
  30. echo 1 ><securityfs>/evm
  31. will enable HMAC validation and creation
  32. ::
  33. echo 0x80000003 ><securityfs>/evm
  34. will enable HMAC and digital signature validation and
  35. HMAC creation and disable all further modification of policy.
  36. ::
  37. echo 0x80000006 ><securityfs>/evm
  38. will enable digital signature validation, permit
  39. modification of EVM-protected metadata and
  40. disable all further modification of policy. This option is now
  41. deprecated in favor of::
  42. echo 0x80000002 ><securityfs>/evm
  43. as the outstanding issues that prevent the usage of EVM portable
  44. signatures have been solved.
  45. Echoing a value is additive, the new value is added to the
  46. existing initialization flags.
  47. For example, after::
  48. echo 2 ><securityfs>/evm
  49. another echo can be performed::
  50. echo 1 ><securityfs>/evm
  51. and the resulting value will be 3.
  52. Note that once an HMAC key has been loaded, it will no longer
  53. be possible to enable metadata modification. Signaling that an
  54. HMAC key has been loaded will clear the corresponding flag.
  55. For example, if the current value is 6 (2 and 4 set)::
  56. echo 1 ><securityfs>/evm
  57. will set the new value to 3 (4 cleared).
  58. Loading an HMAC key is the only way to disable metadata
  59. modification.
  60. Until key loading has been signaled EVM can not create
  61. or validate the 'security.evm' xattr, but returns
  62. INTEGRITY_UNKNOWN. Loading keys and signaling EVM
  63. should be done as early as possible. Normally this is
  64. done in the initramfs, which has already been measured
  65. as part of the trusted boot. For more information on
  66. creating and loading existing trusted/encrypted keys,
  67. refer to:
  68. Documentation/security/keys/trusted-encrypted.rst. Both
  69. dracut (via 97masterkey and 98integrity) and systemd (via
  70. core/ima-setup) have support for loading keys at boot
  71. time.
  72. What: /sys/kernel/security/*/evm/evm_xattrs
  73. Date: April 2018
  74. Contact: Matthew Garrett <[email protected]>
  75. Description:
  76. Shows the set of extended attributes used to calculate or
  77. validate the EVM signature, and allows additional attributes
  78. to be added at runtime. Any signatures generated after
  79. additional attributes are added (and on files possessing those
  80. additional attributes) will only be valid if the same
  81. additional attributes are configured on system boot. Writing
  82. a single period (.) will lock the xattr list from any further
  83. modification.