Blame SOURCES/scap-security-guide-0.1.58-RHEL_08_020090-PR_7313.patch

362bfa
From 6eeef4054d707b8b255e9fa600c4c7babffbf5f7 Mon Sep 17 00:00:00 2001
362bfa
From: Matthew Burket <mburket@redhat.com>
362bfa
Date: Mon, 2 Aug 2021 08:37:04 -0500
362bfa
Subject: [PATCH] Add rule for RHEL-08-020090
362bfa
362bfa
---
362bfa
 .../sssd/sssd_enable_certmap/rule.yml         | 58 +++++++++++++++++++
362bfa
 .../sssd_enable_certmap/tests/default.fail.sh |  4 ++
362bfa
 .../tests/with_section.pass.sh                |  7 +++
362bfa
 products/rhel8/profiles/stig.profile          |  1 +
362bfa
 shared/references/cce-redhat-avail.txt        |  1 -
362bfa
 .../data/profile_stability/rhel8/stig.profile |  1 +
362bfa
 .../profile_stability/rhel8/stig_gui.profile  |  1 +
362bfa
 7 files changed, 72 insertions(+), 1 deletion(-)
362bfa
 create mode 100644 linux_os/guide/services/sssd/sssd_enable_certmap/rule.yml
362bfa
 create mode 100644 linux_os/guide/services/sssd/sssd_enable_certmap/tests/default.fail.sh
362bfa
 create mode 100644 linux_os/guide/services/sssd/sssd_enable_certmap/tests/with_section.pass.sh
362bfa
362bfa
diff --git a/linux_os/guide/services/sssd/sssd_enable_certmap/rule.yml b/linux_os/guide/services/sssd/sssd_enable_certmap/rule.yml
362bfa
new file mode 100644
362bfa
index 0000000000..0614a2f4a0
362bfa
--- /dev/null
362bfa
+++ b/linux_os/guide/services/sssd/sssd_enable_certmap/rule.yml
362bfa
@@ -0,0 +1,58 @@
362bfa
+documentation_complete: true
362bfa
+
362bfa
+prodtype: fedora,rhel8
362bfa
+
362bfa
+title: 'Enable Certmap in SSSD'
362bfa
+
362bfa
+description: |-
362bfa
+   SSSD should be configured to verify the certificate of the user or group. To set this up
362bfa
+    ensure that section like <tt>certmap/testing.test/rule_name</tt> is setup in
362bfa
+   <tt>/etc/sssd/sssd.conf</tt>. For example
362bfa
+   
362bfa
+   [certmap/testing.test/rule_name]
362bfa
+   matchrule =<SAN>.*EDIPI@mil
362bfa
+   maprule = (userCertificate;binary={cert!bin})
362bfa
+   domains = testing.test
362bfa
+   
362bfa
+
362bfa
+rationale: |-
362bfa
+   Without mapping the certificate used to authenticate to the user account, the ability to
362bfa
+   determine the identity of the individual user or group will not be available for forensic
362bfa
+   analysis.
362bfa
+
362bfa
+severity: medium
362bfa
+
362bfa
+identifiers:
362bfa
+   cce@rhel8: CCE-86060-1
362bfa
+
362bfa
+references:
362bfa
+   disa: CCI-000187
362bfa
+   nist: IA-5 (2) (c)
362bfa
+   stigid@rhel8: RHEL-08-020090
362bfa
+
362bfa
+warnings:
362bfa
+    - general: |-
362bfa
+        Automatic remediation of this control is not available, since all of the settings in
362bfa
+        in the certmap need to be customized.
362bfa
+
362bfa
+ocil_clause: 'Certmap is not configured in SSSD'
362bfa
+
362bfa
+ocil: |-
362bfa
+    To verify Certmap is enabled in SSSD, run the following command:
362bfa
+    
$ cat sudo cat /etc/sssd/sssd.conf
362bfa
+    If configured properly, output should contain section like the following
362bfa
+    
362bfa
+    [certmap/testing.test/rule_name]
362bfa
+    matchrule =<SAN>.*EDIPI@mil
362bfa
+    maprule = (userCertificate;binary={cert!bin})
362bfa
+    domains = testing.test
362bfa
+    
362bfa
+
362bfa
+template:
362bfa
+    name: lineinfile
362bfa
+    vars:
362bfa
+      path: '/etc/sssd/sssd.conf'
362bfa
+      text: '^\[certmap\/.+\/.+\]$'
362bfa
+    backends:
362bfa
+        ansible: "off"
362bfa
+        bash: "off"
362bfa
diff --git a/linux_os/guide/services/sssd/sssd_enable_certmap/tests/default.fail.sh b/linux_os/guide/services/sssd/sssd_enable_certmap/tests/default.fail.sh
362bfa
new file mode 100644
362bfa
index 0000000000..1e31c0da19
362bfa
--- /dev/null
362bfa
+++ b/linux_os/guide/services/sssd/sssd_enable_certmap/tests/default.fail.sh
362bfa
@@ -0,0 +1,4 @@
362bfa
+#!/bin/bash
362bfa
+
362bfa
+touch /etc/sssd/sssd.conf
362bfa
+sed -i "s/\[certmap.*//g" /etc/sssd/sssd.conf
362bfa
diff --git a/linux_os/guide/services/sssd/sssd_enable_certmap/tests/with_section.pass.sh b/linux_os/guide/services/sssd/sssd_enable_certmap/tests/with_section.pass.sh
362bfa
new file mode 100644
362bfa
index 0000000000..911e095f5d
362bfa
--- /dev/null
362bfa
+++ b/linux_os/guide/services/sssd/sssd_enable_certmap/tests/with_section.pass.sh
362bfa
@@ -0,0 +1,7 @@
362bfa
+#!/bin/bash
362bfa
+cat >> /etc/sssd/sssd.conf<< EOF
362bfa
+[certmap/testing.test/rule_name]
362bfa
+matchrule =<SAN>.*EDIPI@mil
362bfa
+maprule = (userCertificate;binary={cert!bin})
362bfa
+domains = testing.test
362bfa
+EOF
362bfa
diff --git a/products/rhel8/profiles/stig.profile b/products/rhel8/profiles/stig.profile
362bfa
index f17a7b88b1..ec0a3b1753 100644
362bfa
--- a/products/rhel8/profiles/stig.profile
362bfa
+++ b/products/rhel8/profiles/stig.profile
362bfa
@@ -503,6 +503,7 @@ selections:
362bfa
     # RHEL-08-020080
