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

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

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

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