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