@@ -27,8 +27,9 @@ Description:
2727 [fowner=] [fgroup=]]
2828 lsm: [[subj_user=] [subj_role=] [subj_type=]
2929 [obj_user=] [obj_role=] [obj_type=]]
30- option: [[appraise_type=]] [template=] [permit_directio]
31- [appraise_flag=] [appraise_algos=] [keyrings=]
30+ option: [digest_type=] [template=] [permit_directio]
31+ [appraise_type=] [appraise_flag=]
32+ [appraise_algos=] [keyrings=]
3233 base:
3334 func:= [BPRM_CHECK][MMAP_CHECK][CREDS_CHECK][FILE_CHECK][MODULE_CHECK]
3435 [FIRMWARE_CHECK]
@@ -47,10 +48,21 @@ Description:
4748 fgroup:= decimal value
4849 lsm: are LSM specific
4950 option:
50- appraise_type:= [imasig] [imasig|modsig]
51+ appraise_type:= [imasig] | [imasig|modsig] | [sigv3]
52+ where 'imasig' is the original or the signature
53+ format v2.
54+ where 'modsig' is an appended signature,
55+ where 'sigv3' is the signature format v3. (Currently
56+ limited to fsverity digest based signatures
57+ stored in security.ima xattr. Requires
58+ specifying "digest_type=verity" first.)
59+
5160 appraise_flag:= [check_blacklist]
5261 Currently, blacklist check is only for files signed with appended
5362 signature.
63+ digest_type:= verity
64+ Require fs-verity's file digest instead of the
65+ regular IMA file hash.
5466 keyrings:= list of keyrings
5567 (eg, .builtin_trusted_keys|.ima). Only valid
5668 when action is "measure" and func is KEY_CHECK.
@@ -149,3 +161,30 @@ Description:
149161 security.ima xattr of a file:
150162
151163 appraise func=SETXATTR_CHECK appraise_algos=sha256,sha384,sha512
164+
165+ Example of a 'measure' rule requiring fs-verity's digests
166+ with indication of type of digest in the measurement list.
167+
168+ measure func=FILE_CHECK digest_type=verity \
169+ template=ima-ngv2
170+
171+ Example of 'measure' and 'appraise' rules requiring fs-verity
172+ signatures (format version 3) stored in security.ima xattr.
173+
174+ The 'measure' rule specifies the 'ima-sigv3' template option,
175+ which includes the indication of type of digest and the file
176+ signature in the measurement list.
177+
178+ measure func=BPRM_CHECK digest_type=verity \
179+ template=ima-sigv3
180+
181+
182+ The 'appraise' rule specifies the type and signature format
183+ version (sigv3) required.
184+
185+ appraise func=BPRM_CHECK digest_type=verity \
186+ appraise_type=sigv3
187+
188+ All of these policy rules could, for example, be constrained
189+ either based on a filesystem's UUID (fsuuid) or based on LSM
190+ labels.
0 commit comments