Blame SOURCES/scap-security-guide-0.1.58-RHEL_08_030720-PR_7288.patch

889f2b
From fbaa0ae639fbb001e4c9e92d9e35f9dd9309d605 Mon Sep 17 00:00:00 2001
889f2b
From: Matthew Burket <mburket@redhat.com>
889f2b
Date: Mon, 9 Aug 2021 10:56:36 -0500
889f2b
Subject: [PATCH 1/2] Allow set_config_file bash macro and lineinfile to set a
889f2b
 custom sed path separator
889f2b
889f2b
So that if the text has '/' in it  the sed path separator can be changed.
889f2b
---
889f2b
 .../developer/06_contributing_with_content.md |  3 +++
889f2b
 shared/macros-bash.jinja                      | 23 ++++++++++---------
889f2b
 shared/templates/lineinfile/bash.template     |  6 ++++-
889f2b
 3 files changed, 20 insertions(+), 12 deletions(-)
889f2b
889f2b
diff --git a/docs/manual/developer/06_contributing_with_content.md b/docs/manual/developer/06_contributing_with_content.md
889f2b
index 245db1550de..c0d62bef5ca 100644
889f2b
--- a/docs/manual/developer/06_contributing_with_content.md
889f2b
+++ b/docs/manual/developer/06_contributing_with_content.md
889f2b
@@ -1572,6 +1572,9 @@ the following to `rule.yml`:
889f2b
     -   **oval_extend_definitions** - optional, list of additional OVAL
889f2b
         definitions that have to pass along the generated check.
889f2b
 
889f2b
+        **sed_path_separator** - optional, default is `/`, sets the sed path separator. Set this
889f2b
+        to a character like `#` if `/` is in use in your text.
889f2b
+
889f2b
 -   Languages: Ansible, Bash, OVAL
889f2b
 
889f2b
 
889f2b
diff --git a/shared/macros-bash.jinja b/shared/macros-bash.jinja
889f2b
index d654a0e0e89..7af8038a783 100644
889f2b
--- a/shared/macros-bash.jinja
889f2b
+++ b/shared/macros-bash.jinja
889f2b
@@ -444,11 +444,12 @@ printf '%s\n' "{{{ message | replace('"', '\\"') }}}" >&2
889f2b
 # separator_regex: regular expression that describes the separator and surrounding whitespace
889f2b
 # prefix_regex: regular expression describing allowed leading characters at each line
889f2b
 #}}
889f2b
-{{%- macro set_config_file(path, parameter, value, create, insert_after, insert_before, insensitive=true, separator=" ", separator_regex="\s\+", prefix_regex="^\s*") -%}}
889f2b
-    {{%- set line_regex = prefix_regex + ((parameter | escape_regex) | replace("/", "\/")) + separator_regex -%}}
889f2b
+
889f2b
+{{%- macro set_config_file(path, parameter, value, create, insert_after, insert_before, insensitive=true, separator=" ", separator_regex="\s\+", prefix_regex="^\s*", sed_path_separator="/") -%}}
889f2b
     {{%- set new_line = parameter+separator+value -%}}
889f2b
+    {{%- set line_regex = prefix_regex + ((parameter | escape_regex) | replace("/", "\/")) + separator_regex -%}}
889f2b
 if [ -e "{{{ path }}}" ] ; then
889f2b
-    {{{ lineinfile_absent(path, line_regex, insensitive) | indent(4) }}}
889f2b
+    {{{ lineinfile_absent(path, line_regex, insensitive, sed_path_separator=sed_path_separator) | indent(4) }}}
889f2b
 else
889f2b
     {{%- if create %}}
889f2b
     touch "{{{ path }}}"
889f2b
@@ -456,19 +457,19 @@ else
889f2b
     {{{ die("Path '" + path + "' wasn't found on this system. Refusing to continue.", action="return") | indent(4) }}}
889f2b
     {{%- endif %}}
889f2b
 fi
889f2b
-{{{ lineinfile_present(path, new_line, insert_after, insert_before, insensitive) }}}
889f2b
+{{{ lineinfile_present(path, new_line, insert_after, insert_before, insensitive, sed_path_separator=sed_path_separator) }}}
889f2b
 {{%- endmacro -%}}
889f2b
 
889f2b
-{{%- macro lineinfile_absent(path, regex, insensitive=true) -%}}
889f2b
+{{%- macro lineinfile_absent(path, regex, insensitive=true, sed_path_separator="/") -%}}
889f2b
     {{%- if insensitive -%}}
