Blame SOURCES/scap-security-guide-0.1.58-add_RHEL_08_020240-PR_7330.patch

362bfa
From 3d24d93e200f53f3845fffbc8764b8e48517c7b2 Mon Sep 17 00:00:00 2001
362bfa
From: Gabriel Becker <ggasparb@redhat.com>
362bfa
Date: Wed, 4 Aug 2021 16:57:50 +0200
362bfa
Subject: [PATCH] Assign RHEL-08-020240 to account_unique_id and add test
362bfa
 scenarios.
362bfa
362bfa
---
362bfa
 .../accounts-restrictions/account_unique_id/oval/shared.xml  | 2 +-
362bfa
 .../accounts-restrictions/account_unique_id/rule.yml         | 4 +++-
362bfa
 .../account_unique_id/tests/correct_value.pass.sh            | 2 ++
362bfa
 .../account_unique_id/tests/wrong_value.fail.sh              | 5 +++++
362bfa
 products/rhel8/profiles/stig.profile                         | 1 +
362bfa
 shared/references/cce-redhat-avail.txt                       | 1 -
362bfa
 tests/data/profile_stability/rhel8/stig.profile              | 1 +
362bfa
 tests/data/profile_stability/rhel8/stig_gui.profile          | 1 +
362bfa
 8 files changed, 14 insertions(+), 3 deletions(-)
362bfa
 create mode 100644 linux_os/guide/system/accounts/accounts-restrictions/account_unique_id/tests/correct_value.pass.sh
362bfa
 create mode 100644 linux_os/guide/system/accounts/accounts-restrictions/account_unique_id/tests/wrong_value.fail.sh
362bfa
362bfa
diff --git a/linux_os/guide/system/accounts/accounts-restrictions/account_unique_id/oval/shared.xml b/linux_os/guide/system/accounts/accounts-restrictions/account_unique_id/oval/shared.xml
362bfa
index be45c518115..491ad4587ee 100644
362bfa
--- a/linux_os/guide/system/accounts/accounts-restrictions/account_unique_id/oval/shared.xml
362bfa
+++ b/linux_os/guide/system/accounts/accounts-restrictions/account_unique_id/oval/shared.xml
362bfa
@@ -7,7 +7,7 @@
362bfa
 
362bfa
   </definition>
362bfa
 
362bfa
-  
362bfa
+  
362bfa
   <unix:password_object id="obj_all_uids" version="1">
362bfa
     <unix:username operation="pattern match">.*</unix:username>
362bfa
   </unix:password_object>
362bfa
diff --git a/linux_os/guide/system/accounts/accounts-restrictions/account_unique_id/rule.yml b/linux_os/guide/system/accounts/accounts-restrictions/account_unique_id/rule.yml
362bfa
index 731632f7f5a..e55901dbdc5 100644
362bfa
--- a/linux_os/guide/system/accounts/accounts-restrictions/account_unique_id/rule.yml
362bfa
+++ b/linux_os/guide/system/accounts/accounts-restrictions/account_unique_id/rule.yml
362bfa
@@ -12,6 +12,7 @@ severity: medium
362bfa
 
362bfa
 identifiers:
362bfa
     cce@rhel7: CCE-85857-1
362bfa
+    cce@rhel8: CCE-89903-9
362bfa
     cce@sle12: CCE-83196-6
362bfa
     cce@sle15: CCE-83277-4
362bfa
 
362bfa
@@ -19,7 +20,8 @@ references:
362bfa
     cis@rhel7: 6.2.7
362bfa
     disa: CCI-000764,CCI-000804
362bfa
     nist@sle12: IA-2,IA-2.1,IA-8,IA-8.1
362bfa
-    srg: SRG-OS-000104-GPOS-00051,SRG-OS-000121-GPOS-00062
362bfa
+    srg: SRG-OS-000104-GPOS-00051,SRG-OS-000121-GPOS-00062,SRG-OS-000042-GPOS-00020
362bfa
+    stigid@rhel8: RHEL-08-020240
362bfa
     stigid@sle12: SLES-12-010640
362bfa
     stigid@sle15: SLES-15-010230
362bfa
 
