Blame SOURCES/scap-security-guide-0.1.44-cpe-shadow-utils.patch

2b7fd2
From 2e618f9239de966ec167f7b43ae854650a3421ad Mon Sep 17 00:00:00 2001
2b7fd2
From: Watson Sato <wsato@redhat.com>
2b7fd2
Date: Wed, 3 Apr 2019 18:05:15 +0200
2b7fd2
Subject: [PATCH 1/3] Introduce CPE shadow-utils
2b7fd2
2b7fd2
- Add inventory OVAL check for shadow-utils package installed
2b7fd2
- Add shadow-utils CPE to RHEL7 dictionary
2b7fd2
---
2b7fd2
 rhel7/cpe/rhel7-cpe-dictionary.xml            |  5 ++++
2b7fd2
 ...installed_env_has_shadow-utils_package.xml | 24 +++++++++++++++++++
2b7fd2
 2 files changed, 29 insertions(+)
2b7fd2
 create mode 100644 shared/checks/oval/installed_env_has_shadow-utils_package.xml
2b7fd2
2b7fd2
diff --git a/rhel7/cpe/rhel7-cpe-dictionary.xml b/rhel7/cpe/rhel7-cpe-dictionary.xml
2b7fd2
index 23541378f8..44fe06f103 100644
2b7fd2
--- a/rhel7/cpe/rhel7-cpe-dictionary.xml
2b7fd2
+++ b/rhel7/cpe/rhel7-cpe-dictionary.xml
2b7fd2
@@ -47,4 +47,9 @@
2b7fd2
             
2b7fd2
             <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5" href="filename">installed_env_is_a_machine</check>
2b7fd2
       </cpe-item>
2b7fd2
+      <cpe-item name="cpe:/a:shadow-utils">
2b7fd2
+            <title xml:lang="en-us">Package shadow-utils is installed</title>
2b7fd2
+            
2b7fd2
+            <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5" href="filename">installed_env_has_shadow-utils_package</check>
2b7fd2
+      </cpe-item>
2b7fd2
 </cpe-list>
2b7fd2
diff --git a/shared/checks/oval/installed_env_has_shadow-utils_package.xml b/shared/checks/oval/installed_env_has_shadow-utils_package.xml
2b7fd2
new file mode 100644
2b7fd2
index 0000000000..12dd5bd565
2b7fd2
--- /dev/null
2b7fd2
+++ b/shared/checks/oval/installed_env_has_shadow-utils_package.xml
2b7fd2
@@ -0,0 +1,24 @@
2b7fd2
+<def-group>
2b7fd2
+  
2b7fd2
+  id="installed_env_has_shadow-utils_package" version="1">
2b7fd2
+    <metadata>
2b7fd2
+      <title>Package shadow-utils is installed</title>
2b7fd2
+      <affected family="unix">
2b7fd2
+        <platform>multi_platform_all</platform>
2b7fd2
+      </affected>
2b7fd2
+      <description>Checks if package shadow-utils is installed.</description>
2b7fd2
+      <reference ref_id="cpe:/a:shadow-utils" source="CPE" />
2b7fd2
+    </metadata>
2b7fd2
+    <criteria>
2b7fd2
+      <criterion comment="Package shadow-utils is installed" test_ref="test_env_has_shadow-utils_installed" />
2b7fd2
+    </criteria>
2b7fd2
+  </definition>
2b7fd2
+
2b7fd2
+  <linux:rpminfo_test check="all" check_existence="at_least_one_exists" comment="system has package shadow-utils installed" id="test_env_has_shadow-utils_installed" version="1">
2b7fd2
+    <linux:object object_ref="obj_env_has_shadow-utils_installed" />
2b7fd2
+  </linux:rpminfo_test>
2b7fd2
+  <linux:rpminfo_object id="obj_env_has_shadow-utils_installed" version="1">
2b7fd2
+    <linux:name>shadow-utils</linux:name>
2b7fd2
+  </linux:rpminfo_object>
2b7fd2
+
2b7fd2
+</def-group>
2b7fd2
2b7fd2
From 06650f96e4e880c90a23eaf565e70d37a175aa47 Mon Sep 17 00:00:00 2001
2b7fd2
From: Watson Sato <wsato@redhat.com>
2b7fd2
Date: Wed, 3 Apr 2019 18:10:33 +0200
2b7fd2
Subject: [PATCH 2/3] Rules are applicable when shadow-utils installed
2b7fd2
2b7fd2
If package shadow-utils is not installed, the rule will result in
2b7fd2
notapplicable.
2b7fd2
---
2b7fd2
 .../account_disable_post_pw_expiration.rule                     | 2 ++
