Blame SOURCES/scap-security-guide-0.1.58-rhel8_stig_08_010291-PR_7169.patch

9be3b2
From 7da420a853591a6e994439a9ada2b88d6793e3e7 Mon Sep 17 00:00:00 2001
9be3b2
From: Carlos Matos <cmatos@redhat.com>
9be3b2
Date: Tue, 29 Jun 2021 14:00:14 -0400
9be3b2
Subject: [PATCH 1/5] New rules for RHEL-08-010291
9be3b2
9be3b2
---
9be3b2
 .../services/ssh/sshd_approved_ciphers.var    |  2 +-
9be3b2
 .../ansible/shared.yml                        | 16 +++++
9be3b2
 .../bash/shared.sh                            | 13 ++++
9be3b2
 .../oval/shared.xml                           | 35 +++++++++++
9be3b2
 .../rule.yml                                  | 62 +++++++++++++++++++
9be3b2
 .../tests/stig_correct.pass.sh                | 15 +++++
9be3b2
 .../tests/stig_correct_commented.fail.sh      | 15 +++++
9be3b2
 ...ct_followed_by_incorrect_commented.pass.sh | 18 ++++++
9be3b2
 .../tests/stig_empty_file.fail.sh             | 10 +++
9be3b2
 .../tests/stig_empty_policy.fail.sh           | 14 +++++
9be3b2
 ...rect_followed_by_correct_commented.fail.sh | 19 ++++++
9be3b2
 .../tests/stig_incorrect_policy.fail.sh       | 15 +++++
9be3b2
 .../tests/stig_missing_file.fail.sh           | 11 ++++
9be3b2
 .../ansible/shared.yml                        | 45 ++++++++++++++
9be3b2
 .../bash/shared.sh                            | 25 ++++++++
9be3b2
 .../oval/shared.xml                           | 35 +++++++++++
9be3b2
 .../rule.yml                                  | 62 +++++++++++++++++++
9be3b2
 .../tests/rhel8_stig_correct.pass.sh          | 17 +++++
9be3b2
 .../tests/rhel8_stig_empty_policy.fail.sh     |  7 +++
9be3b2
 .../tests/rhel8_stig_incorrect_policy.fail.sh | 14 +++++
9be3b2
 .../tests/rhel8_stig_missing_file.fail.sh     | 11 ++++
9be3b2
 products/rhel8/profiles/stig.profile          |  6 ++
9be3b2
 .../data/profile_stability/rhel8/stig.profile |  3 +
9be3b2
 .../profile_stability/rhel8/stig_gui.profile  |  3 +
9be3b2
 24 files changed, 472 insertions(+), 1 deletion(-)
9be3b2
 create mode 100644 linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/ansible/shared.yml
9be3b2
 create mode 100644 linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/bash/shared.sh
9be3b2
 create mode 100644 linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/oval/shared.xml
9be3b2
 create mode 100644 linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/rule.yml
9be3b2
 create mode 100644 linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_correct.pass.sh
9be3b2
 create mode 100644 linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_correct_commented.fail.sh
9be3b2
 create mode 100644 linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_correct_followed_by_incorrect_commented.pass.sh
9be3b2
 create mode 100644 linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_empty_file.fail.sh
9be3b2
 create mode 100644 linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_empty_policy.fail.sh
9be3b2
 create mode 100644 linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_incorrect_followed_by_correct_commented.fail.sh
9be3b2
 create mode 100644 linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_incorrect_policy.fail.sh
9be3b2
 create mode 100644 linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_missing_file.fail.sh
9be3b2
 create mode 100644 linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/ansible/shared.yml
9be3b2
 create mode 100644 linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/bash/shared.sh
9be3b2
 create mode 100644 linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/oval/shared.xml
9be3b2
 create mode 100644 linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/rule.yml
9be3b2
 create mode 100644 linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/tests/rhel8_stig_correct.pass.sh
9be3b2
 create mode 100644 linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/tests/rhel8_stig_empty_policy.fail.sh
9be3b2
 create mode 100644 linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/tests/rhel8_stig_incorrect_policy.fail.sh
9be3b2
 create mode 100644 linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/tests/rhel8_stig_missing_file.fail.sh
9be3b2
9be3b2
diff --git a/linux_os/guide/services/ssh/sshd_approved_ciphers.var b/linux_os/guide/services/ssh/sshd_approved_ciphers.var
9be3b2
index 46891daa619..a240bbbfaef 100644
9be3b2
--- a/linux_os/guide/services/ssh/sshd_approved_ciphers.var
9be3b2
+++ b/linux_os/guide/services/ssh/sshd_approved_ciphers.var
9be3b2
@@ -11,6 +11,6 @@ operator: equals
9be3b2
 interactive: false
9be3b2
 
9be3b2
 options:
9be3b2
-    stig: aes128-ctr,aes192-ctr,aes256-ctr
9be3b2
+    stig: aes256-ctr,aes192-ctr,aes128-ctr
9be3b2
     default: aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se
