2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/Documentation/admin-guide/LSM
Jasjiv Singh 1d887d6f81 ipe: add errno field to IPE policy load auditing
Users of IPE require a way to identify when and why an operation fails,
allowing them to both respond to violations of policy and be notified
of potentially malicious actions on their systems with respect to IPE.

This patch introduces a new error field to the AUDIT_IPE_POLICY_LOAD event
to log policy loading failures. Currently, IPE only logs successful policy
loads, but not failures. Tracking failures is crucial to detect malicious
attempts and ensure a complete audit trail for security events.

The new error field will capture the following error codes:

* -ENOKEY: Key used to sign the IPE policy not found in the keyring
* -ESTALE: Attempting to update an IPE policy with an older version
* -EKEYREJECTED: IPE signature verification failed
* -ENOENT: Policy was deleted while updating
* -EEXIST: Same name policy already deployed
* -ERANGE: Policy version number overflow
* -EINVAL: Policy version parsing error
* -EPERM: Insufficient permission
* -ENOMEM: Out of memory (OOM)
* -EBADMSG: Policy is invalid

Here are some examples of the updated audit record types:

AUDIT_IPE_POLICY_LOAD(1422):
audit:  AUDIT1422 policy_name="Test_Policy" policy_version=0.0.1
policy_digest=sha256:84EFBA8FA71E62AE0A537FAB962F8A2BD1053964C4299DCA
92BFFF4DB82E86D3 auid=1000 ses=3 lsm=ipe res=1 errno=0

The above record shows a new policy has been successfully loaded into
the kernel with the policy name, version, and hash with the errno=0.

AUDIT_IPE_POLICY_LOAD(1422) with error:

audit: AUDIT1422 policy_name=? policy_version=? policy_digest=?
auid=1000 ses=3 lsm=ipe res=0 errno=-74

The above record shows a policy load failure due to an invalid policy
(-EBADMSG).

By adding this error field, we ensure that all policy load attempts,
whether successful or failed, are logged, providing a comprehensive
audit trail for IPE policy management.

Signed-off-by: Jasjiv Singh <jasjivsingh@linux.microsoft.com>
Signed-off-by: Fan Wu <wufan@kernel.org>
2025-05-27 18:08:51 -07:00
..
apparmor.rst Docs: Update LSM/apparmor.rst 2024-11-26 19:21:06 -08:00
index.rst landlock: Add audit documentation 2025-03-26 13:59:49 +01:00
ipe.rst ipe: add errno field to IPE policy load auditing 2025-05-27 18:08:51 -07:00
landlock.rst landlock: Add audit documentation 2025-03-26 13:59:49 +01:00
LoadPin.rst security/loadpin: Update the changing interface in the source code. 2021-03-15 13:32:32 -06:00
SafeSetID.rst docs: SafeSetID: fix a warning 2020-10-28 11:42:02 -06:00
SELinux.rst Documentation: Update SELinux reference policy URL 2018-11-19 12:40:48 -05:00
Smack.rst Smack: Improve Documentation 2018-12-13 13:31:01 -08:00
tomoyo.rst tomoyo: update project links 2024-06-03 22:43:11 +09:00
Yama.rst doc: yama: Swap HTTP for HTTPS and replace dead link 2020-07-13 09:40:42 -06:00