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

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