From 26a329a41c00ef3f27f7dbc3cb82847debc68564 Mon Sep 17 00:00:00 2001 From: Marcus Burghardt Date: Thu, 30 Nov 2023 11:13:00 +0100 Subject: [PATCH] Refactor OVAL in file_permissions_unauthorized_sgid Adopted the create_local_mount_points_list macro. Also aligned the rule logic to the file_permissions_unauthorized_suid rule. --- .../oval/shared.xml | 88 ++++++++++++------- 1 file changed, 56 insertions(+), 32 deletions(-) diff --git a/linux_os/guide/system/permissions/files/file_permissions_unauthorized_sgid/oval/shared.xml b/linux_os/guide/system/permissions/files/file_permissions_unauthorized_sgid/oval/shared.xml index b932ac038b7e..2537be2633e5 100644 --- a/linux_os/guide/system/permissions/files/file_permissions_unauthorized_sgid/oval/shared.xml +++ b/linux_os/guide/system/permissions/files/file_permissions_unauthorized_sgid/oval/shared.xml @@ -1,53 +1,77 @@ - + {{{ oval_metadata("Evaluates to true if all files with SGID set are owned by RPM packages.") }}} - + - - - + + + true + - - - / + {{%- set var_local_mount_points = "var_" ~ rule_id ~ "_local_mountpoints" -%}} + {{{ create_local_mount_points_list(var_local_mount_points) }}} + + + + + ^.*$ - state_file_permissions_unauthorized_sgid_sgid_set - state_file_permissions_unauthorized_sgid_filepaths + state_file_permissions_unauthorized_sgid_set - - + + + + + + + .* .* .* .* .* - + - - - / - ^.*$ - state_file_permissions_unauthorized_sgid_sgid_set - - - - true - + + + + - - - + + + + - - - + + + var_file_permissions_unauthorized_sgid_all_sgid_files + state_file_permissions_unauthorized_sgid_rpm_filepaths + - - - + + +