9be3b2
     cis_rhel7: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc,blowfish-cbc,cast128-cbc,3des-cbc
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/ansible/shared.yml b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/ansible/shared.yml
9be3b2
new file mode 100644
9be3b2
index 00000000000..badb5896cf2
9be3b2
--- /dev/null
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/ansible/shared.yml
9be3b2
@@ -0,0 +1,16 @@
9be3b2
+# platform = Red Hat Enterprise Linux 8,multi_platform_fedora
9be3b2
+# reboot = true
9be3b2
+# strategy = restrict
9be3b2
+# complexity = low
9be3b2
+# disruption = low
9be3b2
+{{{ ansible_instantiate_variables("sshd_approved_ciphers") }}}
9be3b2
+
9be3b2
+{{{ ansible_set_config_file(
9be3b2
+        msg='Configure SSH Daemon to Use FIPS 140-2 Validated MACs: openssh.config',
9be3b2
+        file='/etc/crypto-policies/back-ends/openssh.config',
9be3b2
+        parameter='Ciphers',
9be3b2
+        value="{{ sshd_approved_ciphers }}",
9be3b2
+        create='yes',
9be3b2
+        prefix_regex='^.*'
9be3b2
+    )
9be3b2
+}}}
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/bash/shared.sh b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/bash/shared.sh
9be3b2
new file mode 100644
9be3b2
index 00000000000..cdc66a8aac6
9be3b2
--- /dev/null
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/bash/shared.sh
9be3b2
@@ -0,0 +1,13 @@
9be3b2
+# platform = Red Hat Enterprise Linux 8,multi_platform_fedora
9be3b2
+. /usr/share/scap-security-guide/remediation_functions
9be3b2
+{{{ bash_instantiate_variables("sshd_approved_ciphers") }}}
9be3b2
+
9be3b2
+{{{ set_config_file(
9be3b2
+        path="/etc/crypto-policies/back-ends/openssh.config",
9be3b2
+        parameter="Ciphers",
9be3b2
+        value="${sshd_approved_ciphers}",
9be3b2
+        create=true,
9be3b2
+        insensitive=false,
9be3b2
+        prefix_regex="^.*"
9be3b2
+	)
9be3b2
+}}}
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/oval/shared.xml b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/oval/shared.xml
9be3b2
new file mode 100644
9be3b2
index 00000000000..1879e77398b
9be3b2
--- /dev/null
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/oval/shared.xml
9be3b2
@@ -0,0 +1,35 @@
9be3b2
+{{%- set PATH = "/etc/crypto-policies/back-ends/openssh.config" -%}}
9be3b2
+<def-group>
9be3b2
+  <definition class="compliance" id="{{{ rule_id }}}" version="1">
9be3b2
+    {{{ oval_metadata("Limit the Message Authentication Codes (MACs) to those which are FIPS-approved.") }}}
9be3b2
+    <criteria operator="AND" comment="Test conditions - presence of the file plus.">
9be3b2
+      <criterion comment="Check that {{{ PATH }}} contains FIPS-approved SSHD Ciphers" test_ref="test_{{{ rule_id }}}" />
9be3b2
+    </criteria>
9be3b2
+  </definition>
9be3b2
+
9be3b2
+  
9be3b2
+  comment="test the value of Ciphers setting in the {{{ PATH }}} file"
9be3b2
+  id="test_{{{ rule_id }}}" version="1">
9be3b2
+    <ind:object object_ref="obj_{{{ rule_id }}}" />
9be3b2
+    <ind:state state_ref="ste_{{{ rule_id }}}" />
9be3b2
+  </ind:textfilecontent54_test>
9be3b2
+
9be3b2
+  <ind:textfilecontent54_object id="obj_{{{ rule_id }}}" version="1">
9be3b2
+    <ind:filepath>{{{ PATH }}}</ind:filepath>
9be3b2
+    <ind:pattern operation="pattern match">^Ciphers.*$</ind:pattern>
9be3b2
+    <ind:instance operation="greater than or equal" datatype="int">1</ind:instance>
9be3b2
+  </ind:textfilecontent54_object>
9be3b2
+
9be3b2
+  <ind:textfilecontent54_state id="ste_{{{ rule_id }}}" version="1">
9be3b2
+    <ind:text var_ref="sshd_ciphers_crypto" operation="equals"></ind:text>
9be3b2
+  </ind:textfilecontent54_state>
9be3b2
+
9be3b2
+  <local_variable id="sshd_ciphers_crypto" datatype="string" comment="The regex of the directive" version="1">
9be3b2
+    <concat>
9be3b2
+      <literal_component>Ciphers </literal_component>
9be3b2
+      <variable_component var_ref="sshd_approved_ciphers"/>
9be3b2
+    </concat>
9be3b2
+  </local_variable>
9be3b2
+
9be3b2
+  <external_variable comment="SSH Approved Ciphers by FIPS" datatype="string" id="sshd_approved_ciphers" version="1" />
9be3b2
+</def-group>
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/rule.yml b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/rule.yml
9be3b2
new file mode 100644
9be3b2
index 00000000000..cd1553dbdb3
9be3b2
--- /dev/null
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/rule.yml
9be3b2
@@ -0,0 +1,62 @@
9be3b2
+documentation_complete: true
9be3b2
+
9be3b2
+prodtype: fedora,rhel8
9be3b2
+
9be3b2
+title: 'Configure SSH Daemon to Use FIPS 140-2 Validated Ciphers: openssh.config'
9be3b2
+
9be3b2
+description: |-
9be3b2
+    Crypto Policies provide a centralized control over crypto algorithms usage of many packages.
9be3b2
+    OpenSSH is supported by system crypto policy, but the OpenSSH configuration may be
9be3b2
+    set up incorrectly.
9be3b2
+
9be3b2
+    To check that Crypto Policies settings for ciphers are configured correctly, ensure that
9be3b2
+    <tt>/etc/crypto-policies/back-ends/openssh.config</tt> contains the following
9be3b2
+    line and is not commented out:
9be3b2
+    
Ciphers {{{ xccdf_value("sshd_approved_ciphers") }}}
9be3b2
+
9be3b2
+rationale: |-
9be3b2
+    Overriding the system crypto policy makes the behavior of the OpenSSH daemon
9be3b2
+    violate expectations, and makes system configuration more fragmented. By
9be3b2
+    specifying a cipher list with the order of ciphers being in a “strongest to
9be3b2
+    weakest” orientation, the system will automatically attempt to use the
9be3b2
+    strongest cipher for securing SSH connections.
9be3b2
+
9be3b2
+severity: medium
9be3b2
+
9be3b2
+identifiers:
9be3b2
+    cce@rhel8: CCE-85870-4
9be3b2
+
9be3b2
+references:
9be3b2
+    nist: AC-17(2)
9be3b2
+    srg: SRG-OS-000250-GPOS-00093
9be3b2
+    disa: CCI-001453
9be3b2
+    stigid@rhel8: RHEL-08-010291
9be3b2
+
9be3b2
+ocil_clause: 'Crypto Policy for OpenSSH Server is not configured correctly'
9be3b2
+
9be3b2
+ocil: |-
9be3b2
+    To verify if the OpenSSH daemon uses defined Cipher suite in the Crypto Policy, run:
9be3b2
+    
$ grep -i ciphers /etc/crypto-policies/back-ends/openssh.config
9be3b2
+    and verify that the line matches:
9be3b2
+    
Ciphers {{{ xccdf_value("sshd_approved_ciphers") }}}
9be3b2
+
9be3b2
+warnings:
9be3b2
+    - general: |-
9be3b2
+        The system needs to be rebooted for these changes to take effect.
9be3b2
+    - regulatory: |-
9be3b2
+        System Crypto Modules must be provided by a vendor that undergoes
9be3b2
+        FIPS-140 certifications.
9be3b2
+        FIPS-140 is applicable to all Federal agencies that use
9be3b2
+        cryptographic-based security systems to protect sensitive information
9be3b2
+        in computer and telecommunication systems (including voice systems) as
9be3b2
+        defined in Section 5131 of the Information Technology Management Reform
9be3b2
+        Act of 1996, Public Law 104-106. This standard shall be used in
9be3b2
+        designing and implementing cryptographic modules that Federal
9be3b2
+        departments and agencies operate or are operated for them under
9be3b2
+        contract. See {{{ weblink(link="https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.140-2.pdf") }}}
9be3b2
+        To meet this, the system has to have cryptographic software provided by
9be3b2
+        a vendor that has undergone this certification. This means providing
9be3b2
+        documentation, test results, design information, and independent third
9be3b2
+        party review by an accredited lab. While open source software is
9be3b2
+        capable of meeting this, it does not meet FIPS-140 unless the vendor
9be3b2
+        submits to this process.
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_correct.pass.sh b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_correct.pass.sh
9be3b2
new file mode 100644
9be3b2
index 00000000000..0a27a7e0984
9be3b2
--- /dev/null
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_correct.pass.sh
9be3b2
@@ -0,0 +1,15 @@
9be3b2
+#!/bin/bash
9be3b2
+# platform = multi_platform_fedora,Red Hat Enterprise Linux 8
9be3b2
+# profiles = xccdf_org.ssgproject.content_profile_stig
9be3b2
+
9be3b2
+sshd_approved_ciphers=aes256-ctr,aes192-ctr,aes128-ctr
9be3b2
+configfile=/etc/crypto-policies/back-ends/openssh.config
9be3b2
+
9be3b2
+# Ensure directory + file is there
9be3b2
+test -d /etc/crypto-policies/back-ends || mkdir -p /etc/crypto-policies/back-ends
9be3b2
+
9be3b2
+if [[ -f $configfile ]]; then
9be3b2
+    sed -i "s/^.*Ciphers.*$/Ciphers ${sshd_approved_ciphers}/" $configfile
9be3b2
+else
9be3b2
+    echo "Ciphers ${sshd_approved_ciphers}" > "$configfile"
9be3b2
+fi
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_correct_commented.fail.sh b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_correct_commented.fail.sh
9be3b2
new file mode 100644
9be3b2
index 00000000000..5cadd95ba38
9be3b2
--- /dev/null
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_correct_commented.fail.sh
9be3b2
@@ -0,0 +1,15 @@
9be3b2
+#!/bin/bash
9be3b2
+# platform = multi_platform_fedora,Red Hat Enterprise Linux 8
9be3b2
+# profiles = xccdf_org.ssgproject.content_profile_stig
9be3b2
+
9be3b2
+sshd_approved_ciphers=aes256-ctr,aes192-ctr,aes128-ctr
9be3b2
+configfile=/etc/crypto-policies/back-ends/openssh.config
9be3b2
+
9be3b2
+# Ensure directory + file is there
9be3b2
+test -d /etc/crypto-policies/back-ends || mkdir -p /etc/crypto-policies/back-ends
9be3b2
+
9be3b2
+if [[ -f $configfile ]]; then
9be3b2
+    sed -i "s/^.*Ciphers.*$/#Ciphers ${sshd_approved_ciphers}/" $configfile
9be3b2
+else
9be3b2
+    echo "#Ciphers ${sshd_approved_ciphers}" > "$configfile"
9be3b2
+fi
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_correct_followed_by_incorrect_commented.pass.sh b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_correct_followed_by_incorrect_commented.pass.sh
9be3b2
new file mode 100644
9be3b2
index 00000000000..26220063757
9be3b2
--- /dev/null
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_correct_followed_by_incorrect_commented.pass.sh
9be3b2
@@ -0,0 +1,18 @@
9be3b2
+#!/bin/bash
9be3b2
+# platform = multi_platform_fedora,Red Hat Enterprise Linux 8
9be3b2
+# profiles = xccdf_org.ssgproject.content_profile_stig
9be3b2
+
9be3b2
+sshd_approved_ciphers=aes256-ctr,aes192-ctr,aes128-ctr
9be3b2
+configfile=/etc/crypto-policies/back-ends/openssh.config
9be3b2
+
9be3b2
+# Ensure directory + file is there
9be3b2
+test -d /etc/crypto-policies/back-ends || mkdir -p /etc/crypto-policies/back-ends
9be3b2
+
9be3b2
+if [[ -f $configfile ]]; then
9be3b2
+    sed -i "s/^.*Ciphers.*$/Ciphers ${sshd_approved_ciphers}/" $configfile
9be3b2
+else
9be3b2
+    echo "Ciphers ${sshd_approved_ciphers}" > "$configfile"
9be3b2
+fi
9be3b2
+
9be3b2
+# follow up with incorrect
9be3b2
+echo "#Ciphers aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr" >> $configfile
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_empty_file.fail.sh b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_empty_file.fail.sh
9be3b2
new file mode 100644
9be3b2
index 00000000000..55ef3f58422
9be3b2
--- /dev/null
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_empty_file.fail.sh
9be3b2
@@ -0,0 +1,10 @@
9be3b2
+#!/bin/bash
9be3b2
+# platform = multi_platform_fedora,Red Hat Enterprise Linux 8
9be3b2
+# profiles = xccdf_org.ssgproject.content_profile_stig
9be3b2
+
9be3b2
+configfile=/etc/crypto-policies/back-ends/openssh.config
9be3b2
+
9be3b2
+# Ensure directory + file is there
9be3b2
+test -d /etc/crypto-policies/back-ends || mkdir -p /etc/crypto-policies/back-ends
9be3b2
+
9be3b2
+echo "" > $configfile
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_empty_policy.fail.sh b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_empty_policy.fail.sh
9be3b2
new file mode 100644
9be3b2
index 00000000000..7105441ad80
9be3b2
--- /dev/null
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_empty_policy.fail.sh
9be3b2
@@ -0,0 +1,14 @@
9be3b2
+#!/bin/bash
9be3b2
+# platform = multi_platform_fedora,Red Hat Enterprise Linux 8
9be3b2
+# profiles = xccdf_org.ssgproject.content_profile_stig
9be3b2
+
9be3b2
+configfile=/etc/crypto-policies/back-ends/openssh.config
9be3b2
+
9be3b2
+# Ensure directory + file is there
9be3b2
+test -d /etc/crypto-policies/back-ends || mkdir -p /etc/crypto-policies/back-ends
9be3b2
+
9be3b2
+if [[ -f $configfile ]]; then
9be3b2
+    sed -i "s/^.*Ciphers.*$/Ciphers /" $configfile
9be3b2
+else
9be3b2
+    echo "Ciphers " > "$configfile"
9be3b2
+fi
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_incorrect_followed_by_correct_commented.fail.sh b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_incorrect_followed_by_correct_commented.fail.sh
9be3b2
new file mode 100644
9be3b2
index 00000000000..195f5e8d8ed
9be3b2
--- /dev/null
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_incorrect_followed_by_correct_commented.fail.sh
9be3b2
@@ -0,0 +1,19 @@
9be3b2
+#!/bin/bash
9be3b2
+# platform = multi_platform_fedora,Red Hat Enterprise Linux 8
9be3b2
+# profiles = xccdf_org.ssgproject.content_profile_stig
9be3b2
+
9be3b2
+sshd_approved_ciphers=aes256-ctr,aes192-ctr,aes128-ctr
9be3b2
+incorrect_sshd_approved_ciphers=aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr
9be3b2
+configfile=/etc/crypto-policies/back-ends/openssh.config
9be3b2
+
9be3b2
+# Ensure directory + file is there
9be3b2
+test -d /etc/crypto-policies/back-ends || mkdir -p /etc/crypto-policies/back-ends
9be3b2
+
9be3b2
+if [[ -f $configfile ]]; then
9be3b2
+    sed -i "s/^.*Ciphers.*$/Ciphers ${incorrect_sshd_approved_ciphers}/" $configfile
9be3b2
+else
9be3b2
+    echo "Ciphers ${incorrect_sshd_approved_ciphers}" > "$configfile"
9be3b2
+fi
9be3b2
+
9be3b2
+# follow up with correct value
9be3b2
+echo "Ciphers ${sshd_approved_ciphers}" >> $configfile
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_incorrect_policy.fail.sh b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_incorrect_policy.fail.sh
9be3b2
new file mode 100644
9be3b2
index 00000000000..92bd4ed9c5a
9be3b2
--- /dev/null
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_incorrect_policy.fail.sh
9be3b2
@@ -0,0 +1,15 @@
9be3b2
+#!/bin/bash
9be3b2
+# platform = multi_platform_fedora,Red Hat Enterprise Linux 8
9be3b2
+# profiles = xccdf_org.ssgproject.content_profile_stig
9be3b2
+
9be3b2
+incorrect_sshd_approved_ciphers=aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes256-cbc
9be3b2
+configfile=/etc/crypto-policies/back-ends/openssh.config
9be3b2
+
9be3b2
+# Ensure directory + file is there
9be3b2
+test -d /etc/crypto-policies/back-ends || mkdir -p /etc/crypto-policies/back-ends
9be3b2
+
9be3b2
+if [[ -f $configfile ]]; then
9be3b2
+    sed -i "s/^.*Ciphers.*$/Ciphers ${incorrect_sshd_approved_ciphers}/" $configfile
9be3b2
+else
9be3b2
+    echo "Ciphers ${incorrect_sshd_approved_ciphers}" > "$configfile"
9be3b2
+fi
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_missing_file.fail.sh b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_missing_file.fail.sh
9be3b2
new file mode 100644
9be3b2
index 00000000000..2138caad319
9be3b2
--- /dev/null
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_missing_file.fail.sh
9be3b2
@@ -0,0 +1,11 @@
9be3b2
+#!/bin/bash
9be3b2
+# platform = multi_platform_fedora,Red Hat Enterprise Linux 8
9be3b2
+# profiles = xccdf_org.ssgproject.content_profile_stig
9be3b2
+
9be3b2
+configfile=/etc/crypto-policies/back-ends/openssh.config
9be3b2
+
9be3b2
+# Ensure directory + file is there
9be3b2
+test -d /etc/crypto-policies/back-ends || mkdir -p /etc/crypto-policies/back-ends
9be3b2
+
9be3b2
+# If file exists, remove it
9be3b2
+test -f $configfile && rm -f $configfile
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/ansible/shared.yml b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/ansible/shared.yml
9be3b2
new file mode 100644
9be3b2
index 00000000000..7532ba51639
9be3b2
--- /dev/null
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/ansible/shared.yml
9be3b2
@@ -0,0 +1,45 @@
9be3b2
+# platform = Red Hat Enterprise Linux 8,multi_platform_fedora
9be3b2
+# reboot = true
9be3b2
+# strategy = restrict
9be3b2
+# complexity = low
9be3b2
+# disruption = low
9be3b2
+{{{ ansible_instantiate_variables("sshd_approved_ciphers") }}}
9be3b2
+
9be3b2
+- name: "{{{ rule_title }}}: Set facts"
9be3b2
+  set_fact:
9be3b2
+    path: /etc/crypto-policies/back-ends/opensshserver.config
9be3b2
+    correct_value: "-oCiphers={{ sshd_approved_ciphers }}"
9be3b2
+
9be3b2
+- name: "{{{ rule_title }}}: Stat"
9be3b2
+  stat:
9be3b2
+    path: "{{ path }}"
9be3b2
+    follow: yes
9be3b2
+  register: opensshserver_file
9be3b2
+
9be3b2
+- name: "{{{ rule_title }}}: Create"
9be3b2
+  lineinfile:
9be3b2
+    path: "{{ path }}"
9be3b2
+    line: "{{ correct_value }}"
9be3b2
+    create: yes
9be3b2
+  when: not opensshserver_file.stat.exists or opensshserver_file.stat.size <= correct_value|length
9be3b2
+
9be3b2
+- name: "{{{ rule_title }}}"
9be3b2
+  block:
9be3b2
+    - name: "Existing value check"
9be3b2
+      lineinfile:
9be3b2
+        path: "{{ path }}"
9be3b2
+        create: false
9be3b2
+        regexp: "{{ correct_value }}"
9be3b2
+        state: absent
9be3b2
+      check_mode: true
9be3b2
+      changed_when: false
9be3b2
+      register: opensshserver
9be3b2
+
9be3b2
+    - name: "Update/Correct value"
9be3b2
+      replace:
9be3b2
+        path: "{{ path }}"
9be3b2
+        regexp: (-oCiphers=\S+)
9be3b2
+        replace: "{{ correct_value }}"
9be3b2
+      when: opensshserver.found is defined and opensshserver.found != 1
9be3b2
+
9be3b2
+  when: opensshserver_file.stat.exists and opensshserver_file.stat.size > correct_value|length
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/bash/shared.sh b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/bash/shared.sh
9be3b2
new file mode 100644
9be3b2
index 00000000000..1bc022f93b6
9be3b2
--- /dev/null
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/bash/shared.sh
9be3b2
@@ -0,0 +1,25 @@
9be3b2
+# platform = Red Hat Enterprise Linux 8,multi_platform_fedora
9be3b2
+. /usr/share/scap-security-guide/remediation_functions
9be3b2
+{{{ bash_instantiate_variables("sshd_approved_ciphers") }}}
9be3b2
+
9be3b2
+CONF_FILE=/etc/crypto-policies/back-ends/opensshserver.config
9be3b2
+correct_value="-oCiphers=${sshd_approved_ciphers}"
9be3b2
+
9be3b2
+grep -q ${correct_value} ${CONF_FILE}
9be3b2
+
9be3b2
+if [[ $? -ne 0 ]]; then
9be3b2
+    # We need to get the existing value, using PCRE to maintain same regex
9be3b2
+    existing_value=$(grep -Po '(-oCiphers=\S+)' ${CONF_FILE})
9be3b2
+
9be3b2
+    if [[ ! -z ${existing_value} ]]; then
9be3b2
+        # replace existing_value with correct_value
9be3b2
+        sed -i "s/${existing_value}/${correct_value}/g" ${CONF_FILE}
9be3b2
+    else
9be3b2
+        # ***NOTE*** #
9be3b2
+        # This probably means this file is not here or it's been modified
9be3b2
+        # unintentionally.
9be3b2
+        # ********** #
9be3b2
+        # echo correct_value to end
9be3b2
+        echo ${correct_value} >> ${CONF_FILE}
9be3b2
+    fi
9be3b2
+fi
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/oval/shared.xml b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/oval/shared.xml
9be3b2
new file mode 100644
9be3b2
index 00000000000..92ad7ce3d3f
9be3b2
--- /dev/null
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/oval/shared.xml
9be3b2
@@ -0,0 +1,35 @@
9be3b2
+{{%- set PATH = "/etc/crypto-policies/back-ends/opensshserver.config" -%}}
9be3b2
+<def-group>
9be3b2
+  <definition class="compliance" id="{{{ rule_id }}}" version="1">
9be3b2
+    {{{ oval_metadata("Limit the Message Authentication Codes (Ciphers) to those which are FIPS-approved.") }}}
9be3b2
+    <criteria operator="AND" comment="Test conditions - presence of the file plus.">
9be3b2
+      <criterion comment="Check that {{{ PATH }}} contains FIPS-approved SSHD Ciphers" test_ref="test_{{{ rule_id }}}" />
9be3b2
+    </criteria>
9be3b2
+  </definition>
9be3b2
+
9be3b2
+  
9be3b2
+  comment="test the value of Ciphers setting in the {{{ PATH }}} file"
9be3b2
+  id="test_{{{ rule_id }}}" version="1">
9be3b2
+    <ind:object object_ref="obj_{{{ rule_id }}}" />
9be3b2
+    <ind:state state_ref="ste_{{{ rule_id }}}" />
9be3b2
+  </ind:textfilecontent54_test>
9be3b2
+
9be3b2
+  <ind:textfilecontent54_object id="obj_{{{ rule_id }}}" version="1">
9be3b2
+    <ind:filepath>{{{ PATH }}}</ind:filepath>
9be3b2
+    <ind:pattern operation="pattern match">^.*(-oCiphers=\S+).*$</ind:pattern>
9be3b2
+    <ind:instance operation="equals" datatype="int">1</ind:instance>
9be3b2
+  </ind:textfilecontent54_object>
9be3b2
+
9be3b2
+  <ind:textfilecontent54_state id="ste_{{{ rule_id }}}" version="1">
9be3b2
+    <ind:subexpression var_ref="sshd_ciphers_crypto_opensshserver" operation="equals" />
9be3b2
+  </ind:textfilecontent54_state>
9be3b2
+
9be3b2
+  <local_variable id="sshd_ciphers_crypto_opensshserver" datatype="string" comment="The regex of the directive" version="1">
9be3b2
+    <concat>
9be3b2
+      <literal_component>-oCiphers=</literal_component>
9be3b2
+      <variable_component var_ref="sshd_approved_ciphers"/>
9be3b2
+    </concat>
9be3b2
+  </local_variable>
9be3b2
+
9be3b2
+  <external_variable comment="SSH Approved Ciphers by FIPS" datatype="string" id="sshd_approved_ciphers" version="1" />
9be3b2
+</def-group>
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/rule.yml b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/rule.yml
9be3b2
new file mode 100644
9be3b2
index 00000000000..877c6f38db0
9be3b2
--- /dev/null
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/rule.yml
9be3b2
@@ -0,0 +1,62 @@
9be3b2
+documentation_complete: true
9be3b2
+
9be3b2
+prodtype: rhel8
9be3b2
+
9be3b2
+title: 'Configure SSH Daemon to Use FIPS 140-2 Validated MACs: opensshserver.config'
9be3b2
+
9be3b2
+description: |-
9be3b2
+    Crypto Policies provide a centralized control over crypto algorithms usage of many packages.
9be3b2
+    OpenSSH is supported by system crypto policy, but the OpenSSH configuration may be
9be3b2
+    set up incorrectly.
9be3b2
+
9be3b2
+    To check that Crypto Policies settings for ciphers are configured correctly, ensure that
9be3b2
+    <tt>/etc/crypto-policies/back-ends/opensshserver.config</tt> contains the following
9be3b2
+    text and is not commented out:
9be3b2
+    
-oCiphers={{{ xccdf_value("sshd_approved_ciphers") }}}
9be3b2
+
9be3b2
+rationale: |-
9be3b2
+    Overriding the system crypto policy makes the behavior of the OpenSSH daemon
9be3b2
+    violate expectations, and makes system configuration more fragmented. By
9be3b2
+    specifying a cipher list with the order of ciphers being in a “strongest to
9be3b2
+    weakest” orientation, the system will automatically attempt to use the
9be3b2
+    strongest cipher for securing SSH connections.
9be3b2
+
9be3b2
+severity: medium
9be3b2
+
9be3b2
+identifiers:
9be3b2
+    cce@rhel8: CCE-85871-2
9be3b2
+
9be3b2
+references:
9be3b2
+    nist: AC-17(2)
9be3b2
+    srg: SRG-OS-000250-GPOS-00093
9be3b2
+    disa: CCI-001453
9be3b2
+    stigid@rhel8: RHEL-08-010290
9be3b2
+
9be3b2
+ocil_clause: 'Crypto Policy for OpenSSH Server is not configured correctly'
9be3b2
+
9be3b2
+ocil: |-
9be3b2
+    To verify if the OpenSSH daemon uses defined MACs in the Crypto Policy, run:
9be3b2
+    
$ grep -Po '(-oCiphers=\S+)' /etc/crypto-policies/back-ends/opensshserver.config
9be3b2
+    and verify that the line matches:
9be3b2
+    
-oCiphers={{{ xccdf_value("sshd_approved_ciphers") }}}
9be3b2
+
9be3b2
+warnings:
9be3b2
+    - general: |-
9be3b2
+        The system needs to be rebooted for these changes to take effect.
9be3b2
+    - regulatory: |-
9be3b2
+        System Crypto Modules must be provided by a vendor that undergoes
9be3b2
+        FIPS-140 certifications.
9be3b2
+        FIPS-140 is applicable to all Federal agencies that use
9be3b2
+        cryptographic-based security systems to protect sensitive information
9be3b2
+        in computer and telecommunication systems (including voice systems) as
9be3b2
+        defined in Section 5131 of the Information Technology Management Reform
9be3b2
+        Act of 1996, Public Law 104-106. This standard shall be used in
9be3b2
+        designing and implementing cryptographic modules that Federal
9be3b2
+        departments and agencies operate or are operated for them under
9be3b2
+        contract. See {{{ weblink(link="https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.140-2.pdf") }}}
9be3b2
+        To meet this, the system has to have cryptographic software provided by
9be3b2
+        a vendor that has undergone this certification. This means providing
9be3b2
+        documentation, test results, design information, and independent third
9be3b2
+        party review by an accredited lab. While open source software is
9be3b2
+        capable of meeting this, it does not meet FIPS-140 unless the vendor
9be3b2
+        submits to this process.
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/tests/rhel8_stig_correct.pass.sh b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/tests/rhel8_stig_correct.pass.sh
9be3b2
new file mode 100644
9be3b2
index 00000000000..1a8911d523c
9be3b2
--- /dev/null
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/tests/rhel8_stig_correct.pass.sh
9be3b2
@@ -0,0 +1,17 @@
9be3b2
+#!/bin/bash
9be3b2
+# platform = Red Hat Enterprise Linux 8
9be3b2
+# profiles = xccdf_org.ssgproject.content_profile_stig
9be3b2
+
9be3b2
+sshd_approved_ciphers=aes256-ctr,aes192-ctr,aes128-ctr
9be3b2
+configfile=/etc/crypto-policies/back-ends/opensshserver.config
9be3b2
+correct_value="-oCiphers=${sshd_approved_ciphers}"
9be3b2
+
9be3b2
+# Ensure directory + file is there
9be3b2
+test -d /etc/crypto-policies/back-ends || mkdir -p /etc/crypto-policies/back-ends
9be3b2
+
9be3b2
+# Proceed when file exists
9be3b2
+if [[ -f $configfile ]]; then
9be3b2
+    sed -i -r "s/-oCiphers=\S+/${correct_value}/" $configfile
9be3b2
+else
9be3b2
+    echo "${correct_value}" > "$configfile"
9be3b2
+fi
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/tests/rhel8_stig_empty_policy.fail.sh b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/tests/rhel8_stig_empty_policy.fail.sh
9be3b2
new file mode 100644
9be3b2
index 00000000000..3dde1479296
9be3b2
--- /dev/null
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/tests/rhel8_stig_empty_policy.fail.sh
9be3b2
@@ -0,0 +1,7 @@
9be3b2
+#!/bin/bash
9be3b2
+# platform = Red Hat Enterprise Linux 8
9be3b2
+# profiles = xccdf_org.ssgproject.content_profile_stig
9be3b2
+
9be3b2
+configfile=/etc/crypto-policies/back-ends/opensshserver.config
9be3b2
+
9be3b2
+echo "" > "$configfile"
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/tests/rhel8_stig_incorrect_policy.fail.sh b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/tests/rhel8_stig_incorrect_policy.fail.sh
9be3b2
new file mode 100644
9be3b2
index 00000000000..f97f54db502
9be3b2
--- /dev/null
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/tests/rhel8_stig_incorrect_policy.fail.sh
9be3b2
@@ -0,0 +1,14 @@
9be3b2
+#!/bin/bash
9be3b2
+# platform = Red Hat Enterprise Linux 8
9be3b2
+# profiles = xccdf_org.ssgproject.content_profile_stig
9be3b2
+
9be3b2
+configfile=/etc/crypto-policies/back-ends/opensshserver.config
9be3b2
+
9be3b2
+# Ensure directory + file is there
9be3b2
+test -d /etc/crypto-policies/back-ends || mkdir -p /etc/crypto-policies/back-ends
9be3b2
+
9be3b2
+if [[ -f $configfile ]]; then
9be3b2
+    sed -i -r "s/-oCiphers=\S+/-oCiphers=aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes256-cbc/" $configfile
9be3b2
+else
9be3b2
+    echo "-oCiphers=aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes256-cbc" > "$configfile"
9be3b2
+fi
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/tests/rhel8_stig_missing_file.fail.sh b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/tests/rhel8_stig_missing_file.fail.sh
9be3b2
new file mode 100644
9be3b2
index 00000000000..11e596ced87
9be3b2
--- /dev/null
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/tests/rhel8_stig_missing_file.fail.sh
9be3b2
@@ -0,0 +1,11 @@
9be3b2
+#!/bin/bash
9be3b2
+# platform = Red Hat Enterprise Linux 8
9be3b2
+# profiles = xccdf_org.ssgproject.content_profile_stig
9be3b2
+
9be3b2
+configfile=/etc/crypto-policies/back-ends/opensshserver.config
9be3b2
+
9be3b2
+# Ensure directory + file is there
9be3b2
+test -d /etc/crypto-policies/back-ends || mkdir -p /etc/crypto-policies/back-ends
9be3b2
+
9be3b2
+# If file exists, remove it
9be3b2
+test -f $configfile && rm -f $configfile
9be3b2
diff --git a/products/rhel8/profiles/stig.profile b/products/rhel8/profiles/stig.profile
9be3b2
index 28b47cca487..a3783efafd6 100644
9be3b2
--- a/products/rhel8/profiles/stig.profile
9be3b2
+++ b/products/rhel8/profiles/stig.profile
9be3b2
@@ -50,7 +50,11 @@ selections:
9be3b2
     - var_password_pam_retry=3