2b7fd2
 .../accounts_maximum_age_login_defs.rule                        | 2 ++
2b7fd2
 .../accounts_minimum_age_login_defs.rule                        | 2 ++
2b7fd2
 .../accounts_password_minlen_login_defs.rule                    | 2 ++
2b7fd2
 .../accounts_password_warn_age_login_defs.rule                  | 2 ++
2b7fd2
 .../accounts-session/accounts_logon_fail_delay.rule             | 2 ++
2b7fd2
 6 files changed, 12 insertions(+)
2b7fd2
2b7fd2
diff --git a/linux_os/guide/system/accounts/accounts-restrictions/account_expiration/account_disable_post_pw_expiration.rule b/linux_os/guide/system/accounts/accounts-restrictions/account_expiration/account_disable_post_pw_expiration.rule
2b7fd2
index 9d19274f1c..d8b29b6436 100644
2b7fd2
--- a/linux_os/guide/system/accounts/accounts-restrictions/account_expiration/account_disable_post_pw_expiration.rule
2b7fd2
+++ b/linux_os/guide/system/accounts/accounts-restrictions/account_expiration/account_disable_post_pw_expiration.rule
2b7fd2
@@ -62,3 +62,5 @@ ocil: |-
2b7fd2
     to an appropriate integer as shown in the example below:
2b7fd2
     
$ grep "INACTIVE" /etc/default/useradd
2b7fd2
     INACTIVE=<sub idref="var_account_disable_post_pw_expiration" />
2b7fd2
+
2b7fd2
+platform: shadow-utils
2b7fd2
diff --git a/linux_os/guide/system/accounts/accounts-restrictions/password_expiration/accounts_maximum_age_login_defs.rule b/linux_os/guide/system/accounts/accounts-restrictions/password_expiration/accounts_maximum_age_login_defs.rule
2b7fd2
index 90dc1b4f2b..de322bc787 100644
2b7fd2
--- a/linux_os/guide/system/accounts/accounts-restrictions/password_expiration/accounts_maximum_age_login_defs.rule
2b7fd2
+++ b/linux_os/guide/system/accounts/accounts-restrictions/password_expiration/accounts_maximum_age_login_defs.rule
2b7fd2
@@ -55,3 +55,5 @@ ocil: |-
2b7fd2
     
$ grep PASS_MAX_DAYS /etc/login.defs
2b7fd2
     The DoD and FISMA requirement is 60.
2b7fd2
     A value of 180 days is sufficient for many environments.
2b7fd2
+
2b7fd2
+platform: shadow-utils
2b7fd2
diff --git a/linux_os/guide/system/accounts/accounts-restrictions/password_expiration/accounts_minimum_age_login_defs.rule b/linux_os/guide/system/accounts/accounts-restrictions/password_expiration/accounts_minimum_age_login_defs.rule
2b7fd2
index 88706c8b3e..dd7030cd0a 100644
2b7fd2
--- a/linux_os/guide/system/accounts/accounts-restrictions/password_expiration/accounts_minimum_age_login_defs.rule
2b7fd2
+++ b/linux_os/guide/system/accounts/accounts-restrictions/password_expiration/accounts_minimum_age_login_defs.rule
2b7fd2
@@ -49,3 +49,5 @@ ocil_clause: 'it is not equal to or greater than the required value'
2b7fd2
 ocil: |-
2b7fd2
     To check the minimum password age, run the command:
2b7fd2
     