362bfa
 
362bfa
     # RHEL-08-020090
362bfa
+    - sssd_enable_certmap
362bfa
 
362bfa
     # RHEL-08-020100
362bfa
     - accounts_password_pam_retry
362bfa
diff --git a/shared/references/cce-redhat-avail.txt b/shared/references/cce-redhat-avail.txt
362bfa
index 73d025484e..e80557f033 100644
362bfa
--- a/shared/references/cce-redhat-avail.txt
362bfa
+++ b/shared/references/cce-redhat-avail.txt
362bfa
@@ -186,7 +186,6 @@ CCE-86056-9
362bfa
 CCE-86057-7
362bfa
 CCE-86058-5
362bfa
 CCE-86059-3
362bfa
-CCE-86060-1
362bfa
 CCE-86061-9
362bfa
 CCE-86062-7
362bfa
 CCE-86063-5
362bfa
diff --git a/tests/data/profile_stability/rhel8/stig.profile b/tests/data/profile_stability/rhel8/stig.profile
362bfa
index 236e595604..bffa509b69 100644
362bfa
--- a/tests/data/profile_stability/rhel8/stig.profile
362bfa
+++ b/tests/data/profile_stability/rhel8/stig.profile
362bfa
@@ -275,6 +275,7 @@ selections:
362bfa
 - sshd_set_keepalive_0
362bfa
 - sshd_use_strong_rng
362bfa
 - sshd_x11_use_localhost
362bfa
+- sssd_enable_certmap
362bfa
 - sssd_enable_smartcards
362bfa
 - sssd_offline_cred_expiration
362bfa
 - sudo_remove_no_authenticate
362bfa
diff --git a/tests/data/profile_stability/rhel8/stig_gui.profile b/tests/data/profile_stability/rhel8/stig_gui.profile
362bfa
index 9973b5adef..c84ac75c7b 100644
362bfa
--- a/tests/data/profile_stability/rhel8/stig_gui.profile
362bfa
+++ b/tests/data/profile_stability/rhel8/stig_gui.profile
362bfa
@@ -286,6 +286,7 @@ selections:
362bfa
 - sshd_set_keepalive_0
362bfa
 - sshd_use_strong_rng
362bfa
 - sshd_x11_use_localhost
362bfa
+- sssd_enable_certmap
362bfa
 - sssd_enable_smartcards
362bfa
 - sssd_offline_cred_expiration
362bfa
 - sudo_remove_no_authenticate