889f2b
         {{%- set modifier="Id" -%}}
889f2b
     {{%- else -%}}
889f2b
         {{%- set modifier="d" -%}}
889f2b
     {{%- endif -%}}
889f2b
-    {{% if '/' in regex %}}
889f2b
-    {{{ raise("regex (" + regex + ") uses sed path separator (/) in " + rule_id) }}}
889f2b
+    {{% if sed_path_separator in regex %}}
889f2b
+    {{{ raise("regex (" + regex + ") uses sed path separator (" + sed_path_separator + ") in " + rule_id) }}}
889f2b
     {{% endif %}}
889f2b
-LC_ALL=C sed -i "/{{{ regex }}}/{{{ modifier }}}" "{{{ path }}}"
889f2b
+LC_ALL=C sed -i "{{{ sed_path_separator }}}{{{ regex }}}{{{ sed_path_separator }}}{{{ modifier }}}" "{{{ path }}}"
889f2b
 {{%- endmacro -%}}
889f2b
 
889f2b
 {{%- macro lineinfile_absent_in_directory(dirname, regex, insensitive=true) -%}}
889f2b
@@ -480,7 +481,7 @@ LC_ALL=C sed -i "/{{{ regex }}}/{{{ modifier }}}" "{{{ path }}}"
889f2b
 LC_ALL=C sed -i "/{{{ regex }}}/{{{ modifier }}}" "{{{ dirname }}}"/*
889f2b
 {{%- endmacro -%}}
889f2b
 
889f2b
-{{%- macro lineinfile_present(path, line, insert_after="", insert_before="", insensitive=true) -%}}
889f2b
+{{%- macro lineinfile_present(path, line, insert_after="", insert_before="", insensitive=true, sed_path_separator="/") -%}}
889f2b
     {{%- if insensitive -%}}
889f2b
         {{%- set grep_args="-q -m 1 -i" -%}}
889f2b
     {{%- else -%}}
889f2b
@@ -496,7 +497,7 @@ printf '%s\n' "{{{ line }}}" > "{{{ path }}}"
889f2b
 cat "{{{ path }}}.bak" >> "{{{ path }}}"
889f2b
     {{%- elif insert_after %}}
889f2b
 # Insert after the line matching the regex '{{{ insert_after }}}'
889f2b
-line_number="$(LC_ALL=C grep -n "{{{ insert_after }}}" "{{{ path }}}.bak" | LC_ALL=C sed 's/:.*//g')"
889f2b
+line_number="$(LC_ALL=C grep -n "{{{ insert_after }}}" "{{{ path }}}.bak" | LC_ALL=C sed 's{{{sed_path_separator}}}:.*{{{sed_path_separator}}}{{{sed_path_separator}}}g')"
889f2b
 if [ -z "$line_number" ]; then
889f2b
     # There was no match of '{{{ insert_after }}}', insert at
889f2b
     # the end of the file.
889f2b
@@ -508,7 +509,7 @@ else
889f2b
 fi
889f2b
     {{%- elif insert_before %}}
889f2b
 # Insert before the line matching the regex '{{{ insert_before }}}'.
889f2b
-line_number="$(LC_ALL=C grep -n "{{{ insert_before }}}" "{{{ path }}}.bak" | LC_ALL=C sed 's/:.*//g')"
889f2b
+line_number="$(LC_ALL=C grep -n "{{{ insert_before }}}" "{{{ path }}}.bak" | LC_ALL=C sed 's{{{sed_path_separator}}}:.*{{{sed_path_separator}}}{{{sed_path_separator}}}g')"
889f2b
 if [ -z "$line_number" ]; then
889f2b
     # There was no match of '{{{ insert_before }}}', insert at
889f2b
     # the end of the file.
889f2b
diff --git a/shared/templates/lineinfile/bash.template b/shared/templates/lineinfile/bash.template
889f2b
index 0e43e88842a..6d1ca349268 100644
889f2b
--- a/shared/templates/lineinfile/bash.template
889f2b
+++ b/shared/templates/lineinfile/bash.template
889f2b
@@ -4,4 +4,8 @@
889f2b
 # complexity = low
889f2b
 # disruption = low
889f2b
 
