Blame SOURCES/scap-security-guide-0.1.58-RHEL_08_020300-PR_7289.patch

362bfa
From 2af7d6d8f86f80dbac088d115a50162cfc28c542 Mon Sep 17 00:00:00 2001
362bfa
From: Matthew Burket <mburket@redhat.com>
362bfa
Date: Tue, 27 Jul 2021 07:49:50 -0500
362bfa
Subject: [PATCH] Add rule for RHEL-08-020300
362bfa
362bfa
---
362bfa
 .../accounts_password_pam_dictcheck/rule.yml  | 45 +++++++++++++++++++
362bfa
 .../tests/disabled.fail.sh                    |  3 ++
362bfa
 .../tests/enable.pass.sh                      |  3 ++
362bfa
 .../tests/not_defined.fail.sh                 |  3 ++
362bfa
 .../var_password_pam_dictcheck.var            | 16 +++++++
362bfa
 products/rhel8/profiles/stig.profile          |  2 +
362bfa
 shared/references/cce-redhat-avail.txt        |  1 -
362bfa
 .../data/profile_stability/rhel8/stig.profile |  2 +
362bfa
 .../profile_stability/rhel8/stig_gui.profile  |  2 +
362bfa
 9 files changed, 76 insertions(+), 1 deletion(-)
362bfa
 create mode 100644 linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_dictcheck/rule.yml
362bfa
 create mode 100644 linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_dictcheck/tests/disabled.fail.sh
362bfa
 create mode 100644 linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_dictcheck/tests/enable.pass.sh
362bfa
 create mode 100644 linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_dictcheck/tests/not_defined.fail.sh
362bfa
 create mode 100644 linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/var_password_pam_dictcheck.var
362bfa
362bfa
diff --git a/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_dictcheck/rule.yml b/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_dictcheck/rule.yml
362bfa
new file mode 100644
362bfa
index 0000000000..2990150c0a
362bfa
--- /dev/null
362bfa
+++ b/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_dictcheck/rule.yml
362bfa
@@ -0,0 +1,45 @@
362bfa
+documentation_complete: true
362bfa
+
362bfa
+prodtype: fedora,rhel8
362bfa
+
362bfa
+title: 'Ensure PAM Enforces Password Requirements - Prevent the Use of Dictionary Words'
362bfa
+
362bfa
+description: |-
362bfa
+    The pam_pwquality module's <tt>dictcheck</tt> check if passwords contains dictionary words. When
362bfa
+    <tt>dictcheck</tt> is set to <tt>1</tt> passwords will be checked for dictionary words.
362bfa
+
362bfa
+rationale: |-
362bfa
+    Use of a complex password helps to increase the time and resources required to compromise the password.
362bfa
+    Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at
362bfa
+    guessing and brute-force attacks.
362bfa
+    

362bfa
+    Password complexity is one factor of several that determines how long it takes to crack a password. The more
362bfa
+    complex the password, the greater the number of possible combinations that need to be tested before the
362bfa
+    password is compromised.
362bfa
+    