362bfa
diff --git a/linux_os/guide/system/accounts/accounts-restrictions/account_unique_id/tests/correct_value.pass.sh b/linux_os/guide/system/accounts/accounts-restrictions/account_unique_id/tests/correct_value.pass.sh
362bfa
new file mode 100644
362bfa
index 00000000000..645c46eb847
362bfa
--- /dev/null
362bfa
+++ b/linux_os/guide/system/accounts/accounts-restrictions/account_unique_id/tests/correct_value.pass.sh
362bfa
@@ -0,0 +1,2 @@
362bfa
+#!/bin/bash
362bfa
+# remediation = none
362bfa
diff --git a/linux_os/guide/system/accounts/accounts-restrictions/account_unique_id/tests/wrong_value.fail.sh b/linux_os/guide/system/accounts/accounts-restrictions/account_unique_id/tests/wrong_value.fail.sh
362bfa
new file mode 100644
362bfa
index 00000000000..cc7f2215041
362bfa
--- /dev/null
362bfa
+++ b/linux_os/guide/system/accounts/accounts-restrictions/account_unique_id/tests/wrong_value.fail.sh
362bfa
@@ -0,0 +1,5 @@
362bfa
+#!/bin/bash
362bfa
+# remediation = none
362bfa
+
362bfa
+echo "test_user:x:30090:30090:Test User:/home/test_user:/usr/bin/bash" >> /etc/passwd
362bfa
+echo "test_user_2:x:30090:30090:Test User 2:/home/test_user_2:/usr/bin/bash" >> /etc/passwd
362bfa
diff --git a/products/rhel8/profiles/stig.profile b/products/rhel8/profiles/stig.profile
362bfa
index ec0a3b17537..bdddfef846f 100644
362bfa
--- a/products/rhel8/profiles/stig.profile
362bfa
+++ b/products/rhel8/profiles/stig.profile
362bfa
@@ -552,6 +552,7 @@ selections:
362bfa
     - accounts_password_minlen_login_defs
362bfa
 
362bfa
     # RHEL-08-020240
362bfa
+    - account_unique_id
362bfa
 
362bfa
     # RHEL-08-020250
362bfa
     - sssd_enable_smartcards
362bfa
diff --git a/shared/references/cce-redhat-avail.txt b/shared/references/cce-redhat-avail.txt
362bfa
index 61384c108a0..1d54e8ec15f 100644
362bfa
--- a/shared/references/cce-redhat-avail.txt
362bfa
+++ b/shared/references/cce-redhat-avail.txt
362bfa
@@ -3969,7 +3969,6 @@ CCE-89899-9
362bfa
 CCE-89900-5
362bfa
 CCE-89901-3
362bfa
 CCE-89902-1
362bfa
-CCE-89903-9
362bfa
 CCE-89904-7
362bfa
 CCE-89905-4
362bfa
 CCE-89906-2
362bfa
diff --git a/tests/data/profile_stability/rhel8/stig.profile b/tests/data/profile_stability/rhel8/stig.profile
362bfa
index bffa509b698..71dd6330a16 100644
362bfa
--- a/tests/data/profile_stability/rhel8/stig.profile
362bfa
+++ b/tests/data/profile_stability/rhel8/stig.profile
362bfa
@@ -26,6 +26,7 @@ selections:
362bfa
 - account_disable_post_pw_expiration
362bfa
 - account_emergency_expire_date
362bfa
 - account_temp_expire_date
362bfa
+- account_unique_id
362bfa
 - accounts_have_homedir_login_defs
362bfa
 - accounts_logon_fail_delay
362bfa
 - accounts_max_concurrent_login_sessions
362bfa
diff --git a/tests/data/profile_stability/rhel8/stig_gui.profile b/tests/data/profile_stability/rhel8/stig_gui.profile
362bfa
index c84ac75c7bf..3e788b27bac 100644
362bfa
--- a/tests/data/profile_stability/rhel8/stig_gui.profile
362bfa
+++ b/tests/data/profile_stability/rhel8/stig_gui.profile
362bfa
@@ -37,6 +37,7 @@ selections:
362bfa
 - account_disable_post_pw_expiration
362bfa
 - account_emergency_expire_date
362bfa
 - account_temp_expire_date
362bfa
+- account_unique_id
362bfa
 - accounts_have_homedir_login_defs
362bfa
 - accounts_logon_fail_delay
362bfa
 - accounts_max_concurrent_login_sessions