889f2b
-{{{ set_config_file(PATH, TEXT, value="", create='yes', insert_after="", insert_before="", separator="", separator_regex="", prefix_regex="^\s*") -}}}
889f2b
+{{% if SED_PATH_SEPARATOR %}}
889f2b
+    {{{ set_config_file(PATH, TEXT, value="", create='yes', insert_after="", insert_before="", separator="", separator_regex="", prefix_regex="^\s*", sed_path_separator=SED_PATH_SEPARATOR) -}}}
889f2b
+{{% else %}}
889f2b
+    {{{ set_config_file(PATH, TEXT, value="", create='yes', insert_after="", insert_before="", separator="", separator_regex="", prefix_regex="^\s*") -}}}
889f2b
+{{% endif %}}
889f2b
889f2b
From 4b3182bd5d5308fed16f58da9656aa76a4275569 Mon Sep 17 00:00:00 2001
889f2b
From: Matthew Burket <mburket@redhat.com>
889f2b
Date: Mon, 9 Aug 2021 13:56:32 -0500
889f2b
Subject: [PATCH 2/2] Add new rule for RHEL-08-030720
889f2b
889f2b
---
889f2b
 .../ansible/shared.yml                        |  9 ++++
889f2b
 .../bash/shared.sh                            | 11 +++++
889f2b
 .../oval/shared.xml                           | 43 +++++++++++++++++++
889f2b
 .../rule.yml                                  | 40 +++++++++++++++++
889f2b
 .../tests/default_no_pass.fail.sh             |  7 +++
889f2b
 .../tests/rsyslog.pass.sh                     |  4 ++
889f2b
 .../tests/rsyslog_wrong_value.fail.sh         |  4 ++
889f2b
 .../tests/rsyslogd.pass.sh                    |  4 ++
889f2b
 .../tests/rsyslogd_wrong_value.fail.sh        |  4 ++
889f2b
 .../tests/setup.sh                            |  9 ++++
889f2b
 products/rhel8/profiles/stig.profile          |  1 +
889f2b
 shared/references/cce-redhat-avail.txt        |  1 -
889f2b
 .../data/profile_stability/rhel8/stig.profile |  1 +
889f2b
 .../profile_stability/rhel8/stig_gui.profile  |  1 +
889f2b
 14 files changed, 138 insertions(+), 1 deletion(-)
889f2b
 create mode 100644 linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/ansible/shared.yml
889f2b
 create mode 100644 linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/bash/shared.sh
889f2b
 create mode 100644 linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/oval/shared.xml
889f2b
 create mode 100644 linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/rule.yml
889f2b
 create mode 100644 linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/tests/default_no_pass.fail.sh
889f2b
 create mode 100644 linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/tests/rsyslog.pass.sh
889f2b
 create mode 100644 linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/tests/rsyslog_wrong_value.fail.sh
889f2b
 create mode 100644 linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/tests/rsyslogd.pass.sh
889f2b
 create mode 100644 linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/tests/rsyslogd_wrong_value.fail.sh
889f2b
 create mode 100644 linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/tests/setup.sh
