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

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