362bfa
+    Passwords with dictionary words may be more vulnerable to password-guessing attacks.
362bfa
+
362bfa
+severity: medium
362bfa
+
362bfa
+identifiers:
362bfa
+    cce@rhel8: CCE-86233-4
362bfa
+
362bfa
+references:
362bfa
+    disa: CCI-000366
362bfa
+    nist: IA-5(c),IA-5(1)(a),CM-6(a),IA-5(4)
362bfa
+    stigid@rhel8: RHEL-08-020300
362bfa
+
362bfa
+ocil_clause: 'dictcheck is not found or not equal to the required value'
362bfa
+
362bfa
+ocil: |-
362bfa
+    To check if dictionary words are disallowed run the following command:
362bfa
+    
$ sudo grep dictcheck /etc/security/pwquality.conf /etc/pwquality.conf.d/*.conf
362bfa
+    The <tt>dictcheck</tt> parameter should be equal to 1. The value should look like
362bfa
+    
dictcheck=1
362bfa
+
362bfa
+
362bfa
+template:
362bfa
+    name: accounts_password
362bfa
+    vars:
362bfa
+        variable: dictcheck
362bfa
+        operation: equals
362bfa
diff --git a/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_dictcheck/tests/disabled.fail.sh b/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_dictcheck/tests/disabled.fail.sh
362bfa
new file mode 100644
362bfa
index 0000000000..cb84c6d968
362bfa
--- /dev/null
362bfa
+++ b/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_dictcheck/tests/disabled.fail.sh
362bfa
@@ -0,0 +1,3 @@
362bfa
+#!/bin/bash
362bfa
+
362bfa
+echo "dictcheck=0" > /etc/security/pwquality.conf
362bfa
diff --git a/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_dictcheck/tests/enable.pass.sh b/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_dictcheck/tests/enable.pass.sh
362bfa
new file mode 100644
362bfa
index 0000000000..ceb9f7ec44
362bfa
--- /dev/null
362bfa
+++ b/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_dictcheck/tests/enable.pass.sh
362bfa
@@ -0,0 +1,3 @@
362bfa
+#!/bin/bash
362bfa
+
362bfa
+echo "dictcheck=1" > /etc/security/pwquality.conf
362bfa
diff --git a/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_dictcheck/tests/not_defined.fail.sh b/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_dictcheck/tests/not_defined.fail.sh
362bfa
new file mode 100644
362bfa
index 0000000000..57e54b6623
362bfa
--- /dev/null
362bfa
+++ b/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_dictcheck/tests/not_defined.fail.sh
362bfa
@@ -0,0 +1,3 @@
362bfa
+#!/bin/bash
362bfa
+
362bfa
+sed -i s/dictcheck.+//g /etc/security/pwquality.conf
362bfa
diff --git a/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/var_password_pam_dictcheck.var b/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/var_password_pam_dictcheck.var
362bfa
new file mode 100644
362bfa
index 0000000000..26452c3a8e
362bfa
--- /dev/null
362bfa
+++ b/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/var_password_pam_dictcheck.var
362bfa
@@ -0,0 +1,16 @@
362bfa
+documentation_complete: true
362bfa
+
362bfa
+title: dictcheck
362bfa
+
362bfa
+description: |-
362bfa
+    Prevent the use of dictionary words for passwords.
362bfa
+
362bfa
+type: number
362bfa
+
362bfa
+operator: equals
362bfa
+
362bfa
+interactive: false
362bfa
+
362bfa
+options:
362bfa
+    1: 1
362bfa
+    default: 1
362bfa
diff --git a/products/rhel8/profiles/stig.profile b/products/rhel8/profiles/stig.profile
362bfa
index bf410c2087..f17a7b88b1 100644
362bfa
--- a/products/rhel8/profiles/stig.profile
362bfa
+++ b/products/rhel8/profiles/stig.profile
362bfa
@@ -45,6 +45,7 @@ selections:
362bfa
     - var_password_pam_minlen=15
362bfa
     - var_password_pam_ocredit=1
362bfa
     - var_password_pam_dcredit=1
362bfa
+    - var_password_pam_dictcheck=1
362bfa
     - var_password_pam_ucredit=1
362bfa
     - var_password_pam_lcredit=1
362bfa
     - var_password_pam_retry=3
362bfa
@@ -567,6 +568,7 @@ selections:
362bfa
     - sssd_offline_cred_expiration
362bfa
 
362bfa
     # RHEL-08-020300
362bfa
+    - accounts_password_pam_dictcheck
362bfa
 
362bfa
     # RHEL-08-020310
362bfa
     - accounts_logon_fail_delay
362bfa
diff --git a/shared/references/cce-redhat-avail.txt b/shared/references/cce-redhat-avail.txt
362bfa
index 0b794d5c2a..dae4495b2d 100644
362bfa
--- a/shared/references/cce-redhat-avail.txt
362bfa
+++ b/shared/references/cce-redhat-avail.txt
362bfa
@@ -362,7 +362,6 @@ CCE-86229-2
362bfa
 CCE-86230-0
362bfa
 CCE-86231-8
362bfa
 CCE-86232-6
362bfa
-CCE-86233-4
362bfa
 CCE-86234-2
362bfa
 CCE-86235-9
362bfa
 CCE-86236-7
362bfa
diff --git a/tests/data/profile_stability/rhel8/stig.profile b/tests/data/profile_stability/rhel8/stig.profile
362bfa
index ddfa13e731..236e595604 100644
362bfa
--- a/tests/data/profile_stability/rhel8/stig.profile
362bfa
+++ b/tests/data/profile_stability/rhel8/stig.profile
362bfa
@@ -35,6 +35,7 @@ selections:
362bfa
 - accounts_password_all_shadowed_sha512
362bfa
 - accounts_password_minlen_login_defs
362bfa
 - accounts_password_pam_dcredit
362bfa
+- accounts_password_pam_dictcheck
362bfa
 - accounts_password_pam_difok
362bfa
 - accounts_password_pam_lcredit
362bfa
 - accounts_password_pam_maxclassrepeat
362bfa
@@ -332,6 +333,7 @@ selections:
362bfa
 - var_password_pam_minlen=15
362bfa
 - var_password_pam_ocredit=1
362bfa
 - var_password_pam_dcredit=1
362bfa
+- var_password_pam_dictcheck=1
362bfa
 - var_password_pam_ucredit=1
362bfa
 - var_password_pam_lcredit=1
362bfa
 - var_password_pam_retry=3
362bfa
diff --git a/tests/data/profile_stability/rhel8/stig_gui.profile b/tests/data/profile_stability/rhel8/stig_gui.profile
362bfa
index 017ab8c0e3..9973b5adef 100644
362bfa
--- a/tests/data/profile_stability/rhel8/stig_gui.profile
362bfa
+++ b/tests/data/profile_stability/rhel8/stig_gui.profile
362bfa
@@ -46,6 +46,7 @@ selections:
362bfa
 - accounts_password_all_shadowed_sha512
362bfa
 - accounts_password_minlen_login_defs
362bfa
 - accounts_password_pam_dcredit
362bfa
+- accounts_password_pam_dictcheck
362bfa
 - accounts_password_pam_difok
362bfa
 - accounts_password_pam_lcredit
362bfa
 - accounts_password_pam_maxclassrepeat
362bfa
@@ -342,6 +343,7 @@ selections:
362bfa
 - var_password_pam_minlen=15
362bfa
 - var_password_pam_ocredit=1
362bfa
 - var_password_pam_dcredit=1
362bfa
+- var_password_pam_dictcheck=1
362bfa
 - var_password_pam_ucredit=1
362bfa
 - var_password_pam_lcredit=1
362bfa
 - var_password_pam_retry=3