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

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