889f2b
889f2b
diff --git a/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/ansible/shared.yml b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/ansible/shared.yml
889f2b
new file mode 100644
889f2b
index 00000000000..637f90003b2
889f2b
--- /dev/null
889f2b
+++ b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/ansible/shared.yml
889f2b
@@ -0,0 +1,9 @@
889f2b
+# platform = Red Hat Virtualization 4,multi_platform_fedora,multi_platform_rhel
889f2b
+# reboot = false
889f2b
+# strategy = configure
889f2b
+# complexity = low
889f2b
+# disruption = low
889f2b
+
889f2b
+{{{ ansible_set_config_file_dir(msg, "/etc/rsyslog.conf", "/etc/rsyslog.d", "/etc/rsyslog.conf", 
889f2b
+                                "$ActionSendStreamDriverAuthMode", separator=' ', separator_regex='\s', 
889f2b
+                                value="x509/name", create='yes') }}}
889f2b
diff --git a/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/bash/shared.sh b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/bash/shared.sh
889f2b
new file mode 100644
889f2b
index 00000000000..71d312f332f
889f2b
--- /dev/null
889f2b
+++ b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/bash/shared.sh
889f2b
@@ -0,0 +1,11 @@
889f2b
+# platform = Red Hat Virtualization 4,multi_platform_fedora,multi_platform_rhel
889f2b
+# reboot = false
889f2b
+# strategy = configure
889f2b
+# complexity = low
889f2b
+# disruption = low
889f2b
+
889f2b
+if ! grep -s "\$ActionSendStreamDriverAuthMode\s*x509/name" /etc/rsyslog.conf /etc/rsyslog.d/*.conf; then
889f2b
+	mkdir -p /etc/rsyslog.d
889f2b
+    sed -i '/^.*\$ActionSendStreamDriverAuthMode.*/d' /etc/rsyslog.conf /etc/rsyslog.d/*.conf
889f2b
+    echo "\$ActionSendStreamDriverAuthMode x509/name" > /etc/rsyslog.d/stream_driver_auth.conf
889f2b
+fi
889f2b
diff --git a/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/oval/shared.xml b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/oval/shared.xml
889f2b
new file mode 100644
889f2b
index 00000000000..8e1ec48a974
889f2b
--- /dev/null
889f2b
+++ b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/oval/shared.xml
889f2b
@@ -0,0 +1,43 @@
889f2b
+<def-group>
889f2b
+    <definition class="compliance" id="{{{ rule_id }}}" version="1">
889f2b
+        {{{ oval_metadata("Rsyslogd must authenticate remote system its sending logs to.") }}}
889f2b
+        <criteria operator="AND">
889f2b
+            <criteria operator="OR">
889f2b
+                 
889f2b
+                            test_ref="test_{{{rule_id}}}_action_send_stream_driver_auth_mode" />
889f2b
+                
889f2b
+                            test_ref="test_{{{rule_id}}}_action_send_stream_driver_auth_mode_dir" />
889f2b
+            </criteria>
889f2b
+        </criteria>
889f2b
+    </definition>
889f2b
+
889f2b
+    
889f2b
+                                comment="Check if $ActionSendStreamDriverAuthMode x509/name is set in /etc/rsyslog.conf"
889f2b
+                                id="test_{{{rule_id}}}_action_send_stream_driver_auth_mode" version="1">
889f2b
+
889f2b
+        <ind:object object_ref="obj_{{{rule_id}}}_action_send_stream_driver_auth_mode" />
889f2b
+    </ind:textfilecontent54_test>
889f2b
+
889f2b
+    
889f2b
+                                    comment="Check if  $ActionSendStreamDriverAuthMode x509/name is set in /etc/rsyslog.conf"
889f2b
+                                    version="1">
889f2b
+        <ind:filepath>/etc/rsyslog.conf</ind:filepath>
889f2b
+        <ind:pattern operation="pattern match">^\$ActionSendStreamDriverAuthMode x509/name$</ind:pattern>
889f2b
+        <ind:instance datatype="int">1</ind:instance>
889f2b
+    </ind:textfilecontent54_object>
889f2b
+
889f2b
+    
889f2b
+                                comment="Check if $ActionSendStreamDriverAuthMode x509/name is set in /etc/rsyslog.conf"
889f2b
+                                id="test_{{{rule_id}}}_action_send_stream_driver_auth_mode_dir" version="1">
889f2b
+        <ind:object object_ref="obj_{{{rule_id}}}_action_send_stream_driver_auth_mode_dir" />
889f2b
+    </ind:textfilecontent54_test>
889f2b
+
889f2b
+    
889f2b
+                                    comment="Check if $ActionSendStreamDriverAuthMode x509/name is set in /etc/rsyslog.d"
889f2b
+                                    version="1">
889f2b
+        <ind:path>/etc/rsyslog.d</ind:path>
889f2b
+        <ind:filename operation="pattern match">^.*conf$</ind:filename>
889f2b
+        <ind:pattern operation="pattern match">^\$ActionSendStreamDriverAuthMode x509/name$</ind:pattern>
889f2b
+        <ind:instance datatype="int">1</ind:instance>
889f2b
+    </ind:textfilecontent54_object>
889f2b
+</def-group>
889f2b
diff --git a/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/rule.yml b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/rule.yml
889f2b
new file mode 100644
889f2b
index 00000000000..beaf8ce96da
889f2b
--- /dev/null
889f2b
+++ b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/rule.yml
889f2b
@@ -0,0 +1,40 @@
889f2b
+documentation_complete: true
889f2b
+
889f2b
+title: Ensure Rsyslog Authenticates Off-Loaded Audit Records
889f2b
+
889f2b
+description: |-
889f2b
+    Rsyslogd is a system utility providing support for message logging. Support
889f2b
+    for both internet and UNIX domain sockets enables this utility to support both local
889f2b
+    and remote logging.  Couple this utility with <tt>gnutls</tt> (which is a secure communications
889f2b
+    library implementing the SSL, TLS and DTLS protocols), and you have a method to securely
889f2b
+    encrypt and off-load auditing.
889f2b
+
889f2b
+    When using <tt>rsyslogd</tt> to off-load logs the remote system must be authenticated.
889f2b
+
889f2b
+rationale: |-
889f2b
+    The audit records generated by Rsyslog contain valuable information regarding system
889f2b
+    configuration, user authentication, and other such information. Audit records should be
889f2b
+    protected from unauthorized access.
889f2b
+
889f2b
+severity: medium
889f2b
+
889f2b
+identifiers:
889f2b
+    cce@rhel8: CCE-86339-9
889f2b
+
889f2b
+references:
889f2b
+    disa: CCI-001851
889f2b
+    nist: AU-4(1)
889f2b
+    srg: SRG-OS-000342-GPOS-00133,SRG-OS-000479-GPOS-00224
889f2b
+    stigid@rhel8: RHEL-08-030720
889f2b
+
889f2b
+
889f2b
+ocil_clause: '$ActionSendStreamDriverAuthMode in /etc/rsyslog.conf is not set to x509/name'
889f2b
+
889f2b
+ocil: |-
889f2b
+    Verify the operating system authenticates the remote logging server for off-loading audit logs with the following command:
889f2b
+
889f2b
+    
$ sudo grep -i '$ActionSendStreamDriverAuthMode' /etc/rsyslog.conf /etc/rsyslog.d/*.conf
889f2b
+    The output should be
889f2b
+    
$/etc/rsyslog.conf:$ActionSendStreamDriverAuthMode x509/name
889f2b
+
889f2b
+
889f2b
diff --git a/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/tests/default_no_pass.fail.sh b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/tests/default_no_pass.fail.sh
889f2b
new file mode 100644
889f2b
index 00000000000..54d70f6b85f
889f2b
--- /dev/null
889f2b
+++ b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/tests/default_no_pass.fail.sh
889f2b
@@ -0,0 +1,7 @@
889f2b
+#!/bin/bash
889f2b
+bash -x setup.sh
889f2b
+
889f2b
+if [[ -f encrypt.conf ]]; then
889f2b
+  sed -i "/^\$ActionSendStreamDriverMod.*/d" /etc/rsyslog.conf
889f2b
+fi
889f2b
+  sed -i "/^\$ActionSendStreamDriverMod.*/d" /etc/rsyslog.conf
889f2b
diff --git a/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/tests/rsyslog.pass.sh b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/tests/rsyslog.pass.sh
889f2b
new file mode 100644
889f2b
index 00000000000..fe3db6f9c41
889f2b
--- /dev/null
889f2b
+++ b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/tests/rsyslog.pass.sh
889f2b
@@ -0,0 +1,4 @@
889f2b
+#!/bin/bash
889f2b
+bash -x setup.sh
889f2b
+
889f2b
+echo "\$ActionSendStreamDriverAuthMode x509/name" >> /etc/rsyslog.conf
889f2b
diff --git a/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/tests/rsyslog_wrong_value.fail.sh b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/tests/rsyslog_wrong_value.fail.sh
889f2b
new file mode 100644
889f2b
index 00000000000..bad06fba0e9
889f2b
--- /dev/null
889f2b
+++ b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/tests/rsyslog_wrong_value.fail.sh
889f2b
@@ -0,0 +1,4 @@
889f2b
+#!/bin/bash
889f2b
+bash -x setup.sh
889f2b
+
889f2b
+echo "\$ActionSendStreamDriverAuthMode 0" >> /etc/rsyslog.conf
889f2b
diff --git a/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/tests/rsyslogd.pass.sh b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/tests/rsyslogd.pass.sh
889f2b
new file mode 100644
889f2b
index 00000000000..ab511daecc7
889f2b
--- /dev/null
889f2b
+++ b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/tests/rsyslogd.pass.sh
889f2b
@@ -0,0 +1,4 @@
889f2b
+#!/bin/bash
889f2b
+bash -x setup.sh
889f2b
+
889f2b
+echo "\$ActionSendStreamDriverAuthMode x509/name" >> /etc/rsyslog.d/encrypt.conf
889f2b
diff --git a/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/tests/rsyslogd_wrong_value.fail.sh b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/tests/rsyslogd_wrong_value.fail.sh
889f2b
new file mode 100644
889f2b
index 00000000000..02bf64747a7
889f2b
--- /dev/null
889f2b
+++ b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/tests/rsyslogd_wrong_value.fail.sh
889f2b
@@ -0,0 +1,4 @@
889f2b
+#!/bin/bash
889f2b
+bash -x setup.sh
889f2b
+
889f2b
+echo "\$ActionSendStreamDriverAuthMode x509/certvalid" >> /etc/rsyslog.d/encrypt.conf
889f2b
diff --git a/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/tests/setup.sh b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/tests/setup.sh
889f2b
new file mode 100644
889f2b
index 00000000000..9686f16bcc9
889f2b
--- /dev/null
889f2b
+++ b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdriverauthmode/tests/setup.sh
889f2b
@@ -0,0 +1,9 @@
889f2b
+#!/bin/bash
889f2b
+# Use this script to ensure the rsyslog directory structure and rsyslog conf file
889f2b
+# exist in the test env.
889f2b
+config_file=/etc/rsyslog.conf
889f2b
+
889f2b
+# Ensure directory structure exists (useful for container based testing)
889f2b
+test -f $config_file || touch $config_file
889f2b
+
889f2b
+test -d /etc/rsyslog.d/ || mkdir /etc/rsyslog.d/
889f2b
diff --git a/products/rhel8/profiles/stig.profile b/products/rhel8/profiles/stig.profile
889f2b
index ec0a3b17537..382247057cd 100644
889f2b
--- a/products/rhel8/profiles/stig.profile
889f2b
+++ b/products/rhel8/profiles/stig.profile
889f2b
@@ -854,6 +854,7 @@ selections:
889f2b
     - rsyslog_encrypt_offload_actionsendstreamdrivermode
