where 'imasig' is the original or the signature
format v2.
where 'modsig' is an appended signature,
- where 'sigv3' is the signature format v3. (Currently
- limited to fsverity digest based signatures
- stored in security.ima xattr. Requires
- specifying "digest_type=verity" first.)
+ where 'sigv3' is the signature format v3.
appraise_flag:= [check_blacklist] (deprecated)
Setting the check_blacklist flag is no longer necessary.
appraise func=BPRM_CHECK digest_type=verity \
appraise_type=sigv3
+ Example of a regular IMA file hash 'appraise' rule requiring
+ signature version 3 format stored in security.ima xattr.
+
+ appraise func=BPRM_CHECK appraise_type=sigv3
+
All of these policy rules could, for example, be constrained
either based on a filesystem's UUID (fsuuid) or based on LSM
labels.
IMA_GID | IMA_EGID |
IMA_FGROUP | IMA_DIGSIG_REQUIRED |
IMA_PERMIT_DIRECTIO | IMA_VALIDATE_ALGOS |
- IMA_CHECK_BLACKLIST | IMA_VERITY_REQUIRED))
+ IMA_CHECK_BLACKLIST | IMA_VERITY_REQUIRED |
+ IMA_SIGV3_REQUIRED))
return false;
break;
break;
case Opt_digest_type:
ima_log_string(ab, "digest_type", args[0].from);
- if (entry->flags & IMA_DIGSIG_REQUIRED)
- result = -EINVAL;
- else if ((strcmp(args[0].from, "verity")) == 0)
+ if ((strcmp(args[0].from, "verity")) == 0)
entry->flags |= IMA_VERITY_REQUIRED;
else
result = -EINVAL;
else
entry->flags |= IMA_DIGSIG_REQUIRED | IMA_CHECK_BLACKLIST;
} else if (strcmp(args[0].from, "sigv3") == 0) {
- /* Only fsverity supports sigv3 for now */
- if (entry->flags & IMA_VERITY_REQUIRED)
- entry->flags |= IMA_DIGSIG_REQUIRED | IMA_CHECK_BLACKLIST;
- else
- result = -EINVAL;
+ entry->flags |= IMA_SIGV3_REQUIRED |
+ IMA_DIGSIG_REQUIRED |
+ IMA_CHECK_BLACKLIST;
} else if (IS_ENABLED(CONFIG_IMA_APPRAISE_MODSIG) &&
strcmp(args[0].from, "imasig|modsig") == 0) {
- if (entry->flags & IMA_VERITY_REQUIRED)
+ if ((entry->flags & IMA_VERITY_REQUIRED) ||
+ (entry->flags & IMA_SIGV3_REQUIRED))
result = -EINVAL;
else
entry->flags |= IMA_DIGSIG_REQUIRED |
/* d-ngv2 template field recommended for unsigned fs-verity digests */
if (!result && entry->action == MEASURE &&
- entry->flags & IMA_VERITY_REQUIRED) {
+ (entry->flags & IMA_VERITY_REQUIRED)) {
template_desc = entry->template ? entry->template :
ima_template_desc_current();
check_template_field(template_desc, "d-ngv2",
if (entry->template)
seq_printf(m, "template=%s ", entry->template->name);
if (entry->flags & IMA_DIGSIG_REQUIRED) {
- if (entry->flags & IMA_VERITY_REQUIRED)
+ if (entry->flags & IMA_SIGV3_REQUIRED)
seq_puts(m, "appraise_type=sigv3 ");
else if (entry->flags & IMA_MODSIG_ALLOWED)
seq_puts(m, "appraise_type=imasig|modsig ");