2019-06-01 10:08:55 +02:00
|
|
|
|
2011-10-05 11:54:46 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-13 08:47:43 -04:00
|
|
|
|
2014-11-05 17:01:13 +02:00
|
|
|
|
2013-08-13 08:47:43 -04:00
|
|
|
|
2020-10-02 10:38:15 -07:00
|
|
|
|
2011-10-05 11:54:46 +03:00
|
|
|
|
|
|
|
|
|
2018-02-12 17:26:20 -08:00
|
|
|
|
KEYS: Move the point of trust determination to __key_link()
Move the point at which a key is determined to be trustworthy to
__key_link() so that we use the contents of the keyring being linked in to
to determine whether the key being linked in is trusted or not.
What is 'trusted' then becomes a matter of what's in the keyring.
Currently, the test is done when the key is parsed, but given that at that
point we can only sensibly refer to the contents of the system trusted
keyring, we can only use that as the basis for working out the
trustworthiness of a new key.
With this change, a trusted keyring is a set of keys that once the
trusted-only flag is set cannot be added to except by verification through
one of the contained keys.
Further, adding a key into a trusted keyring, whilst it might grant
trustworthiness in the context of that keyring, does not automatically
grant trustworthiness in the context of a second keyring to which it could
be secondarily linked.
To accomplish this, the authentication data associated with the key source
must now be retained. For an X.509 cert, this means the contents of the
AuthorityKeyIdentifier and the signature data.
If system keyrings are disabled then restrict_link_by_builtin_trusted()
resolves to restrict_link_reject(). The integrity digital signature code
still works correctly with this as it was previously using
KEY_FLAG_TRUSTED_ONLY, which doesn't permit anything to be added if there
is no system keyring against which trust can be determined.
Signed-off-by: David Howells <dhowells@redhat.com>
2016-04-06 16:14:26 +01:00
|
|
|
|
|
|
|
|
|
2011-10-05 11:54:46 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-09-07 13:22:23 -07:00
|
|
|
|
2015-10-22 21:26:10 +03:00
|
|
|
|
2011-10-05 11:54:46 +03:00
|
|
|
|
|
|
|
|
|
2013-08-13 08:47:43 -04:00
|
|
|
|
2015-10-22 21:26:10 +03:00
|
|
|
|
2013-08-13 08:47:43 -04:00
|
|
|
|
|
|
|
|
|
2018-12-09 01:56:59 +05:30
|
|
|
|
2022-01-25 21:58:28 -05:00
|
|
|
|
2011-10-05 11:54:46 +03:00
|
|
|
|
|
|
|
|
|
2016-04-07 09:45:23 +01:00
|
|
|
|
2023-05-22 19:09:43 -04:00
|
|
|
|
KEYS: Move the point of trust determination to __key_link()
Move the point at which a key is determined to be trustworthy to
__key_link() so that we use the contents of the keyring being linked in to
to determine whether the key being linked in is trusted or not.
What is 'trusted' then becomes a matter of what's in the keyring.
Currently, the test is done when the key is parsed, but given that at that
point we can only sensibly refer to the contents of the system trusted
keyring, we can only use that as the basis for working out the
trustworthiness of a new key.
With this change, a trusted keyring is a set of keys that once the
trusted-only flag is set cannot be added to except by verification through
one of the contained keys.
Further, adding a key into a trusted keyring, whilst it might grant
trustworthiness in the context of that keyring, does not automatically
grant trustworthiness in the context of a second keyring to which it could
be secondarily linked.
To accomplish this, the authentication data associated with the key source
must now be retained. For an X.509 cert, this means the contents of the
AuthorityKeyIdentifier and the signature data.
If system keyrings are disabled then restrict_link_by_builtin_trusted()
resolves to restrict_link_reject(). The integrity digital signature code
still works correctly with this as it was previously using
KEY_FLAG_TRUSTED_ONLY, which doesn't permit anything to be added if there
is no system keyring against which trust can be determined.
Signed-off-by: David Howells <dhowells@redhat.com>
2016-04-06 16:14:26 +01:00
|
|
|
|
2023-05-22 19:09:43 -04:00
|
|
|
|
KEYS: Move the point of trust determination to __key_link()
Move the point at which a key is determined to be trustworthy to
__key_link() so that we use the contents of the keyring being linked in to
to determine whether the key being linked in is trusted or not.
What is 'trusted' then becomes a matter of what's in the keyring.
Currently, the test is done when the key is parsed, but given that at that
point we can only sensibly refer to the contents of the system trusted
keyring, we can only use that as the basis for working out the
trustworthiness of a new key.
With this change, a trusted keyring is a set of keys that once the
trusted-only flag is set cannot be added to except by verification through
one of the contained keys.
Further, adding a key into a trusted keyring, whilst it might grant
trustworthiness in the context of that keyring, does not automatically
grant trustworthiness in the context of a second keyring to which it could
be secondarily linked.
To accomplish this, the authentication data associated with the key source
must now be retained. For an X.509 cert, this means the contents of the
AuthorityKeyIdentifier and the signature data.
If system keyrings are disabled then restrict_link_by_builtin_trusted()
resolves to restrict_link_reject(). The integrity digital signature code
still works correctly with this as it was previously using
KEY_FLAG_TRUSTED_ONLY, which doesn't permit anything to be added if there
is no system keyring against which trust can be determined.
Signed-off-by: David Howells <dhowells@redhat.com>
2016-04-06 16:14:26 +01:00
|
|
|
|
|
|
|
|
|
2019-06-27 23:19:30 -03:00
|
|
|
|
2011-10-05 11:54:46 +03:00
|
|
|
|
2019-06-27 23:19:30 -03:00
|
|
|
|
|
|
|
|
|
2011-10-05 11:54:46 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-10 18:43:43 -07:00
|
|
|
|
2011-10-05 11:54:46 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-06-27 23:19:30 -03:00
|
|
|
|
2011-10-05 11:54:46 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-06-27 23:19:30 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-03-10 19:42:07 -04:00
|
|
|
|
2019-06-27 23:19:30 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-10-10 16:12:03 +09:00
|
|
|
|
2013-02-07 00:12:08 +02:00
|
|
|
|
2013-10-10 16:12:03 +09:00
|
|
|
|
2019-06-27 23:19:30 -03:00
|
|
|
|
|
|
|
|
|
ima: support fs-verity file digest based version 3 signatures
IMA may verify a file's integrity against a "good" value stored in the
'security.ima' xattr or as an appended signature, based on policy. When
the "good value" is stored in the xattr, the xattr may contain a file
hash or signature. In either case, the "good" value is preceded by a
header. The first byte of the xattr header indicates the type of data
- hash, signature - stored in the xattr. To support storing fs-verity
signatures in the 'security.ima' xattr requires further differentiating
the fs-verity signature from the existing IMA signature.
In addition the signatures stored in 'security.ima' xattr, need to be
disambiguated. Instead of directly signing the fs-verity digest, a new
signature format version 3 is defined as the hash of the ima_file_id
structure, which identifies the type of signature and the digest.
The IMA policy defines "which" files are to be measured, verified, and/or
audited. For those files being verified, the policy rules indicate "how"
the file should be verified. For example to require a file be signed,
the appraise policy rule must include the 'appraise_type' option.
appraise_type:= [imasig] | [imasig|modsig] | [sigv3]
where 'imasig' is the original or signature format v2 (default),
where 'modsig' is an appended signature,
where 'sigv3' is the signature format v3.
The policy rule must also indicate the type of digest, if not the IMA
default, by first specifying the digest type:
digest_type:= [verity]
The following policy rule requires fsverity signatures. The rule may be
constrained, for example based on a fsuuid or LSM label.
appraise func=BPRM_CHECK digest_type=verity appraise_type=sigv3
Acked-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
2021-11-24 10:56:33 -05:00
|
|
|
|
2019-06-27 23:19:30 -03:00
|
|
|
|
2026-03-10 19:42:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-07 00:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-10-05 11:54:46 +03:00
|
|
|
|
2013-08-13 08:47:43 -04:00
|
|
|
|
2019-06-27 23:19:30 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-06-17 09:44:52 +02:00
|
|
|
|
2019-07-10 18:43:43 -07:00
|
|
|
|
2019-06-17 09:44:52 +02:00
|
|
|
|
2013-08-13 08:47:43 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-12-09 01:56:59 +05:30
|
|
|
|
2019-07-10 18:43:43 -07:00
|
|
|
|
2018-12-09 01:57:00 +05:30
|
|
|
|
2018-12-09 01:56:59 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-01-21 17:59:28 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-15 07:27:20 -04:00
|
|
|
|
2022-01-25 21:58:30 -05:00
|
|
|
|
2021-04-09 10:35:07 -04:00
|
|
|
|
|
|
|
|
|
2018-12-09 01:56:59 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-10 18:43:43 -07:00
|
|
|
|
2022-11-11 18:13:17 +08:00
|
|
|
|
2019-07-10 18:43:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-12-09 01:56:59 +05:30
|
|
|
|
2022-01-25 21:58:28 -05:00
|
|
|
|
2023-03-02 11:46:52 -05:00
|
|
|
|
|
|
|
|
|
2018-12-09 01:56:59 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-10-03 17:15:44 -07:00
|
|
|
|
2015-10-22 21:26:10 +03:00
|
|
|
|
|
|
|
|
|
2026-02-21 16:37:42 -08:00
|
|
|
|
2016-08-31 16:05:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-03-02 11:46:52 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-01-25 21:58:28 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-31 16:05:43 -07:00
|
|
|
|
2018-12-09 01:56:59 +05:30
|
|
|
|
2022-11-11 18:13:17 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-13 08:47:43 -04:00
|
|
|
|
2014-11-05 17:01:13 +02:00
|
|
|
|
2021-02-10 08:01:31 +00:00
|
|
|
|
|
|
|
|
|
2014-11-05 17:01:13 +02:00
|
|
|
|
|
|
|
|
|
2018-12-09 01:57:00 +05:30
|
|
|
|
2014-11-05 17:01:13 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-12-09 01:57:00 +05:30
|
|
|
|
2019-07-10 18:43:43 -07:00
|
|
|
|
2018-12-09 01:57:00 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-01-09 08:24:28 +08:00
|
|
|
|
|
|
|
|
|
2018-12-09 01:57:00 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-02 10:38:13 -07:00
|
|
|
|
2020-10-02 10:38:17 -07:00
|
|
|
|
2018-12-09 01:57:00 +05:30
|
|
|
|
2019-07-10 18:43:43 -07:00
|
|
|
|
2018-12-09 01:57:00 +05:30
|
|
|
|
2020-10-02 10:38:25 -07:00
|
|
|
|
2017-09-10 09:49:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-11-05 17:01:13 +02:00
|
|
|
|
2017-09-10 09:49:45 +02:00
|
|
|
|
2020-10-02 10:38:17 -07:00
|
|
|
|
2014-11-05 17:01:13 +02:00
|
|
|
|
2019-07-10 18:43:43 -07:00
|
|
|
|
|
|
|
|
|
2018-12-09 01:57:00 +05:30
|
|
|
|
2019-07-10 18:43:43 -07:00
|
|
|
|
2018-12-09 01:57:00 +05:30
|
|
|
|
2017-09-10 09:49:45 +02:00
|
|
|
|
2018-12-09 01:57:00 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-10 18:43:43 -07:00
|
|
|
|
2018-12-09 01:57:00 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-10 18:43:43 -07:00
|
|
|
|
2014-11-05 17:01:13 +02:00
|
|
|
|