evm 3.4 KB

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