889f2b
 
889f2b
     # RHEL-08-030720
889f2b
+    - rsyslog_encrypt_offload_actionsendstreamdriverauthmode
889f2b
 
889f2b
     # RHEL-08-030730
889f2b
     # this rule expects configuration in MB instead percentage as how STIG demands
889f2b
diff --git a/shared/references/cce-redhat-avail.txt b/shared/references/cce-redhat-avail.txt
889f2b
index 61384c108a0..03211442aba 100644
889f2b
--- a/shared/references/cce-redhat-avail.txt
889f2b
+++ b/shared/references/cce-redhat-avail.txt
889f2b
@@ -460,7 +460,6 @@ CCE-86335-7
889f2b
 CCE-86336-5
889f2b
 CCE-86337-3
889f2b
 CCE-86338-1
889f2b
-CCE-86339-9
889f2b
 CCE-86340-7
889f2b
 CCE-86341-5
889f2b
 CCE-86342-3
889f2b
diff --git a/tests/data/profile_stability/rhel8/stig.profile b/tests/data/profile_stability/rhel8/stig.profile
889f2b
index bffa509b698..481e7b28228 100644
889f2b
--- a/tests/data/profile_stability/rhel8/stig.profile
889f2b
+++ b/tests/data/profile_stability/rhel8/stig.profile
889f2b
@@ -238,6 +238,7 @@ selections:
889f2b
 - require_singleuser_auth
