Blame SOURCES/scap-security-guide-0.1.64-stig_aide-PR_9282.patch

792d3d
From 95b79ffa7e9247bd65a92311b92e37b0d83e4432 Mon Sep 17 00:00:00 2001
792d3d
From: Watson Sato <wsato@redhat.com>
792d3d
Date: Tue, 2 Aug 2022 15:01:42 +0200
792d3d
Subject: [PATCH] Add rsyslogd to the list of tools check by aide
792d3d
792d3d
RHEL products will also check for integrity of /usr/sbin/rsyslogd.
792d3d
---
792d3d
 .../aide/aide_check_audit_tools/ansible/shared.yml             | 1 +
792d3d
 .../aide/aide_check_audit_tools/bash/shared.sh                 | 3 +--
792d3d
 .../aide/aide_check_audit_tools/oval/shared.xml                | 2 +-
792d3d
 .../aide/aide_check_audit_tools/tests/correct.pass.sh          | 2 +-
792d3d
 .../aide_check_audit_tools/tests/correct_with_selinux.pass.sh  | 2 +-
792d3d
 .../aide/aide_check_audit_tools/tests/not_config.fail.sh       | 2 +-
792d3d
 6 files changed, 6 insertions(+), 6 deletions(-)
792d3d
792d3d
diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/ansible/shared.yml b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/ansible/shared.yml
792d3d
index 9d1b7b675c9..5905ea8d0e6 100644
792d3d
--- a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/ansible/shared.yml
792d3d
+++ b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/ansible/shared.yml
792d3d
@@ -22,6 +22,7 @@
792d3d
       - /usr/sbin/aureport
792d3d
       - /usr/sbin/ausearch
792d3d
       - /usr/sbin/autrace
792d3d
+      {{% if product == 'ol8' or 'rhel' in product %}}- /usr/sbin/rsyslogd{{% endif %}}
792d3d
 
792d3d
 - name: Ensure existing AIDE configuration for audit tools are correct
792d3d
   lineinfile:
792d3d
diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/bash/shared.sh b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/bash/shared.sh
792d3d
index d0a1ba2522f..a81e25c3950 100644
792d3d
--- a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/bash/shared.sh
792d3d
+++ b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/bash/shared.sh
792d3d
@@ -18,12 +18,11 @@
792d3d
 {{% set auditfiles = auditfiles + ["/usr/sbin/audispd"] %}}
792d3d
 {{% endif %}}
792d3d
 
792d3d
-{{% if product == 'ol8' %}}
792d3d
+{{% if product == 'ol8' or 'rhel' in product %}}
792d3d
 {{% set auditfiles = auditfiles + ["/usr/sbin/rsyslogd"] %}}
792d3d
 {{% endif %}}
792d3d
 
792d3d
 {{% for file in auditfiles %}}
792d3d
-
792d3d
 if grep -i '^.*{{{file}}}.*$' {{{ aide_conf_path }}}; then
792d3d
 sed -i "s#.*{{{file}}}.*#{{{file}}} {{{ aide_string() }}}#" {{{ aide_conf_path }}}
792d3d
 else
792d3d
diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/oval/shared.xml b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/oval/shared.xml
792d3d
index 6ce56c1137a..ca9bf4f94d0 100644
792d3d
--- a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/oval/shared.xml
792d3d
+++ b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/oval/shared.xml
792d3d
@@ -11,7 +11,7 @@
792d3d
       {{% if 'rhel' not in product and product != 'ol8' %}}
792d3d
       <criterion comment="audispd is checked in {{{ aide_conf_path }}}" test_ref="test_aide_verify_audispd" />
792d3d
       {{% endif %}}
792d3d
-      {{% if product == 'ol8' %}}
792d3d
+      {{% if product == 'ol8' or 'rhel' in product %}}
792d3d
       <criterion comment="rsyslogd is checked in {{{ aide_conf_path }}}" test_ref="test_aide_verify_rsyslogd" />
792d3d
       {{% endif %}}
792d3d
       <criterion comment="augenrules is checked in {{{ aide_conf_path }}}" test_ref="test_aide_verify_augenrules" />
792d3d
diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/correct.pass.sh b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/correct.pass.sh
792d3d
index 756b88d8a23..071dde13295 100644
792d3d
--- a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/correct.pass.sh
792d3d
+++ b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/correct.pass.sh
792d3d
@@ -7,7 +7,7 @@ aide --init
792d3d
 
792d3d
 
792d3d
 declare -a bins
792d3d
-bins=('/usr/sbin/auditctl' '/usr/sbin/auditd' '/usr/sbin/augenrules' '/usr/sbin/aureport' '/usr/sbin/ausearch' '/usr/sbin/autrace')
792d3d
+bins=('/usr/sbin/auditctl' '/usr/sbin/auditd' '/usr/sbin/augenrules' '/usr/sbin/aureport' '/usr/sbin/ausearch' '/usr/sbin/autrace' '/usr/sbin/rsyslogd')
792d3d
 
792d3d
 for theFile in "${bins[@]}"
792d3d
 do
792d3d
diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/correct_with_selinux.pass.sh b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/correct_with_selinux.pass.sh
792d3d
index f3a2a126d3d..cb9bbfa7350 100644
792d3d
--- a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/correct_with_selinux.pass.sh
792d3d
+++ b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/correct_with_selinux.pass.sh
792d3d
@@ -4,7 +4,7 @@
792d3d
 yum -y install aide
792d3d
 
792d3d
 declare -a bins
792d3d
-bins=('/usr/sbin/auditctl' '/usr/sbin/auditd' '/usr/sbin/augenrules' '/usr/sbin/aureport' '/usr/sbin/ausearch' '/usr/sbin/autrace')
792d3d
+bins=('/usr/sbin/auditctl' '/usr/sbin/auditd' '/usr/sbin/augenrules' '/usr/sbin/aureport' '/usr/sbin/ausearch' '/usr/sbin/autrace' '/usr/sbin/rsyslogd')
792d3d
 
792d3d
 for theFile in "${bins[@]}"
792d3d
 do
792d3d
diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/not_config.fail.sh b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/not_config.fail.sh
792d3d
index 4315cef2073..a22aecb0000 100644
792d3d
--- a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/not_config.fail.sh
792d3d
+++ b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/not_config.fail.sh
792d3d
@@ -6,7 +6,7 @@ yum -y install aide
792d3d
 aide --init
792d3d
 
792d3d
 declare -a bins
792d3d
-bins=('/usr/sbin/auditctl' '/usr/sbin/auditd' '/usr/sbin/augenrules' '/usr/sbin/aureport' '/usr/sbin/ausearch' '/usr/sbin/autrace')
792d3d
+bins=('/usr/sbin/auditctl' '/usr/sbin/auditd' '/usr/sbin/augenrules' '/usr/sbin/aureport' '/usr/sbin/ausearch' '/usr/sbin/autrace' '/usr/sbin/rsyslogd')
792d3d
 
792d3d
 for theFile in "${bins[@]}"
792d3d
 do