9be3b2
     - var_password_pam_minlen=15
9be3b2
     - var_sshd_set_keepalive=0
9be3b2
+<<<<<<< HEAD
9be3b2
     - sshd_approved_macs=stig
9be3b2
+=======
9be3b2
+    - sshd_approved_ciphers=stig
9be3b2
+>>>>>>> 4d62df6b2 (New rules for RHEL-08-010291)
9be3b2
     - sshd_idle_timeout_value=10_minutes
9be3b2
     - var_accounts_passwords_pam_faillock_deny=3
9be3b2
     - var_accounts_passwords_pam_faillock_fail_interval=900
9be3b2
@@ -185,6 +189,8 @@ selections:
9be3b2
     - harden_sshd_macs_opensshserver_conf_crypto_policy
9be3b2
 
9be3b2
     # RHEL-08-010291
9be3b2
+    - harden_sshd_ciphers_openssh_conf_crypto_policy
9be3b2
+    - harden_sshd_ciphers_opensshserver_conf_crypto_policy
9be3b2
 
9be3b2
     # RHEL-08-010292
9be3b2
     - sshd_use_strong_rng
9be3b2
diff --git a/tests/data/profile_stability/rhel8/stig.profile b/tests/data/profile_stability/rhel8/stig.profile
9be3b2
index 393051a34ea..05335cc38fb 100644
9be3b2
--- a/tests/data/profile_stability/rhel8/stig.profile
9be3b2
+++ b/tests/data/profile_stability/rhel8/stig.profile
9be3b2
@@ -147,6 +147,8 @@ selections:
9be3b2
 - grub2_vsyscall_argument