889f2b
 - root_permissions_syslibrary_files
889f2b
 - rsyslog_cron_logging
889f2b
+- rsyslog_encrypt_offload_actionsendstreamdriverauthmode
889f2b
 - rsyslog_encrypt_offload_actionsendstreamdrivermode
889f2b
 - rsyslog_encrypt_offload_defaultnetstreamdriver
889f2b
 - rsyslog_remote_access_monitoring
889f2b
diff --git a/tests/data/profile_stability/rhel8/stig_gui.profile b/tests/data/profile_stability/rhel8/stig_gui.profile
889f2b
index c84ac75c7bf..7fb3d892a30 100644
889f2b
--- a/tests/data/profile_stability/rhel8/stig_gui.profile
889f2b
+++ b/tests/data/profile_stability/rhel8/stig_gui.profile
889f2b
@@ -249,6 +249,7 @@ selections:
889f2b
 - require_singleuser_auth
889f2b
 - root_permissions_syslibrary_files
889f2b
 - rsyslog_cron_logging
889f2b
+- rsyslog_encrypt_offload_actionsendstreamdriverauthmode
889f2b
 - rsyslog_encrypt_offload_actionsendstreamdrivermode
889f2b
 - rsyslog_encrypt_offload_defaultnetstreamdriver
889f2b
 - rsyslog_remote_access_monitoring