$ grep PASS_MIN_DAYS /etc/login.defs
2b7fd2
+
2b7fd2
+platform: shadow-utils
2b7fd2
diff --git a/linux_os/guide/system/accounts/accounts-restrictions/password_expiration/accounts_password_minlen_login_defs.rule b/linux_os/guide/system/accounts/accounts-restrictions/password_expiration/accounts_password_minlen_login_defs.rule
2b7fd2
index 814fda94b9..d38ee253fb 100644
2b7fd2
--- a/linux_os/guide/system/accounts/accounts-restrictions/password_expiration/accounts_password_minlen_login_defs.rule
2b7fd2
+++ b/linux_os/guide/system/accounts/accounts-restrictions/password_expiration/accounts_password_minlen_login_defs.rule
2b7fd2
@@ -51,3 +51,5 @@ ocil: |-
2b7fd2
     To check the minimum password length, run the command:
2b7fd2
     
$ grep PASS_MIN_LEN /etc/login.defs
2b7fd2
     The DoD requirement is <tt>15</tt>.
2b7fd2
+
2b7fd2
+platform: shadow-utils
2b7fd2
diff --git a/linux_os/guide/system/accounts/accounts-restrictions/password_expiration/accounts_password_warn_age_login_defs.rule b/linux_os/guide/system/accounts/accounts-restrictions/password_expiration/accounts_password_warn_age_login_defs.rule
2b7fd2
index d8947ad9fd..85b5cd762f 100644
2b7fd2
--- a/linux_os/guide/system/accounts/accounts-restrictions/password_expiration/accounts_password_warn_age_login_defs.rule
2b7fd2
+++ b/linux_os/guide/system/accounts/accounts-restrictions/password_expiration/accounts_password_warn_age_login_defs.rule
2b7fd2
@@ -40,3 +40,5 @@ ocil: |-
2b7fd2
     To check the password warning age, run the command:
2b7fd2
     
$ grep PASS_WARN_AGE /etc/login.defs
2b7fd2
     The DoD requirement is 7.
2b7fd2
+
2b7fd2
+platform: shadow-utils
2b7fd2
diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_logon_fail_delay.rule b/linux_os/guide/system/accounts/accounts-session/accounts_logon_fail_delay.rule
2b7fd2
index 171051e138..33fc873e97 100644
2b7fd2
--- a/linux_os/guide/system/accounts/accounts-session/accounts_logon_fail_delay.rule
2b7fd2
+++ b/linux_os/guide/system/accounts/accounts-session/accounts_logon_fail_delay.rule
2b7fd2
@@ -37,3 +37,5 @@ ocil: |-
2b7fd2
     All output must show the value of <tt>FAIL_DELAY</tt> set as shown in the below:
2b7fd2
     
$ sudo grep -i "FAIL_DELAY" /etc/login.defs
2b7fd2
     fail_delay <sub idref="var_accounts_fail_delay" />
2b7fd2
+
2b7fd2
+platform: shadow-utils
2b7fd2
2b7fd2
From 63ab7328a57c185734037a124eab2ab8ac740e82 Mon Sep 17 00:00:00 2001
2b7fd2
From: Watson Sato <wsato@redhat.com>
2b7fd2
Date: Wed, 3 Apr 2019 18:14:58 +0200
2b7fd2
Subject: [PATCH 3/3] Map shadow-utils platform to CPE name
2b7fd2
2b7fd2
---
2b7fd2
 ssg/constants.py | 3 ++-
2b7fd2
 1 file changed, 2 insertions(+), 1 deletion(-)
2b7fd2
2b7fd2
diff --git a/ssg/constants.py b/ssg/constants.py
2b7fd2
index b80382be3d..f96fd51790 100644
2b7fd2
--- a/ssg/constants.py
2b7fd2
+++ b/ssg/constants.py
2b7fd2
@@ -375,7 +375,8 @@
2b7fd2
 
2b7fd2
 XCCDF_PLATFORM_TO_CPE = {
2b7fd2
     "machine": "cpe:/a:machine",
2b7fd2
-    "container": "cpe:/a:container"
2b7fd2
+    "container": "cpe:/a:container",
2b7fd2
+    "shadow-utils": "cpe:/a:shadow-utils",
2b7fd2
 }
2b7fd2
 
2b7fd2
 # Application constants