diff options
author | THOBY Simon <Simon.THOBY@viveris.fr> | 2021-08-16 11:11:00 +0300 |
---|---|---|
committer | Mimi Zohar <zohar@linux.ibm.com> | 2021-08-17 00:33:07 +0300 |
commit | 583a80ae86b5ceb68119cfb9a37404cf22f6cc46 (patch) | |
tree | 69a1369662423cbd98f3f39584633e7175d95c32 /security/integrity/ima/ima_main.c | |
parent | 1624dc0086056c3a35fd34b0235bb1eb88c1c4d5 (diff) | |
download | linux-583a80ae86b5ceb68119cfb9a37404cf22f6cc46.tar.xz |
IMA: add a policy option to restrict xattr hash algorithms on appraisal
The kernel has the ability to restrict the set of hash algorithms it
accepts for the security.ima xattr when it appraises files.
Define a new IMA policy rule option "appraise_algos=", using the
mentioned mechanism to expose a user-toggable policy knob to opt-in
to that restriction and select the desired set of algorithms that
must be accepted.
When a policy rule uses the 'appraise_algos' option, appraisal of a
file referenced by that rule will now fail if the digest algorithm
employed to hash the file was not one of those explicitly listed in
the option. In its absence, any hash algorithm compiled in the
kernel will be accepted.
For example, on a system where SELinux is properly deployed, the rule
appraise func=BPRM_CHECK obj_type=iptables_exec_t \
appraise_algos=sha256,sha384
will block the execution of iptables if the xattr security.ima of its
executables were not hashed with either sha256 or sha384.
Signed-off-by: THOBY Simon <Simon.THOBY@viveris.fr>
Reviewed-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Diffstat (limited to 'security/integrity/ima/ima_main.c')
0 files changed, 0 insertions, 0 deletions