9be3b2
 - harden_sshd_macs_openssh_conf_crypto_policy
9be3b2
 - harden_sshd_macs_opensshserver_conf_crypto_policy
9be3b2
+- harden_sshd_ciphers_openssh_conf_crypto_policy
9be3b2
+- harden_sshd_ciphers_opensshserver_conf_crypto_policy
9be3b2
 - install_smartcard_packages
9be3b2
 - installed_OS_is_vendor_supported
9be3b2
 - kerberos_disable_no_keytab
9be3b2
@@ -328,6 +330,7 @@ selections:
9be3b2
 - var_password_pam_retry=3
9be3b2
 - var_sshd_set_keepalive=0
9be3b2
 - sshd_approved_macs=stig
9be3b2
+- sshd_approved_ciphers=stig
9be3b2
 - sshd_idle_timeout_value=10_minutes
9be3b2
 - var_accounts_passwords_pam_faillock_deny=3
9be3b2
 - var_accounts_passwords_pam_faillock_fail_interval=900
9be3b2
diff --git a/tests/data/profile_stability/rhel8/stig_gui.profile b/tests/data/profile_stability/rhel8/stig_gui.profile
9be3b2
index de82fb34518..a0adc835a0d 100644
9be3b2
--- a/tests/data/profile_stability/rhel8/stig_gui.profile
9be3b2
+++ b/tests/data/profile_stability/rhel8/stig_gui.profile
9be3b2
@@ -158,6 +158,8 @@ selections:
9be3b2
 - grub2_vsyscall_argument
