|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/rule.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/rule.yml
|
|
|
07cb6b |
index dac47a1c6d1..3a6167a5717 100644
|
|
|
07cb6b |
--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/rule.yml
|
|
|
07cb6b |
+++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/rule.yml
|
|
|
07cb6b |
@@ -39,7 +39,7 @@ references:
|
|
|
07cb6b |
nist: CM-5(6),CM-5(6).1
|
|
|
07cb6b |
srg: SRG-OS-000259-GPOS-00100
|
|
|
07cb6b |
stigid@ol8: OL08-00-010350
|
|
|
07cb6b |
- stigid@rhel8: RHEL-08-010350
|
|
|
07cb6b |
+ stigid@rhel8: RHEL-08-010351
|
|
|
07cb6b |
stigid@sle12: SLES-12-010876
|
|
|
07cb6b |
stigid@sle15: SLES-15-010356
|
|
|
07cb6b |
stigid@ubuntu2004: UBTU-20-010431
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/all_dirs_ok.pass.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/all_dirs_ok.pass.sh
|
|
|
07cb6b |
index 50fdb17bd2e..6a05a2b82ea 100644
|
|
|
07cb6b |
--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/all_dirs_ok.pass.sh
|
|
|
07cb6b |
+++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/all_dirs_ok.pass.sh
|
|
|
07cb6b |
@@ -1,4 +1,4 @@
|
|
|
07cb6b |
-# platform = multi_platform_sle,Red Hat Enterprise Linux 8,multi_platform_fedora
|
|
|
07cb6b |
+# platform = multi_platform_sle,multi_platform_rhel,multi_platform_fedora
|
|
|
07cb6b |
|
|
|
07cb6b |
DIRS="/lib /lib64 /usr/lib /usr/lib64"
|
|
|
07cb6b |
for dirPath in $DIRS; do
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/correct_groupowner.pass.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/correct_groupowner.pass.sh
|
|
|
07cb6b |
new file mode 100644
|
|
|
07cb6b |
index 00000000000..6a05a2b82ea
|
|
|
07cb6b |
--- /dev/null
|
|
|
07cb6b |
+++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/correct_groupowner.pass.sh
|
|
|
07cb6b |
@@ -0,0 +1,6 @@
|
|
|
07cb6b |
+# platform = multi_platform_sle,multi_platform_rhel,multi_platform_fedora
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+DIRS="/lib /lib64 /usr/lib /usr/lib64"
|
|
|
07cb6b |
+for dirPath in $DIRS; do
|
|
|
07cb6b |
+ find "$dirPath" -type d -exec chgrp root '{}' \;
|
|
|
07cb6b |
+done
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/incorrect_groupowner.fail.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/incorrect_groupowner.fail.sh
|
|
|
07cb6b |
new file mode 100644
|
|
|
07cb6b |
index 00000000000..36461f5e5c3
|
|
|
07cb6b |
--- /dev/null
|
|
|
07cb6b |
+++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/incorrect_groupowner.fail.sh
|
|
|
07cb6b |
@@ -0,0 +1,6 @@
|
|
|
07cb6b |
+# platform = multi_platform_sle,multi_platform_rhel,multi_platform_fedora
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+DIRS="/lib /lib64 /usr/lib /usr/lib64"
|
|
|
07cb6b |
+for dirPath in $DIRS; do
|
|
|
07cb6b |
+ mkdir -p "$dirPath/testme" && chgrp nobody "$dirPath/testme"
|
|
|
07cb6b |
+done
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/incorrect_groupowner_2.fail.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/incorrect_groupowner_2.fail.sh
|
|
|
07cb6b |
new file mode 100644
|
|
|
07cb6b |
index 00000000000..3f09e3dd018
|
|
|
07cb6b |
--- /dev/null
|
|
|
07cb6b |
+++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/incorrect_groupowner_2.fail.sh
|
|
|
07cb6b |
@@ -0,0 +1,6 @@
|
|
|
07cb6b |
+# platform = multi_platform_sle,multi_platform_rhel,multi_platform_fedora
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+DIRS="/lib /lib64 /usr/lib /usr/lib64"
|
|
|
07cb6b |
+for dirPath in $DIRS; do
|
|
|
07cb6b |
+ mkdir -p "$dirPath/testme/test2" && chgrp nobody "$dirPath/testme/test2"
|
|
|
07cb6b |
+done
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/nobody_group_owned_dir_on_lib.fail.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/nobody_group_owned_dir_on_lib.fail.sh
|
|
|
07cb6b |
index 043ad6b2dee..36461f5e5c3 100644
|
|
|
07cb6b |
--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/nobody_group_owned_dir_on_lib.fail.sh
|
|
|
07cb6b |
+++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/nobody_group_owned_dir_on_lib.fail.sh
|
|
|
07cb6b |
@@ -1,4 +1,4 @@
|
|
|
07cb6b |
-# platform = multi_platform_sle,Red Hat Enterprise Linux 8,multi_platform_fedora
|
|
|
07cb6b |
+# platform = multi_platform_sle,multi_platform_rhel,multi_platform_fedora
|
|
|
07cb6b |
|
|
|
07cb6b |
DIRS="/lib /lib64 /usr/lib /usr/lib64"
|
|
|
07cb6b |
for dirPath in $DIRS; do
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_binary_dirs/rule.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_binary_dirs/rule.yml
|
|
|
07cb6b |
index e2362388678..ba923d8ac55 100644
|
|
|
07cb6b |
--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_binary_dirs/rule.yml
|
|
|
07cb6b |
+++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_binary_dirs/rule.yml
|
|
|
07cb6b |
@@ -27,7 +27,7 @@ references:
|
|
|
07cb6b |
srg: SRG-OS-000258-GPOS-00099
|
|
|
07cb6b |
stigid@ubuntu2004: UBTU-20-010424
|
|
|
07cb6b |
|
|
|
07cb6b |
-ocil_clause: 'any system exectables directories are found to not be owned by root'
|
|
|
07cb6b |
+ocil_clause: 'any system executables directories are found to not be owned by root'
|
|
|
07cb6b |
|
|
|
07cb6b |
ocil: |-
|
|
|
07cb6b |
System executables are stored in the following directories by default:
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/oval/shared.xml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/oval/shared.xml
|
|
|
07cb6b |
deleted file mode 100644
|
|
|
07cb6b |
index 28e193f827c..00000000000
|
|
|
07cb6b |
--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/oval/shared.xml
|
|
|
07cb6b |
+++ /dev/null
|
|
|
07cb6b |
@@ -1,28 +0,0 @@
|
|
|
07cb6b |
-<def-group>
|
|
|
07cb6b |
- <definition class="compliance" id="dir_ownership_library_dirs" version="1">
|
|
|
07cb6b |
- {{{ oval_metadata("
|
|
|
07cb6b |
- Checks that /lib, /lib64, /usr/lib, /usr/lib64, /lib/modules, and
|
|
|
07cb6b |
- directories therein, are owned by root.
|
|
|
07cb6b |
- ") }}}
|
|
|
07cb6b |
- <criteria operator="AND">
|
|
|
07cb6b |
- <criterion test_ref="test_dir_ownership_lib_dir" />
|
|
|
07cb6b |
- </criteria>
|
|
|
07cb6b |
- </definition>
|
|
|
07cb6b |
-
|
|
|
07cb6b |
- <unix:file_test check="all" check_existence="none_exist" comment="library directories uid root" id="test_dir_ownership_lib_dir" version="1">
|
|
|
07cb6b |
- <unix:object object_ref="object_dir_ownership_lib_dir" />
|
|
|
07cb6b |
- </unix:file_test>
|
|
|
07cb6b |
-
|
|
|
07cb6b |
-
|
|
|
07cb6b |
- <unix:file_object comment="library directories" id="object_dir_ownership_lib_dir" version="1">
|
|
|
07cb6b |
-
|
|
|
07cb6b |
- <unix:path operation="pattern match">^\/lib(|64)\/|^\/usr\/lib(|64)\/</unix:path>
|
|
|
07cb6b |
- <unix:filename xsi:nil="true" />
|
|
|
07cb6b |
- <filter action="include">state_owner_library_dirs_not_root</filter>
|
|
|
07cb6b |
- </unix:file_object>
|
|
|
07cb6b |
-
|
|
|
07cb6b |
- <unix:file_state id="state_owner_library_dirs_not_root" version="1">
|
|
|
07cb6b |
- <unix:user_id datatype="int" operation="not equal">0</unix:user_id>
|
|
|
07cb6b |
- </unix:file_state>
|
|
|
07cb6b |
-
|
|
|
07cb6b |
-</def-group>
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/rule.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/rule.yml
|
|
|
07cb6b |
index d6a0beddf6e..f0781b307b3 100644
|
|
|
07cb6b |
--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/rule.yml
|
|
|
07cb6b |
+++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/rule.yml
|
|
|
07cb6b |
@@ -27,6 +27,8 @@ rationale: |-
|
|
|
07cb6b |
severity: medium
|
|
|
07cb6b |
|
|
|
07cb6b |
identifiers:
|
|
|
07cb6b |
+ cce@rhel8: CCE-89021-0
|
|
|
07cb6b |
+ cce@rhel9: CCE-89022-8
|
|
|
07cb6b |
cce@sle12: CCE-83236-0
|
|
|
07cb6b |
cce@sle15: CCE-85735-9
|
|
|
07cb6b |
|
|
|
07cb6b |
@@ -34,6 +36,7 @@ references:
|
|
|
07cb6b |
disa: CCI-001499
|
|
|
07cb6b |
nist: CM-5(6),CM-5(6).1
|
|
|
07cb6b |
srg: SRG-OS-000259-GPOS-00100
|
|
|
07cb6b |
+ stigid@rhel8: RHEL-08-010341
|
|
|
07cb6b |
stigid@sle12: SLES-12-010874
|
|
|
07cb6b |
stigid@sle15: SLES-15-010354
|
|
|
07cb6b |
stigid@ubuntu2004: UBTU-20-010429
|
|
|
07cb6b |
@@ -49,3 +52,14 @@ ocil: |-
|
|
|
07cb6b |
For each of these directories, run the following command to find files not
|
|
|
07cb6b |
owned by root:
|
|
|
07cb6b |
$ sudo find -L $DIR ! -user root -type d -exec chown root {} \;
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+template:
|
|
|
07cb6b |
+ name: file_owner
|
|
|
07cb6b |
+ vars:
|
|
|
07cb6b |
+ filepath:
|
|
|
07cb6b |
+ - /lib/
|
|
|
07cb6b |
+ - /lib64/
|
|
|
07cb6b |
+ - /usr/lib/
|
|
|
07cb6b |
+ - /usr/lib64/
|
|
|
07cb6b |
+ recursive: 'true'
|
|
|
07cb6b |
+ fileuid: '0'
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/tests/all_dirs_ok.pass.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/tests/correct_owner.pass.sh
|
|
|
07cb6b |
similarity index 69%
|
|
|
07cb6b |
rename from linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/tests/all_dirs_ok.pass.sh
|
|
|
07cb6b |
rename to linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/tests/correct_owner.pass.sh
|
|
|
07cb6b |
index 01891664f64..a0d4990582e 100644
|
|
|
07cb6b |
--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/tests/all_dirs_ok.pass.sh
|
|
|
07cb6b |
+++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/tests/correct_owner.pass.sh
|
|
|
07cb6b |
@@ -1,4 +1,4 @@
|
|
|
07cb6b |
-# platform = multi_platform_sle
|
|
|
07cb6b |
+# platform = multi_platform_sle,multi_platform_rhel
|
|
|
07cb6b |
DIRS="/lib /lib64 /usr/lib /usr/lib64"
|
|
|
07cb6b |
for dirPath in $DIRS; do
|
|
|
07cb6b |
find "$dirPath" -type d -exec chown root '{}' \;
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/tests/nobody_owned_dir_on_lib.fail.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/tests/incorrect_owner.fail.sh
|
|
|
07cb6b |
similarity index 63%
|
|
|
07cb6b |
rename from linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/tests/nobody_owned_dir_on_lib.fail.sh
|
|
|
07cb6b |
rename to linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/tests/incorrect_owner.fail.sh
|
|
|
07cb6b |
index 59b8a1867eb..f366c2d7922 100644
|
|
|
07cb6b |
--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/tests/nobody_owned_dir_on_lib.fail.sh
|
|
|
07cb6b |
+++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/tests/incorrect_owner.fail.sh
|
|
|
07cb6b |
@@ -1,4 +1,5 @@
|
|
|
07cb6b |
-# platform = multi_platform_sle
|
|
|
07cb6b |
+# platform = multi_platform_sle,multi_platform_rhel
|
|
|
07cb6b |
+groupadd nogroup
|
|
|
07cb6b |
DIRS="/lib /lib64"
|
|
|
07cb6b |
for dirPath in $DIRS; do
|
|
|
07cb6b |
mkdir -p "$dirPath/testme" && chown nobody:nogroup "$dirPath/testme"
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/oval/shared.xml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/oval/shared.xml
|
|
|
07cb6b |
index a0e4e24b4f4..add26b2e778 100644
|
|
|
07cb6b |
--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/oval/shared.xml
|
|
|
07cb6b |
+++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/oval/shared.xml
|
|
|
07cb6b |
@@ -1,8 +1,8 @@
|
|
|
07cb6b |
<def-group>
|
|
|
07cb6b |
<definition class="compliance" id="dir_permissions_library_dirs" version="1">
|
|
|
07cb6b |
{{{ oval_metadata("
|
|
|
07cb6b |
- Checks that /lib, /lib64, /usr/lib, /usr/lib64, /lib/modules, and
|
|
|
07cb6b |
- objects therein, are not group-writable or world-writable.
|
|
|
07cb6b |
+ Checks that the directories /lib, /lib64, /usr/lib and /usr/lib64
|
|
|
07cb6b |
+ are not group-writable or world-writable.
|
|
|
07cb6b |
") }}}
|
|
|
07cb6b |
<criteria operator="AND">
|
|
|
07cb6b |
<criterion test_ref="dir_test_perms_lib_dir" />
|
|
|
07cb6b |
@@ -19,7 +19,7 @@
|
|
|
07cb6b |
<unix:path operation="pattern match">^\/lib(|64)|^\/usr\/lib(|64)</unix:path>
|
|
|
07cb6b |
<unix:filename xsi:nil="true" />
|
|
|
07cb6b |
<filter action="include">dir_state_perms_nogroupwrite_noworldwrite</filter>
|
|
|
07cb6b |
- <filter action="exclude">dir_perms_state_symlink</filter>
|
|
|
07cb6b |
+ <filter action="exclude">dir_perms_state_nogroupwrite_noworldwrite_symlink</filter>
|
|
|
07cb6b |
</unix:file_object>
|
|
|
07cb6b |
|
|
|
07cb6b |
<unix:file_state id="dir_state_perms_nogroupwrite_noworldwrite" version="1" operator="OR">
|
|
|
07cb6b |
@@ -27,7 +27,7 @@
|
|
|
07cb6b |
<unix:owrite datatype="boolean">true</unix:owrite>
|
|
|
07cb6b |
</unix:file_state>
|
|
|
07cb6b |
|
|
|
07cb6b |
- <unix:file_state id="dir_perms_state_symlink" version="1">
|
|
|
07cb6b |
+ <unix:file_state id="dir_perms_state_nogroupwrite_noworldwrite_symlink" version="1">
|
|
|
07cb6b |
<unix:type operation="equals">symbolic link</unix:type>
|
|
|
07cb6b |
</unix:file_state>
|
|
|
07cb6b |
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/rule.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/rule.yml
|
|
|
07cb6b |
index db89a5e47a1..6e62e8c6bbf 100644
|
|
|
07cb6b |
--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/rule.yml
|
|
|
07cb6b |
+++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/rule.yml
|
|
|
07cb6b |
@@ -60,3 +60,14 @@ ocil: |-
|
|
|
07cb6b |
To find shared libraries that are group-writable or world-writable,
|
|
|
07cb6b |
run the following command for each directory DIR which contains shared libraries:
|
|
|
07cb6b |
$ sudo find -L DIR -perm /022 -type d
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+template:
|
|
|
07cb6b |
+ name: file_permissions
|
|
|
07cb6b |
+ vars:
|
|
|
07cb6b |
+ filepath:
|
|
|
07cb6b |
+ - /lib/
|
|
|
07cb6b |
+ - /lib64/
|
|
|
07cb6b |
+ - /usr/lib/
|
|
|
07cb6b |
+ - /usr/lib64/
|
|
|
07cb6b |
+ recursive: 'true'
|
|
|
07cb6b |
+ filemode: '0755'
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_system_commands_dirs/ansible/shared.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_system_commands_dirs/ansible/shared.yml
|
|
|
07cb6b |
index 6b3a2905068..eec7485f90c 100644
|
|
|
07cb6b |
--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_system_commands_dirs/ansible/shared.yml
|
|
|
07cb6b |
+++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_system_commands_dirs/ansible/shared.yml
|
|
|
07cb6b |
@@ -1,4 +1,4 @@
|
|
|
07cb6b |
-# platform = multi_platform_sle,Oracle Linux 8,Red Hat Enterprise Linux 8,multi_platform_fedora
|
|
|
07cb6b |
+# platform = multi_platform_sle,Oracle Linux 8,multi_platform_rhel,multi_platform_fedora
|
|
|
07cb6b |
# reboot = false
|
|
|
07cb6b |
# strategy = restrict
|
|
|
07cb6b |
# complexity = medium
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_system_commands_dirs/bash/shared.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_system_commands_dirs/bash/shared.sh
|
|
|
07cb6b |
index a9e8c7d8e25..e352dd34a67 100644
|
|
|
07cb6b |
--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_system_commands_dirs/bash/shared.sh
|
|
|
07cb6b |
+++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_system_commands_dirs/bash/shared.sh
|
|
|
07cb6b |
@@ -1,4 +1,4 @@
|
|
|
07cb6b |
-# platform = multi_platform_sle,Oracle Linux 8,Red Hat Enterprise Linux 8,multi_platform_fedora,multi_platform_ubuntu
|
|
|
07cb6b |
+# platform = multi_platform_sle,Oracle Linux 8,multi_platform_rhel,multi_platform_fedora,multi_platform_ubuntu
|
|
|
07cb6b |
|
|
|
07cb6b |
for SYSCMDFILES in /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin
|
|
|
07cb6b |
do
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/ansible/shared.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/ansible/shared.yml
|
|
|
07cb6b |
deleted file mode 100644
|
|
|
07cb6b |
index de81a3703b4..00000000000
|
|
|
07cb6b |
--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/ansible/shared.yml
|
|
|
07cb6b |
+++ /dev/null
|
|
|
07cb6b |
@@ -1,18 +0,0 @@
|
|
|
07cb6b |
-# platform = Red Hat Virtualization 4,multi_platform_fedora,multi_platform_rhel,multi_platform_ol,multi_platform_sle
|
|
|
07cb6b |
-# reboot = false
|
|
|
07cb6b |
-# strategy = restrict
|
|
|
07cb6b |
-# complexity = medium
|
|
|
07cb6b |
-# disruption = medium
|
|
|
07cb6b |
-- name: "Read list libraries without root ownership"
|
|
|
07cb6b |
- command: "find -L /usr/lib /usr/lib64 /lib /lib64 \\! -user root"
|
|
|
07cb6b |
- register: libraries_not_owned_by_root
|
|
|
07cb6b |
- changed_when: False
|
|
|
07cb6b |
- failed_when: False
|
|
|
07cb6b |
- check_mode: no
|
|
|
07cb6b |
-
|
|
|
07cb6b |
-- name: "Set ownership of system libraries to root"
|
|
|
07cb6b |
- file:
|
|
|
07cb6b |
- path: "{{ item }}"
|
|
|
07cb6b |
- owner: "root"
|
|
|
07cb6b |
- with_items: "{{ libraries_not_owned_by_root.stdout_lines }}"
|
|
|
07cb6b |
- when: libraries_not_owned_by_root | length > 0
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/bash/shared.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/bash/shared.sh
|
|
|
07cb6b |
deleted file mode 100644
|
|
|
07cb6b |
index c75167d2fe7..00000000000
|
|
|
07cb6b |
--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/bash/shared.sh
|
|
|
07cb6b |
+++ /dev/null
|
|
|
07cb6b |
@@ -1,8 +0,0 @@
|
|
|
07cb6b |
-# platform = Red Hat Virtualization 4,multi_platform_fedora,multi_platform_rhel,multi_platform_ol,multi_platform_sle
|
|
|
07cb6b |
-for LIBDIR in /usr/lib /usr/lib64 /lib /lib64
|
|
|
07cb6b |
-do
|
|
|
07cb6b |
- if [ -d $LIBDIR ]
|
|
|
07cb6b |
- then
|
|
|
07cb6b |
- find -L $LIBDIR \! -user root -exec chown root {} \;
|
|
|
07cb6b |
- fi
|
|
|
07cb6b |
-done
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/oval/shared.xml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/oval/shared.xml
|
|
|
07cb6b |
deleted file mode 100644
|
|
|
07cb6b |
index 59ee3d82a21..00000000000
|
|
|
07cb6b |
--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/oval/shared.xml
|
|
|
07cb6b |
+++ /dev/null
|
|
|
07cb6b |
@@ -1,39 +0,0 @@
|
|
|
07cb6b |
-<def-group>
|
|
|
07cb6b |
- <definition class="compliance" id="file_ownership_library_dirs" version="1">
|
|
|
07cb6b |
- {{{ oval_metadata("
|
|
|
07cb6b |
- Checks that /lib, /lib64, /usr/lib, /usr/lib64, /lib/modules, and
|
|
|
07cb6b |
- objects therein, are owned by root.
|
|
|
07cb6b |
- ") }}}
|
|
|
07cb6b |
- <criteria operator="AND">
|
|
|
07cb6b |
- <criterion test_ref="test_ownership_lib_dir" />
|
|
|
07cb6b |
- <criterion test_ref="test_ownership_lib_files" />
|
|
|
07cb6b |
- </criteria>
|
|
|
07cb6b |
- </definition>
|
|
|
07cb6b |
-
|
|
|
07cb6b |
- <unix:file_test check="all" check_existence="none_exist" comment="library directories uid root" id="test_ownership_lib_dir" version="1">
|
|
|
07cb6b |
- <unix:object object_ref="object_file_ownership_lib_dir" />
|
|
|
07cb6b |
- </unix:file_test>
|
|
|
07cb6b |
-
|
|
|
07cb6b |
- <unix:file_test check="all" check_existence="none_exist" comment="library files uid root" id="test_ownership_lib_files" version="1">
|
|
|
07cb6b |
- <unix:object object_ref="object_file_ownership_lib_files" />
|
|
|
07cb6b |
- </unix:file_test>
|
|
|
07cb6b |
-
|
|
|
07cb6b |
- <unix:file_object comment="library directories" id="object_file_ownership_lib_dir" version="1">
|
|
|
07cb6b |
-
|
|
|
07cb6b |
- <unix:path operation="pattern match">^\/lib(|64)\/|^\/usr\/lib(|64)\/</unix:path>
|
|
|
07cb6b |
- <unix:filename xsi:nil="true" />
|
|
|
07cb6b |
- <filter action="include">state_owner_libraries_not_root</filter>
|
|
|
07cb6b |
- </unix:file_object>
|
|
|
07cb6b |
-
|
|
|
07cb6b |
- <unix:file_object comment="library files" id="object_file_ownership_lib_files" version="1">
|
|
|
07cb6b |
-
|
|
|
07cb6b |
- <unix:path operation="pattern match">^\/lib(|64)\/|^\/usr\/lib(|64)\/</unix:path>
|
|
|
07cb6b |
- <unix:filename operation="pattern match">^.*$</unix:filename>
|
|
|
07cb6b |
- <filter action="include">state_owner_libraries_not_root</filter>
|
|
|
07cb6b |
- </unix:file_object>
|
|
|
07cb6b |
-
|
|
|
07cb6b |
- <unix:file_state id="state_owner_libraries_not_root" version="1">
|
|
|
07cb6b |
- <unix:user_id datatype="int" operation="not equal">0</unix:user_id>
|
|
|
07cb6b |
- </unix:file_state>
|
|
|
07cb6b |
-
|
|
|
07cb6b |
-</def-group>
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/rule.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/rule.yml
|
|
|
07cb6b |
index d80681c1e65..b6bc18e8310 100644
|
|
|
07cb6b |
--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/rule.yml
|
|
|
07cb6b |
+++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/rule.yml
|
|
|
07cb6b |
@@ -60,3 +60,14 @@ ocil: |-
|
|
|
07cb6b |
For each of these directories, run the following command to find files not
|
|
|
07cb6b |
owned by root:
|
|
|
07cb6b |
$ sudo find -L $DIR ! -user root -exec chown root {} \;
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+template:
|
|
|
07cb6b |
+ name: file_owner
|
|
|
07cb6b |
+ vars:
|
|
|
07cb6b |
+ filepath:
|
|
|
07cb6b |
+ - /lib/
|
|
|
07cb6b |
+ - /lib64/
|
|
|
07cb6b |
+ - /usr/lib/
|
|
|
07cb6b |
+ - /usr/lib64/
|
|
|
07cb6b |
+ file_regex: ^.*$
|
|
|
07cb6b |
+ fileuid: '0'
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/tests/correct_owner.pass.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/tests/correct_owner.pass.sh
|
|
|
07cb6b |
new file mode 100644
|
|
|
07cb6b |
index 00000000000..92c6a0889d4
|
|
|
07cb6b |
--- /dev/null
|
|
|
07cb6b |
+++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/tests/correct_owner.pass.sh
|
|
|
07cb6b |
@@ -0,0 +1,9 @@
|
|
|
07cb6b |
+# platform = multi_platform_sle,multi_platform_rhel,multi_platform_fedora,multi_platform_ubuntu
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+for SYSLIBDIRS in /lib /lib64 /usr/lib /usr/lib64
|
|
|
07cb6b |
+do
|
|
|
07cb6b |
+ if [[ -d $SYSLIBDIRS ]]
|
|
|
07cb6b |
+ then
|
|
|
07cb6b |
+ find $SYSLIBDIRS ! -user root -type f -exec chown root '{}' \;
|
|
|
07cb6b |
+ fi
|
|
|
07cb6b |
+done
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/tests/incorrect_owner.fail.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/tests/incorrect_owner.fail.sh
|
|
|
07cb6b |
new file mode 100644
|
|
|
07cb6b |
index 00000000000..84da71f45f7
|
|
|
07cb6b |
--- /dev/null
|
|
|
07cb6b |
+++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/tests/incorrect_owner.fail.sh
|
|
|
07cb6b |
@@ -0,0 +1,11 @@
|
|
|
07cb6b |
+# platform = multi_platform_sle,multi_platform_rhel,multi_platform_fedora,multi_platform_ubuntu
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+useradd user_test
|
|
|
07cb6b |
+for TESTFILE in /lib/test_me /lib64/test_me /usr/lib/test_me /usr/lib64/test_me
|
|
|
07cb6b |
+do
|
|
|
07cb6b |
+ if [[ ! -f $TESTFILE ]]
|
|
|
07cb6b |
+ then
|
|
|
07cb6b |
+ touch $TESTFILE
|
|
|
07cb6b |
+ fi
|
|
|
07cb6b |
+ chown user_test $TESTFILE
|
|
|
07cb6b |
+done
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/ansible/shared.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/ansible/shared.yml
|
|
|
07cb6b |
deleted file mode 100644
|
|
|
07cb6b |
index cf9eebace8b..00000000000
|
|
|
07cb6b |
--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/ansible/shared.yml
|
|
|
07cb6b |
+++ /dev/null
|
|
|
07cb6b |
@@ -1,18 +0,0 @@
|
|
|
07cb6b |
-# platform = Red Hat Virtualization 4,multi_platform_fedora,multi_platform_rhel,multi_platform_ol,multi_platform_sle
|
|
|
07cb6b |
-# reboot = false
|
|
|
07cb6b |
-# strategy = restrict
|
|
|
07cb6b |
-# complexity = high
|
|
|
07cb6b |
-# disruption = medium
|
|
|
07cb6b |
-- name: "Read list of world and group writable files in libraries directories"
|
|
|
07cb6b |
- command: "find /lib /lib64 /usr/lib /usr/lib64 -perm /022 -type f"
|
|
|
07cb6b |
- register: world_writable_library_files
|
|
|
07cb6b |
- changed_when: False
|
|
|
07cb6b |
- failed_when: False
|
|
|
07cb6b |
- check_mode: no
|
|
|
07cb6b |
-
|
|
|
07cb6b |
-- name: "Disable world/group writability to library files"
|
|
|
07cb6b |
- file:
|
|
|
07cb6b |
- path: "{{ item }}"
|
|
|
07cb6b |
- mode: "go-w"
|
|
|
07cb6b |
- with_items: "{{ world_writable_library_files.stdout_lines }}"
|
|
|
07cb6b |
- when: world_writable_library_files.stdout_lines | length > 0
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/bash/shared.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/bash/shared.sh
|
|
|
07cb6b |
deleted file mode 100644
|
|
|
07cb6b |
index af04ad625d3..00000000000
|
|
|
07cb6b |
--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/bash/shared.sh
|
|
|
07cb6b |
+++ /dev/null
|
|
|
07cb6b |
@@ -1,5 +0,0 @@
|
|
|
07cb6b |
-# platform = multi_platform_all
|
|
|
07cb6b |
-DIRS="/lib /lib64 /usr/lib /usr/lib64"
|
|
|
07cb6b |
-for dirPath in $DIRS; do
|
|
|
07cb6b |
- find "$dirPath" -perm /022 -type f -exec chmod go-w '{}' \;
|
|
|
07cb6b |
-done
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/oval/shared.xml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/oval/shared.xml
|
|
|
07cb6b |
deleted file mode 100644
|
|
|
07cb6b |
index f25c52260c4..00000000000
|
|
|
07cb6b |
--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/oval/shared.xml
|
|
|
07cb6b |
+++ /dev/null
|
|
|
07cb6b |
@@ -1,46 +0,0 @@
|
|
|
07cb6b |
-<def-group>
|
|
|
07cb6b |
- <definition class="compliance" id="file_permissions_library_dirs" version="1">
|
|
|
07cb6b |
- {{{ oval_metadata("
|
|
|
07cb6b |
- Checks that /lib, /lib64, /usr/lib, /usr/lib64, /lib/modules, and
|
|
|
07cb6b |
- objects therein, are not group-writable or world-writable.
|
|
|
07cb6b |
- ") }}}
|
|
|
07cb6b |
- <criteria operator="AND">
|
|
|
07cb6b |
- <criterion test_ref="test_perms_lib_dir" />
|
|
|
07cb6b |
- <criterion test_ref="test_perms_lib_files" />
|
|
|
07cb6b |
- </criteria>
|
|
|
07cb6b |
- </definition>
|
|
|
07cb6b |
-
|
|
|
07cb6b |
- <unix:file_test check="all" check_existence="none_exist" comment="library directories go-w" id="test_perms_lib_dir" version="1">
|
|
|
07cb6b |
- <unix:object object_ref="object_file_permissions_lib_dir" />
|
|
|
07cb6b |
- </unix:file_test>
|
|
|
07cb6b |
-
|
|
|
07cb6b |
- <unix:file_test check="all" check_existence="none_exist" comment="library files go-w" id="test_perms_lib_files" version="1">
|
|
|
07cb6b |
- <unix:object object_ref="object_file_permissions_lib_files" />
|
|
|
07cb6b |
- </unix:file_test>
|
|
|
07cb6b |
-
|
|
|
07cb6b |
- <unix:file_object comment="library directories" id="object_file_permissions_lib_dir" version="1">
|
|
|
07cb6b |
-
|
|
|
07cb6b |
- <unix:path operation="pattern match">^\/lib(|64)|^\/usr\/lib(|64)</unix:path>
|
|
|
07cb6b |
- <unix:filename xsi:nil="true" />
|
|
|
07cb6b |
- <filter action="include">state_perms_nogroupwrite_noworldwrite</filter>
|
|
|
07cb6b |
- <filter action="exclude">perms_state_symlink</filter>
|
|
|
07cb6b |
- </unix:file_object>
|
|
|
07cb6b |
-
|
|
|
07cb6b |
- <unix:file_object comment="library files" id="object_file_permissions_lib_files" version="1">
|
|
|
07cb6b |
-
|
|
|
07cb6b |
- <unix:path operation="pattern match">^\/lib(|64)|^\/usr\/lib(|64)</unix:path>
|
|
|
07cb6b |
- <unix:filename operation="pattern match">^.*$</unix:filename>
|
|
|
07cb6b |
- <filter action="include">state_perms_nogroupwrite_noworldwrite</filter>
|
|
|
07cb6b |
- <filter action="exclude">perms_state_symlink</filter>
|
|
|
07cb6b |
- </unix:file_object>
|
|
|
07cb6b |
-
|
|
|
07cb6b |
- <unix:file_state id="state_perms_nogroupwrite_noworldwrite" version="1" operator="OR">
|
|
|
07cb6b |
- <unix:gwrite datatype="boolean">true</unix:gwrite>
|
|
|
07cb6b |
- <unix:owrite datatype="boolean">true</unix:owrite>
|
|
|
07cb6b |
- </unix:file_state>
|
|
|
07cb6b |
-
|
|
|
07cb6b |
- <unix:file_state id="perms_state_symlink" version="1">
|
|
|
07cb6b |
- <unix:type operation="equals">symbolic link</unix:type>
|
|
|
07cb6b |
- </unix:file_state>
|
|
|
07cb6b |
-
|
|
|
07cb6b |
-</def-group>
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/rule.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/rule.yml
|
|
|
07cb6b |
index 9a07e76929e..5a708cf78c3 100644
|
|
|
07cb6b |
--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/rule.yml
|
|
|
07cb6b |
+++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/rule.yml
|
|
|
07cb6b |
@@ -61,3 +61,14 @@ ocil: |-
|
|
|
07cb6b |
To find shared libraries that are group-writable or world-writable,
|
|
|
07cb6b |
run the following command for each directory DIR which contains shared libraries:
|
|
|
07cb6b |
$ sudo find -L DIR -perm /022 -type f
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+template:
|
|
|
07cb6b |
+ name: file_permissions
|
|
|
07cb6b |
+ vars:
|
|
|
07cb6b |
+ filepath:
|
|
|
07cb6b |
+ - /lib/
|
|
|
07cb6b |
+ - /lib64/
|
|
|
07cb6b |
+ - /usr/lib/
|
|
|
07cb6b |
+ - /usr/lib64/
|
|
|
07cb6b |
+ file_regex: ^.*$
|
|
|
07cb6b |
+ filemode: '0755'
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/tests/incorrect_permissions.fail.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/tests/lenient_permissions.fail.sh
|
|
|
07cb6b |
similarity index 100%
|
|
|
07cb6b |
rename from linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/tests/incorrect_permissions.fail.sh
|
|
|
07cb6b |
rename to linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/tests/lenient_permissions.fail.sh
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/rule.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/rule.yml
|
|
|
07cb6b |
index eaf04c8d36c..ec135b5279c 100644
|
|
|
07cb6b |
--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/rule.yml
|
|
|
07cb6b |
+++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/rule.yml
|
|
|
07cb6b |
@@ -4,7 +4,7 @@ prodtype: fedora,ol8,rhel8,rhel9,sle12,sle15,ubuntu2004
|
|
|
07cb6b |
|
|
|
07cb6b |
title: |-
|
|
|
07cb6b |
Verify the system-wide library files in directories
|
|
|
07cb6b |
- "/lib", "/lib64", "/usr/lib/" and "/usr/lib64" are owned by root.
|
|
|
07cb6b |
+ "/lib", "/lib64", "/usr/lib/" and "/usr/lib64" are group-owned by root.
|
|
|
07cb6b |
|
|
|
07cb6b |
description: |-
|
|
|
07cb6b |
System-wide library files are stored in the following directories
|
|
|
07cb6b |
@@ -15,7 +15,7 @@ description: |-
|
|
|
07cb6b |
/usr/lib64
|
|
|
07cb6b |
|
|
|
07cb6b |
All system-wide shared library files should be protected from unauthorised
|
|
|
07cb6b |
- access. If any of these files is not owned by root, correct its owner with
|
|
|
07cb6b |
+ access. If any of these files is not group-owned by root, correct its group-owner with
|
|
|
07cb6b |
the following command:
|
|
|
07cb6b |
$ sudo chgrp root FILE
|
|
|
07cb6b |
|
|
|
07cb6b |
@@ -48,7 +48,7 @@ references:
|
|
|
07cb6b |
stigid@sle15: SLES-15-010355
|
|
|
07cb6b |
stigid@ubuntu2004: UBTU-20-01430
|
|
|
07cb6b |
|
|
|
07cb6b |
-ocil_clause: 'system wide library files are not group owned by root'
|
|
|
07cb6b |
+ocil_clause: 'system wide library files are not group-owned by root'
|
|
|
07cb6b |
|
|
|
07cb6b |
ocil: |-
|
|
|
07cb6b |
System-wide library files are stored in the following directories:
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/correct_groupowner.pass.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/correct_groupowner.pass.sh
|
|
|
07cb6b |
index 0e982c3b8ca..5356d3742d3 100644
|
|
|
07cb6b |
--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/correct_groupowner.pass.sh
|
|
|
07cb6b |
+++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/correct_groupowner.pass.sh
|
|
|
07cb6b |
@@ -1,4 +1,4 @@
|
|
|
07cb6b |
-# platform = multi_platform_sle,Red Hat Enterprise Linux 8,multi_platform_fedora,multi_platform_ubuntu
|
|
|
07cb6b |
+# platform = multi_platform_sle,multi_platform_rhel,multi_platform_fedora,multi_platform_ubuntu
|
|
|
07cb6b |
|
|
|
07cb6b |
for SYSLIBDIRS in /lib /lib64 /usr/lib /usr/lib64
|
|
|
07cb6b |
do
|
|
|
07cb6b |
diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/incorrect_groupowner.fail.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/incorrect_groupowner.fail.sh
|
|
|
07cb6b |
index 23a7703f57d..7352b60aa4b 100644
|
|
|
07cb6b |
--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/incorrect_groupowner.fail.sh
|
|
|
07cb6b |
+++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/incorrect_groupowner.fail.sh
|
|
|
07cb6b |
@@ -1,4 +1,4 @@
|
|
|
07cb6b |
-# platform = multi_platform_sle,Red Hat Enterprise Linux 8,multi_platform_fedora,multi_platform_ubuntu
|
|
|
07cb6b |
+# platform = multi_platform_sle,multi_platform_rhel,multi_platform_fedora,multi_platform_ubuntu
|
|
|
07cb6b |
|
|
|
07cb6b |
groupadd group_test
|
|
|
07cb6b |
for TESTFILE in /lib/test_me /lib64/test_me /usr/lib/test_me /usr/lib64/test_me
|
|
|
07cb6b |
diff --git a/products/rhel8/profiles/stig.profile b/products/rhel8/profiles/stig.profile
|
|
|
07cb6b |
index ff23f83cfbf..88b3a7e3783 100644
|
|
|
07cb6b |
--- a/products/rhel8/profiles/stig.profile
|
|
|
07cb6b |
+++ b/products/rhel8/profiles/stig.profile
|
|
|
07cb6b |
@@ -235,8 +235,13 @@ selections:
|
|
|
07cb6b |
# RHEL-08-010340
|
|
|
07cb6b |
- file_ownership_library_dirs
|
|
|
07cb6b |
|
|
|
07cb6b |
+ # RHEL-08-010341
|
|
|
07cb6b |
+ - dir_ownership_library_dirs
|
|
|
07cb6b |
+
|
|
|
07cb6b |
# RHEL-08-010350
|
|
|
07cb6b |
- root_permissions_syslibrary_files
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+ # RHEL-08-010351
|
|
|
07cb6b |
- dir_group_ownership_library_dirs
|
|
|
07cb6b |
|
|
|
07cb6b |
# RHEL-08-010360
|
|
|
07cb6b |
diff --git a/products/rhel9/profiles/stig.profile b/products/rhel9/profiles/stig.profile
|
|
|
07cb6b |
index 8cc6d132591..65465be2c07 100644
|
|
|
07cb6b |
--- a/products/rhel9/profiles/stig.profile
|
|
|
07cb6b |
+++ b/products/rhel9/profiles/stig.profile
|
|
|
07cb6b |
@@ -236,8 +236,13 @@ selections:
|
|
|
07cb6b |
# RHEL-08-010340
|
|
|
07cb6b |
- file_ownership_library_dirs
|
|
|
07cb6b |
|
|
|
07cb6b |
+ # RHEL-08-010341
|
|
|
07cb6b |
+ - dir_ownership_library_dirs
|
|
|
07cb6b |
+
|
|
|
07cb6b |
# RHEL-08-010350
|
|
|
07cb6b |
- root_permissions_syslibrary_files
|
|
|
07cb6b |
+
|
|
|
07cb6b |
+ # RHEL-08-010351
|
|
|
07cb6b |
- dir_group_ownership_library_dirs
|
|
|
07cb6b |
|
|
|
07cb6b |
# RHEL-08-010360
|
|
|
07cb6b |
diff --git a/shared/references/cce-redhat-avail.txt b/shared/references/cce-redhat-avail.txt
|
|
|
07cb6b |
index 8aad24b20f7..eb3f17f4f3d 100644
|
|
|
07cb6b |
--- a/shared/references/cce-redhat-avail.txt
|
|
|
07cb6b |
+++ b/shared/references/cce-redhat-avail.txt
|
|
|
07cb6b |
@@ -2957,8 +2957,6 @@ CCE-89017-8
|
|
|
07cb6b |
CCE-89018-6
|
|
|
07cb6b |
CCE-89019-4
|
|
|
07cb6b |
CCE-89020-2
|
|
|
07cb6b |
-CCE-89021-0
|
|
|
07cb6b |
-CCE-89022-8
|
|
|
07cb6b |
CCE-89023-6
|
|
|
07cb6b |
CCE-89024-4
|
|
|
07cb6b |
CCE-89025-1
|
|
|
07cb6b |
diff --git a/shared/templates/file_groupowner/ansible.template b/shared/templates/file_groupowner/ansible.template
|
|
|
07cb6b |
index 68fc2e1e17e..0b4ab594155 100644
|
|
|
07cb6b |
--- a/shared/templates/file_groupowner/ansible.template
|
|
|
07cb6b |
+++ b/shared/templates/file_groupowner/ansible.template
|
|
|
07cb6b |
@@ -12,6 +12,7 @@
|
|
|
07cb6b |
paths: "{{{ path }}}"
|
|
|
07cb6b |
patterns: {{{ FILE_REGEX[loop.index0] }}}
|
|
|
07cb6b |
use_regex: yes
|
|
|
07cb6b |
+ hidden: yes
|
|
|
07cb6b |
register: files_found
|
|
|
07cb6b |
|
|
|
07cb6b |
- name: Ensure group owner on {{{ path }}} file(s) matching {{{ FILE_REGEX[loop.index0] }}}
|
|
|
07cb6b |
diff --git a/shared/templates/file_groupowner/oval.template b/shared/templates/file_groupowner/oval.template
|
|
|
07cb6b |
index fd2e5db5d93..64a494471a8 100644
|
|
|
07cb6b |
--- a/shared/templates/file_groupowner/oval.template
|
|
|
07cb6b |
+++ b/shared/templates/file_groupowner/oval.template
|
|
|
07cb6b |
@@ -45,6 +45,10 @@
|
|
|
07cb6b |
{{%- else %}}
|
|
|
07cb6b |
<unix:filepath{{% if FILEPATH_IS_REGEX %}} operation="pattern match"{{% endif %}}>{{{ filepath }}}</unix:filepath>
|
|
|
07cb6b |
{{%- endif %}}
|
|
|
07cb6b |
+ <filter action="exclude">symlink_file_groupowner{{{ FILEID }}}_uid_{{{ FILEGID }}}</filter>
|
|
|
07cb6b |
</unix:file_object>
|
|
|
07cb6b |
{{% endfor %}}
|
|
|
07cb6b |
+ <unix:file_state id="symlink_file_groupowner{{{ FILEID }}}_uid_{{{ FILEGID }}}" version="1">
|
|
|
07cb6b |
+ <unix:type operation="equals">symbolic link</unix:type>
|
|
|
07cb6b |
+ </unix:file_state>
|
|
|
07cb6b |
</def-group>
|
|
|
07cb6b |
diff --git a/shared/templates/file_owner/ansible.template b/shared/templates/file_owner/ansible.template
|
|
|
07cb6b |
index 590c9fc6055..dba9e65a277 100644
|
|
|
07cb6b |
--- a/shared/templates/file_owner/ansible.template
|
|
|
07cb6b |
+++ b/shared/templates/file_owner/ansible.template
|
|
|
07cb6b |
@@ -12,6 +12,7 @@
|
|
|
07cb6b |
paths: "{{{ path }}}"
|
|
|
07cb6b |
patterns: {{{ FILE_REGEX[loop.index0] }}}
|
|
|
07cb6b |
use_regex: yes
|
|
|
07cb6b |
+ hidden: yes
|
|
|
07cb6b |
register: files_found
|
|
|
07cb6b |
|
|
|
07cb6b |
- name: Ensure group owner on {{{ path }}} file(s) matching {{{ FILE_REGEX[loop.index0] }}}
|
|
|
07cb6b |
diff --git a/shared/templates/file_owner/oval.template b/shared/templates/file_owner/oval.template
|
|
|
07cb6b |
index 105e29c81c8..777831d790d 100644
|
|
|
07cb6b |
--- a/shared/templates/file_owner/oval.template
|
|
|
07cb6b |
+++ b/shared/templates/file_owner/oval.template
|
|
|
07cb6b |
@@ -44,6 +44,10 @@
|
|
|
07cb6b |
{{%- else %}}
|
|
|
07cb6b |
<unix:filepath{{% if FILEPATH_IS_REGEX %}} operation="pattern match"{{% endif %}}>{{{ filepath }}}</unix:filepath>
|
|
|
07cb6b |
{{%- endif %}}
|
|
|
07cb6b |
+ <filter action="exclude">symlink_file_owner{{{ FILEID }}}_uid_{{{ FILEUID }}}</filter>
|
|
|
07cb6b |
</unix:file_object>
|
|
|
07cb6b |
{{% endfor %}}
|
|
|
07cb6b |
+ <unix:file_state id="symlink_file_owner{{{ FILEID }}}_uid_{{{ FILEUID }}}" version="1">
|
|
|
07cb6b |
+ <unix:type operation="equals">symbolic link</unix:type>
|
|
|
07cb6b |
+ </unix:file_state>
|
|
|
07cb6b |
</def-group>
|
|
|
07cb6b |
diff --git a/shared/templates/file_permissions/ansible.template b/shared/templates/file_permissions/ansible.template
|
|
|
07cb6b |
index fc211bdc4c3..6d4dedcee51 100644
|
|
|
07cb6b |
--- a/shared/templates/file_permissions/ansible.template
|
|
|
07cb6b |
+++ b/shared/templates/file_permissions/ansible.template
|
|
|
07cb6b |
@@ -12,6 +12,7 @@
|
|
|
07cb6b |
paths: "{{{ path }}}"
|
|
|
07cb6b |
patterns: {{{ FILE_REGEX[loop.index0] }}}
|
|
|
07cb6b |
use_regex: yes
|
|
|
07cb6b |
+ hidden: yes
|
|
|
07cb6b |
register: files_found
|
|
|
07cb6b |
|
|
|
07cb6b |
- name: Set permissions for {{{ path }}} file(s)
|
|
|
07cb6b |
diff --git a/tests/data/profile_stability/rhel8/stig.profile b/tests/data/profile_stability/rhel8/stig.profile
|
|
|
07cb6b |
index b5621425b96..c5a9b6a32ad 100644
|
|
|
07cb6b |
--- a/tests/data/profile_stability/rhel8/stig.profile
|
|
|
07cb6b |
+++ b/tests/data/profile_stability/rhel8/stig.profile
|
|
|
07cb6b |
@@ -181,6 +181,7 @@ selections:
|
|
|
07cb6b |
- dconf_gnome_screensaver_idle_delay
|
|
|
07cb6b |
- dconf_gnome_screensaver_lock_enabled
|
|
|
07cb6b |
- dir_group_ownership_library_dirs
|
|
|
07cb6b |
+- dir_ownership_library_dirs
|
|
|
07cb6b |
- dir_permissions_library_dirs
|
|
|
07cb6b |
- dir_perms_world_writable_root_owned
|
|
|
07cb6b |
- dir_perms_world_writable_sticky_bits
|
|
|
07cb6b |
diff --git a/tests/data/profile_stability/rhel8/stig_gui.profile b/tests/data/profile_stability/rhel8/stig_gui.profile
|
|
|
07cb6b |
index 31221ed632c..32d195e28aa 100644
|
|
|
07cb6b |
--- a/tests/data/profile_stability/rhel8/stig_gui.profile
|
|
|
07cb6b |
+++ b/tests/data/profile_stability/rhel8/stig_gui.profile
|
|
|
07cb6b |
@@ -192,6 +192,7 @@ selections:
|
|
|
07cb6b |
- dconf_gnome_screensaver_idle_delay
|
|
|
07cb6b |
- dconf_gnome_screensaver_lock_enabled
|
|
|
07cb6b |
- dir_group_ownership_library_dirs
|
|
|
07cb6b |
+- dir_ownership_library_dirs
|
|
|
07cb6b |
- dir_permissions_library_dirs
|
|
|
07cb6b |
- dir_perms_world_writable_root_owned
|
|
|
07cb6b |
- dir_perms_world_writable_sticky_bits
|