9be3b2
 - harden_sshd_macs_openssh_conf_crypto_policy
9be3b2
 - harden_sshd_macs_opensshserver_conf_crypto_policy
9be3b2
+- harden_sshd_ciphers_openssh_conf_crypto_policy
9be3b2
+- harden_sshd_ciphers_opensshserver_conf_crypto_policy
9be3b2
 - install_smartcard_packages
9be3b2
 - installed_OS_is_vendor_supported
9be3b2
 - kerberos_disable_no_keytab
9be3b2
@@ -338,6 +340,7 @@ selections:
9be3b2
 - var_password_pam_retry=3
9be3b2
 - var_sshd_set_keepalive=0
9be3b2
 - sshd_approved_macs=stig
9be3b2
+- sshd_approved_ciphers=stig
9be3b2
 - sshd_idle_timeout_value=10_minutes
9be3b2
 - var_accounts_passwords_pam_faillock_deny=3
9be3b2
 - var_accounts_passwords_pam_faillock_fail_interval=900
9be3b2
9be3b2
From c943e715615de1aa957d62d239e532f86ef0959e Mon Sep 17 00:00:00 2001
9be3b2
From: Carlos Matos <cmatos@redhat.com>
9be3b2
Date: Tue, 29 Jun 2021 14:04:49 -0400
9be3b2
Subject: [PATCH 2/5] replaced MACs with Ciphers
9be3b2
9be3b2
---
9be3b2
 .../ansible/shared.yml                                          | 2 +-
9be3b2
 .../oval/shared.xml                                             | 2 +-
9be3b2
 .../oval/shared.xml                                             | 2 +-
9be3b2
 3 files changed, 3 insertions(+), 3 deletions(-)
9be3b2
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/ansible/shared.yml b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/ansible/shared.yml
9be3b2
index badb5896cf2..956a19f3025 100644
9be3b2
--- a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/ansible/shared.yml
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/ansible/shared.yml
9be3b2
@@ -6,7 +6,7 @@
9be3b2
 {{{ ansible_instantiate_variables("sshd_approved_ciphers") }}}
9be3b2
 
9be3b2
 {{{ ansible_set_config_file(
9be3b2
-        msg='Configure SSH Daemon to Use FIPS 140-2 Validated MACs: openssh.config',
9be3b2
+        msg='Configure SSH Daemon to Use FIPS 140-2 Validated Ciphers: openssh.config',
9be3b2
         file='/etc/crypto-policies/back-ends/openssh.config',
9be3b2
         parameter='Ciphers',
9be3b2
         value="{{ sshd_approved_ciphers }}",
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/oval/shared.xml b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/oval/shared.xml
9be3b2
index 1879e77398b..9b3b4f1995d 100644
9be3b2
--- a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/oval/shared.xml
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/oval/shared.xml
9be3b2
@@ -1,7 +1,7 @@
9be3b2
 {{%- set PATH = "/etc/crypto-policies/back-ends/openssh.config" -%}}
9be3b2
 <def-group>
9be3b2
   <definition class="compliance" id="{{{ rule_id }}}" version="1">
9be3b2
-    {{{ oval_metadata("Limit the Message Authentication Codes (MACs) to those which are FIPS-approved.") }}}
9be3b2
+    {{{ oval_metadata("Limit the Ciphers to those which are FIPS-approved.") }}}
9be3b2
     <criteria operator="AND" comment="Test conditions - presence of the file plus.">
9be3b2
       <criterion comment="Check that {{{ PATH }}} contains FIPS-approved SSHD Ciphers" test_ref="test_{{{ rule_id }}}" />
9be3b2
     </criteria>
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/oval/shared.xml b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/oval/shared.xml
9be3b2
index 92ad7ce3d3f..3afbc1619a4 100644
9be3b2
--- a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/oval/shared.xml
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/oval/shared.xml
9be3b2
@@ -1,7 +1,7 @@
9be3b2
 {{%- set PATH = "/etc/crypto-policies/back-ends/opensshserver.config" -%}}
9be3b2
 <def-group>
9be3b2
   <definition class="compliance" id="{{{ rule_id }}}" version="1">
9be3b2
-    {{{ oval_metadata("Limit the Message Authentication Codes (Ciphers) to those which are FIPS-approved.") }}}
9be3b2
+    {{{ oval_metadata("Limit the Ciphers to those which are FIPS-approved.") }}}
9be3b2
     <criteria operator="AND" comment="Test conditions - presence of the file plus.">
9be3b2
       <criterion comment="Check that {{{ PATH }}} contains FIPS-approved SSHD Ciphers" test_ref="test_{{{ rule_id }}}" />
9be3b2
     </criteria>
9be3b2
9be3b2
From 26383895dfffc5e643295301c052ccd3d77cb906 Mon Sep 17 00:00:00 2001
9be3b2
From: Carlos Matos <cmatos@redhat.com>
9be3b2
Date: Mon, 19 Jul 2021 09:33:38 -0400
9be3b2
Subject: [PATCH 3/5] Fixed issue with oval not checking for commented out
9be3b2
 line, and updated remediations
9be3b2
9be3b2
---
9be3b2
 .../rule.yml                                           |  8 ++++----
9be3b2
 .../ansible/shared.yml                                 |  2 +-
9be3b2
 .../bash/shared.sh                                     | 10 ++++++++--
9be3b2
 .../oval/shared.xml                                    |  2 +-
9be3b2
 .../rule.yml                                           |  6 +++---
9be3b2
 5 files changed, 17 insertions(+), 11 deletions(-)
9be3b2
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/rule.yml b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/rule.yml
9be3b2
index cd1553dbdb3..d626ec6e260 100644
9be3b2
--- a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/rule.yml
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/rule.yml
9be3b2
@@ -2,7 +2,7 @@ documentation_complete: true
9be3b2
 
9be3b2
 prodtype: fedora,rhel8
9be3b2
 
9be3b2
-title: 'Configure SSH Daemon to Use FIPS 140-2 Validated Ciphers: openssh.config'
9be3b2
+title: 'Configure SSH Client to Use FIPS 140-2 Validated Ciphers: openssh.config'
9be3b2
 
9be3b2
 description: |-
9be3b2
     Crypto Policies provide a centralized control over crypto algorithms usage of many packages.
9be3b2
@@ -15,7 +15,7 @@ description: |-
9be3b2
     
Ciphers {{{ xccdf_value("sshd_approved_ciphers") }}}
9be3b2
 
9be3b2
 rationale: |-
9be3b2
-    Overriding the system crypto policy makes the behavior of the OpenSSH daemon
9be3b2
+    Overriding the system crypto policy makes the behavior of the OpenSSH client
9be3b2
     violate expectations, and makes system configuration more fragmented. By
9be3b2
     specifying a cipher list with the order of ciphers being in a “strongest to
9be3b2
     weakest” orientation, the system will automatically attempt to use the
9be3b2
@@ -32,10 +32,10 @@ references:
9be3b2
     disa: CCI-001453
9be3b2
     stigid@rhel8: RHEL-08-010291
9be3b2
 
9be3b2
-ocil_clause: 'Crypto Policy for OpenSSH Server is not configured correctly'
9be3b2
+ocil_clause: 'Crypto Policy for OpenSSH client is not configured correctly'
9be3b2
 
9be3b2
 ocil: |-
9be3b2
-    To verify if the OpenSSH daemon uses defined Cipher suite in the Crypto Policy, run:
9be3b2
+    To verify if the OpenSSH client uses defined Cipher suite in the Crypto Policy, run:
9be3b2
     
$ grep -i ciphers /etc/crypto-policies/back-ends/openssh.config
9be3b2
     and verify that the line matches:
9be3b2
     
Ciphers {{{ xccdf_value("sshd_approved_ciphers") }}}
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/ansible/shared.yml b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/ansible/shared.yml
9be3b2
index 7532ba51639..3e637f37e69 100644
9be3b2
--- a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/ansible/shared.yml
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/ansible/shared.yml
9be3b2
@@ -19,7 +19,7 @@
9be3b2
 - name: "{{{ rule_title }}}: Create"
9be3b2
   lineinfile:
9be3b2
     path: "{{ path }}"
9be3b2
-    line: "{{ correct_value }}"
9be3b2
+    line: "CRYPTO_POLICY='{{ correct_value }}'"
9be3b2
     create: yes
9be3b2
   when: not opensshserver_file.stat.exists or opensshserver_file.stat.size <= correct_value|length
9be3b2
 
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/bash/shared.sh b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/bash/shared.sh
9be3b2
index 1bc022f93b6..eaa4463caad 100644
9be3b2
--- a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/bash/shared.sh
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/bash/shared.sh
9be3b2
@@ -5,7 +5,13 @@
9be3b2
 CONF_FILE=/etc/crypto-policies/back-ends/opensshserver.config
9be3b2
 correct_value="-oCiphers=${sshd_approved_ciphers}"
9be3b2
 
9be3b2
-grep -q ${correct_value} ${CONF_FILE}
9be3b2
+# Test if file exists
9be3b2
+test -f ${CONF_FILE} || touch ${CONF_FILE}
9be3b2
+
9be3b2
+# Ensure CRYPTO_POLICY is not commented out
9be3b2
+sed -i 's/#CRYPTO_POLICY=/CRYPTO_POLICY=/' ${CONF_FILE}
9be3b2
+
9be3b2
+grep -q "'${correct_value}'" ${CONF_FILE}
9be3b2
 
9be3b2
 if [[ $? -ne 0 ]]; then
9be3b2
     # We need to get the existing value, using PCRE to maintain same regex
9be3b2
@@ -20,6 +26,6 @@ if [[ $? -ne 0 ]]; then
9be3b2
         # unintentionally.
9be3b2
         # ********** #
9be3b2
         # echo correct_value to end
9be3b2
-        echo ${correct_value} >> ${CONF_FILE}
9be3b2
+        echo "CRYPTO_POLICY='${correct_value}'" >> ${CONF_FILE}
9be3b2
     fi
9be3b2
 fi
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/oval/shared.xml b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/oval/shared.xml
9be3b2
index 3afbc1619a4..53919eaae7f 100644
9be3b2
--- a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/oval/shared.xml
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/oval/shared.xml
9be3b2
@@ -16,7 +16,7 @@
9be3b2
 
9be3b2
   <ind:textfilecontent54_object id="obj_{{{ rule_id }}}" version="1">
9be3b2
     <ind:filepath>{{{ PATH }}}</ind:filepath>
9be3b2
-    <ind:pattern operation="pattern match">^.*(-oCiphers=\S+).*$</ind:pattern>
9be3b2
+    <ind:pattern operation="pattern match">^(?!#).*(-oCiphers=\S+).*$</ind:pattern>
9be3b2
     <ind:instance operation="equals" datatype="int">1</ind:instance>
9be3b2
   </ind:textfilecontent54_object>
9be3b2
 
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/rule.yml b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/rule.yml
9be3b2
index 877c6f38db0..0aac8e2038d 100644
9be3b2
--- a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/rule.yml
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/rule.yml
9be3b2
@@ -2,7 +2,7 @@ documentation_complete: true
9be3b2
 
9be3b2
 prodtype: rhel8
9be3b2
 
9be3b2
-title: 'Configure SSH Daemon to Use FIPS 140-2 Validated MACs: opensshserver.config'
9be3b2
+title: 'Configure SSH Server to Use FIPS 140-2 Validated MACs: opensshserver.config'
9be3b2
 
9be3b2
 description: |-
9be3b2
     Crypto Policies provide a centralized control over crypto algorithms usage of many packages.
9be3b2
@@ -15,7 +15,7 @@ description: |-
9be3b2
     
-oCiphers={{{ xccdf_value("sshd_approved_ciphers") }}}
9be3b2
 
9be3b2
 rationale: |-
9be3b2
-    Overriding the system crypto policy makes the behavior of the OpenSSH daemon
9be3b2
+    Overriding the system crypto policy makes the behavior of the OpenSSH server
9be3b2
     violate expectations, and makes system configuration more fragmented. By
9be3b2
     specifying a cipher list with the order of ciphers being in a “strongest to
9be3b2
     weakest” orientation, the system will automatically attempt to use the
9be3b2
@@ -35,7 +35,7 @@ references:
9be3b2
 ocil_clause: 'Crypto Policy for OpenSSH Server is not configured correctly'
9be3b2
 
9be3b2
 ocil: |-
9be3b2
-    To verify if the OpenSSH daemon uses defined MACs in the Crypto Policy, run:
9be3b2
+    To verify if the OpenSSH server uses defined MACs in the Crypto Policy, run:
9be3b2
     
$ grep -Po '(-oCiphers=\S+)' /etc/crypto-policies/back-ends/opensshserver.config
9be3b2
     and verify that the line matches:
9be3b2
     
-oCiphers={{{ xccdf_value("sshd_approved_ciphers") }}}
9be3b2
9be3b2
From 7967125f58de7e6843002d674fab90c4429452f3 Mon Sep 17 00:00:00 2001
9be3b2
From: Carlos Matos <cmatos@redhat.com>
9be3b2
Date: Mon, 19 Jul 2021 09:53:28 -0400
9be3b2
Subject: [PATCH 4/5] Replace MACs verbiage with ciphers
9be3b2
9be3b2
---
9be3b2
 .../rule.yml                                                  | 4 ++--
9be3b2
 1 file changed, 2 insertions(+), 2 deletions(-)
9be3b2
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/rule.yml b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/rule.yml
9be3b2
index 0aac8e2038d..81ee763831d 100644
9be3b2
--- a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/rule.yml
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/rule.yml
9be3b2
@@ -2,7 +2,7 @@ documentation_complete: true
9be3b2
 
9be3b2
 prodtype: rhel8
9be3b2
 
9be3b2
-title: 'Configure SSH Server to Use FIPS 140-2 Validated MACs: opensshserver.config'
9be3b2
+title: 'Configure SSH Server to Use FIPS 140-2 Validated Ciphers: opensshserver.config'
9be3b2
 
9be3b2
 description: |-
9be3b2
     Crypto Policies provide a centralized control over crypto algorithms usage of many packages.
9be3b2
@@ -35,7 +35,7 @@ references:
9be3b2
 ocil_clause: 'Crypto Policy for OpenSSH Server is not configured correctly'
9be3b2
 
9be3b2
 ocil: |-
9be3b2
-    To verify if the OpenSSH server uses defined MACs in the Crypto Policy, run:
9be3b2
+    To verify if the OpenSSH server uses defined ciphers in the Crypto Policy, run:
9be3b2
     
$ grep -Po '(-oCiphers=\S+)' /etc/crypto-policies/back-ends/opensshserver.config
9be3b2
     and verify that the line matches:
9be3b2
     
-oCiphers={{{ xccdf_value("sshd_approved_ciphers") }}}
9be3b2
9be3b2
From ab21f2d59db725f07b70e3e748ebc96c34e23b79 Mon Sep 17 00:00:00 2001
9be3b2
From: Carlos Matos <cmatos@redhat.com>
9be3b2
Date: Tue, 20 Jul 2021 09:01:50 -0400
9be3b2
Subject: [PATCH 5/5] Sorted refs, updated test scenario, fixed duplicate CCE
9be3b2
9be3b2
---
9be3b2
 .../harden_sshd_ciphers_openssh_conf_crypto_policy/rule.yml   | 4 ++--
9be3b2
 .../stig_incorrect_followed_by_correct_commented.fail.sh      | 2 +-
9be3b2
 .../rule.yml                                                  | 4 ++--
9be3b2
 products/rhel8/profiles/stig.profile                          | 3 ---
9be3b2
 shared/references/cce-redhat-avail.txt                        | 2 --
9be3b2
 tests/data/profile_stability/rhel8/stig.profile               | 4 ++--
9be3b2
 tests/data/profile_stability/rhel8/stig_gui.profile           | 4 ++--
9be3b2
 7 files changed, 9 insertions(+), 14 deletions(-)
9be3b2
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/rule.yml b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/rule.yml
9be3b2
index d626ec6e260..0aa310d9245 100644
9be3b2
--- a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/rule.yml
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/rule.yml
9be3b2
@@ -24,12 +24,12 @@ rationale: |-
9be3b2
 severity: medium
9be3b2
 
9be3b2
 identifiers:
9be3b2
-    cce@rhel8: CCE-85870-4
9be3b2
+    cce@rhel8: CCE-85902-5
9be3b2
 
9be3b2
 references:
9be3b2
+    disa: CCI-001453
9be3b2
     nist: AC-17(2)
9be3b2
     srg: SRG-OS-000250-GPOS-00093
9be3b2
-    disa: CCI-001453
9be3b2
     stigid@rhel8: RHEL-08-010291
9be3b2
 
9be3b2
 ocil_clause: 'Crypto Policy for OpenSSH client is not configured correctly'
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_incorrect_followed_by_correct_commented.fail.sh b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_incorrect_followed_by_correct_commented.fail.sh
9be3b2
index 195f5e8d8ed..6ad1f4fd0f3 100644
9be3b2
--- a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_incorrect_followed_by_correct_commented.fail.sh
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_openssh_conf_crypto_policy/tests/stig_incorrect_followed_by_correct_commented.fail.sh
9be3b2
@@ -16,4 +16,4 @@ else
9be3b2
 fi
9be3b2
 
9be3b2
 # follow up with correct value
9be3b2
-echo "Ciphers ${sshd_approved_ciphers}" >> $configfile
9be3b2
+echo "#Ciphers ${sshd_approved_ciphers}" >> $configfile
9be3b2
diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/rule.yml b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/rule.yml
9be3b2
index 81ee763831d..b56f2421f22 100644
9be3b2
--- a/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/rule.yml
9be3b2
+++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_ciphers_opensshserver_conf_crypto_policy/rule.yml
9be3b2
@@ -24,12 +24,12 @@ rationale: |-
9be3b2
 severity: medium
9be3b2
 
9be3b2
 identifiers:
9be3b2
-    cce@rhel8: CCE-85871-2
9be3b2
+    cce@rhel8: CCE-85897-7
9be3b2
 
9be3b2
 references:
9be3b2
+    disa: CCI-001453
9be3b2
     nist: AC-17(2)
9be3b2
     srg: SRG-OS-000250-GPOS-00093
9be3b2
-    disa: CCI-001453
9be3b2
     stigid@rhel8: RHEL-08-010290
9be3b2
 
9be3b2
 ocil_clause: 'Crypto Policy for OpenSSH Server is not configured correctly'
9be3b2
diff --git a/products/rhel8/profiles/stig.profile b/products/rhel8/profiles/stig.profile
9be3b2
index a3783efafd6..7270a8f91f2 100644
9be3b2
--- a/products/rhel8/profiles/stig.profile
9be3b2
+++ b/products/rhel8/profiles/stig.profile
9be3b2
@@ -50,11 +50,8 @@ selections:
9be3b2
     - var_password_pam_retry=3
9be3b2
     - var_password_pam_minlen=15
9be3b2
     - var_sshd_set_keepalive=0
9be3b2
-<<<<<<< HEAD
9be3b2
     - sshd_approved_macs=stig
9be3b2
-=======
9be3b2
     - sshd_approved_ciphers=stig
9be3b2
->>>>>>> 4d62df6b2 (New rules for RHEL-08-010291)
9be3b2
     - sshd_idle_timeout_value=10_minutes
9be3b2
     - var_accounts_passwords_pam_faillock_deny=3
9be3b2
     - var_accounts_passwords_pam_faillock_fail_interval=900
9be3b2
diff --git a/shared/references/cce-redhat-avail.txt b/shared/references/cce-redhat-avail.txt
9be3b2
index 036d34cea1d..665f903ead4 100644
9be3b2
--- a/shared/references/cce-redhat-avail.txt
9be3b2
+++ b/shared/references/cce-redhat-avail.txt
9be3b2
@@ -33,11 +33,9 @@ CCE-85892-8
9be3b2
 CCE-85893-6
9be3b2
 CCE-85895-1
9be3b2
 CCE-85896-9
9be3b2
-CCE-85897-7
9be3b2
 CCE-85898-5
9be3b2
 CCE-85900-9
9be3b2
 CCE-85901-7
9be3b2
-CCE-85902-5
9be3b2
 CCE-85903-3
9be3b2
 CCE-85904-1
9be3b2
 CCE-85905-8
9be3b2
diff --git a/tests/data/profile_stability/rhel8/stig.profile b/tests/data/profile_stability/rhel8/stig.profile
9be3b2
index 05335cc38fb..7d59cfff625 100644
9be3b2
--- a/tests/data/profile_stability/rhel8/stig.profile
9be3b2
+++ b/tests/data/profile_stability/rhel8/stig.profile
9be3b2
@@ -145,10 +145,10 @@ selections:
9be3b2
 - grub2_uefi_admin_username
9be3b2
 - grub2_uefi_password
9be3b2
 - grub2_vsyscall_argument
9be3b2
-- harden_sshd_macs_openssh_conf_crypto_policy
9be3b2
-- harden_sshd_macs_opensshserver_conf_crypto_policy
9be3b2
 - harden_sshd_ciphers_openssh_conf_crypto_policy
9be3b2
 - harden_sshd_ciphers_opensshserver_conf_crypto_policy
9be3b2
+- harden_sshd_macs_openssh_conf_crypto_policy
9be3b2
+- harden_sshd_macs_opensshserver_conf_crypto_policy
9be3b2
 - install_smartcard_packages
9be3b2
 - installed_OS_is_vendor_supported
9be3b2
 - kerberos_disable_no_keytab
9be3b2
diff --git a/tests/data/profile_stability/rhel8/stig_gui.profile b/tests/data/profile_stability/rhel8/stig_gui.profile
9be3b2
index a0adc835a0d..2c2daad6f6d 100644
9be3b2
--- a/tests/data/profile_stability/rhel8/stig_gui.profile
9be3b2
+++ b/tests/data/profile_stability/rhel8/stig_gui.profile
9be3b2
@@ -156,10 +156,10 @@ selections:
9be3b2
 - grub2_uefi_admin_username
9be3b2
 - grub2_uefi_password
9be3b2
 - grub2_vsyscall_argument
9be3b2
-- harden_sshd_macs_openssh_conf_crypto_policy
9be3b2
-- harden_sshd_macs_opensshserver_conf_crypto_policy
9be3b2
 - harden_sshd_ciphers_openssh_conf_crypto_policy
9be3b2
 - harden_sshd_ciphers_opensshserver_conf_crypto_policy
9be3b2
+- harden_sshd_macs_openssh_conf_crypto_policy
9be3b2
+- harden_sshd_macs_opensshserver_conf_crypto_policy
9be3b2
 - install_smartcard_packages
9be3b2
 - installed_OS_is_vendor_supported
9be3b2
 - kerberos_disable_no_keytab