From ff1465361ce508f93601c5dcefe092ef09bc26bb Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 26 2022 13:52:49 +0000 Subject: import scap-security-guide-0.1.57-9.el8_5 --- diff --git a/SOURCES/reorder-reference-in-alphabetical-order.patch b/SOURCES/reorder-reference-in-alphabetical-order.patch new file mode 100644 index 0000000..d044f16 --- /dev/null +++ b/SOURCES/reorder-reference-in-alphabetical-order.patch @@ -0,0 +1,41 @@ +From 628cbacb76e9950528359038cf3237ac7166f0b7 Mon Sep 17 00:00:00 2001 +From: Gabriel Becker +Date: Mon, 14 Mar 2022 12:57:26 +0100 +Subject: [PATCH] Reorder reference in alphabetical order. + +--- + .../integrity/crypto/configure_bind_crypto_policy/rule.yml | 2 +- + .../software/integrity/crypto/configure_crypto_policy/rule.yml | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/linux_os/guide/system/software/integrity/crypto/configure_bind_crypto_policy/rule.yml b/linux_os/guide/system/software/integrity/crypto/configure_bind_crypto_policy/rule.yml +index e58c950..8d73d9d 100644 +--- a/linux_os/guide/system/software/integrity/crypto/configure_bind_crypto_policy/rule.yml ++++ b/linux_os/guide/system/software/integrity/crypto/configure_bind_crypto_policy/rule.yml +@@ -29,8 +29,8 @@ identifiers: + references: + nerc-cip: CIP-003-3 R4.2,CIP-007-3 R5.1 + nist: SC-13,SC-12(2),SC-12(3) +- stigid@rhel8: RHEL-08-010020 + srg: SRG-OS-000423-GPOS-00187,SRG-OS-000426-GPOS-00190 ++ stigid@rhel8: RHEL-08-010020 + + ocil_clause: |- + BIND is installed and the BIND config file doesn't contain the +diff --git a/linux_os/guide/system/software/integrity/crypto/configure_crypto_policy/rule.yml b/linux_os/guide/system/software/integrity/crypto/configure_crypto_policy/rule.yml +index 5eea87a..a5a8df3 100644 +--- a/linux_os/guide/system/software/integrity/crypto/configure_crypto_policy/rule.yml ++++ b/linux_os/guide/system/software/integrity/crypto/configure_crypto_policy/rule.yml +@@ -65,8 +65,8 @@ references: + nerc-cip: CIP-003-3 R4.2,CIP-007-3 R5.1,CIP-007-3 R7.1 + nist: AC-17(a),AC-17(2),CM-6(a),MA-4(6),SC-13,SC-12(2),SC-12(3) + ospp: FCS_COP.1(1),FCS_COP.1(2),FCS_COP.1(3),FCS_COP.1(4),FCS_CKM.1,FCS_CKM.2,FCS_TLSC_EXT.1 +- stigid@rhel8: RHEL-08-010020 + srg: SRG-OS-000396-GPOS-00176,SRG-OS-000393-GPOS-00173,SRG-OS-000394-GPOS-00174 ++ stigid@rhel8: RHEL-08-010020 + + ocil_clause: 'cryptographic policy is not configured or is configured incorrectly' + +-- +2.34.1 + diff --git a/SOURCES/scap-security-guide-0.1.58-BZ_1942281-PR_7471.patch b/SOURCES/scap-security-guide-0.1.58-BZ_1942281-PR_7471.patch new file mode 100644 index 0000000..4086d83 --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.58-BZ_1942281-PR_7471.patch @@ -0,0 +1,199 @@ +From 2cbc694687190cadb155c5582f93a8cf91ebdc4c Mon Sep 17 00:00:00 2001 +From: Marcus Burghardt +Date: Thu, 26 Aug 2021 15:04:46 +0200 +Subject: [PATCH] Bug 1942281 - Set postfix rules to notapplicable when package + is not installed + +--- + .../rule.yml | 2 ++ + .../rule.yml | 2 ++ + .../services/mail/postfix_harden_os/group.yml | 2 ++ + .../rule.yml | 3 ++- + products/rhel8/profiles/stig.profile | 4 +--- + products/rhel9/profiles/stig.profile | 4 +--- + shared/applicability/general.yml | 5 +++++ + .../installed_env_has_postfix_package.xml | 20 +++++++++++++++++++ + shared/references/cce-redhat-avail.txt | 1 - + .../data/profile_stability/rhel8/stig.profile | 3 ++- + .../profile_stability/rhel8/stig_gui.profile | 3 ++- + 11 files changed, 39 insertions(+), 10 deletions(-) + create mode 100644 shared/checks/oval/installed_env_has_postfix_package.xml + +diff --git a/linux_os/guide/services/mail/postfix_client/postfix_client_configure_relayhost/rule.yml b/linux_os/guide/services/mail/postfix_client/postfix_client_configure_relayhost/rule.yml +index 0faafeb0c2f..4b440e79845 100644 +--- a/linux_os/guide/services/mail/postfix_client/postfix_client_configure_relayhost/rule.yml ++++ b/linux_os/guide/services/mail/postfix_client/postfix_client_configure_relayhost/rule.yml +@@ -21,3 +21,5 @@ ocil: |- + Run the following command to ensure postfix routes mail to this system: +
$ grep relayhost /etc/postfix/main.cf
+ If properly configured, the output should show only {{{ xccdf_value("var_postfix_relayhost") }}}. ++ ++platform: postfix +diff --git a/linux_os/guide/services/mail/postfix_client/postfix_network_listening_disabled/rule.yml b/linux_os/guide/services/mail/postfix_client/postfix_network_listening_disabled/rule.yml +index 096020ef687..579db484976 100644 +--- a/linux_os/guide/services/mail/postfix_client/postfix_network_listening_disabled/rule.yml ++++ b/linux_os/guide/services/mail/postfix_client/postfix_network_listening_disabled/rule.yml +@@ -42,3 +42,5 @@ ocil: |- + Run the following command to ensure postfix accepts mail messages from only the local system: +
$ grep inet_interfaces /etc/postfix/main.cf
+ If properly configured, the output should show only {{{ xccdf_value("var_postfix_inet_interfaces") }}}. ++ ++platform: postfix +diff --git a/linux_os/guide/services/mail/postfix_harden_os/group.yml b/linux_os/guide/services/mail/postfix_harden_os/group.yml +index 19b662508bd..8a415425e7d 100644 +--- a/linux_os/guide/services/mail/postfix_harden_os/group.yml ++++ b/linux_os/guide/services/mail/postfix_harden_os/group.yml +@@ -6,3 +6,5 @@ description: |- + The guidance in this section is appropriate for any host which is + operating as a site MTA, whether the mail server runs using Sendmail, Postfix, + or some other software. ++ ++platform: postfix +diff --git a/linux_os/guide/services/mail/postfix_harden_os/postfix_server_cfg/postfix_server_relay/postfix_prevent_unrestricted_relay/rule.yml b/linux_os/guide/services/mail/postfix_harden_os/postfix_server_cfg/postfix_server_relay/postfix_prevent_unrestricted_relay/rule.yml +index 9b4c7656a85..75e4133b119 100644 +--- a/linux_os/guide/services/mail/postfix_harden_os/postfix_server_cfg/postfix_server_relay/postfix_prevent_unrestricted_relay/rule.yml ++++ b/linux_os/guide/services/mail/postfix_harden_os/postfix_server_cfg/postfix_server_relay/postfix_prevent_unrestricted_relay/rule.yml +@@ -1,6 +1,6 @@ + documentation_complete: true + +-prodtype: ol7,ol8,rhel7,rhel8,wrlinux1019 ++prodtype: ol7,ol8,rhel7,rhel8,rhel9,wrlinux1019 + + title: 'Prevent Unrestricted Mail Relaying' + +@@ -19,6 +19,7 @@ severity: medium + identifiers: + cce@rhel7: CCE-80512-7 + cce@rhel8: CCE-84054-6 ++ cce@rhel9: CCE-87232-5 + + references: + disa: CCI-000366 +diff --git a/products/rhel8/profiles/stig.profile b/products/rhel8/profiles/stig.profile +index d31b251645b..5e9a2216fcd 100644 +--- a/products/rhel8/profiles/stig.profile ++++ b/products/rhel8/profiles/stig.profile +@@ -1160,9 +1160,7 @@ selections: + - sysctl_net_core_bpf_jit_harden + + # RHEL-08-040290 +- # /etc/postfix/main.cf does not exist on default installation resulting in error during remediation +- # there needs to be a new platform check to identify when postfix is installed or not +- # - postfix_prevent_unrestricted_relay ++ - postfix_prevent_unrestricted_relay + + # RHEL-08-040300 + - aide_verify_ext_attributes +diff --git a/products/rhel9/profiles/stig.profile b/products/rhel9/profiles/stig.profile +index a40d848ee67..8d60468528d 100644 +--- a/products/rhel9/profiles/stig.profile ++++ b/products/rhel9/profiles/stig.profile +@@ -1030,9 +1030,7 @@ selections: + - sysctl_net_ipv4_conf_all_rp_filter + + # RHEL-08-040290 +- # /etc/postfix/main.cf does not exist on default installation resulting in error during remediation +- # there needs to be a new platform check to identify when postfix is installed or not +- # - postfix_prevent_unrestricted_relay ++ - postfix_prevent_unrestricted_relay + + # RHEL-08-040300 + - aide_verify_ext_attributes +diff --git a/shared/applicability/general.yml b/shared/applicability/general.yml +index 6e3ecfd9bf9..4163a07cbad 100644 +--- a/shared/applicability/general.yml ++++ b/shared/applicability/general.yml +@@ -44,6 +44,11 @@ cpes: + title: "Package pam is installed" + check_id: installed_env_has_pam_package + ++ - postfix: ++ name: "cpe:/a:postfix" ++ title: "Package postfix is installed" ++ check_id: installed_env_has_postfix_package ++ + - sssd: + name: "cpe:/a:sssd" + title: "Package sssd-common is installed" +diff --git a/shared/checks/oval/installed_env_has_postfix_package.xml b/shared/checks/oval/installed_env_has_postfix_package.xml +new file mode 100644 +index 00000000000..95ad355147b +--- /dev/null ++++ b/shared/checks/oval/installed_env_has_postfix_package.xml +@@ -0,0 +1,20 @@ ++ ++ ++ ++ ++ Package postfix is installed ++ ++ multi_platform_all ++ ++ Checks if package postfix is installed. ++ ++ ++ ++ ++ ++ ++ ++ {{{ oval_test_package_installed(package='postfix', evr='', test_id='test_env_has_postfix_installed') }}} ++ ++ +diff --git a/shared/references/cce-redhat-avail.txt b/shared/references/cce-redhat-avail.txt +index ee4c156b79c..29fe687600c 100644 +--- a/shared/references/cce-redhat-avail.txt ++++ b/shared/references/cce-redhat-avail.txt +@@ -1314,7 +1314,6 @@ CCE-87228-3 + CCE-87229-1 + CCE-87230-9 + CCE-87231-7 +-CCE-87232-5 + CCE-87233-3 + CCE-87234-1 + CCE-87235-8 +diff --git a/tests/data/profile_stability/rhel8/stig.profile b/tests/data/profile_stability/rhel8/stig.profile +index ba596f86f83..ca0097b844b 100644 +--- a/tests/data/profile_stability/rhel8/stig.profile ++++ b/tests/data/profile_stability/rhel8/stig.profile +@@ -64,8 +64,8 @@ selections: + - accounts_user_home_paths_only + - accounts_user_interactive_home_directory_defined + - accounts_user_interactive_home_directory_exists +-- aide_check_audit_tools + - agent_mfetpd_running ++- aide_check_audit_tools + - aide_scan_notification + - aide_verify_acls + - aide_verify_ext_attributes +@@ -304,6 +304,7 @@ selections: + - partition_for_var_log_audit + - partition_for_var_tmp + - postfix_client_configure_mail_alias ++- postfix_prevent_unrestricted_relay + - require_emergency_target_auth + - require_singleuser_auth + - root_permissions_syslibrary_files +diff --git a/tests/data/profile_stability/rhel8/stig_gui.profile b/tests/data/profile_stability/rhel8/stig_gui.profile +index 9db93027011..3533208c4a5 100644 +--- a/tests/data/profile_stability/rhel8/stig_gui.profile ++++ b/tests/data/profile_stability/rhel8/stig_gui.profile +@@ -75,8 +75,8 @@ selections: + - accounts_user_home_paths_only + - accounts_user_interactive_home_directory_defined + - accounts_user_interactive_home_directory_exists +-- aide_check_audit_tools + - agent_mfetpd_running ++- aide_check_audit_tools + - aide_scan_notification + - aide_verify_acls + - aide_verify_ext_attributes +@@ -315,6 +315,7 @@ selections: + - partition_for_var_log_audit + - partition_for_var_tmp + - postfix_client_configure_mail_alias ++- postfix_prevent_unrestricted_relay + - require_emergency_target_auth + - require_singleuser_auth + - root_permissions_syslibrary_files diff --git a/SOURCES/scap-security-guide-0.1.58-RHEL_08_010400-PR_7411.patch b/SOURCES/scap-security-guide-0.1.58-RHEL_08_010400-PR_7411.patch new file mode 100644 index 0000000..54ac113 --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.58-RHEL_08_010400-PR_7411.patch @@ -0,0 +1,375 @@ +From f027c56e45e703663c25dea18f78111d5d8a7e0f Mon Sep 17 00:00:00 2001 +From: Matthew Burket +Date: Thu, 19 Aug 2021 11:16:08 -0500 +Subject: [PATCH] Added rule for RHEL-08-010400 + +--- + .../ansible/shared.yml | 27 +++++++++++++ + .../bash/shared.sh | 33 +++++++++++++++ + .../oval/shared.xml | 30 ++++++++++++++ + .../sssd_certificate_verification/rule.yml | 40 +++++++++++++++++++ + .../tests/correct_value.pass.sh | 6 +++ + .../tests/correct_with_others_before.pass.sh | 6 +++ + .../tests/not_configured.fail.sh | 5 +++ + .../tests/partial_config.fail.sh | 6 +++ + .../tests/wrong_section.fail.sh | 6 +++ + .../tests/wrong_value.fail.sh | 6 +++ + ...rtificate_verification_digest_function.var | 20 ++++++++++ + products/rhel8/profiles/stig.profile | 2 + + shared/references/cce-redhat-avail.txt | 1 - + .../data/profile_stability/rhel8/stig.profile | 4 +- + .../profile_stability/rhel8/stig_gui.profile | 4 +- + 15 files changed, 193 insertions(+), 3 deletions(-) + create mode 100644 linux_os/guide/services/sssd/sssd_certificate_verification/ansible/shared.yml + create mode 100644 linux_os/guide/services/sssd/sssd_certificate_verification/bash/shared.sh + create mode 100644 linux_os/guide/services/sssd/sssd_certificate_verification/oval/shared.xml + create mode 100644 linux_os/guide/services/sssd/sssd_certificate_verification/rule.yml + create mode 100644 linux_os/guide/services/sssd/sssd_certificate_verification/tests/correct_value.pass.sh + create mode 100644 linux_os/guide/services/sssd/sssd_certificate_verification/tests/correct_with_others_before.pass.sh + create mode 100644 linux_os/guide/services/sssd/sssd_certificate_verification/tests/not_configured.fail.sh + create mode 100644 linux_os/guide/services/sssd/sssd_certificate_verification/tests/partial_config.fail.sh + create mode 100644 linux_os/guide/services/sssd/sssd_certificate_verification/tests/wrong_section.fail.sh + create mode 100644 linux_os/guide/services/sssd/sssd_certificate_verification/tests/wrong_value.fail.sh + create mode 100644 linux_os/guide/services/sssd/var_sssd_certificate_verification_digest_function.var + +diff --git a/linux_os/guide/services/sssd/sssd_certificate_verification/ansible/shared.yml b/linux_os/guide/services/sssd/sssd_certificate_verification/ansible/shared.yml +new file mode 100644 +index 00000000000..8e36f0974fd +--- /dev/null ++++ b/linux_os/guide/services/sssd/sssd_certificate_verification/ansible/shared.yml +@@ -0,0 +1,27 @@ ++# platform = multi_platform_fedora,multi_platform_rhel ++# reboot = false ++# strategy = configure ++# complexity = low ++# disruption = medium ++ ++- name: Ensure that "certificate_verification" is not set in /etc/sssd/sssd.conf ++ ini_file: ++ path: /etc/sssd/sssd.conf ++ section: sssd ++ option: certificate_verification ++ state: absent ++ ++- name: 'Ensure that "certificate_verification" is not set in /etc/sssd/conf.d/*.conf' ++ ini_file: ++ path: /etc/sssd/conf.d/*.conf ++ section: sssd ++ option: certificate_verification ++ state: absent ++ ++- name: Ensure that "certificate_verification" is set ++ ini_file: ++ path: /etc/sssd/conf.d/certificate_verification.conf ++ section: sssd ++ option: certificate_verification ++ value: "ocsp_dgst = sha1" ++ state: present +diff --git a/linux_os/guide/services/sssd/sssd_certificate_verification/bash/shared.sh b/linux_os/guide/services/sssd/sssd_certificate_verification/bash/shared.sh +new file mode 100644 +index 00000000000..8f9e5514480 +--- /dev/null ++++ b/linux_os/guide/services/sssd/sssd_certificate_verification/bash/shared.sh +@@ -0,0 +1,33 @@ ++# platform = multi_platform_rhel,multi_platform_fedora ++# reboot = false ++# strategy = configure ++# complexity = low ++# disruption = medium ++ ++# include our remediation functions library ++. /usr/share/scap-security-guide/remediation_functions ++ ++{{{ bash_instantiate_variables("var_sssd_certificate_verification_digest_function") }}} ++ ++found=false ++for f in /etc/sssd/sssd.conf /etc/sssd/conf.d/*.conf; do ++ if [ ! -e "$f" ]; then ++ continue ++ fi ++ cert=$( awk '/^\s*\[/{f=0} /^\s*\[sssd\]/{f=1} f{nu=gensub("^\\s*certificate_verification\\s*=\\s*ocsp_dgst\\s*=\\s*(\\w+).*","\\1",1); if($0!=nu){cert=nu}} END{print cert}' "$f" ) ++ if [ -n "$cert" ] ; then ++ if [ "$cert" != $var_sssd_certificate_verification_digest_function ] ; then ++ sed -i "s/^certificate_verification\s*=.*/certificate_verification = ocsp_dgst = $var_sssd_certificate_verification_digest_function/" "$f" ++ fi ++ found=true ++ fi ++done ++ ++if ! $found ; then ++ SSSD_CONF="/etc/sssd/conf.d/certificate_verification.conf" ++ mkdir -p $( dirname $SSSD_CONF ) ++ touch $SSSD_CONF ++ chown root:root $SSSD_CONF ++ chmod 600 $SSSD_CONF ++ echo -e "[sssd]\ncertificate_verification = ocsp_dgst = $var_sssd_certificate_verification_digest_function" >> $SSSD_CONF ++fi +diff --git a/linux_os/guide/services/sssd/sssd_certificate_verification/oval/shared.xml b/linux_os/guide/services/sssd/sssd_certificate_verification/oval/shared.xml +new file mode 100644 +index 00000000000..77736f54f03 +--- /dev/null ++++ b/linux_os/guide/services/sssd/sssd_certificate_verification/oval/shared.xml +@@ -0,0 +1,30 @@ ++ ++ ++ {{{ oval_metadata("SSSD should be configured with the correct ocsp_dgst ++ digest function") }}} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ^/etc/sssd/(sssd|conf\.d/.*)\.conf$ ++ ^[\s]*\[sssd](?:[^\n\[]*\n+)+?[\s]*certificate_verification\s*=\s*ocsp_dgst\s*=\s*(\w+)$ ++ 1 ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/linux_os/guide/services/sssd/sssd_certificate_verification/rule.yml b/linux_os/guide/services/sssd/sssd_certificate_verification/rule.yml +new file mode 100644 +index 00000000000..182e75a2aab +--- /dev/null ++++ b/linux_os/guide/services/sssd/sssd_certificate_verification/rule.yml +@@ -0,0 +1,40 @@ ++documentation_complete: true ++ ++prodtype: fedora,rhel8 ++ ++title: 'Certificate certificate status checking in SSSD' ++ ++description: |- ++ Multifactor solutions that require devices separate from information systems gaining access include, ++ for example, hardware tokens providing time-based or challenge-response authenticators and smart cards. ++ By configuring certificate_verification to ocsp_dgst=sha1 sures that certificates for ++ multifactor solutions are checked via Online Certificate Status Protocol (OCSP). ++ ++rationale: |- ++ Enusring that multifactor solutions certificates are checked via Online Certificate Status Protocol (OCSP) ++ ensures the security of the system. ++ ++severity: medium ++ ++identifiers: ++ cce@rhel8: CCE-86120-3 ++ ++references: ++ disa: CCI-001948 ++ nist: IA-2(11) ++ srg: SRG-OS-000375-GPOS-00160,SRG-OS-000377-GPOS-00162 ++ stigid@rhel8: RHEL-08-010400 ++ ++ ++ocil_clause: 'certificate_verification in sssd is not configured' ++ ++ocil: |- ++ Check to see if Online Certificate Status Protocol (OCSP) ++ is enabled and using the proper digest value on the system with the following command: ++
$ sudo grep certificate_verification /etc/sssd/sssd.conf /etc/sssd/conf.d/*.conf | grep -v "^#"
++ If configured properly, output should look like ++
++        certificate_verification = ocsp_dgst=sha1
++    
++ The "sssd" service must be restarted for the changes to take effect. To restart the "sssd" service, run the following command: ++
$ sudo systemctl restart sssd.service
+diff --git a/linux_os/guide/services/sssd/sssd_certificate_verification/tests/correct_value.pass.sh b/linux_os/guide/services/sssd/sssd_certificate_verification/tests/correct_value.pass.sh +new file mode 100644 +index 00000000000..24c19f44fdc +--- /dev/null ++++ b/linux_os/guide/services/sssd/sssd_certificate_verification/tests/correct_value.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++# packages = sssd-common ++ ++mkdir -p /etc/sssd/conf.d ++touch /etc/sssd/sssd.conf ++echo -e "[sssd]\ncertificate_verification = ocsp_dgst=sha1" >> /etc/sssd/sssd.conf +diff --git a/linux_os/guide/services/sssd/sssd_certificate_verification/tests/correct_with_others_before.pass.sh b/linux_os/guide/services/sssd/sssd_certificate_verification/tests/correct_with_others_before.pass.sh +new file mode 100644 +index 00000000000..982450fc81b +--- /dev/null ++++ b/linux_os/guide/services/sssd/sssd_certificate_verification/tests/correct_with_others_before.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++# packages = sssd-common ++ ++mkdir -p /etc/sssd/conf.d ++touch /etc/sssd/sssd.conf ++echo -e "[sssd]\ndifferent_option = test\ncertificate_verification = ocsp_dgst=sha1" >> /etc/sssd/sssd.conf +diff --git a/linux_os/guide/services/sssd/sssd_certificate_verification/tests/not_configured.fail.sh b/linux_os/guide/services/sssd/sssd_certificate_verification/tests/not_configured.fail.sh +new file mode 100644 +index 00000000000..ed011f9d4bc +--- /dev/null ++++ b/linux_os/guide/services/sssd/sssd_certificate_verification/tests/not_configured.fail.sh +@@ -0,0 +1,5 @@ ++#!/bin/bash ++# packages = sssd-common ++ ++mkdir -p /etc/sssd/conf.d ++touch /etc/sssd/sssd.conf +diff --git a/linux_os/guide/services/sssd/sssd_certificate_verification/tests/partial_config.fail.sh b/linux_os/guide/services/sssd/sssd_certificate_verification/tests/partial_config.fail.sh +new file mode 100644 +index 00000000000..3c7c468b9d5 +--- /dev/null ++++ b/linux_os/guide/services/sssd/sssd_certificate_verification/tests/partial_config.fail.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++# packages = sssd-common ++ ++mkdir -p /etc/sssd/conf.d ++touch /etc/sssd/sssd.conf ++echo -e "[sssd]\ncertificate_verification = ocsp_dgst=" >> /etc/sssd/sssd.conf +diff --git a/linux_os/guide/services/sssd/sssd_certificate_verification/tests/wrong_section.fail.sh b/linux_os/guide/services/sssd/sssd_certificate_verification/tests/wrong_section.fail.sh +new file mode 100644 +index 00000000000..635ca4bebcc +--- /dev/null ++++ b/linux_os/guide/services/sssd/sssd_certificate_verification/tests/wrong_section.fail.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++# packages = sssd-common ++ ++mkdir -p /etc/sssd/conf.d ++touch /etc/sssd/sssd.conf ++echo -e "[ssd]\ncertificate_verification = ocsp_dgst=sha1" >> /etc/sssd/sssd.conf +diff --git a/linux_os/guide/services/sssd/sssd_certificate_verification/tests/wrong_value.fail.sh b/linux_os/guide/services/sssd/sssd_certificate_verification/tests/wrong_value.fail.sh +new file mode 100644 +index 00000000000..93f363edc04 +--- /dev/null ++++ b/linux_os/guide/services/sssd/sssd_certificate_verification/tests/wrong_value.fail.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++# packages = sssd-common ++ ++mkdir -p /etc/sssd/conf.d ++touch /etc/sssd/sssd.conf ++echo -e "[sssd]\ncertificate_verification = ocsp_dgst=sha256" >> /etc/sssd/sssd.conf +diff --git a/linux_os/guide/services/sssd/var_sssd_certificate_verification_digest_function.var b/linux_os/guide/services/sssd/var_sssd_certificate_verification_digest_function.var +new file mode 100644 +index 00000000000..cdbd0a13576 +--- /dev/null ++++ b/linux_os/guide/services/sssd/var_sssd_certificate_verification_digest_function.var +@@ -0,0 +1,20 @@ ++documentation_complete: true ++ ++title: 'SSSD certificate_verification option' ++ ++description: |- ++ Value of the certificate_verification option in ++ the SSSD config. ++ ++type: string ++ ++operator: equals ++ ++interactive: true ++ ++options: ++ sha1: sha1 ++ sha256: sha256 ++ sha384: sha384 ++ sha512: sha512 ++ default: sha1 +diff --git a/products/rhel8/profiles/stig.profile b/products/rhel8/profiles/stig.profile +index 9dc9360e899..5b1f709faaf 100644 +--- a/products/rhel8/profiles/stig.profile ++++ b/products/rhel8/profiles/stig.profile +@@ -70,6 +70,7 @@ selections: + - var_auditd_disk_error_action=halt + - var_auditd_max_log_file_action=syslog + - var_auditd_disk_full_action=halt ++ - var_sssd_certificate_verification_digest_function=sha1 + + ### Enable / Configure FIPS + - enable_fips_mode +@@ -275,6 +276,7 @@ selections: + - install_smartcard_packages + + # RHEL-08-010400 ++ - sssd_certificate_verification + + # RHEL-08-010410 + - package_opensc_installed +diff --git a/shared/references/cce-redhat-avail.txt b/shared/references/cce-redhat-avail.txt +index 3b24e19da06..81f94f7dbca 100644 +--- a/shared/references/cce-redhat-avail.txt ++++ b/shared/references/cce-redhat-avail.txt +@@ -236,7 +236,6 @@ CCE-86116-1 + CCE-86117-9 + CCE-86118-7 + CCE-86119-5 +-CCE-86120-3 + CCE-86121-1 + CCE-86122-9 + CCE-86123-7 +diff --git a/tests/data/profile_stability/rhel8/stig.profile b/tests/data/profile_stability/rhel8/stig.profile +index e9ba0f0adbf..baef93bba64 100644 +--- a/tests/data/profile_stability/rhel8/stig.profile ++++ b/tests/data/profile_stability/rhel8/stig.profile +@@ -342,6 +342,7 @@ selections: + - sshd_set_keepalive_0 + - sshd_use_strong_rng + - sshd_x11_use_localhost ++- sssd_certificate_verification + - sssd_enable_certmap + - sssd_enable_smartcards + - sssd_offline_cred_expiration +@@ -410,6 +411,7 @@ selections: + - sshd_approved_macs=stig + - sshd_approved_ciphers=stig + - sshd_idle_timeout_value=10_minutes ++- var_accounts_authorized_local_users_regex=rhel8 + - var_accounts_passwords_pam_faillock_deny=3 + - var_accounts_passwords_pam_faillock_fail_interval=900 + - var_accounts_passwords_pam_faillock_unlock_time=never +@@ -425,7 +427,7 @@ selections: + - var_auditd_disk_error_action=halt + - var_auditd_max_log_file_action=syslog + - var_auditd_disk_full_action=halt +-- var_accounts_authorized_local_users_regex=rhel8 ++- var_sssd_certificate_verification_digest_function=sha1 + - var_system_crypto_policy=fips + - var_sudo_timestamp_timeout=always_prompt + title: DISA STIG for Red Hat Enterprise Linux 8 +diff --git a/tests/data/profile_stability/rhel8/stig_gui.profile b/tests/data/profile_stability/rhel8/stig_gui.profile +index c8540f9392e..237f66c721f 100644 +--- a/tests/data/profile_stability/rhel8/stig_gui.profile ++++ b/tests/data/profile_stability/rhel8/stig_gui.profile +@@ -353,6 +353,7 @@ selections: + - sshd_set_keepalive_0 + - sshd_use_strong_rng + - sshd_x11_use_localhost ++- sssd_certificate_verification + - sssd_enable_certmap + - sssd_enable_smartcards + - sssd_offline_cred_expiration +@@ -420,6 +421,7 @@ selections: + - sshd_approved_macs=stig + - sshd_approved_ciphers=stig + - sshd_idle_timeout_value=10_minutes ++- var_accounts_authorized_local_users_regex=rhel8 + - var_accounts_passwords_pam_faillock_deny=3 + - var_accounts_passwords_pam_faillock_fail_interval=900 + - var_accounts_passwords_pam_faillock_unlock_time=never +@@ -435,7 +437,7 @@ selections: + - var_auditd_disk_error_action=halt + - var_auditd_max_log_file_action=syslog + - var_auditd_disk_full_action=halt +-- var_accounts_authorized_local_users_regex=rhel8 ++- var_sssd_certificate_verification_digest_function=sha1 + - var_system_crypto_policy=fips + - var_sudo_timestamp_timeout=always_prompt + title: DISA STIG with GUI for Red Hat Enterprise Linux 8 diff --git a/SOURCES/scap-security-guide-0.1.58-ansible_disable_ctrlaltdel_reboot-PR_7571.patch b/SOURCES/scap-security-guide-0.1.58-ansible_disable_ctrlaltdel_reboot-PR_7571.patch new file mode 100644 index 0000000..5909c1e --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.58-ansible_disable_ctrlaltdel_reboot-PR_7571.patch @@ -0,0 +1,23 @@ +From 91fb54a2e5e52d789f786fefbe711e7250470437 Mon Sep 17 00:00:00 2001 +From: Watson Sato +Date: Thu, 16 Sep 2021 19:45:26 +0200 +Subject: [PATCH] Force masking of ctrl-alt-del.target + +Without forcing the remediation it never converges. +The target is stopped but not masked. +--- + .../disable_ctrlaltdel_reboot/ansible/shared.yml | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/linux_os/guide/system/accounts/accounts-physical/disable_ctrlaltdel_reboot/ansible/shared.yml b/linux_os/guide/system/accounts/accounts-physical/disable_ctrlaltdel_reboot/ansible/shared.yml +index 8ea1de865ae..30f06a8751c 100644 +--- a/linux_os/guide/system/accounts/accounts-physical/disable_ctrlaltdel_reboot/ansible/shared.yml ++++ b/linux_os/guide/system/accounts/accounts-physical/disable_ctrlaltdel_reboot/ansible/shared.yml +@@ -7,6 +7,7 @@ + - name: Disable Ctrl-Alt-Del Reboot Activation + systemd: + name: ctrl-alt-del.target ++ force: yes + masked: yes + state: stopped + diff --git a/SOURCES/scap-security-guide-0.1.58-fix_rsyslog_streamdriver_remediation_typos-PR_7570.patch b/SOURCES/scap-security-guide-0.1.58-fix_rsyslog_streamdriver_remediation_typos-PR_7570.patch new file mode 100644 index 0000000..40928d4 --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.58-fix_rsyslog_streamdriver_remediation_typos-PR_7570.patch @@ -0,0 +1,33 @@ +From 69eb6ab86201b5566595b3b6ac12f643dcd9e0ca Mon Sep 17 00:00:00 2001 +From: Watson Sato +Date: Thu, 16 Sep 2021 14:59:27 +0200 +Subject: [PATCH] Fix typo in rsyslog streamdriver remediations + +The Ansible remediations don't need to escape '$'. +--- + .../ansible/shared.yml | 2 +- + .../ansible/shared.yml | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdrivermode/ansible/shared.yml b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdrivermode/ansible/shared.yml +index bbd27a00611..5d11103fc0f 100644 +--- a/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdrivermode/ansible/shared.yml ++++ b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdrivermode/ansible/shared.yml +@@ -5,5 +5,5 @@ + # disruption = low + + {{{ ansible_set_config_file(file="/etc/rsyslog.d/encrypt.conf", +- parameter="\$ActionSendStreamDriverMode", value="1", create=true, separator=" ", separator_regex=" ") ++ parameter="$ActionSendStreamDriverMode", value="1", create=true, separator=" ", separator_regex=" ") + }}} +diff --git a/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_defaultnetstreamdriver/ansible/shared.yml b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_defaultnetstreamdriver/ansible/shared.yml +index b215daaef4b..035ab152876 100644 +--- a/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_defaultnetstreamdriver/ansible/shared.yml ++++ b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_defaultnetstreamdriver/ansible/shared.yml +@@ -5,5 +5,5 @@ + # disruption = low + + {{{ ansible_set_config_file(file="/etc/rsyslog.d/encrypt.conf", +- parameter="\$DefaultNetstreamDriver", value="gtls", create=true, separator=" ", separator_regex=" ") ++ parameter="$DefaultNetstreamDriver", value="gtls", create=true, separator=" ", separator_regex=" ") + }}} diff --git a/SOURCES/scap-security-guide-0.1.58-templated_tests-PR_7211.patch b/SOURCES/scap-security-guide-0.1.58-templated_tests-PR_7211.patch new file mode 100644 index 0000000..590a222 --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.58-templated_tests-PR_7211.patch @@ -0,0 +1,1837 @@ +From 1036c6b55b95a27be57b065a4b9acfecc83639b3 Mon Sep 17 00:00:00 2001 +From: Alexander Scheel +Date: Tue, 6 Jul 2021 16:02:03 -0400 +Subject: [PATCH 01/19] Add tests for package_installed template + +Signed-off-by: Alexander Scheel +--- + .../package_installed/tests/package-installed-removed.fail.sh | 4 ++++ + .../package_installed/tests/package-installed.pass.sh | 3 +++ + .../templates/package_installed/tests/package-removed.fail.sh | 3 +++ + 3 files changed, 10 insertions(+) + create mode 100644 shared/templates/package_installed/tests/package-installed-removed.fail.sh + create mode 100644 shared/templates/package_installed/tests/package-installed.pass.sh + create mode 100644 shared/templates/package_installed/tests/package-removed.fail.sh + +diff --git a/shared/templates/package_installed/tests/package-installed-removed.fail.sh b/shared/templates/package_installed/tests/package-installed-removed.fail.sh +new file mode 100644 +index 00000000000..1ce59225303 +--- /dev/null ++++ b/shared/templates/package_installed/tests/package-installed-removed.fail.sh +@@ -0,0 +1,4 @@ ++#!/bin/bash ++ ++{{{ bash_package_install(PKGNAME) }}} ++{{{ bash_package_remove(PKGNAME) }}} +diff --git a/shared/templates/package_installed/tests/package-installed.pass.sh b/shared/templates/package_installed/tests/package-installed.pass.sh +new file mode 100644 +index 00000000000..2a0506c57fd +--- /dev/null ++++ b/shared/templates/package_installed/tests/package-installed.pass.sh +@@ -0,0 +1,3 @@ ++#!/bin/bash ++ ++{{{ bash_package_install(PKGNAME) }}} +diff --git a/shared/templates/package_installed/tests/package-removed.fail.sh b/shared/templates/package_installed/tests/package-removed.fail.sh +new file mode 100644 +index 00000000000..c2838396f56 +--- /dev/null ++++ b/shared/templates/package_installed/tests/package-removed.fail.sh +@@ -0,0 +1,3 @@ ++#!/bin/bash ++ ++{{{ bash_package_remove(PKGNAME) }}} + +From 3008339e7779b144a2b7fa72854d1185e33438f5 Mon Sep 17 00:00:00 2001 +From: Alexander Scheel +Date: Tue, 6 Jul 2021 16:16:56 -0400 +Subject: [PATCH 02/19] Refactor ssg/templates.py generation (SCE) + +This refactors SSG's template generation code to better align between +where we are now upstream and future changes related to templated SCE +support. + +At this point in time, we wish to make some changes to allow building +templated (both in the Jinja and shared/templates senses) test cases, +and many of the SCE-enablement changes are relevant, I chose to pull +them in almost entirely. The original commit message is preserved below: + + Refactor template generation for SCEs + + ssg/templates.py holds the core of template generation logic. We + will need a template_builder for SCE (so we can load SCE metadata + from templated content) but we do not wish to write this SCE content + out immediately; instead, we wish to wait until + build-scripts/build_templated_content.py is run. + + We refactor to make the resolved languages for a rule (the + intersection between theoretical languages allowed by the rule and + the actual languages allowed by the template) accessible to callers, + and, also allow reading just a single templated language artifact + into memory (instead of from disk). + +Notably, this last change is most useful to us; we don't want to put the +file in a template/build-system specified location; we wish to control +its location exactly here. + +Note that no changes to ssg/templates.py for the test suite change were +done here; this was purely a change to sync future changes for SCE +content. + +Signed-off-by: Alexander Scheel +--- + ssg/templates.py | 112 +++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 89 insertions(+), 23 deletions(-) + +diff --git a/ssg/templates.py b/ssg/templates.py +index 6783d0f2d5e..47a8a5eb852 100644 +--- a/ssg/templates.py ++++ b/ssg/templates.py +@@ -107,14 +107,17 @@ def __init__( + self.checks_dir = checks_dir + self.output_dirs = dict() + for lang in languages: ++ lang_dir = lang + if lang == "oval": + # OVAL checks need to be put to a different directory because +- # they are processed differently than remediations later in the +- # build process ++ # they are processed differently than remediations later in ++ # the build process + output_dir = self.checks_dir ++ if lang.startswith("sce-"): ++ lang_dir = "sce" + else: + output_dir = self.remediations_dir +- dir_ = os.path.join(output_dir, lang) ++ dir_ = os.path.join(output_dir, lang_dir) + self.output_dirs[lang] = dir_ + # scan directory structure and dynamically create list of templates + for item in sorted(os.listdir(self.templates_dir)): +@@ -124,25 +127,41 @@ def __init__( + maybe_template.load() + templates[item] = maybe_template + ++ def build_lang_file( ++ self, rule_id, template_name, template_vars, lang, local_env_yaml): ++ """ ++ Builds and returns templated content for a given rule for a given ++ language; does not write the output to disk. ++ """ ++ if lang not in templates[template_name].langs: ++ return None ++ ++ template_file_name = lang + ".template" ++ template_file_path = os.path.join(self.templates_dir, template_name, template_file_name) ++ template_parameters = templates[template_name].preprocess(template_vars, lang) ++ jinja_dict = ssg.utils.merge_dicts(local_env_yaml, template_parameters) ++ filled_template = ssg.jinja.process_file_with_macros( ++ template_file_path, jinja_dict) ++ ++ return filled_template + + def build_lang( +- self, rule_id, template_name, template_vars, lang, local_env_yaml): ++ self, rule_id, template_name, template_vars, lang, local_env_yaml, platforms=None): + """ + Builds templated content for a given rule for a given language. + Writes the output to the correct build directories. + """ + if lang not in templates[template_name].langs: + return +- template_file_name = lang + ".template" +- template_file_path = os.path.join(self.templates_dir, template_name, template_file_name) ++ ++ filled_template = self.build_lang_file(rule_id, template_name, ++ template_vars, lang, local_env_yaml) ++ + ext = lang_to_ext_map[lang] + output_file_name = rule_id + ext + output_filepath = os.path.join( + self.output_dirs[lang], output_file_name) +- template_parameters = templates[template_name].preprocess(template_vars, lang) +- jinja_dict = ssg.utils.merge_dicts(local_env_yaml, template_parameters) +- filled_template = ssg.jinja.process_file_with_macros( +- template_file_path, jinja_dict) ++ + with open(output_filepath, "w") as f: + f.write(filled_template) + +@@ -168,6 +187,37 @@ def get_langs_to_generate(self, rule): + else: + return languages + ++ def get_template_name(self, template): ++ """ ++ Given a template dictionary from a Rule instance, determine the name ++ of the template (from templates) this rule uses. ++ """ ++ try: ++ template_name = template["name"] ++ except KeyError: ++ raise ValueError( ++ "Rule {0} is missing template name under template key".format( ++ rule_id)) ++ if template_name not in templates.keys(): ++ raise ValueError( ++ "Rule {0} uses template {1} which does not exist.".format( ++ rule_id, template_name)) ++ return template_name ++ ++ def get_resolved_langs_to_generate(self, rule): ++ """ ++ Given a specific Rule instance, determine which languages are ++ generated by the combination of the rule's template_backends AND ++ the rule's template keys. ++ """ ++ if rule.template is None: ++ return None ++ ++ rule_langs = set(self.get_langs_to_generate(rule)) ++ template_name = self.get_template_name(rule.template) ++ template_langs = set(templates[template_name].langs) ++ return rule_langs.intersection(template_langs) ++ + def process_product_vars(self, all_variables): + """ + Given a dictionary with the format key[@]=value, filter out +@@ -183,21 +233,12 @@ def process_product_vars(self, all_variables): + + return processed + +- def build_rule(self, rule_id, rule_title, template, langs_to_generate): ++ def build_rule(self, rule_id, rule_title, template, langs_to_generate, platforms=None): + """ + Builds templated content for a given rule for selected languages, + writing the output to the correct build directories. + """ +- try: +- template_name = template["name"] +- except KeyError: +- raise ValueError( +- "Rule {0} is missing template name under template key".format( +- rule_id)) +- if template_name not in templates.keys(): +- raise ValueError( +- "Rule {0} uses template {1} which does not exist.".format( +- rule_id, template_name)) ++ template_name = self.get_template_name(template) + try: + template_vars = self.process_product_vars(template["vars"]) + except KeyError: +@@ -216,11 +257,36 @@ def build_rule(self, rule_id, rule_title, template, langs_to_generate): + for lang in langs_to_generate: + try: + self.build_lang( +- rule_id, template_name, template_vars, lang, local_env_yaml) ++ rule_id, template_name, template_vars, lang, local_env_yaml, platforms) + except Exception as e: + print("Error building templated {0} content for rule {1}".format(lang, rule_id), file=sys.stderr) + raise e + ++ def get_lang_for_rule(self, rule_id, rule_title, template, language): ++ """ ++ For the specified rule, build and return only the specified language ++ content. ++ """ ++ template_name = self.get_template_name(template) ++ try: ++ template_vars = self.process_product_vars(template["vars"]) ++ except KeyError: ++ raise ValueError( ++ "Rule {0} does not contain mandatory 'vars:' key under " ++ "'template:' key.".format(rule_id)) ++ # Add the rule ID which will be reused in OVAL templates as OVAL ++ # definition ID so that the build system matches the generated ++ # check with the rule. ++ template_vars["_rule_id"] = rule_id ++ # checks and remediations are processed with a custom YAML dict ++ local_env_yaml = self.env_yaml.copy() ++ local_env_yaml["rule_id"] = rule_id ++ local_env_yaml["rule_title"] = rule_title ++ local_env_yaml["products"] = self.env_yaml["product"] ++ ++ return self.build_lang_file(rule_id, template_name, template_vars, ++ language, local_env_yaml) ++ + def build_extra_ovals(self): + declaration_path = os.path.join(self.templates_dir, "extra_ovals.yml") + declaration = ssg.yaml.open_raw(declaration_path) +@@ -245,7 +311,7 @@ def build_all_rules(self): + continue + langs_to_generate = self.get_langs_to_generate(rule) + self.build_rule( +- rule.id_, rule.title, rule.template, langs_to_generate) ++ rule.id_, rule.title, rule.template, langs_to_generate, platforms=rule.platforms) + + def build(self): + """ + +From 8da04c6a85d40432a19904b16251885e12b75999 Mon Sep 17 00:00:00 2001 +From: Alexander Scheel +Date: Tue, 6 Jul 2021 16:50:06 -0400 +Subject: [PATCH 03/19] Remove incorrect tests for package installation + +These tests assume that the package manager is yum (and forcibly +installs it) in some cases. This doesn't work on Debian-like systems; +prefer the templated version instead, which uses the +bash_package_install Jinja macro instead (and uses the +bash_package_remove macro for the negative case) + +Signed-off-by: Alexander Scheel +--- + .../ntp/package_chrony_installed/tests/installed.pass.sh | 4 ---- + .../ntp/package_chrony_installed/tests/removed.fail.sh | 3 --- + .../package_audit_installed/tests/installed.pass.sh | 4 ---- + .../package_audit_installed/tests/removed.fail.sh | 3 --- + .../package_rsyslog_installed/tests/installed.pass.sh | 3 --- + .../package_rsyslog_installed/tests/notinstalled.fail.sh | 3 --- + .../package_firewalld_installed/tests/installed.pass.sh | 4 ---- + .../package_firewalld_installed/tests/removed.fail.sh | 3 --- + .../package_libselinux_installed/tests/installed.pass.sh | 4 ---- + .../aide/package_aide_installed/tests/installed.pass.sh | 3 --- + .../aide/package_aide_installed/tests/notinstalled.fail.sh | 3 --- + .../sudo/package_sudo_installed/tests/installed.pass.sh | 4 ---- + .../sudo/package_sudo_installed/tests/removed.fail.sh | 3 --- + 13 files changed, 53 deletions(-) + delete mode 100644 linux_os/guide/services/ntp/package_chrony_installed/tests/installed.pass.sh + delete mode 100644 linux_os/guide/services/ntp/package_chrony_installed/tests/removed.fail.sh + delete mode 100644 linux_os/guide/system/auditing/package_audit_installed/tests/installed.pass.sh + delete mode 100644 linux_os/guide/system/auditing/package_audit_installed/tests/removed.fail.sh + delete mode 100644 linux_os/guide/system/logging/package_rsyslog_installed/tests/installed.pass.sh + delete mode 100644 linux_os/guide/system/logging/package_rsyslog_installed/tests/notinstalled.fail.sh + delete mode 100644 linux_os/guide/system/network/network-firewalld/firewalld_activation/package_firewalld_installed/tests/installed.pass.sh + delete mode 100644 linux_os/guide/system/network/network-firewalld/firewalld_activation/package_firewalld_installed/tests/removed.fail.sh + delete mode 100644 linux_os/guide/system/selinux/package_libselinux_installed/tests/installed.pass.sh + delete mode 100644 linux_os/guide/system/software/integrity/software-integrity/aide/package_aide_installed/tests/installed.pass.sh + delete mode 100644 linux_os/guide/system/software/integrity/software-integrity/aide/package_aide_installed/tests/notinstalled.fail.sh + delete mode 100644 linux_os/guide/system/software/sudo/package_sudo_installed/tests/installed.pass.sh + delete mode 100644 linux_os/guide/system/software/sudo/package_sudo_installed/tests/removed.fail.sh + +diff --git a/linux_os/guide/services/ntp/package_chrony_installed/tests/installed.pass.sh b/linux_os/guide/services/ntp/package_chrony_installed/tests/installed.pass.sh +deleted file mode 100644 +index c692df2b282..00000000000 +--- a/linux_os/guide/services/ntp/package_chrony_installed/tests/installed.pass.sh ++++ /dev/null +@@ -1,4 +0,0 @@ +-#!/bin/bash +-# package = yum +- +-yum install -y chrony +diff --git a/linux_os/guide/services/ntp/package_chrony_installed/tests/removed.fail.sh b/linux_os/guide/services/ntp/package_chrony_installed/tests/removed.fail.sh +deleted file mode 100644 +index eba551f99d4..00000000000 +--- a/linux_os/guide/services/ntp/package_chrony_installed/tests/removed.fail.sh ++++ /dev/null +@@ -1,3 +0,0 @@ +-#!/bin/bash +- +-yum remove -y chrony +diff --git a/linux_os/guide/system/auditing/package_audit_installed/tests/installed.pass.sh b/linux_os/guide/system/auditing/package_audit_installed/tests/installed.pass.sh +deleted file mode 100644 +index 1c19ce31a87..00000000000 +--- a/linux_os/guide/system/auditing/package_audit_installed/tests/installed.pass.sh ++++ /dev/null +@@ -1,4 +0,0 @@ +-#!/bin/bash +-# package = yum +- +-yum install -y audit +diff --git a/linux_os/guide/system/auditing/package_audit_installed/tests/removed.fail.sh b/linux_os/guide/system/auditing/package_audit_installed/tests/removed.fail.sh +deleted file mode 100644 +index 45dd05a9638..00000000000 +--- a/linux_os/guide/system/auditing/package_audit_installed/tests/removed.fail.sh ++++ /dev/null +@@ -1,3 +0,0 @@ +-#!/bin/bash +- +-yum remove -y audit +diff --git a/linux_os/guide/system/logging/package_rsyslog_installed/tests/installed.pass.sh b/linux_os/guide/system/logging/package_rsyslog_installed/tests/installed.pass.sh +deleted file mode 100644 +index 6e4107fa3bd..00000000000 +--- a/linux_os/guide/system/logging/package_rsyslog_installed/tests/installed.pass.sh ++++ /dev/null +@@ -1,3 +0,0 @@ +-#!/bin/bash +-# packages = rsyslog +- +diff --git a/linux_os/guide/system/logging/package_rsyslog_installed/tests/notinstalled.fail.sh b/linux_os/guide/system/logging/package_rsyslog_installed/tests/notinstalled.fail.sh +deleted file mode 100644 +index f64bf1b340a..00000000000 +--- a/linux_os/guide/system/logging/package_rsyslog_installed/tests/notinstalled.fail.sh ++++ /dev/null +@@ -1,3 +0,0 @@ +-#!/bin/bash +- +-yum remove -y rsyslog +diff --git a/linux_os/guide/system/network/network-firewalld/firewalld_activation/package_firewalld_installed/tests/installed.pass.sh b/linux_os/guide/system/network/network-firewalld/firewalld_activation/package_firewalld_installed/tests/installed.pass.sh +deleted file mode 100644 +index 7a4748863bf..00000000000 +--- a/linux_os/guide/system/network/network-firewalld/firewalld_activation/package_firewalld_installed/tests/installed.pass.sh ++++ /dev/null +@@ -1,4 +0,0 @@ +-#!/bin/bash +-# package = yum +- +-yum install -y firewalld +diff --git a/linux_os/guide/system/network/network-firewalld/firewalld_activation/package_firewalld_installed/tests/removed.fail.sh b/linux_os/guide/system/network/network-firewalld/firewalld_activation/package_firewalld_installed/tests/removed.fail.sh +deleted file mode 100644 +index a9107df7de8..00000000000 +--- a/linux_os/guide/system/network/network-firewalld/firewalld_activation/package_firewalld_installed/tests/removed.fail.sh ++++ /dev/null +@@ -1,3 +0,0 @@ +-#!/bin/bash +- +-yum remove -y firewalld +diff --git a/linux_os/guide/system/selinux/package_libselinux_installed/tests/installed.pass.sh b/linux_os/guide/system/selinux/package_libselinux_installed/tests/installed.pass.sh +deleted file mode 100644 +index 5d30cf77841..00000000000 +--- a/linux_os/guide/system/selinux/package_libselinux_installed/tests/installed.pass.sh ++++ /dev/null +@@ -1,4 +0,0 @@ +-#!/bin/bash +-# package = yum +- +-yum install -y libselinux +diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/package_aide_installed/tests/installed.pass.sh b/linux_os/guide/system/software/integrity/software-integrity/aide/package_aide_installed/tests/installed.pass.sh +deleted file mode 100644 +index fa8b85b..0000000 +--- a/linux_os/guide/system/software/integrity/software-integrity/aide/package_aide_installed/tests/installed.pass.sh ++++ /dev/null +@@ -1,3 +0,0 @@ +-#!/bin/bash +-# packages = aide +- +diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/package_aide_installed/tests/notinstalled.fail.sh b/linux_os/guide/system/software/integrity/software-integrity/aide/package_aide_installed/tests/notinstalled.fail.sh +deleted file mode 100644 +index 75978b6..0000000 +--- a/linux_os/guide/system/software/integrity/software-integrity/aide/package_aide_installed/tests/notinstalled.fail.sh ++++ /dev/null +@@ -1,3 +0,0 @@ +-#!/bin/bash +- +-yum remove -y aide +diff --git a/linux_os/guide/system/software/sudo/package_sudo_installed/tests/installed.pass.sh b/linux_os/guide/system/software/sudo/package_sudo_installed/tests/installed.pass.sh +deleted file mode 100644 +index dafc6998a9a..00000000000 +--- a/linux_os/guide/system/software/sudo/package_sudo_installed/tests/installed.pass.sh ++++ /dev/null +@@ -1,4 +0,0 @@ +-#!/bin/bash +-# package = yum +- +-yum install -y sudo +diff --git a/linux_os/guide/system/software/sudo/package_sudo_installed/tests/removed.fail.sh b/linux_os/guide/system/software/sudo/package_sudo_installed/tests/removed.fail.sh +deleted file mode 100644 +index d22b562c15e..00000000000 +--- a/linux_os/guide/system/software/sudo/package_sudo_installed/tests/removed.fail.sh ++++ /dev/null +@@ -1,3 +0,0 @@ +-#!/bin/bash +- +-rpm -e --nodeps sudo + +From 6c49dcb79aaf5b239f09ecfdac07b443736b5b5e Mon Sep 17 00:00:00 2001 +From: Alexander Scheel +Date: Tue, 6 Jul 2021 16:51:05 -0400 +Subject: [PATCH 04/19] Support templating test content + +We introduced a new method to the template builder in ssg/templates.py +for finding (and building) test content under shared/templates/... +This uses Jinja macros and has the full context of the template present, +so for instance, package_installed tests can use the correct package +name on the target platform. + +Signed-off-by: Alexander Scheel +--- + ssg/templates.py | 46 ++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 46 insertions(+) + +diff --git a/ssg/templates.py b/ssg/templates.py +index 47a8a5eb852..0a39c3ba094 100644 +--- a/ssg/templates.py ++++ b/ssg/templates.py +@@ -145,6 +145,52 @@ def build_lang_file( + + return filled_template + ++ def get_all_tests( ++ self, rule_id, rule_template, local_env_yaml, platforms=None): ++ """ ++ Builds a dictionary of a test case path -> test case value mapping. ++ ++ Here, we want to know what the relative path on disk (under the tests/ ++ subdirectory) is (such as "installed.pass.sh"), along with the actual ++ contents of the test case. ++ ++ Presumably, we'll find the test case we want (all of them when ++ building a test case tarball) and write them to disk in the ++ appropriate location. ++ """ ++ template_name = rule_template['name'] ++ template_vars = rule_template['vars'] ++ ++ base_dir = os.path.abspath(os.path.join(self.templates_dir, template_name, "tests")) ++ results = dict() ++ ++ # If no test cases exist, return an empty dictionary. ++ if not os.path.exists(base_dir): ++ return results ++ ++ # Walk files; note that we don't need to do anything about directories ++ # as only files are recorded in the mapping; directories can be ++ # inferred from the path. ++ for dirpath, _, filenames in os.walk(base_dir): ++ if not filenames: ++ continue ++ ++ for filename in filenames: ++ # Relative path to the file becomes our results key. ++ absolute_path = os.path.abspath(os.path.join(dirpath, filename)) ++ relative_path = os.path.relpath(absolute_path, base_dir) ++ ++ # Load template parameters and apply it to the test case. ++ template_parameters = templates[template_name].preprocess(template_vars, "tests") ++ jinja_dict = ssg.utils.merge_dicts(local_env_yaml, template_parameters) ++ filled_template = ssg.jinja.process_file_with_macros( ++ absolute_path, jinja_dict) ++ ++ # Save the results under the relative path. ++ results[relative_path] = filled_template ++ ++ return results ++ + def build_lang( + self, rule_id, template_name, template_vars, lang, local_env_yaml, platforms=None): + """ + +From 4bd5061ffbb524b09975982fbd6dae26f35770c3 Mon Sep 17 00:00:00 2001 +From: Alexander Scheel +Date: Tue, 6 Jul 2021 16:53:44 -0400 +Subject: [PATCH 05/19] Add templated tests into templated directory + +This extends the existing templated directory generation to also include +tests under shared/templates/.../tests. The complicated portion is in +subdirectory handling: we need to ensure we create all necessary nested +subdirectories that are implicitly implied by the relative paths. This +is a shortcoming in the get_all_tests's return format. + +Signed-off-by: Alexander Scheel +--- + tests/ssg_test_suite/common.py | 43 ++++++++++++++++++++++++++++++++++ + 1 file changed, 43 insertions(+) + +diff --git a/tests/ssg_test_suite/common.py b/tests/ssg_test_suite/common.py +index 3dbeaf304a4..2bd4b2bd1c7 100644 +--- a/tests/ssg_test_suite/common.py ++++ b/tests/ssg_test_suite/common.py +@@ -21,6 +21,9 @@ + from ssg.rule_yaml import parse_prodtype + from ssg_test_suite.log import LogHelper + ++import ssg.templates ++ ++ + Scenario_run = namedtuple( + "Scenario_run", + ("rule_id", "script")) +@@ -39,6 +42,8 @@ + + _SHARED_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '../shared')) + ++_SHARED_TEMPLATES = os.path.abspath(os.path.join(SSG_ROOT, 'shared/templates')) ++ + REMOTE_USER = "root" + REMOTE_USER_HOME_DIRECTORY = "/root" + REMOTE_TEST_SCENARIOS_DIRECTORY = os.path.join(REMOTE_USER_HOME_DIRECTORY, "ssgts") +@@ -278,6 +283,11 @@ def template_tests(product=None): + yaml_path = product_yaml_path(SSG_ROOT, product) + product_yaml = load_product_yaml(yaml_path) + ++ # Initialize a mock template_builder. ++ empty = "/ssgts/empty/placeholder" ++ template_builder = ssg.templates.Builder(product_yaml, empty, ++ _SHARED_TEMPLATES, empty, empty) ++ + # Below we could run into a DocumentationNotComplete error. However, + # because the test suite isn't executed in the context of a particular + # build (though, ideally it would be linked), we may not know exactly +@@ -299,8 +309,11 @@ def template_tests(product=None): + + # Load rule content in our environment. We use this to satisfy + # some implied properties that might be used in the test suite. ++ # Make sure we normalize to a specific product as well so that ++ # when we load templated content it is correct. + rule_path = get_rule_dir_yaml(dirpath) + rule = RuleYAML.from_yaml(rule_path, product_yaml) ++ rule.normalize(product) + + # Note that most places would check prodtype, but we don't care + # about that here: if the rule is available to the product, we +@@ -320,6 +333,36 @@ def template_tests(product=None): + dest_path = os.path.join(tmpdir, rule.id_) + os.mkdir(dest_path) + ++ # The priority order is rule-specific tests over templated tests. ++ # That is, for any test under rule_id/tests with a name matching a ++ # test under shared/templates//tests/, the former ++ # will preferred. This means we need to process templates first, ++ # so they'll be overwritten later if necessary. ++ if rule.template: ++ templated_tests = template_builder.get_all_tests( ++ rule.id_, rule.template, local_env_yaml) ++ ++ for relative_path in templated_tests: ++ output_path = os.path.join(dest_path, relative_path) ++ ++ # If there's a separator in the file name, it means we ++ # have nested directories to deal with. ++ if os.path.sep in relative_path: ++ parts = os.path.split(relative_path)[:-1] ++ for subdir_index in range(len(parts)): ++ # We need to expand all directories in correct ++ # order, preserving any previous directories (as ++ # they're nested). Use the star operator to splat ++ # array parts into arguments to os.path.join(...). ++ new_directory = os.path.join(dest_path, *parts[:subdir_index]) ++ os.mkdir(new_directory) ++ ++ # Write out the test content to the desired location on ++ # disk. ++ with open(output_path, 'w') as output_fp: ++ test_content = templated_tests[relative_path] ++ print(test_content, file=output_fp) ++ + # Walk the test directory, writing all tests into the output + # directory, recursively. + tests_dir_path = os.path.join(dirpath, "tests") + +From 013b247c1be897bd12ae4cf2bc2443279b1a52c9 Mon Sep 17 00:00:00 2001 +From: Alexander Scheel +Date: Wed, 7 Jul 2021 07:00:37 -0400 +Subject: [PATCH 06/19] Teach iterate_over_rules about templated tests + +There are two parts to rule-based test execution: + + 1. Building the tarball of tests and shipping it over to the remote + machine. + 2. Iterating over these tests to see which scenarios are actually + applicable and any other metadata actions we need to take. + +In particular, item two is controlled by iterate_over_rules. Here we +need to: + + 1. Teach it about the templating system. + 2. Switch it from returning a list of test cases to a dictionary + mapping test case -> contents. This allows us to contain the + templating system to common.py only and not leak it into other parts + of the test suite. + 3. Do a little bit of refactoring to contain shared code between + iterate_over_rules and template_tests. + +Signed-off-by: Alexander Scheel +--- + tests/ssg_test_suite/common.py | 146 ++++++++++++++++++++++++--------- + 1 file changed, 108 insertions(+), 38 deletions(-) + +diff --git a/tests/ssg_test_suite/common.py b/tests/ssg_test_suite/common.py +index 2bd4b2bd1c7..b357f816027 100644 +--- a/tests/ssg_test_suite/common.py ++++ b/tests/ssg_test_suite/common.py +@@ -264,6 +264,62 @@ def _rel_abs_path(current_path, base_path): + return os.path.relpath(current_path, base_path) + + ++def get_product_context(product=None): ++ """ ++ Returns a product YAML context if any product is specified. Hard-coded to ++ assume a debug build. ++ """ ++ # Load product's YAML file if present. This will allow us to parse ++ # tests in the context of the product we're executing under. ++ product_yaml = dict() ++ if product: ++ yaml_path = product_yaml_path(SSG_ROOT, product) ++ product_yaml = load_product_yaml(yaml_path) ++ ++ # We could run into a DocumentationNotComplete error when loading a ++ # rule's YAML contents. However, because the test suite isn't executed ++ # in the context of a particular build (though, ideally it would be ++ # linked), we may not know exactly whether the top-level rule/profile ++ # we're testing is actually completed. Thus, forcibly set the required ++ # property to bypass this error. ++ product_yaml['cmake_build_type'] = 'Debug' ++ ++ return product_yaml ++ ++ ++def load_rule_and_env(rule_dir_path, env_yaml, product=None): ++ """ ++ Loads a rule and returns the combination of the RuleYAML class and ++ the corresponding local environment for that rule. ++ """ ++ ++ # First build the path to the rule.yml file ++ rule_path = get_rule_dir_yaml(rule_dir_path) ++ ++ # Load rule content in our environment. We use this to satisfy ++ # some implied properties that might be used in the test suite. ++ # Make sure we normalize to a specific product as well so that ++ # when we load templated content it is correct. ++ rule = RuleYAML.from_yaml(rule_path, env_yaml) ++ rule.normalize(product) ++ ++ # Note that most places would check prodtype, but we don't care ++ # about that here: if the rule is available to the product, we ++ # load and parse it anyways as we have no knowledge of the ++ # top-level profile or rule passed into the test suite. ++ prodtypes = parse_prodtype(rule.prodtype) ++ ++ # Our local copy of env_yaml needs some properties from rule.yml ++ # for completeness. ++ local_env_yaml = dict() ++ local_env_yaml.update(env_yaml) ++ local_env_yaml['rule_id'] = rule.id_ ++ local_env_yaml['rule_title'] = rule.title ++ local_env_yaml['products'] = prodtypes ++ ++ return rule, local_env_yaml ++ ++ + def template_tests(product=None): + """ + Create a temporary directory with test cases parsed via jinja using +@@ -276,26 +332,14 @@ def template_tests(product=None): + # it on success. Wrap in a try/except block and reraise the original + # exception after removing the temporary directory. + try: +- # Load product's YAML file if present. This will allow us to parse +- # tests in the context of the product we're executing under. +- product_yaml = dict() +- if product: +- yaml_path = product_yaml_path(SSG_ROOT, product) +- product_yaml = load_product_yaml(yaml_path) ++ # Load the product context we're executing under, if any. ++ product_yaml = get_product_context(product) + + # Initialize a mock template_builder. + empty = "/ssgts/empty/placeholder" + template_builder = ssg.templates.Builder(product_yaml, empty, + _SHARED_TEMPLATES, empty, empty) + +- # Below we could run into a DocumentationNotComplete error. However, +- # because the test suite isn't executed in the context of a particular +- # build (though, ideally it would be linked), we may not know exactly +- # whether the top-level rule/profile we're testing is actually +- # completed. Thus, forcibly set the required property to bypass this +- # error. +- product_yaml['cmake_build_type'] = 'Debug' +- + # Note that we're not exactly copying 1-for-1 the contents of the + # directory structure into the temporary one. Instead we want a + # flattened mapping with all rules in a single top-level directory +@@ -307,27 +351,8 @@ def template_tests(product=None): + if "tests" not in dirnames or not is_rule_dir(dirpath): + continue + +- # Load rule content in our environment. We use this to satisfy +- # some implied properties that might be used in the test suite. +- # Make sure we normalize to a specific product as well so that +- # when we load templated content it is correct. +- rule_path = get_rule_dir_yaml(dirpath) +- rule = RuleYAML.from_yaml(rule_path, product_yaml) +- rule.normalize(product) +- +- # Note that most places would check prodtype, but we don't care +- # about that here: if the rule is available to the product, we +- # load and parse it anyways as we have no knowledge of the +- # top-level profile or rule passed into the test suite. +- prodtypes = parse_prodtype(rule.prodtype) +- +- # Our local copy of env_yaml needs some properties from rule.yml +- # for completeness. +- local_env_yaml = dict() +- local_env_yaml.update(product_yaml) +- local_env_yaml['rule_id'] = rule.id_ +- local_env_yaml['rule_title'] = rule.title +- local_env_yaml['products'] = prodtypes ++ # Load the rule and its environment ++ rule, local_env_yaml = load_rule_and_env(dirpath, product_yaml, product) + + # Create the destination directory. + dest_path = os.path.join(tmpdir, rule.id_) +@@ -473,21 +498,66 @@ def iterate_over_rules(product=None): + id -- full rule id as it is present in datastream + short_id -- short rule ID, the same as basename of the directory + containing the test scenarios in Bash +- files -- list of executable .sh files in the "tests" directory ++ files -- list of executable .sh files in the uploaded tarball + """ ++ ++ # Here we need to perform some magic to handle parsing the rule (from a ++ # product perspective) and loading any templated tests. In particular, ++ # identifying which tests to potentially run involves invoking the ++ # templating engine. ++ # ++ # Begin by loading context about our execution environment, if any. ++ product_yaml = get_product_context(product) ++ ++ # Initialize a mock template_builder. ++ empty = "/ssgts/empty/placeholder" ++ template_builder = ssg.templates.Builder(product_yaml, empty, ++ _SHARED_TEMPLATES, empty, empty) ++ + for dirpath, dirnames, filenames in walk_through_benchmark_dirs(product): + if "rule.yml" in filenames and "tests" in dirnames: + short_rule_id = os.path.basename(dirpath) ++ ++ # Load the rule itself to check for a template. ++ rule, local_env_yaml = load_rule_and_env(dirpath, product_yaml, product) ++ ++ # All tests is a mapping from path (in the tarball) to contents ++ # of the test case. This is necessary because later code (which ++ # attempts to parse headers from the test case) don't have easy ++ # access to templated content. By reading it and returning it ++ # here, we can save later code from having to understand the ++ # templating system. ++ all_tests = dict() ++ ++ # Start ++ if rule.template: ++ templated_tests = template_builder.get_all_tests( ++ rule.id_, rule.template, local_env_yaml) ++ all_tests.update(templated_tests) ++ ++ # Add additional tests from the local rule directory. Note that, ++ # like the behavior in template_tests, this will overwrite any ++ # templated tests with the same file name. + tests_dir = os.path.join(dirpath, "tests") + tests_dir_files = os.listdir(tests_dir) ++ for test_case in tests_dir_files: ++ test_path = os.path.join(tests_dir, test_case) ++ if os.path.isdir(test_path): ++ continue ++ ++ with open(test_path) as fp: ++ all_tests[test_case] = fp.read() ++ + # Filter out everything except the shell test scenarios. + # Other files in rule directories are editor swap files + # or other content than a test case. +- scripts = filter(lambda x: x.endswith(".sh"), tests_dir_files) ++ allowed_scripts = filter(lambda x: x.endswith(".sh"), all_tests) ++ content_mapping = {x: all_tests[x] for x in allowed_scripts} ++ + full_rule_id = OSCAP_RULE + short_rule_id + result = Rule( + directory=tests_dir, id=full_rule_id, short_id=short_rule_id, +- files=scripts) ++ files=content_mapping) + yield result + + + +From 84014297a6881610e682ec7d54eca658b6ff127a Mon Sep 17 00:00:00 2001 +From: Alexander Scheel +Date: Wed, 7 Jul 2021 07:05:13 -0400 +Subject: [PATCH 07/19] Update rule execution to support templated tests + +We needed to make a few small changes to rule-based test execution in +order for it to correctly understand templated tests: + + 1. Product selection (from the CLI) needs to be passed down into the + iterate_over_rules helper function. + 2. Scenario loading needs to have knowledge of the returned test data. + 3. Parsing of parameters needs to occur from the returned test data + rather than attempting to re-read it ourselves. + +My assumption is that this will suffice for combined, since that method +of operation uses this method internally. + +Signed-off-by: Alexander Scheel +--- + tests/ssg_test_suite/rule.py | 30 +++++++++++++++--------------- + 1 file changed, 15 insertions(+), 15 deletions(-) + +diff --git a/tests/ssg_test_suite/rule.py b/tests/ssg_test_suite/rule.py +index 9f390749077..5ad7eb8ed27 100644 +--- a/tests/ssg_test_suite/rule.py ++++ b/tests/ssg_test_suite/rule.py +@@ -24,7 +24,7 @@ + + + Scenario = collections.namedtuple( +- "Scenario", ["script", "context", "script_params"]) ++ "Scenario", ["script", "context", "script_params", "contents"]) + + + def get_viable_profiles(selected_profiles, datastream, benchmark, script=None): +@@ -250,7 +250,7 @@ def _prepare_environment(self, scenarios_by_rule): + + def _get_rules_to_test(self, target): + rules_to_test = [] +- for rule in common.iterate_over_rules(): ++ for rule in common.iterate_over_rules(self.test_env.product): + if not self._rule_should_be_tested(rule, target): + continue + if not xml_operations.find_rule_in_benchmark( +@@ -300,7 +300,7 @@ def _modify_parameters(self, script, params): + .format(OSCAP_PROFILE_ALL_ID, script)) + return params + +- def _parse_parameters(self, script): ++ def _parse_parameters(self, script_content): + """Parse parameters from script header""" + params = {'profiles': [], + 'templates': [], +@@ -309,16 +309,15 @@ def _parse_parameters(self, script): + 'remediation': ['all'], + 'variables': [], + } +- with open(script, 'r') as script_file: +- script_content = script_file.read() +- for parameter in params: +- found = re.search(r'^# {0} = (.*)$'.format(parameter), +- script_content, +- re.MULTILINE) +- if found is None: +- continue +- splitted = found.group(1).split(',') +- params[parameter] = [value.strip() for value in splitted] ++ ++ for parameter in params: ++ found = re.search(r'^# {0} = (.*)$'.format(parameter), ++ script_content, re.MULTILINE) ++ if found is None: ++ continue ++ splitted = found.group(1).split(',') ++ params[parameter] = [value.strip() for value in splitted] ++ + return params + + def _get_scenarios(self, rule_dir, scripts, scenarios_regex, benchmark_cpes): +@@ -331,6 +330,7 @@ def _get_scenarios(self, rule_dir, scripts, scenarios_regex, benchmark_cpes): + + scenarios = [] + for script in scripts: ++ script_contents = scripts[script] + if scenarios_regex is not None: + if scenarios_pattern.match(script) is None: + logging.debug("Skipping script %s - it did not match " +@@ -338,10 +338,10 @@ def _get_scenarios(self, rule_dir, scripts, scenarios_regex, benchmark_cpes): + continue + script_context = _get_script_context(script) + if script_context is not None: +- script_params = self._parse_parameters(os.path.join(rule_dir, script)) ++ script_params = self._parse_parameters(script_contents) + script_params = self._modify_parameters(script, script_params) + if common.matches_platform(script_params["platform"], benchmark_cpes): +- scenarios += [Scenario(script, script_context, script_params)] ++ scenarios += [Scenario(script, script_context, script_params, script_contents)] + else: + logging.warning("Script %s is not applicable on given platform" % script) + + +From c763af671037cb9bfd5bfd5bd24f5efe9e4fc4c1 Mon Sep 17 00:00:00 2001 +From: Alexander Scheel +Date: Wed, 7 Jul 2021 07:22:47 -0400 +Subject: [PATCH 08/19] Make sure we read all test contents with Jinja + +Signed-off-by: Alexander Scheel +--- + tests/ssg_test_suite/common.py | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/tests/ssg_test_suite/common.py b/tests/ssg_test_suite/common.py +index b357f816027..865c8a8b988 100644 +--- a/tests/ssg_test_suite/common.py ++++ b/tests/ssg_test_suite/common.py +@@ -545,8 +545,7 @@ def iterate_over_rules(product=None): + if os.path.isdir(test_path): + continue + +- with open(test_path) as fp: +- all_tests[test_case] = fp.read() ++ all_tests[test_case] = process_file(test_path, local_env_yaml) + + # Filter out everything except the shell test scenarios. + # Other files in rule directories are editor swap files + +From 1234addaa4f776e3c814192c0aaf8f2137a74481 Mon Sep 17 00:00:00 2001 +From: Alexander Scheel +Date: Thu, 8 Jul 2021 07:44:16 -0400 +Subject: [PATCH 09/19] Fix pep8 issues + +Signed-off-by: Alexander Scheel +--- + ssg/templates.py | 5 +++-- + tests/ssg_test_suite/common.py | 5 +++-- + 2 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/ssg/templates.py b/ssg/templates.py +index 0a39c3ba094..818b1f79f68 100644 +--- a/ssg/templates.py ++++ b/ssg/templates.py +@@ -201,7 +201,8 @@ def build_lang( + return + + filled_template = self.build_lang_file(rule_id, template_name, +- template_vars, lang, local_env_yaml) ++ template_vars, lang, ++ local_env_yaml) + + ext = lang_to_ext_map[lang] + output_file_name = rule_id + ext +@@ -331,7 +332,7 @@ def get_lang_for_rule(self, rule_id, rule_title, template, language): + local_env_yaml["products"] = self.env_yaml["product"] + + return self.build_lang_file(rule_id, template_name, template_vars, +- language, local_env_yaml) ++ language, local_env_yaml) + + def build_extra_ovals(self): + declaration_path = os.path.join(self.templates_dir, "extra_ovals.yml") +diff --git a/tests/ssg_test_suite/common.py b/tests/ssg_test_suite/common.py +index 865c8a8b988..977e9f52c24 100644 +--- a/tests/ssg_test_suite/common.py ++++ b/tests/ssg_test_suite/common.py +@@ -338,7 +338,8 @@ def template_tests(product=None): + # Initialize a mock template_builder. + empty = "/ssgts/empty/placeholder" + template_builder = ssg.templates.Builder(product_yaml, empty, +- _SHARED_TEMPLATES, empty, empty) ++ _SHARED_TEMPLATES, empty, ++ empty) + + # Note that we're not exactly copying 1-for-1 the contents of the + # directory structure into the temporary one. Instead we want a +@@ -512,7 +513,7 @@ def iterate_over_rules(product=None): + # Initialize a mock template_builder. + empty = "/ssgts/empty/placeholder" + template_builder = ssg.templates.Builder(product_yaml, empty, +- _SHARED_TEMPLATES, empty, empty) ++ _SHARED_TEMPLATES, empty, empty) + + for dirpath, dirnames, filenames in walk_through_benchmark_dirs(product): + if "rule.yml" in filenames and "tests" in dirnames: + +From 81fcdf3e18f83da44b697ef7f47759a8eadd9854 Mon Sep 17 00:00:00 2001 +From: Alexander Scheel +Date: Wed, 14 Jul 2021 08:06:57 -0400 +Subject: [PATCH 10/19] Split template_tests into template_rule_tests + +Signed-off-by: Alexander Scheel +--- + tests/ssg_test_suite/common.py | 146 +++++++++++++++++---------------- + 1 file changed, 77 insertions(+), 69 deletions(-) + +diff --git a/tests/ssg_test_suite/common.py b/tests/ssg_test_suite/common.py +index 977e9f52c24..4e77bd888fe 100644 +--- a/tests/ssg_test_suite/common.py ++++ b/tests/ssg_test_suite/common.py +@@ -320,6 +320,82 @@ def load_rule_and_env(rule_dir_path, env_yaml, product=None): + return rule, local_env_yaml + + ++def template_rule_tests(product, product_yaml, template_builder, tmpdir, dirpath): ++ """ ++ For a given rule directory, templates all contained tests into the output ++ (tmpdir) directory. ++ """ ++ ++ # Load the rule and its environment ++ rule, local_env_yaml = load_rule_and_env(dirpath, product_yaml, product) ++ ++ # Create the destination directory. ++ dest_path = os.path.join(tmpdir, rule.id_) ++ os.mkdir(dest_path) ++ ++ # The priority order is rule-specific tests over templated tests. ++ # That is, for any test under rule_id/tests with a name matching a ++ # test under shared/templates//tests/, the former ++ # will preferred. This means we need to process templates first, ++ # so they'll be overwritten later if necessary. ++ if rule.template: ++ templated_tests = template_builder.get_all_tests(rule.id_, rule.template, ++ local_env_yaml) ++ ++ for relative_path in templated_tests: ++ output_path = os.path.join(dest_path, relative_path) ++ ++ # If there's a separator in the file name, it means we ++ # have nested directories to deal with. ++ if os.path.sep in relative_path: ++ parts = os.path.split(relative_path)[:-1] ++ for subdir_index in range(len(parts)): ++ # We need to expand all directories in correct ++ # order, preserving any previous directories (as ++ # they're nested). Use the star operator to splat ++ # array parts into arguments to os.path.join(...). ++ new_directory = os.path.join(dest_path, *parts[:subdir_index]) ++ os.mkdir(new_directory) ++ ++ # Write out the test content to the desired location on ++ # disk. ++ with open(output_path, 'w') as output_fp: ++ test_content = templated_tests[relative_path] ++ print(test_content, file=output_fp) ++ ++ # Walk the test directory, writing all tests into the output ++ # directory, recursively. ++ tests_dir_path = os.path.join(dirpath, "tests") ++ tests_dir_path = os.path.abspath(tests_dir_path) ++ for dirpath, dirnames, filenames in os.walk(tests_dir_path): ++ for dirname in dirnames: ++ # We want to recreate the correct path under the temporary ++ # directory. Resolve it to a relative path from the tests/ ++ # directory. ++ dir_path = _rel_abs_path(os.path.join(dirpath, dirname), tests_dir_path) ++ assert '../' not in dir_path ++ tmp_dir_path = os.path.join(dest_path, dir_path) ++ os.mkdir(tmp_dir_path) ++ ++ for filename in filenames: ++ # We want to recreate the correct path under the temporary ++ # directory. Resolve it to a relative path from the tests/ ++ # directory. Assumption: directories should be created ++ # prior to recursing into them, so we don't need to handle ++ # if a file's parent directory doesn't yet exist under the ++ # destination. ++ src_test_path = os.path.join(dirpath, filename) ++ rel_test_path = _rel_abs_path(src_test_path, tests_dir_path) ++ dest_test_path = os.path.join(dest_path, rel_test_path) ++ ++ # Rather than performing an OS-level copy, we need to ++ # first parse the test with jinja and then write it back ++ # out to the destination. ++ parsed_test = process_file(src_test_path, local_env_yaml) ++ with open(dest_test_path, 'w') as output_fp: ++ print(parsed_test, file=output_fp) ++ ++ + def template_tests(product=None): + """ + Create a temporary directory with test cases parsed via jinja using +@@ -352,75 +428,7 @@ def template_tests(product=None): + if "tests" not in dirnames or not is_rule_dir(dirpath): + continue + +- # Load the rule and its environment +- rule, local_env_yaml = load_rule_and_env(dirpath, product_yaml, product) +- +- # Create the destination directory. +- dest_path = os.path.join(tmpdir, rule.id_) +- os.mkdir(dest_path) +- +- # The priority order is rule-specific tests over templated tests. +- # That is, for any test under rule_id/tests with a name matching a +- # test under shared/templates//tests/, the former +- # will preferred. This means we need to process templates first, +- # so they'll be overwritten later if necessary. +- if rule.template: +- templated_tests = template_builder.get_all_tests( +- rule.id_, rule.template, local_env_yaml) +- +- for relative_path in templated_tests: +- output_path = os.path.join(dest_path, relative_path) +- +- # If there's a separator in the file name, it means we +- # have nested directories to deal with. +- if os.path.sep in relative_path: +- parts = os.path.split(relative_path)[:-1] +- for subdir_index in range(len(parts)): +- # We need to expand all directories in correct +- # order, preserving any previous directories (as +- # they're nested). Use the star operator to splat +- # array parts into arguments to os.path.join(...). +- new_directory = os.path.join(dest_path, *parts[:subdir_index]) +- os.mkdir(new_directory) +- +- # Write out the test content to the desired location on +- # disk. +- with open(output_path, 'w') as output_fp: +- test_content = templated_tests[relative_path] +- print(test_content, file=output_fp) +- +- # Walk the test directory, writing all tests into the output +- # directory, recursively. +- tests_dir_path = os.path.join(dirpath, "tests") +- tests_dir_path = os.path.abspath(tests_dir_path) +- for dirpath, dirnames, filenames in os.walk(tests_dir_path): +- for dirname in dirnames: +- # We want to recreate the correct path under the temporary +- # directory. Resolve it to a relative path from the tests/ +- # directory. +- dir_path = _rel_abs_path(os.path.join(dirpath, dirname), tests_dir_path) +- assert '../' not in dir_path +- tmp_dir_path = os.path.join(dest_path, dir_path) +- os.mkdir(tmp_dir_path) +- +- for filename in filenames: +- # We want to recreate the correct path under the temporary +- # directory. Resolve it to a relative path from the tests/ +- # directory. Assumption: directories should be created +- # prior to recursing into them, so we don't need to handle +- # if a file's parent directory doesn't yet exist under the +- # destination. +- src_test_path = os.path.join(dirpath, filename) +- rel_test_path = _rel_abs_path(src_test_path, tests_dir_path) +- dest_test_path = os.path.join(dest_path, rel_test_path) +- +- # Rather than performing an OS-level copy, we need to +- # first parse the test with jinja and then write it back +- # out to the destination. +- parsed_test = process_file(src_test_path, local_env_yaml) +- with open(dest_test_path, 'w') as output_fp: +- print(parsed_test, file=output_fp) +- ++ template_rule_tests(product, product_yaml, template_builder, tmpdir, dirpath) + except Exception as exp: + shutil.rmtree(tmpdir, ignore_errors=True) + raise exp + +From 9bd6bf1bb5a51a69dc30d4d6eaa2e159c2ac0446 Mon Sep 17 00:00:00 2001 +From: Alexander Scheel +Date: Wed, 14 Jul 2021 08:23:27 -0400 +Subject: [PATCH 11/19] Refactor template_rule_tests into write_* helpers + +Signed-off-by: Alexander Scheel +--- + tests/ssg_test_suite/common.py | 93 ++++++++++++++++++---------------- + 1 file changed, 50 insertions(+), 43 deletions(-) + +diff --git a/tests/ssg_test_suite/common.py b/tests/ssg_test_suite/common.py +index 4e77bd888fe..1f3cad807e6 100644 +--- a/tests/ssg_test_suite/common.py ++++ b/tests/ssg_test_suite/common.py +@@ -320,49 +320,27 @@ def load_rule_and_env(rule_dir_path, env_yaml, product=None): + return rule, local_env_yaml + + +-def template_rule_tests(product, product_yaml, template_builder, tmpdir, dirpath): +- """ +- For a given rule directory, templates all contained tests into the output +- (tmpdir) directory. +- """ +- +- # Load the rule and its environment +- rule, local_env_yaml = load_rule_and_env(dirpath, product_yaml, product) +- +- # Create the destination directory. +- dest_path = os.path.join(tmpdir, rule.id_) +- os.mkdir(dest_path) +- +- # The priority order is rule-specific tests over templated tests. +- # That is, for any test under rule_id/tests with a name matching a +- # test under shared/templates//tests/, the former +- # will preferred. This means we need to process templates first, +- # so they'll be overwritten later if necessary. +- if rule.template: +- templated_tests = template_builder.get_all_tests(rule.id_, rule.template, +- local_env_yaml) +- +- for relative_path in templated_tests: +- output_path = os.path.join(dest_path, relative_path) +- +- # If there's a separator in the file name, it means we +- # have nested directories to deal with. +- if os.path.sep in relative_path: +- parts = os.path.split(relative_path)[:-1] +- for subdir_index in range(len(parts)): +- # We need to expand all directories in correct +- # order, preserving any previous directories (as +- # they're nested). Use the star operator to splat +- # array parts into arguments to os.path.join(...). +- new_directory = os.path.join(dest_path, *parts[:subdir_index]) +- os.mkdir(new_directory) +- +- # Write out the test content to the desired location on +- # disk. +- with open(output_path, 'w') as output_fp: +- test_content = templated_tests[relative_path] +- print(test_content, file=output_fp) +- ++def write_rule_templated_tests(dest_path, relative_path, test_content): ++ output_path = os.path.join(dest_path, relative_path) ++ ++ # If there's a separator in the file name, it means we have nested ++ # directories to deal with. ++ if os.path.sep in relative_path: ++ parts = os.path.split(relative_path)[:-1] ++ for subdir_index in range(len(parts)): ++ # We need to expand all directories in the correct order, ++ # preserving any previous directories (as they're nested). ++ # Use the star operator to splat array parts into arguments ++ # to os.path.join(...). ++ new_directory = os.path.join(dest_path, *parts[:subdir_index]) ++ os.mkdir(new_directory) ++ ++ # Write out the test content to the desired location on disk. ++ with open(output_path, 'w') as output_fp: ++ print(test_content, file=output_fp) ++ ++ ++def write_rule_dir_tests(local_env_yaml, dest_path, dirpath): + # Walk the test directory, writing all tests into the output + # directory, recursively. + tests_dir_path = os.path.join(dirpath, "tests") +@@ -396,6 +374,35 @@ def template_rule_tests(product, product_yaml, template_builder, tmpdir, dirpath + print(parsed_test, file=output_fp) + + ++def template_rule_tests(product, product_yaml, template_builder, tmpdir, dirpath): ++ """ ++ For a given rule directory, templates all contained tests into the output ++ (tmpdir) directory. ++ """ ++ ++ # Load the rule and its environment ++ rule, local_env_yaml = load_rule_and_env(dirpath, product_yaml, product) ++ ++ # Create the destination directory. ++ dest_path = os.path.join(tmpdir, rule.id_) ++ os.mkdir(dest_path) ++ ++ # The priority order is rule-specific tests over templated tests. ++ # That is, for any test under rule_id/tests with a name matching a ++ # test under shared/templates//tests/, the former ++ # will preferred. This means we need to process templates first, ++ # so they'll be overwritten later if necessary. ++ if rule.template: ++ templated_tests = template_builder.get_all_tests(rule.id_, rule.template, ++ local_env_yaml) ++ ++ for relative_path in templated_tests: ++ test_content = templated_tests[relative_path] ++ write_rule_templated_tests(dest_path, relative_path, test_content) ++ ++ write_rule_dir_tests(local_env_yaml, dest_path, dirpath) ++ ++ + def template_tests(product=None): + """ + Create a temporary directory with test cases parsed via jinja using + +From 5b74ff0aa8ef1b085ef9d6c0148283835a2917f8 Mon Sep 17 00:00:00 2001 +From: Alexander Scheel +Date: Wed, 14 Jul 2021 08:24:10 -0400 +Subject: [PATCH 12/19] Remove unnecessary assertion + +Signed-off-by: Alexander Scheel +--- + tests/ssg_test_suite/common.py | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/tests/ssg_test_suite/common.py b/tests/ssg_test_suite/common.py +index 1f3cad807e6..9c232dcad02 100644 +--- a/tests/ssg_test_suite/common.py ++++ b/tests/ssg_test_suite/common.py +@@ -351,7 +351,6 @@ def write_rule_dir_tests(local_env_yaml, dest_path, dirpath): + # directory. Resolve it to a relative path from the tests/ + # directory. + dir_path = _rel_abs_path(os.path.join(dirpath, dirname), tests_dir_path) +- assert '../' not in dir_path + tmp_dir_path = os.path.join(dest_path, dir_path) + os.mkdir(tmp_dir_path) + + +From 0ab1b95de66d60cf135c985697d6269464777de9 Mon Sep 17 00:00:00 2001 +From: Alexander Scheel +Date: Wed, 14 Jul 2021 08:25:26 -0400 +Subject: [PATCH 13/19] Remove unnecessary _rel_abs_path + +As pointed out by Matej, the extra abspath is unnecessary prior to +calling relpath. Remove our helper and switch to calling relpath +directly. + +Signed-off-by: Alexander Scheel +--- + tests/ssg_test_suite/common.py | 15 ++------------- + 1 file changed, 2 insertions(+), 13 deletions(-) + +diff --git a/tests/ssg_test_suite/common.py b/tests/ssg_test_suite/common.py +index 9c232dcad02..04117359203 100644 +--- a/tests/ssg_test_suite/common.py ++++ b/tests/ssg_test_suite/common.py +@@ -253,17 +253,6 @@ def _make_file_root_owned(tarinfo): + return tarinfo + + +-def _rel_abs_path(current_path, base_path): +- """ +- Return the value of the current path, relative to the base path, but +- resolving paths absolutely first. This helps when walking a nested +- directory structure and want to get the subtree relative to the original +- path +- """ +- tmp_path = os.path.abspath(current_path) +- return os.path.relpath(current_path, base_path) +- +- + def get_product_context(product=None): + """ + Returns a product YAML context if any product is specified. Hard-coded to +@@ -350,7 +339,7 @@ def write_rule_dir_tests(local_env_yaml, dest_path, dirpath): + # We want to recreate the correct path under the temporary + # directory. Resolve it to a relative path from the tests/ + # directory. +- dir_path = _rel_abs_path(os.path.join(dirpath, dirname), tests_dir_path) ++ dir_path = os.path.relpath(os.path.join(dirpath, dirname), tests_dir_path) + tmp_dir_path = os.path.join(dest_path, dir_path) + os.mkdir(tmp_dir_path) + +@@ -362,7 +351,7 @@ def write_rule_dir_tests(local_env_yaml, dest_path, dirpath): + # if a file's parent directory doesn't yet exist under the + # destination. + src_test_path = os.path.join(dirpath, filename) +- rel_test_path = _rel_abs_path(src_test_path, tests_dir_path) ++ rel_test_path = os.path.relpath(src_test_path, tests_dir_path) + dest_test_path = os.path.join(dest_path, rel_test_path) + + # Rather than performing an OS-level copy, we need to + +From 0d2dadf00682efba465b5378803a68893dc62038 Mon Sep 17 00:00:00 2001 +From: Alexander Scheel +Date: Wed, 14 Jul 2021 14:23:59 -0400 +Subject: [PATCH 14/19] Only template rules with variables + +The audit_rules_privileged_commands_unix2_chkpwd rule lacks variables on +most products, in addition to its limited prodtype. Because the existing +test harness lacks understanding of prodtype (for including rules in the +tarball), we don't check it yet either. This causes issues when the +template is present but has empty variables on the particular product +(such as when this rule is executed under Ubuntu) + +Ultimately we should probably check prodtype in the future, but it +outside the scope of this PR. + +Signed-off-by: Alexander Scheel +--- + tests/ssg_test_suite/common.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/ssg_test_suite/common.py b/tests/ssg_test_suite/common.py +index 04117359203..44105e3b7ae 100644 +--- a/tests/ssg_test_suite/common.py ++++ b/tests/ssg_test_suite/common.py +@@ -380,7 +380,7 @@ def template_rule_tests(product, product_yaml, template_builder, tmpdir, dirpath + # test under shared/templates//tests/, the former + # will preferred. This means we need to process templates first, + # so they'll be overwritten later if necessary. +- if rule.template: ++ if rule.template and rule.template['vars']: + templated_tests = template_builder.get_all_tests(rule.id_, rule.template, + local_env_yaml) + +@@ -534,7 +534,7 @@ def iterate_over_rules(product=None): + all_tests = dict() + + # Start +- if rule.template: ++ if rule.template and rule.template['vars']: + templated_tests = template_builder.get_all_tests( + rule.id_, rule.template, local_env_yaml) + all_tests.update(templated_tests) + +From e00262230d86b39d77dc1d75ffce5c048d5a4652 Mon Sep 17 00:00:00 2001 +From: Alexander Scheel +Date: Mon, 19 Jul 2021 09:06:02 -0400 +Subject: [PATCH 15/19] Document new JINJA/Template testing scenarios + +Signed-off-by: Alexander Scheel +--- + tests/README.md | 32 ++++++++++++++++++++++++++++++++ + 1 file changed, 32 insertions(+) + +diff --git a/tests/README.md b/tests/README.md +index 6b5b4497baf..0b3dfabc6f5 100644 +--- a/tests/README.md ++++ b/tests/README.md +@@ -147,6 +147,7 @@ the rule that `oscap` should return when the rule is evaluated. + very important to keep this naming form. + + For example: ++ + * `something.pass.sh`: Success scenario - script is expected to prepare machine + in such way that the rule is expected to pass. + * `something.fail.sh`: Fail scenario - script is expected to break machine so +@@ -200,6 +201,37 @@ Using `platform` and `variables` metadata: + echo "KerberosAuthentication $auth_enabled" >> /etc/ssh/sshd_config + ``` + ++### Augmenting using Jinja macros ++ ++Each scenario script is processed under the same jinja context as the ++corresponding OVAL and remediation content. This means that product-specific ++information is known to the scenario scripts at upload time (for example, ++`{{{ grub2_boot_path }}}`), allowing them to work across products. This ++also means Jinja macros such as `{{{ bash_package_install(...) }}}` work to ++install/remove specific packages during the course of testing (such as, if ++it is desired to both install and remove a package in the same scenario for ++the `package_installed` rules). ++ ++Note that this does have some limitations: knowledge of the profile (and the ++variables it has and the values they take) is still not provided to the test ++scenario. The above `# profiles` or `# variables` directives will still have ++to be used to add any profile-specific information. ++ ++### Augmenting using `shared/templates` ++ ++Additionally, we have enabled test scenarios located under the templated ++directory, `shared/templates/.../tests`. Unlike with build-time content, ++`tests` does not need to be located in the template's manifest (at ++`template.yml`). Instead, SSGTS will automatically parse each rule and ++prefer rule-directory-specific test scenarios over any templated scenarios ++that the rule uses. (E.g., if `installed.pass.sh` is present in the ++template `package_installed` and in the `tests/` subdirectory of the rule ++directory, the latter takes precedence over the former). ++ ++In addition to the Jinja context described above, the contents of the template ++variables (after processing in `template.py`) are also available to the ++test scenario. This enables template-specific checking. ++ + ## Example of adding new test scenarios + + Let's add test scenarios for rule `accounts_password_minlen_login_defs`. + +From c696ebf0001bd6bcced40aafea58cfbc6b870cc1 Mon Sep 17 00:00:00 2001 +From: Alexander Scheel +Date: Tue, 27 Jul 2021 08:17:47 -0400 +Subject: [PATCH 16/19] Correctly handle generation of templated tests + +When rules lacked tests inside the rule directory but had them via a +template, SSGTS would ignore them and claim the rule wasn't found. Fix +this bug to allow template-only tests. + +Signed-off-by: Alexander Scheel +--- + tests/ssg_test_suite/common.py | 30 ++++++++++++++++++++++-------- + 1 file changed, 22 insertions(+), 8 deletions(-) + +diff --git a/tests/ssg_test_suite/common.py b/tests/ssg_test_suite/common.py +index 44105e3b7ae..0cb5451e31b 100644 +--- a/tests/ssg_test_suite/common.py ++++ b/tests/ssg_test_suite/common.py +@@ -334,6 +334,13 @@ def write_rule_dir_tests(local_env_yaml, dest_path, dirpath): + # directory, recursively. + tests_dir_path = os.path.join(dirpath, "tests") + tests_dir_path = os.path.abspath(tests_dir_path) ++ ++ # Note that the tests/ directory may not always exist any more. In ++ # particular, when a rule uses a template, tests may be present there ++ # but not present in the actual rule directory. ++ if not os.path.exists(tests_dir_path): ++ return ++ + for dirpath, dirnames, filenames in os.walk(tests_dir_path): + for dirname in dirnames: + # We want to recreate the correct path under the temporary +@@ -420,7 +427,7 @@ def template_tests(product=None): + # /group_a/rule_a/tests/something.pass.sh -> /rule_a/something.pass.sh + for dirpath, dirnames, _ in walk_through_benchmark_dirs(product): + # Skip anything that isn't obviously a rule. +- if "tests" not in dirnames or not is_rule_dir(dirpath): ++ if not is_rule_dir(dirpath): + continue + + template_rule_tests(product, product_yaml, template_builder, tmpdir, dirpath) +@@ -519,7 +526,7 @@ def iterate_over_rules(product=None): + _SHARED_TEMPLATES, empty, empty) + + for dirpath, dirnames, filenames in walk_through_benchmark_dirs(product): +- if "rule.yml" in filenames and "tests" in dirnames: ++ if is_rule_dir(dirpath): + short_rule_id = os.path.basename(dirpath) + + # Load the rule itself to check for a template. +@@ -543,13 +550,14 @@ def iterate_over_rules(product=None): + # like the behavior in template_tests, this will overwrite any + # templated tests with the same file name. + tests_dir = os.path.join(dirpath, "tests") +- tests_dir_files = os.listdir(tests_dir) +- for test_case in tests_dir_files: +- test_path = os.path.join(tests_dir, test_case) +- if os.path.isdir(test_path): +- continue ++ if os.path.exists(tests_dir): ++ tests_dir_files = os.listdir(tests_dir) ++ for test_case in tests_dir_files: ++ test_path = os.path.join(tests_dir, test_case) ++ if os.path.isdir(test_path): ++ continue + +- all_tests[test_case] = process_file(test_path, local_env_yaml) ++ all_tests[test_case] = process_file(test_path, local_env_yaml) + + # Filter out everything except the shell test scenarios. + # Other files in rule directories are editor swap files +@@ -557,6 +565,12 @@ def iterate_over_rules(product=None): + allowed_scripts = filter(lambda x: x.endswith(".sh"), all_tests) + content_mapping = {x: all_tests[x] for x in allowed_scripts} + ++ # Skip any rules that lack any content. This ensures that if we ++ # end up with rules with a template lacking tests and without any ++ # rule directory tests, we don't include the empty rule here. ++ if not content_mapping: ++ continue ++ + full_rule_id = OSCAP_RULE + short_rule_id + result = Rule( + directory=tests_dir, id=full_rule_id, short_id=short_rule_id, + +From 0661e505c1294a7d5bf6a59813afabff48f31b4c Mon Sep 17 00:00:00 2001 +From: Alexander Scheel +Date: Tue, 27 Jul 2021 12:23:25 -0400 +Subject: [PATCH 17/19] Template tests with matching prodtype + +When prodtype is known to the test system, we can skip templating any +rule that has a prodtype that doesn't match. This saves time during +building the bundle and restricts us to only writing tests we care +about and can potentially use. + +Note that there might be a mismatch between (datastream, rule): if a +rule is updated on disk but the datastream isn't regenerated, you might +run into weird edge cases where this either over- or under-provisions, +but the same issue would likely occur previously. + +Signed-off-by: Alexander Scheel +--- + tests/ssg_test_suite/common.py | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/tests/ssg_test_suite/common.py b/tests/ssg_test_suite/common.py +index 0cb5451e31b..946d7152af1 100644 +--- a/tests/ssg_test_suite/common.py ++++ b/tests/ssg_test_suite/common.py +@@ -378,6 +378,17 @@ def template_rule_tests(product, product_yaml, template_builder, tmpdir, dirpath + # Load the rule and its environment + rule, local_env_yaml = load_rule_and_env(dirpath, product_yaml, product) + ++ # Before we get too far, we wish to search the rule YAML to see if ++ # it is applicable to the current product. If we have a product ++ # and the rule isn't applicable for the product, there's no point ++ # in continuing with the rest of the loading. This should speed up ++ # the loading of the templated tests. Note that we've already ++ # parsed the prodtype into local_env_yaml ++ if product and local_env_yaml['products']: ++ prodtypes = local_env_yaml['products'] ++ if "all" not in prodtypes and product not in prodtypes: ++ return ++ + # Create the destination directory. + dest_path = os.path.join(tmpdir, rule.id_) + os.mkdir(dest_path) +@@ -532,6 +543,17 @@ def iterate_over_rules(product=None): + # Load the rule itself to check for a template. + rule, local_env_yaml = load_rule_and_env(dirpath, product_yaml, product) + ++ # Before we get too far, we wish to search the rule YAML to see if ++ # it is applicable to the current product. If we have a product ++ # and the rule isn't applicable for the product, there's no point ++ # in continuing with the rest of the loading. This should speed up ++ # the loading of the templated tests. Note that we've already ++ # parsed the prodtype into local_env_yaml ++ if product and local_env_yaml['products']: ++ prodtypes = local_env_yaml['products'] ++ if "all" not in prodtypes and product not in prodtypes: ++ continue ++ + # All tests is a mapping from path (in the tarball) to contents + # of the test case. This is necessary because later code (which + # attempts to parse headers from the test case) don't have easy + +From f1c0bbd7fb8af5f0af96bf3d442166724fcc7f94 Mon Sep 17 00:00:00 2001 +From: Alexander Scheel +Date: Tue, 27 Jul 2021 14:51:53 -0400 +Subject: [PATCH 18/19] Use process_file_with_macros rather than process_file + +Signed-off-by: Alexander Scheel +--- + tests/ssg_test_suite/common.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tests/ssg_test_suite/common.py b/tests/ssg_test_suite/common.py +index 946d7152af1..291e0f5c9ad 100644 +--- a/tests/ssg_test_suite/common.py ++++ b/tests/ssg_test_suite/common.py +@@ -15,7 +15,7 @@ + from ssg.constants import MULTI_PLATFORM_MAPPING + from ssg.constants import FULL_NAME_TO_PRODUCT_MAPPING + from ssg.constants import OSCAP_RULE +-from ssg.jinja import process_file ++from ssg.jinja import process_file_with_macros + from ssg.products import product_yaml_path, load_product_yaml + from ssg.rules import get_rule_dir_yaml, is_rule_dir + from ssg.rule_yaml import parse_prodtype +@@ -364,7 +364,7 @@ def write_rule_dir_tests(local_env_yaml, dest_path, dirpath): + # Rather than performing an OS-level copy, we need to + # first parse the test with jinja and then write it back + # out to the destination. +- parsed_test = process_file(src_test_path, local_env_yaml) ++ parsed_test = process_file_with_macros(src_test_path, local_env_yaml) + with open(dest_test_path, 'w') as output_fp: + print(parsed_test, file=output_fp) + +@@ -579,7 +579,7 @@ def iterate_over_rules(product=None): + if os.path.isdir(test_path): + continue + +- all_tests[test_case] = process_file(test_path, local_env_yaml) ++ all_tests[test_case] = process_file_with_macros(test_path, local_env_yaml) + + # Filter out everything except the shell test scenarios. + # Other files in rule directories are editor swap files + +From 0f22db3a49bf8ccb14e0ea52e7884a525fa37f6f Mon Sep 17 00:00:00 2001 +From: Alexander Scheel +Date: Thu, 29 Jul 2021 07:45:41 -0400 +Subject: [PATCH 19/19] Add an option to not run duplicate templated tests + +Signed-off-by: Alexander Scheel +--- + tests/ssg_test_suite/combined.py | 4 ++-- + tests/ssg_test_suite/common.py | 9 ++++++--- + tests/ssg_test_suite/rule.py | 19 +++++++++++++++---- + tests/test_suite.py | 10 ++++++++++ + 4 files changed, 33 insertions(+), 9 deletions(-) + +diff --git a/tests/ssg_test_suite/combined.py b/tests/ssg_test_suite/combined.py +index 05270353235..4ef8898f602 100644 +--- a/tests/ssg_test_suite/combined.py ++++ b/tests/ssg_test_suite/combined.py +@@ -39,10 +39,10 @@ def __init__(self, test_env): + self.results = list() + self._current_result = None + +- def _rule_should_be_tested(self, rule, rules_to_be_tested): ++ def _rule_should_be_tested(self, rule, rules_to_be_tested, tested_templates): + if rule.short_id not in rules_to_be_tested: + return False +- return True ++ return not self._rule_template_been_tested(rule, tested_templates) + + def _modify_parameters(self, script, params): + # If there is no profiles metadata in a script we will use +diff --git a/tests/ssg_test_suite/common.py b/tests/ssg_test_suite/common.py +index 291e0f5c9ad..132a004323f 100644 +--- a/tests/ssg_test_suite/common.py ++++ b/tests/ssg_test_suite/common.py +@@ -31,7 +31,7 @@ + "Scenario_conditions", + ("backend", "scanning_mode", "remediated_by", "datastream")) + Rule = namedtuple( +- "Rule", ["directory", "id", "short_id", "files"]) ++ "Rule", ["directory", "id", "short_id", "files", "template"]) + + SSG_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')) + +@@ -542,6 +542,7 @@ def iterate_over_rules(product=None): + + # Load the rule itself to check for a template. + rule, local_env_yaml = load_rule_and_env(dirpath, product_yaml, product) ++ template_name = None + + # Before we get too far, we wish to search the rule YAML to see if + # it is applicable to the current product. If we have a product +@@ -562,11 +563,13 @@ def iterate_over_rules(product=None): + # templating system. + all_tests = dict() + +- # Start ++ # Start by checking for templating tests and provision them if ++ # present. + if rule.template and rule.template['vars']: + templated_tests = template_builder.get_all_tests( + rule.id_, rule.template, local_env_yaml) + all_tests.update(templated_tests) ++ template_name = rule.template['name'] + + # Add additional tests from the local rule directory. Note that, + # like the behavior in template_tests, this will overwrite any +@@ -596,7 +599,7 @@ def iterate_over_rules(product=None): + full_rule_id = OSCAP_RULE + short_rule_id + result = Rule( + directory=tests_dir, id=full_rule_id, short_id=short_rule_id, +- files=content_mapping) ++ files=content_mapping, template=template_name) + yield result + + +diff --git a/tests/ssg_test_suite/rule.py b/tests/ssg_test_suite/rule.py +index 5ad7eb8ed27..b707326179f 100644 +--- a/tests/ssg_test_suite/rule.py ++++ b/tests/ssg_test_suite/rule.py +@@ -211,13 +211,23 @@ def _final_scan_went_ok(self, runner, rule_id): + logging.error(msg) + return success + +- def _rule_should_be_tested(self, rule, rules_to_be_tested): ++ def _rule_template_been_tested(self, rule, tested_templates): ++ if rule.template is None: ++ return False ++ if self.test_env.duplicate_templates: ++ return False ++ if rule.template in tested_templates: ++ return True ++ tested_templates.add(rule.template) ++ return False ++ ++ def _rule_should_be_tested(self, rule, rules_to_be_tested, tested_templates): + if 'ALL' in rules_to_be_tested: + # don't select rules that are not present in benchmark + if not xml_operations.find_rule_in_benchmark( + self.datastream, self.benchmark_id, rule.id): + return False +- return True ++ return not self._rule_template_been_tested(rule, tested_templates) + else: + for rule_to_be_tested in rules_to_be_tested: + # we check for a substring +@@ -226,7 +236,7 @@ def _rule_should_be_tested(self, rule, rules_to_be_tested): + else: + pattern = OSCAP_RULE + rule_to_be_tested + if fnmatch.fnmatch(rule.id, pattern): +- return True ++ return not self._rule_template_been_tested(rule, tested_templates) + return False + + def _ensure_package_present_for_all_scenarios(self, scenarios_by_rule): +@@ -250,8 +260,9 @@ def _prepare_environment(self, scenarios_by_rule): + + def _get_rules_to_test(self, target): + rules_to_test = [] ++ tested_templates = set() + for rule in common.iterate_over_rules(self.test_env.product): +- if not self._rule_should_be_tested(rule, target): ++ if not self._rule_should_be_tested(rule, target, tested_templates): + continue + if not xml_operations.find_rule_in_benchmark( + self.datastream, self.benchmark_id, rule.id): +diff --git a/tests/test_suite.py b/tests/test_suite.py +index 00da15329a5..445a53f41d8 100755 +--- a/tests/test_suite.py ++++ b/tests/test_suite.py +@@ -116,6 +116,15 @@ def parse_args(): + "or remediation done by using remediation roles " + "that are saved to disk beforehand.") + ++ common_parser.add_argument( ++ "--duplicate-templates", ++ dest="duplicate_templates", ++ default=False, ++ action="store_true", ++ help="Execute all tests even for tests using shared templates; " ++ "otherwise, executes one test per template type" ++ ) ++ + subparsers = parser.add_subparsers(dest="subparser_name", + help="Subcommands: profile, rule, combined") + subparsers.required = True +@@ -345,6 +354,7 @@ def normalize_passed_arguments(options): + # Add in product to the test environment. This is independent of actual + # test environment type so we do it after creation. + options.test_env.product = options.product ++ options.test_env.duplicate_templates = options.duplicate_templates + + try: + benchmark_cpes = xml_operations.benchmark_get_applicable_platforms( diff --git a/SOURCES/scap-security-guide-0.1.59-BZ1884687-PR_7770.patch b/SOURCES/scap-security-guide-0.1.59-BZ1884687-PR_7770.patch new file mode 100644 index 0000000..7e02d22 --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.59-BZ1884687-PR_7770.patch @@ -0,0 +1,841 @@ +commit 549241cec9404bd211a580454fdd28cb72dfe520 +Author: Gabriel Becker +Date: Thu Feb 24 17:24:17 2022 +0100 + + Manual edited patch scap-security-guide-0.1.59-BZ1884687-PR_7770.patch. + +diff --git a/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/ansible/shared.yml b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/ansible/shared.yml +new file mode 100644 +index 0000000..09d1984 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/ansible/shared.yml +@@ -0,0 +1,31 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++- name: Get all local users from /etc/passwd ++ ansible.builtin.getent: ++ database: passwd ++ split: ':' ++ ++- name: Create local_users variable from the getent output ++ ansible.builtin.set_fact: ++ local_users: '{{ ansible_facts.getent_passwd|dict2items }}' ++ ++- name: Test for existence of home directories to avoid creating them, but only fixing group ownership ++ ansible.builtin.stat: ++ path: '{{ item.value[4] }}' ++ register: path_exists ++ loop: '{{ local_users }}' ++ when: ++ - item.value[2]|int >= {{{ gid_min }}} ++ - item.value[2]|int != 65534 ++ ++- name: Ensure interactive local users are the group-owners of their respective home directories ++ ansible.builtin.file: ++ path: '{{ item.0.value[4] }}' ++ group: '{{ item.0.value[2] }}' ++ loop: '{{ local_users|zip(path_exists.results)|list }}' ++ when: ++ - item.1.stat is defined and item.1.stat.exists +diff --git a/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/bash/shared.sh b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/bash/shared.sh +new file mode 100644 +index 0000000..08f7307 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/bash/shared.sh +@@ -0,0 +1,7 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++awk -F':' '{ if ($4 >= {{{ gid_min }}} && $4 != 65534) system("chgrp -f " $4" "$6) }' /etc/passwd +diff --git a/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/oval/shared.xml b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/oval/shared.xml +new file mode 100644 +index 0000000..a1d1f2e +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/oval/shared.xml +@@ -0,0 +1,89 @@ ++ ++ ++ {{{ oval_metadata("All interactive user's Home Directories must be group-owned by its user") }}} ++ ++ ++ ++ ++ ++ ++ ++ ++ nobody ++ state_file_groupownership_home_directories_interactive_gids ++ ++ ++ ++ {{{ gid_min }}} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ var_file_groupownership_home_directories_gids_count ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/rule.yml b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/rule.yml +index 2e6ce60..e33660f 100644 +--- a/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/rule.yml ++++ b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/rule.yml +@@ -10,6 +10,10 @@ description: |- + interactive users home directory, use the following command: +
$ sudo chgrp USER_GROUP /home/USER
+ ++ This rule ensures every home directory related to an interactive user is ++ group-owned by an interactive user. It also ensures that interactive users ++ are group-owners of one and only one home directory. ++ + rationale: |- + If the Group Identifier (GID) of a local interactive users home directory is + not the same as the primary GID of the user, this would allow unauthorized +@@ -42,3 +46,9 @@ ocil: |- + To verify the assigned home directory of all interactive users is group- + owned by that users primary GID, run the following command: +
# ls -ld $(awk -F: '($3>=1000)&&($7 !~ /nologin/){print $6}' /etc/passwd)
++ ++warnings: ++ - general: |- ++ Due to OVAL limitation, this rule can report a false negative in a ++ specific situation where two interactive users swap the group-ownership ++ of their respective home directories. +diff --git a/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/expected_groupowner.pass.sh b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/expected_groupowner.pass.sh +new file mode 100644 +index 0000000..1605339 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/expected_groupowner.pass.sh +@@ -0,0 +1,5 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++chgrp $USER /home/$USER +diff --git a/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/home_dirs_all_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/home_dirs_all_absent.pass.sh +new file mode 100644 +index 0000000..af24025 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/home_dirs_all_absent.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -M $USER ++# This make sure home dirs related to test environment users are also removed. ++rm -Rf /home/* +diff --git a/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/home_dirs_one_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/home_dirs_one_absent.pass.sh +new file mode 100644 +index 0000000..5bce517 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/home_dirs_one_absent.pass.sh +@@ -0,0 +1,7 @@ ++#!/bin/bash ++ ++USER1="cac_user1" ++USER2="cac_user2" ++ ++useradd -m $USER1 ++useradd -M $USER2 +diff --git a/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/home_dirs_with_same_groupowner.fail.sh b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/home_dirs_with_same_groupowner.fail.sh +new file mode 100644 +index 0000000..9d0f765 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/home_dirs_with_same_groupowner.fail.sh +@@ -0,0 +1,10 @@ ++#!/bin/bash ++ ++USER1="cac_user1" ++USER2="cac_user2" ++ ++useradd -m $USER1 ++useradd -m $USER2 ++# Define the same owner for two home directories ++chgrp $USER1 /home/$USER1 ++chgrp $USER1 /home/$USER2 +diff --git a/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/interactive_users_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/interactive_users_absent.pass.sh +new file mode 100644 +index 0000000..ed34f09 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/interactive_users_absent.pass.sh +@@ -0,0 +1,4 @@ ++#!/bin/bash ++ ++# remove all interactive users (ID >= 1000) from /etc/passwd ++sed -i '/.*:[0-9]\{4,\}:/d' /etc/passwd +diff --git a/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/unexpected_groupowner_system_id.fail.sh b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/unexpected_groupowner_system_id.fail.sh +new file mode 100644 +index 0000000..c1a87c1 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/unexpected_groupowner_system_id.fail.sh +@@ -0,0 +1,5 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++chgrp 2 /home/$USER +diff --git a/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/unexpected_groupowner_unknown_id.fail.sh b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/unexpected_groupowner_unknown_id.fail.sh +new file mode 100644 +index 0000000..d352011 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/unexpected_groupowner_unknown_id.fail.sh +@@ -0,0 +1,5 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++chgrp 10005 /home/$USER +diff --git a/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/warning_home_dirs_crossed_groupowner.pass.sh b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/warning_home_dirs_crossed_groupowner.pass.sh +new file mode 100644 +index 0000000..0cffa4a +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/warning_home_dirs_crossed_groupowner.pass.sh +@@ -0,0 +1,10 @@ ++#!/bin/bash ++ ++USER1="cac_user1" ++USER2="cac_user2" ++ ++useradd -m $USER1 ++useradd -m $USER2 ++# Define the same owner for two home directories ++chgrp $USER2 /home/$USER1 ++chgrp $USER1 /home/$USER2 +diff --git a/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/warning_home_dirs_swapped_groupowner.pass.sh b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/warning_home_dirs_swapped_groupowner.pass.sh +new file mode 100644 +index 0000000..3e5b778 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/warning_home_dirs_swapped_groupowner.pass.sh +@@ -0,0 +1,12 @@ ++#!/bin/bash ++ ++USER1="cac_user1" ++USER2="cac_user2" ++ ++useradd -m $USER1 ++useradd -m $USER2 ++# Swap the group-ownership of two home directories ++# WARNING: This test scenario will report a false negative, as explained in the ++# warning section of this rule. ++chgrp $USER2 /home/$USER1 ++chgrp $USER1 /home/$USER2 +diff --git a/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/ansible/shared.yml b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/ansible/shared.yml +new file mode 100644 +index 0000000..97d4274 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/ansible/shared.yml +@@ -0,0 +1,31 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++- name: Get all local users from /etc/passwd ++ ansible.builtin.getent: ++ database: passwd ++ split: ':' ++ ++- name: Create local_users variable from the getent output ++ ansible.builtin.set_fact: ++ local_users: '{{ ansible_facts.getent_passwd|dict2items }}' ++ ++- name: Test for existence home directories to avoid creating them, but only fixing ownership ++ ansible.builtin.stat: ++ path: '{{ item.value[4] }}' ++ register: path_exists ++ loop: '{{ local_users }}' ++ when: ++ - item.value[1]|int >= {{{ uid_min }}} ++ - item.value[1]|int != 65534 ++ ++- name: Ensure interactive local users are the owners of their respective home directories ++ ansible.builtin.file: ++ path: '{{ item.0.value[4] }}' ++ owner: '{{ item.0.value[1] }}' ++ loop: '{{ local_users|zip(path_exists.results)|list }}' ++ when: ++ - item.1.stat is defined and item.1.stat.exists +diff --git a/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/bash/shared.sh b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/bash/shared.sh +new file mode 100644 +index 0000000..1d1e675 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/bash/shared.sh +@@ -0,0 +1,7 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++awk -F':' '{ if ($3 >= {{{ uid_min }}} && $3 != 65534) system("chown -f " $3" "$6) }' /etc/passwd +diff --git a/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/oval/shared.xml b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/oval/shared.xml +new file mode 100644 +index 0000000..3d0b9ae +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/oval/shared.xml +@@ -0,0 +1,142 @@ ++ ++ ++ ++ ++ {{{ oval_metadata("All interactive user's Home Directories must be owned by its user") }}} ++ ++ ++ ++ ++ ++ ++ ++ ++ nobody ++ state_file_ownership_home_directories_interactive_uids ++ ++ ++ ++ ++ {{{ uid_min }}} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ var_file_ownership_home_directories_uids_count ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/rule.yml b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/rule.yml +index 198a9be..042f484 100644 +--- a/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/rule.yml ++++ b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/rule.yml +@@ -10,6 +10,10 @@ description: |- + the following command: +
$ sudo chown USER /home/USER
+ ++ This rule ensures every home directory related to an interactive user is ++ owned by an interactive user. It also ensures that interactive users are ++ owners of one and only one home directory. ++ + rationale: |- + If a local interactive user does not own their home directory, unauthorized + users could access or modify the user's files, and the users may not be able to +@@ -31,3 +35,9 @@ ocil_clause: 'the user ownership is incorrect' + ocil: |- + To verify the home directory ownership, run the following command: +
# ls -ld $(awk -F: '($3>=1000)&&($7 !~ /nologin/){print $6}' /etc/passwd)
++ ++warnings: ++ - general: |- ++ Due to OVAL limitation, this rule can report a false negative in a ++ specific situation where two interactive users swap the ownership of ++ their respective home directories. +diff --git a/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/expected_owner.pass.sh b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/expected_owner.pass.sh +new file mode 100644 +index 0000000..585f759 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/expected_owner.pass.sh +@@ -0,0 +1,5 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++chown $USER /home/$USER +diff --git a/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/home_dir_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/home_dir_absent.pass.sh +new file mode 100644 +index 0000000..7c181af +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/home_dir_absent.pass.sh +@@ -0,0 +1,4 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -M $USER +diff --git a/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/home_dirs_all_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/home_dirs_all_absent.pass.sh +new file mode 100644 +index 0000000..af24025 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/home_dirs_all_absent.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -M $USER ++# This make sure home dirs related to test environment users are also removed. ++rm -Rf /home/* +diff --git a/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/home_dirs_one_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/home_dirs_one_absent.pass.sh +new file mode 100644 +index 0000000..5bce517 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/home_dirs_one_absent.pass.sh +@@ -0,0 +1,7 @@ ++#!/bin/bash ++ ++USER1="cac_user1" ++USER2="cac_user2" ++ ++useradd -m $USER1 ++useradd -M $USER2 +diff --git a/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/home_dirs_with_same_owner.fail.sh b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/home_dirs_with_same_owner.fail.sh +new file mode 100644 +index 0000000..e6aef9e +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/home_dirs_with_same_owner.fail.sh +@@ -0,0 +1,10 @@ ++#!/bin/bash ++ ++USER1="cac_user1" ++USER2="cac_user2" ++ ++useradd -m $USER1 ++useradd -m $USER2 ++# Define the same owner for two home directories ++chown $USER1 /home/$USER1 ++chown $USER1 /home/$USER2 +diff --git a/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/interactive_users_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/interactive_users_absent.pass.sh +new file mode 100644 +index 0000000..ed34f09 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/interactive_users_absent.pass.sh +@@ -0,0 +1,4 @@ ++#!/bin/bash ++ ++# remove all interactive users (ID >= 1000) from /etc/passwd ++sed -i '/.*:[0-9]\{4,\}:/d' /etc/passwd +diff --git a/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/unexpected_owner_system_id.fail.sh b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/unexpected_owner_system_id.fail.sh +new file mode 100644 +index 0000000..011b315 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/unexpected_owner_system_id.fail.sh +@@ -0,0 +1,5 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++chown 2 /home/$USER +diff --git a/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/unexpected_owner_unknown_id.fail.sh b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/unexpected_owner_unknown_id.fail.sh +new file mode 100644 +index 0000000..733af78 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/unexpected_owner_unknown_id.fail.sh +@@ -0,0 +1,5 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++chown 10005 /home/$USER +diff --git a/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/warning_home_dirs_crossed_owner.pass.sh b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/warning_home_dirs_crossed_owner.pass.sh +new file mode 100644 +index 0000000..df5655f +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/warning_home_dirs_crossed_owner.pass.sh +@@ -0,0 +1,10 @@ ++#!/bin/bash ++ ++USER1="cac_user1" ++USER2="cac_user2" ++ ++useradd -m $USER1 ++useradd -m $USER2 ++# Define the same owner for two home directories ++chown $USER2 /home/$USER1 ++chown $USER1 /home/$USER2 +diff --git a/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/warning_home_dirs_swapped_owner.pass.sh b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/warning_home_dirs_swapped_owner.pass.sh +new file mode 100644 +index 0000000..e9cfd5b +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_ownership_home_directories/tests/warning_home_dirs_swapped_owner.pass.sh +@@ -0,0 +1,12 @@ ++#!/bin/bash ++ ++USER1="cac_user1" ++USER2="cac_user2" ++ ++useradd -m $USER1 ++useradd -m $USER2 ++# Swap the ownership of two home directories ++# WARNING: This test scenario will report a false negative, as explained in the ++# warning section of this rule. ++chown $USER2 /home/$USER1 ++chown $USER1 /home/$USER2 +diff --git a/linux_os/guide/system/accounts/accounts-session/file_permissions_home_directories/ansible/shared.yml b/linux_os/guide/system/accounts/accounts-session/file_permissions_home_directories/ansible/shared.yml +new file mode 100644 +index 0000000..945ed7e +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_permissions_home_directories/ansible/shared.yml +@@ -0,0 +1,31 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++- name: Get all local users from /etc/passwd ++ ansible.builtin.getent: ++ database: passwd ++ split: ':' ++ ++- name: Create local_users variable from the getent output ++ ansible.builtin.set_fact: ++ local_users: '{{ ansible_facts.getent_passwd|dict2items }}' ++ ++- name: Test for existence home directories to avoid creating them, but only fixing group ownership ++ ansible.builtin.stat: ++ path: '{{ item.value[4] }}' ++ register: path_exists ++ loop: '{{ local_users }}' ++ when: ++ - item.value[2]|int >= {{{ uid_min }}} ++ - item.value[2]|int != 65534 ++ ++- name: Ensure interactive local users are the group-owners of their respective home directories ++ ansible.builtin.file: ++ path: '{{ item.0.value[4] }}' ++ mode: '0700' ++ loop: '{{ local_users|zip(path_exists.results)|list }}' ++ when: ++ - item.1.stat is defined and item.1.stat.exists +diff --git a/linux_os/guide/system/accounts/accounts-session/file_permissions_home_directories/bash/shared.sh b/linux_os/guide/system/accounts/accounts-session/file_permissions_home_directories/bash/shared.sh +new file mode 100644 +index 0000000..4ebc674 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_permissions_home_directories/bash/shared.sh +@@ -0,0 +1,7 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++awk -F':' '{ if ($4 >= {{{ uid_min }}} && $4 != 65534) system("chmod -f 700 "$6) }' /etc/passwd +diff --git a/linux_os/guide/system/accounts/accounts-session/file_permissions_home_directories/oval/shared.xml b/linux_os/guide/system/accounts/accounts-session/file_permissions_home_directories/oval/shared.xml +new file mode 100644 +index 0000000..0cb261e +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_permissions_home_directories/oval/shared.xml +@@ -0,0 +1,51 @@ ++ ++ ++ {{{ oval_metadata("All Interactive User Home Directories Must Have mode 0750 Or Less Permissive") }}} ++ ++ ++ ++ ++ ++ ++ ++ nobody ++ state_file_permissions_home_directories_interactive_uids ++ ++ ++ ++ {{{ uid_min }}} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ directory ++ false ++ false ++ false ++ false ++ false ++ false ++ false ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/linux_os/guide/system/accounts/accounts-session/file_permissions_home_directories/tests/acceptable_permission.pass.sh b/linux_os/guide/system/accounts/accounts-session/file_permissions_home_directories/tests/acceptable_permission.pass.sh +new file mode 100644 +index 0000000..aaf939e +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_permissions_home_directories/tests/acceptable_permission.pass.sh +@@ -0,0 +1,5 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++chmod 750 /home/$USER +diff --git a/linux_os/guide/system/accounts/accounts-session/file_permissions_home_directories/tests/expected_permissions.pass.sh b/linux_os/guide/system/accounts/accounts-session/file_permissions_home_directories/tests/expected_permissions.pass.sh +new file mode 100644 +index 0000000..5dfd426 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_permissions_home_directories/tests/expected_permissions.pass.sh +@@ -0,0 +1,5 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++chmod 700 /home/$USER +diff --git a/linux_os/guide/system/accounts/accounts-session/file_permissions_home_directories/tests/home_dirs_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/file_permissions_home_directories/tests/home_dirs_absent.pass.sh +new file mode 100644 +index 0000000..af24025 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_permissions_home_directories/tests/home_dirs_absent.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -M $USER ++# This make sure home dirs related to test environment users are also removed. ++rm -Rf /home/* +diff --git a/linux_os/guide/system/accounts/accounts-session/file_permissions_home_directories/tests/interactive_users_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/file_permissions_home_directories/tests/interactive_users_absent.pass.sh +new file mode 100644 +index 0000000..ed34f09 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_permissions_home_directories/tests/interactive_users_absent.pass.sh +@@ -0,0 +1,4 @@ ++#!/bin/bash ++ ++# remove all interactive users (ID >= 1000) from /etc/passwd ++sed -i '/.*:[0-9]\{4,\}:/d' /etc/passwd +diff --git a/linux_os/guide/system/accounts/accounts-session/file_permissions_home_directories/tests/lenient_permission.fail.sh b/linux_os/guide/system/accounts/accounts-session/file_permissions_home_directories/tests/lenient_permission.fail.sh +new file mode 100644 +index 0000000..2f337d2 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/file_permissions_home_directories/tests/lenient_permission.fail.sh +@@ -0,0 +1,5 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++chmod 755 /home/$USER +diff --git a/ssg/constants.py b/ssg/constants.py +index e2d3077..64e2712 100644 +--- a/ssg/constants.py ++++ b/ssg/constants.py +@@ -380,6 +380,7 @@ MAKEFILE_ID_TO_PRODUCT_MAP = { + + + # Application constants ++DEFAULT_GID_MIN = 1000 + DEFAULT_UID_MIN = 1000 + DEFAULT_GRUB2_BOOT_PATH = '/boot/grub2' + DEFAULT_DCONF_GDM_DIR = 'gdm.d' +diff --git a/ssg/products.py b/ssg/products.py +index 25178b7..e410e06 100644 +--- a/ssg/products.py ++++ b/ssg/products.py +@@ -7,6 +7,7 @@ from glob import glob + + from .build_cpe import ProductCPEs + from .constants import (product_directories, ++ DEFAULT_GID_MIN, + DEFAULT_UID_MIN, + DEFAULT_GRUB2_BOOT_PATH, + DEFAULT_DCONF_GDM_DIR, +@@ -39,6 +40,9 @@ def _get_implied_properties(existing_properties): + if pkg_manager in PKG_MANAGER_TO_CONFIG_FILE: + result["pkg_manager_config_file"] = PKG_MANAGER_TO_CONFIG_FILE[pkg_manager] + ++ if "gid_min" not in existing_properties: ++ result["gid_min"] = DEFAULT_GID_MIN ++ + if "uid_min" not in existing_properties: + result["uid_min"] = DEFAULT_UID_MIN + diff --git a/SOURCES/scap-security-guide-0.1.59-BZ1884687B-PR_7790.patch b/SOURCES/scap-security-guide-0.1.59-BZ1884687B-PR_7790.patch new file mode 100644 index 0000000..72ffff6 --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.59-BZ1884687B-PR_7790.patch @@ -0,0 +1,507 @@ +From 5ec53805a4aaf04752400eef826ff49222c0a3ba Mon Sep 17 00:00:00 2001 +From: Marcus Burghardt +Date: Wed, 20 Oct 2021 16:17:01 +0200 +Subject: [PATCH 1/3] OVAL, tests and remediation for the rule: + +accounts_user_interactive_home_directory_defined +--- + .../ansible/shared.yml | 24 +++++++++++++ + .../bash/shared.sh | 9 +++++ + .../oval/shared.xml | 36 +++++++++++++++++++ + .../tests/home_dir_all_empty.fail.sh | 6 ++++ + .../tests/home_dir_not_exclusive.fail.sh | 6 ++++ + .../tests/home_dir_one_empty.fail.sh | 8 +++++ + .../tests/home_dir_properly_defined.pass.sh | 4 +++ + .../tests/home_dir_root.fail.sh | 6 ++++ + .../tests/interactive_users_absent.pass.sh | 4 +++ + 9 files changed, 103 insertions(+) + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/ansible/shared.yml + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/bash/shared.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/oval/shared.xml + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/home_dir_all_empty.fail.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/home_dir_not_exclusive.fail.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/home_dir_one_empty.fail.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/home_dir_properly_defined.pass.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/home_dir_root.fail.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/interactive_users_absent.pass.sh + +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/ansible/shared.yml b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/ansible/shared.yml +new file mode 100644 +index 00000000000..fc9b780daa8 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/ansible/shared.yml +@@ -0,0 +1,24 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++- name: Get all local users from /etc/passwd ++ ansible.builtin.getent: ++ database: passwd ++ split: ':' ++ ++- name: Create local_users variable from the getent output ++ ansible.builtin.set_fact: ++ local_users: '{{ ansible_facts.getent_passwd|dict2items }}' ++ ++- name: Ensure interactive users have a home directory defined ++ ansible.builtin.user: ++ name: '{{ item.key }}' ++ home: '/home/{{ item.key }}' ++ create_home: no ++ loop: '{{ local_users }}' ++ when: ++ - item.value[2]|int >= {{{ uid_min }}} ++ - item.value[2]|int != 65534 +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/bash/shared.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/bash/shared.sh +new file mode 100644 +index 00000000000..23b0a85aa6a +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/bash/shared.sh +@@ -0,0 +1,9 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++for user in `awk -F':' '{ if ($4 >= {{{ uid_min }}} && $4 != 65534) print $1 }' /etc/passwd`; do ++ sed -i "s/\($user:x:[0-9]*:[0-9]*:.*:\).*\(:.*\)$/\1\/home\/$user\2/g" /etc/passwd; ++done +\ No newline at end of file +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/oval/shared.xml b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/oval/shared.xml +new file mode 100644 +index 00000000000..5efb84ab2cf +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/oval/shared.xml +@@ -0,0 +1,36 @@ ++ ++ ++ {{{ oval_metadata("All Interactive Users Must Have A Home Directory Defined") }}} ++ ++ ++ ++ ++ ++ ++ ++ nobody ++ state_accounts_user_interactive_home_directory_defined_uids ++ ++ ++ ++ {{{ uid_min }}} ++ ++ ++ ++ ++ ^\/\w*\/\w{1,}[\/\w]*$ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/home_dir_all_empty.fail.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/home_dir_all_empty.fail.sh +new file mode 100644 +index 00000000000..4bc9e10a21c +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/home_dir_all_empty.fail.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -M $USER ++ ++sed -i "s/\(.*:x:[0-9]\{4,\}:[0-9]*:.*:\).*\(:.*\)$/\1\2/g" /etc/passwd +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/home_dir_not_exclusive.fail.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/home_dir_not_exclusive.fail.sh +new file mode 100644 +index 00000000000..5c905e03791 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/home_dir_not_exclusive.fail.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -M $USER ++ ++sed -i 's/\(.*:x:[0-9]\{4,\}:[0-9]*:.*:\).*\(:.*\)$/\1\/tmp\2/g' /etc/passwd +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/home_dir_one_empty.fail.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/home_dir_one_empty.fail.sh +new file mode 100644 +index 00000000000..00d37799c77 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/home_dir_one_empty.fail.sh +@@ -0,0 +1,8 @@ ++#!/bin/bash ++ ++USER1="cac_user1" ++USER2="cac_user2" ++useradd -M $USER1 ++useradd -M $USER2 ++ ++sed -i "s/\($USER1:x:[0-9]*:[0-9]*:.*:\).*\(:.*\)$/\1\2/g" /etc/passwd +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/home_dir_properly_defined.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/home_dir_properly_defined.pass.sh +new file mode 100644 +index 00000000000..7c181afdd4b +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/home_dir_properly_defined.pass.sh +@@ -0,0 +1,4 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -M $USER +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/home_dir_root.fail.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/home_dir_root.fail.sh +new file mode 100644 +index 00000000000..16bb94477bc +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/home_dir_root.fail.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -M $USER ++ ++sed -i "s/\($USER:x:[0-9]*:[0-9]*:.*:\).*\(:.*\)$/\1\/\2/g" /etc/passwd +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/interactive_users_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/interactive_users_absent.pass.sh +new file mode 100644 +index 00000000000..ed34f0940a7 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/interactive_users_absent.pass.sh +@@ -0,0 +1,4 @@ ++#!/bin/bash ++ ++# remove all interactive users (ID >= 1000) from /etc/passwd ++sed -i '/.*:[0-9]\{4,\}:/d' /etc/passwd + +From 47cf69c176ce8e7ec1922bf8cdcd1d35b02552c9 Mon Sep 17 00:00:00 2001 +From: Marcus Burghardt +Date: Tue, 26 Oct 2021 14:39:11 +0200 +Subject: [PATCH 2/3] OVAL, tests and remediation for the rule: + +accounts_user_interactive_home_directory_exists +--- + .../bash/shared.sh | 2 +- + .../ansible/shared.yml | 24 +++++ + .../bash/shared.sh | 9 ++ + .../oval/shared.xml | 91 +++++++++++++++++++ + .../tests/home_dir_present.pass.sh | 10 ++ + .../tests/home_dirs_all_absent.fail.sh | 6 ++ + .../tests/home_dirs_one_absent.fail.sh | 7 ++ + .../tests/interactive_users_absent.pass.sh | 4 + + 8 files changed, 152 insertions(+), 1 deletion(-) + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/ansible/shared.yml + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/bash/shared.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/oval/shared.xml + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/tests/home_dir_present.pass.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/tests/home_dirs_all_absent.fail.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/tests/home_dirs_one_absent.fail.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/tests/interactive_users_absent.pass.sh + +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/bash/shared.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/bash/shared.sh +index 23b0a85aa6a..94f8a579f1f 100644 +--- a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/bash/shared.sh ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/bash/shared.sh +@@ -6,4 +6,4 @@ + + for user in `awk -F':' '{ if ($4 >= {{{ uid_min }}} && $4 != 65534) print $1 }' /etc/passwd`; do + sed -i "s/\($user:x:[0-9]*:[0-9]*:.*:\).*\(:.*\)$/\1\/home\/$user\2/g" /etc/passwd; +-done +\ No newline at end of file ++done +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/ansible/shared.yml b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/ansible/shared.yml +new file mode 100644 +index 00000000000..e7acc477d25 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/ansible/shared.yml +@@ -0,0 +1,24 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++- name: Get all local users from /etc/passwd ++ ansible.builtin.getent: ++ database: passwd ++ split: ':' ++ ++- name: Create local_users variable from the getent output ++ ansible.builtin.set_fact: ++ local_users: '{{ ansible_facts.getent_passwd|dict2items }}' ++ ++- name: Ensure interactive users have a home directory defined ++ ansible.builtin.user: ++ name: '{{ item.key }}' ++ home: '/home/{{ item.key }}' ++ create_home: yes ++ loop: '{{ local_users }}' ++ when: ++ - item.value[2]|int >= {{{ uid_min }}} ++ - item.value[2]|int != 65534 +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/bash/shared.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/bash/shared.sh +new file mode 100644 +index 00000000000..044b650f103 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/bash/shared.sh +@@ -0,0 +1,9 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++for user in $(awk -F':' '{ if ($4 >= {{{ uid_min }}} && $4 != 65534) print $1}' /etc/passwd); do ++ mkhomedir_helper $user 0077; ++done +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/oval/shared.xml b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/oval/shared.xml +new file mode 100644 +index 00000000000..0a5b313f5b4 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/oval/shared.xml +@@ -0,0 +1,91 @@ ++ ++ ++ {{{ oval_metadata("All Interactive Users Home Directories Must Exist") }}} ++ ++ ++ ++ ++ ++ ++ ++ ++ nobody ++ state_accounts_user_interactive_home_directory_exists_uids ++ ++ ++ ++ {{{ uid_min }}} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ var_accounts_user_interactive_home_directory_exists_dirs_count_fs ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ var_accounts_user_interactive_home_directory_exists_dirs_count ++ ++ ++ ++ ++ ++ ++ +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/tests/home_dir_present.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/tests/home_dir_present.pass.sh +new file mode 100644 +index 00000000000..d5434cbe4f5 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/tests/home_dir_present.pass.sh +@@ -0,0 +1,10 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++ ++# This is to make sure that any possible user create in the test environment has also ++# a home dir created on the system. ++for user in $(awk -F':' '{ if ($4 >= {{{ uid_min }}} && $4 != 65534) print $1}' /etc/passwd); do ++ mkhomedir_helper $user 0077; ++done +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/tests/home_dirs_all_absent.fail.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/tests/home_dirs_all_absent.fail.sh +new file mode 100644 +index 00000000000..af240252de3 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/tests/home_dirs_all_absent.fail.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -M $USER ++# This make sure home dirs related to test environment users are also removed. ++rm -Rf /home/* +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/tests/home_dirs_one_absent.fail.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/tests/home_dirs_one_absent.fail.sh +new file mode 100644 +index 00000000000..5bce517215c +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/tests/home_dirs_one_absent.fail.sh +@@ -0,0 +1,7 @@ ++#!/bin/bash ++ ++USER1="cac_user1" ++USER2="cac_user2" ++ ++useradd -m $USER1 ++useradd -M $USER2 +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/tests/interactive_users_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/tests/interactive_users_absent.pass.sh +new file mode 100644 +index 00000000000..ed34f0940a7 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/tests/interactive_users_absent.pass.sh +@@ -0,0 +1,4 @@ ++#!/bin/bash ++ ++# remove all interactive users (ID >= 1000) from /etc/passwd ++sed -i '/.*:[0-9]\{4,\}:/d' /etc/passwd + +From 0d6a5e588d71e927291641cbf2a23259995f0b2d Mon Sep 17 00:00:00 2001 +From: Marcus Burghardt +Date: Mon, 8 Nov 2021 15:09:12 +0100 +Subject: [PATCH 3/3] Improved the remediation and rule description + +Included conditional on remediation to make sure that +already compliant home directories are skipped. +--- + .../ansible/shared.yml | 3 ++- + .../bash/shared.sh | 7 +++++-- + .../rule.yml | 5 +++++ + .../tests/home_dir_defined_out_home.pass.sh | 4 ++++ + .../ansible/shared.yml | 3 +-- + 5 files changed, 17 insertions(+), 5 deletions(-) + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/home_dir_defined_out_home.pass.sh + +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/ansible/shared.yml b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/ansible/shared.yml +index fc9b780daa8..13fbdd1ca44 100644 +--- a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/ansible/shared.yml ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/ansible/shared.yml +@@ -13,7 +13,7 @@ + ansible.builtin.set_fact: + local_users: '{{ ansible_facts.getent_passwd|dict2items }}' + +-- name: Ensure interactive users have a home directory defined ++- name: Ensure interactive users have an exclusive home directory defined + ansible.builtin.user: + name: '{{ item.key }}' + home: '/home/{{ item.key }}' +@@ -22,3 +22,4 @@ + when: + - item.value[2]|int >= {{{ uid_min }}} + - item.value[2]|int != 65534 ++ - not item.value[4] | regex_search('^\/\w*\/\w{1,}') +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/bash/shared.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/bash/shared.sh +index 94f8a579f1f..7fac61d4892 100644 +--- a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/bash/shared.sh ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/bash/shared.sh +@@ -4,6 +4,9 @@ + # complexity = low + # disruption = low + +-for user in `awk -F':' '{ if ($4 >= {{{ uid_min }}} && $4 != 65534) print $1 }' /etc/passwd`; do +- sed -i "s/\($user:x:[0-9]*:[0-9]*:.*:\).*\(:.*\)$/\1\/home\/$user\2/g" /etc/passwd; ++for user in $(awk -F':' '{ if ($4 >= {{{ uid_min }}} && $4 != 65534) print $1 }' /etc/passwd); do ++ # This follows the same logic of evaluation of home directories as used in OVAL. ++ if ! grep -q $user /etc/passwd | cut -d: -f6 | grep '^\/\w*\/\w\{1,\}'; then ++ sed -i "s/\($user:x:[0-9]*:[0-9]*:.*:\).*\(:.*\)$/\1\/home\/$user\2/g" /etc/passwd; ++ fi + done +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/rule.yml b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/rule.yml +index 20d26032338..b58164c5403 100644 +--- a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/rule.yml ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/rule.yml +@@ -8,6 +8,11 @@ description: |- + Assign home directories to all interactive users that currently do not + have a home directory assigned. + ++ This rule checks if the home directory is properly defined in a folder which has ++ at least one parent folder, like "user" in "/home/user" or "/remote/users/user". ++ Therefore, this rule will report a finding for home directories like /users, ++ /tmp or /. ++ + rationale: |- + If local interactive users are not assigned a valid home directory, there is no + place for the storage and control of files they should own. +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/home_dir_defined_out_home.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/home_dir_defined_out_home.pass.sh +new file mode 100644 +index 00000000000..c7100f304ca +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_defined/tests/home_dir_defined_out_home.pass.sh +@@ -0,0 +1,4 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -M -d /data/$USER $USER +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/ansible/shared.yml b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/ansible/shared.yml +index e7acc477d25..84382a7f488 100644 +--- a/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/ansible/shared.yml ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_interactive_home_directory_exists/ansible/shared.yml +@@ -13,10 +13,9 @@ + ansible.builtin.set_fact: + local_users: '{{ ansible_facts.getent_passwd|dict2items }}' + +-- name: Ensure interactive users have a home directory defined ++- name: Ensure interactive users have a home directory exists + ansible.builtin.user: + name: '{{ item.key }}' +- home: '/home/{{ item.key }}' + create_home: yes + loop: '{{ local_users }}' + when: diff --git a/SOURCES/scap-security-guide-0.1.59-BZ1884687C-PR_7824.patch b/SOURCES/scap-security-guide-0.1.59-BZ1884687C-PR_7824.patch new file mode 100644 index 0000000..631b6b5 --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.59-BZ1884687C-PR_7824.patch @@ -0,0 +1,662 @@ +commit dc273bb872cc53f2d52af4396f4d3bba0acc178f +Author: Gabriel Becker +Date: Thu Feb 24 17:30:42 2022 +0100 + + Manual edited patch scap-security-guide-0.1.59-BZ1884687C-PR_7824.patch. + +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/ansible/shared.yml b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/ansible/shared.yml +new file mode 100644 +index 0000000..ff41e19 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/ansible/shared.yml +@@ -0,0 +1,32 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++- name: Get all local users from /etc/passwd ++ ansible.builtin.getent: ++ database: passwd ++ split: ':' ++ ++- name: Create local_users variable from the getent output ++ ansible.builtin.set_fact: ++ local_users: '{{ ansible_facts.getent_passwd|dict2items }}' ++ ++- name: Test for existence home directories to avoid creating them, but only fixing ownership ++ ansible.builtin.stat: ++ path: '{{ item.value[4] }}' ++ register: path_exists ++ loop: '{{ local_users }}' ++ when: ++ - item.value[2]|int >= {{{ gid_min }}} ++ - item.value[2]|int != 65534 ++ ++- name: Ensure interactive local users are the owners of their respective home directories ++ ansible.builtin.file: ++ path: '{{ item.0.value[4] }}' ++ group: '{{ item.0.value[2] }}' ++ recurse: yes ++ loop: '{{ local_users|zip(path_exists.results)|list }}' ++ when: ++ - item.1.stat is defined and item.1.stat.exists +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/bash/shared.sh b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/bash/shared.sh +new file mode 100644 +index 0000000..e392d2f +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/bash/shared.sh +@@ -0,0 +1,14 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++for user in $(awk -F':' '{ if ($4 >= {{{ gid_min }}} && $4 != 65534) print $1 }' /etc/passwd); do ++ home_dir=$(getent passwd $user | cut -d: -f6) ++ group=$(getent passwd $user | cut -d: -f4) ++ # Only update the group-ownership when necessary. This will avoid changing the inode timestamp ++ # when the group is already defined as expected, therefore not impacting in possible integrity ++ # check systems that also check inodes timestamps. ++ find $home_dir -not -group $group -exec chgrp -f $group {} \; ++done +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/oval/shared.xml b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/oval/shared.xml +new file mode 100644 +index 0000000..1fd016a +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/oval/shared.xml +@@ -0,0 +1,52 @@ ++ ++ ++ {{{ oval_metadata("All User Files and Directories In The Home Directory Must Be Group-Owned By The Primary User") }}} ++ ++ ++ ++ ++ ++ ++ nobody ++ state_accounts_users_home_files_groupownership_interactive_gids ++ ++ ++ ++ {{{ gid_min }}} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ .* ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/rule.yml b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/rule.yml +index 1c0f93a..31a0f1d 100644 +--- a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/rule.yml ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/rule.yml +@@ -10,6 +10,9 @@ description: |- + local interactive users files and directories, use the following command: +
$ sudo chgrp USER_GROUP /home/USER/FILE_DIR
+ ++ This rule ensures every file or directory under the home directory related ++ to an interactive user is group-owned by an interactive user. ++ + rationale: |- + If a local interactive users files are group-owned by a group of which the + user is not a member, unintended users may be able to access them. +@@ -33,3 +36,9 @@ ocil: |- + group-owned by a group the user is a member of, run the + following command: +
$ sudo ls -lLR /home/USER
++ ++warnings: ++ - general: |- ++ Due to OVAL limitation, this rule can report a false negative in a ++ specific situation where two interactive users swap the group-ownership ++ of folders or files in their respective home directories. +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/tests/expected_groupowner.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/tests/expected_groupowner.pass.sh +new file mode 100644 +index 0000000..8538430 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/tests/expected_groupowner.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++echo "$USER" > /home/$USER/$USER.txt ++chgrp -f $USER /home/$USER/$USER.txt +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/tests/home_dirs_all_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/tests/home_dirs_all_absent.pass.sh +new file mode 100644 +index 0000000..af24025 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/tests/home_dirs_all_absent.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -M $USER ++# This make sure home dirs related to test environment users are also removed. ++rm -Rf /home/* +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/tests/home_dirs_one_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/tests/home_dirs_one_absent.pass.sh +new file mode 100644 +index 0000000..5bce517 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/tests/home_dirs_one_absent.pass.sh +@@ -0,0 +1,7 @@ ++#!/bin/bash ++ ++USER1="cac_user1" ++USER2="cac_user2" ++ ++useradd -m $USER1 ++useradd -M $USER2 +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/tests/interactive_users_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/tests/interactive_users_absent.pass.sh +new file mode 100644 +index 0000000..ed34f09 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/tests/interactive_users_absent.pass.sh +@@ -0,0 +1,4 @@ ++#!/bin/bash ++ ++# remove all interactive users (ID >= 1000) from /etc/passwd ++sed -i '/.*:[0-9]\{4,\}:/d' /etc/passwd +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/tests/unexpected_groupowner_system_gid.fail.sh b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/tests/unexpected_groupowner_system_gid.fail.sh +new file mode 100644 +index 0000000..f105723 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/tests/unexpected_groupowner_system_gid.fail.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++echo "$USER" > /home/$USER/$USER.txt ++chgrp 2 /home/$USER/$USER.txt +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/tests/unexpected_groupowner_unknown_gid.fail.sh b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/tests/unexpected_groupowner_unknown_gid.fail.sh +new file mode 100644 +index 0000000..00fa481 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/tests/unexpected_groupowner_unknown_gid.fail.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++echo "$USER" > /home/$USER/$USER.txt ++chgrp 10005 /home/$USER/$USER.txt +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/tests/warning_home_dirs_swapped_groupowner.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/tests/warning_home_dirs_swapped_groupowner.pass.sh +new file mode 100644 +index 0000000..052aa7c +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_groupownership/tests/warning_home_dirs_swapped_groupowner.pass.sh +@@ -0,0 +1,14 @@ ++#!/bin/bash ++ ++USER1="cac_user1" ++USER2="cac_user2" ++ ++useradd -m $USER1 ++useradd -m $USER2 ++echo "$USER1" > /home/$USER1/$USER1.txt ++echo "$USER2" > /home/$USER2/$USER2.txt ++# Swap the ownership of files in two home directories ++# WARNING: This test scenario will report a false negative, as explained in the ++# warning section of this rule. ++chgrp -f $USER2 /home/$USER1/$USER1.txt ++chgrp -f $USER1 /home/$USER2/$USER2.txt +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/ansible/shared.yml b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/ansible/shared.yml +new file mode 100644 +index 0000000..40a0579 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/ansible/shared.yml +@@ -0,0 +1,32 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++- name: Get all local users from /etc/passwd ++ ansible.builtin.getent: ++ database: passwd ++ split: ':' ++ ++- name: Create local_users variable from the getent output ++ ansible.builtin.set_fact: ++ local_users: '{{ ansible_facts.getent_passwd|dict2items }}' ++ ++- name: Test for existence home directories to avoid creating them, but only fixing ownership ++ ansible.builtin.stat: ++ path: '{{ item.value[4] }}' ++ register: path_exists ++ loop: '{{ local_users }}' ++ when: ++ - item.value[1]|int >= {{{ uid_min }}} ++ - item.value[1]|int != 65534 ++ ++- name: Ensure interactive local users are the owners of their respective home directories ++ ansible.builtin.file: ++ path: '{{ item.0.value[4] }}' ++ owner: '{{ item.0.value[1] }}' ++ recurse: yes ++ loop: '{{ local_users|zip(path_exists.results)|list }}' ++ when: ++ - item.1.stat is defined and item.1.stat.exists +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/bash/shared.sh b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/bash/shared.sh +new file mode 100644 +index 0000000..236c800 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/bash/shared.sh +@@ -0,0 +1,13 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++for user in $(awk -F':' '{ if ($3 >= {{{ uid_min }}} && $3 != 65534) print $1 }' /etc/passwd); do ++ home_dir=$(getent passwd $user | cut -d: -f6) ++ # Only update the ownership when necessary. This will avoid changing the inode timestamp ++ # when the owner is already defined as expected, therefore not impacting in possible integrity ++ # check systems that also check inodes timestamps. ++ find $home_dir -not -user $user -exec chown -f $user {} \; ++done +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/oval/shared.xml b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/oval/shared.xml +new file mode 100644 +index 0000000..1850cfb +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/oval/shared.xml +@@ -0,0 +1,52 @@ ++ ++ ++ {{{ oval_metadata("All User Files and Directories In The Home Directory Must Have a Valid Owner") }}} ++ ++ ++ ++ ++ ++ ++ nobody ++ state_accounts_users_home_files_ownership_interactive_uids ++ ++ ++ ++ {{{ uid_min }}} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ .* ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/rule.yml b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/rule.yml +index 13f6bfe..5bfb388 100644 +--- a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/rule.yml ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/rule.yml +@@ -10,6 +10,9 @@ description: |- + directories, use the following command: +
$ sudo chown -R USER /home/USER
+ ++ This rule ensures every file or directory under the home directory related ++ to an interactive user is owned by an interactive user. ++ + rationale: |- + If local interactive users do not own the files in their directories, + unauthorized users may be able to access them. Additionally, if files are not +@@ -34,3 +37,9 @@ ocil: |- + To verify all files and directories in interactive users home directory + are owned by the user, run the following command: +
$ sudo ls -lLR /home/USER
++ ++warnings: ++ - general: |- ++ Due to OVAL limitation, this rule can report a false negative in a ++ specific situation where two interactive users swap the ownership of ++ folders or files in their respective home directories. +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/tests/expected_owner.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/tests/expected_owner.pass.sh +new file mode 100644 +index 0000000..da68cb4 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/tests/expected_owner.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++echo "$USER" > /home/$USER/$USER.txt ++chown $USER /home/$USER/$USER.txt +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/tests/home_dirs_all_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/tests/home_dirs_all_absent.pass.sh +new file mode 100644 +index 0000000..af24025 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/tests/home_dirs_all_absent.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -M $USER ++# This make sure home dirs related to test environment users are also removed. ++rm -Rf /home/* +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/tests/home_dirs_one_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/tests/home_dirs_one_absent.pass.sh +new file mode 100644 +index 0000000..5bce517 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/tests/home_dirs_one_absent.pass.sh +@@ -0,0 +1,7 @@ ++#!/bin/bash ++ ++USER1="cac_user1" ++USER2="cac_user2" ++ ++useradd -m $USER1 ++useradd -M $USER2 +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/tests/interactive_users_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/tests/interactive_users_absent.pass.sh +new file mode 100644 +index 0000000..ed34f09 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/tests/interactive_users_absent.pass.sh +@@ -0,0 +1,4 @@ ++#!/bin/bash ++ ++# remove all interactive users (ID >= 1000) from /etc/passwd ++sed -i '/.*:[0-9]\{4,\}:/d' /etc/passwd +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/tests/unexpected_owner_system_id.fail.sh b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/tests/unexpected_owner_system_id.fail.sh +new file mode 100644 +index 0000000..59c46a9 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/tests/unexpected_owner_system_id.fail.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++echo "$USER" > /home/$USER/$USER.txt ++chown 2 /home/$USER/$USER.txt +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/tests/unexpected_owner_unknown_id.fail.sh b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/tests/unexpected_owner_unknown_id.fail.sh +new file mode 100644 +index 0000000..e0f5514 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/tests/unexpected_owner_unknown_id.fail.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++echo "$USER" > /home/$USER/$USER.txt ++chown 10005 /home/$USER/$USER.txt +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/tests/warning_home_dirs_swapped_owner.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/tests/warning_home_dirs_swapped_owner.pass.sh +new file mode 100644 +index 0000000..1174ec6 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_ownership/tests/warning_home_dirs_swapped_owner.pass.sh +@@ -0,0 +1,14 @@ ++#!/bin/bash ++ ++USER1="cac_user1" ++USER2="cac_user2" ++ ++useradd -m $USER1 ++useradd -m $USER2 ++echo "$USER1" > /home/$USER1/$USER1.txt ++echo "$USER2" > /home/$USER2/$USER2.txt ++# Swap the ownership of files in two home directories ++# WARNING: This test scenario will report a false negative, as explained in the ++# warning section of this rule. ++chown -f $USER2 /home/$USER1/$USER1.txt ++chown -f $USER1 /home/$USER2/$USER2.txt +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/ansible/shared.yml b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/ansible/shared.yml +new file mode 100644 +index 0000000..9473710 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/ansible/shared.yml +@@ -0,0 +1,33 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++- name: Get all local users from /etc/passwd ++ ansible.builtin.getent: ++ database: passwd ++ split: ':' ++ ++- name: Create local_users variable from the getent output ++ ansible.builtin.set_fact: ++ local_users: '{{ ansible_facts.getent_passwd|dict2items }}' ++ ++- name: Test for existence home directories to avoid creating them, but only fixing group ownership ++ ansible.builtin.stat: ++ path: '{{ item.value[4] }}' ++ register: path_exists ++ loop: '{{ local_users }}' ++ when: ++ - item.value[2]|int >= {{{ uid_min }}} ++ - item.value[2]|int != 65534 ++ ++- name: Ensure interactive local users are the group-owners of their respective home directories ++ ansible.builtin.file: ++ path: '{{ item.0.value[4] }}' ++ mode: 'g-w,o=-' ++ follow: no ++ recurse: yes ++ loop: '{{ local_users|zip(path_exists.results)|list }}' ++ when: ++ - item.1.stat is defined and item.1.stat.exists +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/bash/shared.sh b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/bash/shared.sh +new file mode 100644 +index 0000000..186d55d +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/bash/shared.sh +@@ -0,0 +1,12 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++for home_dir in $(awk -F':' '{ if ($4 >= {{{ uid_min }}} && $4 != 65534) print $6 }' /etc/passwd); do ++ # Only update the permissions when necessary. This will avoid changing the inode timestamp when ++ # the permission is already defined as expected, therefore not impacting in possible integrity ++ # check systems that also check inodes timestamps. ++ find $home_dir -perm /027 -exec chmod g-w,o=- {} \; ++done +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/oval/shared.xml b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/oval/shared.xml +new file mode 100644 +index 0000000..d3db46d +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/oval/shared.xml +@@ -0,0 +1,52 @@ ++ ++ ++ {{{ oval_metadata("All User Files and Directories In The Home Directory Must Have Mode 0750 Or Less Permissive") }}} ++ ++ ++ ++ ++ ++ ++ ++ nobody ++ state_accounts_users_home_files_permissions_interactive_uids ++ ++ ++ ++ {{{ uid_min }}} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ .* ++ ++ ++ ++ ++ false ++ false ++ false ++ false ++ false ++ false ++ false ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/tests/acceptable_permission.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/tests/acceptable_permission.pass.sh +new file mode 100644 +index 0000000..3561847 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/tests/acceptable_permission.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++echo "$USER" > /home/$USER/$USER.txt ++chmod -Rf 750 /home/$USER/.* +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/tests/expected_permissions.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/tests/expected_permissions.pass.sh +new file mode 100644 +index 0000000..8ed7fa2 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/tests/expected_permissions.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++echo "$USER" > /home/$USER/$USER.txt ++chmod -Rf 700 /home/$USER/.* +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/tests/home_dirs_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/tests/home_dirs_absent.pass.sh +new file mode 100644 +index 0000000..af24025 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/tests/home_dirs_absent.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -M $USER ++# This make sure home dirs related to test environment users are also removed. ++rm -Rf /home/* +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/tests/interactive_users_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/tests/interactive_users_absent.pass.sh +new file mode 100644 +index 0000000..ed34f09 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/tests/interactive_users_absent.pass.sh +@@ -0,0 +1,4 @@ ++#!/bin/bash ++ ++# remove all interactive users (ID >= 1000) from /etc/passwd ++sed -i '/.*:[0-9]\{4,\}:/d' /etc/passwd +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/tests/lenient_permission.fail.sh b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/tests/lenient_permission.fail.sh +new file mode 100644 +index 0000000..b561671 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/tests/lenient_permission.fail.sh +@@ -0,0 +1,7 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++echo "$USER" > /home/$USER/$USER.txt ++chmod -Rf 700 /home/$USER/.* ++chmod -f o+r /home/$USER/$USER.txt +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/tests/lenient_permission_hidden_files.fail.sh b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/tests/lenient_permission_hidden_files.fail.sh +new file mode 100644 +index 0000000..d7811bc +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_users_home_files_permissions/tests/lenient_permission_hidden_files.fail.sh +@@ -0,0 +1,7 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++echo "$USER" > /home/$USER/.init_file ++chmod -Rf 700 /home/$USER/.* ++chmod -f o+r /home/$USER/.init_file +diff --git a/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/unexpected_groupowner_system_id.fail.sh b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/unexpected_groupowner_system_uid.fail.sh +similarity index 100% +rename from linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/unexpected_groupowner_system_id.fail.sh +rename to linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/unexpected_groupowner_system_uid.fail.sh +diff --git a/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/unexpected_groupowner_unknown_id.fail.sh b/linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/unexpected_groupowner_unknown_uid.fail.sh +similarity index 100% +rename from linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/unexpected_groupowner_unknown_id.fail.sh +rename to linux_os/guide/system/accounts/accounts-session/file_groupownership_home_directories/tests/unexpected_groupowner_unknown_uid.fail.sh diff --git a/SOURCES/scap-security-guide-0.1.59-BZ1884687D-PR_7837.patch b/SOURCES/scap-security-guide-0.1.59-BZ1884687D-PR_7837.patch new file mode 100644 index 0000000..d96e9e6 --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.59-BZ1884687D-PR_7837.patch @@ -0,0 +1,851 @@ +From 55ec5c49441f6b99914eef15c6cc559910311934 Mon Sep 17 00:00:00 2001 +From: Marcus Burghardt +Date: Fri, 5 Nov 2021 14:02:09 +0100 +Subject: [PATCH 1/4] OVAL, tests and remediation for rule: + +accounts_user_dot_user_ownership +--- + .../ansible/shared.yml | 10 ++++ + .../bash/shared.sh | 7 +++ + .../oval/shared.xml | 52 +++++++++++++++++++ + .../accounts_user_dot_user_ownership/rule.yml | 9 ++++ + .../tests/expected_owner.pass.sh | 6 +++ + .../tests/home_dirs_all_absent.pass.sh | 6 +++ + .../home_dirs_one_absent_owner_ok.pass.sh | 10 ++++ + .../tests/interactive_users_absent.pass.sh | 4 ++ + .../tests/no_dot_file_ignored.pass.sh | 6 +++ + .../tests/unexpected_owner_system_uid.fail.sh | 6 +++ + .../unexpected_owner_unknown_uid.fail.sh | 6 +++ + .../tests/warning_swapped_owners.pass.sh | 15 ++++++ + 12 files changed, 137 insertions(+) + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/ansible/shared.yml + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/bash/shared.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/oval/shared.xml + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/expected_owner.pass.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/home_dirs_all_absent.pass.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/home_dirs_one_absent_owner_ok.pass.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/interactive_users_absent.pass.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/no_dot_file_ignored.pass.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/unexpected_owner_system_uid.fail.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/unexpected_owner_unknown_uid.fail.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/warning_swapped_owners.pass.sh + +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/ansible/shared.yml b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/ansible/shared.yml +new file mode 100644 +index 00000000000..3801e0cfdec +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/ansible/shared.yml +@@ -0,0 +1,10 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++- name: Ensure interactive local users are the owners of their respective initialization files ++ ansible.builtin.command: ++ cmd: | ++ awk -F':' '{ if ($3 >= {{{ uid_min }}} && $3 != 65534) system("chown -f " $3" "$6"/.[^\.]?*") }' /etc/passwd +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/bash/shared.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/bash/shared.sh +new file mode 100644 +index 00000000000..f362a2656aa +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/bash/shared.sh +@@ -0,0 +1,7 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++awk -F':' '{ if ($3 >= {{{ uid_min }}} && $3 != 65534) system("chown -f " $3" "$6"/.[^\.]?*") }' /etc/passwd +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/oval/shared.xml b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/oval/shared.xml +new file mode 100644 +index 00000000000..fb12ce73b23 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/oval/shared.xml +@@ -0,0 +1,52 @@ ++ ++ ++ {{{ oval_metadata("User Initialization Files Must Be Owned By the Primary User") }}} ++ ++ ++ ++ ++ ++ ++ nobody ++ state_accounts_user_dot_user_ownership_interactive_uids ++ ++ ++ ++ {{{ uid_min }}} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ^\..* ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/rule.yml b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/rule.yml +index 37efb159c08..ec75aa01f12 100644 +--- a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/rule.yml ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/rule.yml +@@ -9,6 +9,9 @@ description: |- + the primary owner with the following command: +
$ sudo chown USER /home/USER/.*
+ ++ This rule ensures every initialization file related to an interactive user ++ is owned by an interactive user. ++ + rationale: |- + Local initialization files are used to configure the user's shell environment + upon logon. Malicious modification of these files could compromise accounts upon +@@ -33,3 +36,9 @@ ocil: |- + primary user, run the following command: +
$ sudo ls -al /home/USER/.*
+ The user initialization files should be owned by USER. ++ ++warnings: ++ - general: |- ++ Due to OVAL limitation, this rule can report a false negative in a ++ specific situation where two interactive users swap the ownership of ++ their respective initialization files. +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/expected_owner.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/expected_owner.pass.sh +new file mode 100644 +index 00000000000..3d30238225e +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/expected_owner.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++touch /home/$USER/.bashrc ++chown $USER /home/$USER/.bashrc +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/home_dirs_all_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/home_dirs_all_absent.pass.sh +new file mode 100644 +index 00000000000..af240252de3 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/home_dirs_all_absent.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -M $USER ++# This make sure home dirs related to test environment users are also removed. ++rm -Rf /home/* +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/home_dirs_one_absent_owner_ok.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/home_dirs_one_absent_owner_ok.pass.sh +new file mode 100644 +index 00000000000..840477d2c83 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/home_dirs_one_absent_owner_ok.pass.sh +@@ -0,0 +1,10 @@ ++#!/bin/bash ++ ++USER1="cac_user1" ++USER2="cac_user2" ++ ++useradd -m $USER1 ++useradd -M $USER2 ++ ++touch /home/$USER1/.bashrc ++chown $USER1 /home/$USER1/.bashrc +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/interactive_users_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/interactive_users_absent.pass.sh +new file mode 100644 +index 00000000000..ed34f0940a7 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/interactive_users_absent.pass.sh +@@ -0,0 +1,4 @@ ++#!/bin/bash ++ ++# remove all interactive users (ID >= 1000) from /etc/passwd ++sed -i '/.*:[0-9]\{4,\}:/d' /etc/passwd +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/no_dot_file_ignored.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/no_dot_file_ignored.pass.sh +new file mode 100644 +index 00000000000..9292a46b3b2 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/no_dot_file_ignored.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++touch /home/$USER/nodotfile ++chown 2 /home/$USER/nodotfile +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/unexpected_owner_system_uid.fail.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/unexpected_owner_system_uid.fail.sh +new file mode 100644 +index 00000000000..0373eb6a5f6 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/unexpected_owner_system_uid.fail.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++touch /home/$USER/.bashrc ++chown 2 /home/$USER/.bashrc +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/unexpected_owner_unknown_uid.fail.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/unexpected_owner_unknown_uid.fail.sh +new file mode 100644 +index 00000000000..da7f50ce905 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/unexpected_owner_unknown_uid.fail.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++touch /home/$USER/.bashrc ++chown 10005 /home/$USER/.bashrc +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/warning_swapped_owners.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/warning_swapped_owners.pass.sh +new file mode 100644 +index 00000000000..b4a95ae2242 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_user_ownership/tests/warning_swapped_owners.pass.sh +@@ -0,0 +1,15 @@ ++#!/bin/bash ++ ++USER1="cac_user1" ++USER2="cac_user2" ++ ++useradd -m $USER1 ++useradd -m $USER2 ++touch /home/$USER1/.bashrc ++touch /home/$USER2/.bashrc ++ ++# Swap the ownership of files in two home directories ++# WARNING: This test scenario will report a false negative, as explained in the ++# warning section of this rule. ++chown -f $USER2 /home/$USER1/.bashrc ++chown -f $USER1 /home/$USER2/.bashrc + +From cc6318c8afc898190a090058fbdfbdfc741d4d85 Mon Sep 17 00:00:00 2001 +From: Marcus Burghardt +Date: Fri, 5 Nov 2021 14:05:19 +0100 +Subject: [PATCH 2/4] OVAL, tests and remediation for rule: + +accounts_user_dot_group_ownership +--- + .../ansible/shared.yml | 10 ++++ + .../bash/shared.sh | 7 +++ + .../oval/shared.xml | 52 +++++++++++++++++++ + .../rule.yml | 9 ++++ + .../tests/expected_groupowner.pass.sh | 6 +++ + .../tests/home_dirs_all_absent.pass.sh | 6 +++ + .../home_dirs_one_absent_group_ok.pass.sh | 10 ++++ + .../tests/interactive_users_absent.pass.sh | 4 ++ + .../tests/no_dot_file_ignored.pass.sh | 6 +++ + .../unexpected_groupowner_system_gid.fail.sh | 6 +++ + .../unexpected_groupowner_unknown_gid.fail.sh | 6 +++ + .../tests/warning_swapped_groupowners.pass.sh | 15 ++++++ + 12 files changed, 137 insertions(+) + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/ansible/shared.yml + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/bash/shared.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/oval/shared.xml + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/expected_groupowner.pass.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/home_dirs_all_absent.pass.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/home_dirs_one_absent_group_ok.pass.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/interactive_users_absent.pass.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/no_dot_file_ignored.pass.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/unexpected_groupowner_system_gid.fail.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/unexpected_groupowner_unknown_gid.fail.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/warning_swapped_groupowners.pass.sh + +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/ansible/shared.yml b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/ansible/shared.yml +new file mode 100644 +index 00000000000..1a9fa192359 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/ansible/shared.yml +@@ -0,0 +1,10 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++- name: Ensure interactive local users are the group-owners of their respective initialization files ++ ansible.builtin.command: ++ cmd: | ++ awk -F':' '{ if ($3 >= {{{ uid_min }}} && $3 != 65534) system("chgrp -f " $3" "$6"/.[^\.]?*") }' /etc/passwd +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/bash/shared.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/bash/shared.sh +new file mode 100644 +index 00000000000..2b0fe395e29 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/bash/shared.sh +@@ -0,0 +1,7 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++awk -F':' '{ if ($3 >= {{{ uid_min }}} && $3 != 65534) system("chgrp -f " $3" "$6"/.[^\.]?*") }' /etc/passwd +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/oval/shared.xml b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/oval/shared.xml +new file mode 100644 +index 00000000000..7ee39a3e794 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/oval/shared.xml +@@ -0,0 +1,52 @@ ++ ++ ++ {{{ oval_metadata("User Initialization Files Must Be Group-Owned By The Primary User") }}} ++ ++ ++ ++ ++ ++ ++ nobody ++ state_accounts_user_dot_group_ownership_interactive_gids ++ ++ ++ ++ {{{ gid_min }}} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ^\..* ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/rule.yml b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/rule.yml +index a9cf96afc8c..d7d75a6600f 100644 +--- a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/rule.yml ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/rule.yml +@@ -10,6 +10,9 @@ description: |- + interactive user home directory, use the following command: +
$ sudo chgrp USER_GROUP /home/USER/.INIT_FILE
+ ++ This rule ensures every initialization file related to an interactive user ++ is group-owned by an interactive user. ++ + rationale: |- + Local initialization files for interactive users are used to configure the + user's shell environment upon logon. Malicious modification of these files could +@@ -35,3 +38,9 @@ ocil: |- + users in /etc/passwd and verify all initialization files under the + respective users home directory. Check the group owner of all local interactive users + initialization files. ++ ++warnings: ++ - general: |- ++ Due to OVAL limitation, this rule can report a false negative in a ++ specific situation where two interactive users swap the group-ownership ++ of their respective initialization files. +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/expected_groupowner.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/expected_groupowner.pass.sh +new file mode 100644 +index 00000000000..0b89e741fbf +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/expected_groupowner.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++touch /home/$USER/.bashrc ++chgrp $USER /home/$USER/.bashrc +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/home_dirs_all_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/home_dirs_all_absent.pass.sh +new file mode 100644 +index 00000000000..af240252de3 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/home_dirs_all_absent.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -M $USER ++# This make sure home dirs related to test environment users are also removed. ++rm -Rf /home/* +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/home_dirs_one_absent_group_ok.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/home_dirs_one_absent_group_ok.pass.sh +new file mode 100644 +index 00000000000..90e1787dccc +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/home_dirs_one_absent_group_ok.pass.sh +@@ -0,0 +1,10 @@ ++#!/bin/bash ++ ++USER1="cac_user1" ++USER2="cac_user2" ++ ++useradd -m $USER1 ++useradd -M $USER2 ++ ++touch /home/$USER1/.bashrc ++chgrp $USER1 /home/$USER1/.bashrc +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/interactive_users_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/interactive_users_absent.pass.sh +new file mode 100644 +index 00000000000..ed34f0940a7 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/interactive_users_absent.pass.sh +@@ -0,0 +1,4 @@ ++#!/bin/bash ++ ++# remove all interactive users (ID >= 1000) from /etc/passwd ++sed -i '/.*:[0-9]\{4,\}:/d' /etc/passwd +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/no_dot_file_ignored.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/no_dot_file_ignored.pass.sh +new file mode 100644 +index 00000000000..5b9e17c5384 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/no_dot_file_ignored.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++touch /home/$USER/nodotfile ++chgrp 2 /home/$USER/nodotfile +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/unexpected_groupowner_system_gid.fail.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/unexpected_groupowner_system_gid.fail.sh +new file mode 100644 +index 00000000000..b21e7229ed2 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/unexpected_groupowner_system_gid.fail.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++touch /home/$USER/.bashrc ++chgrp 2 /home/$USER/.bashrc +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/unexpected_groupowner_unknown_gid.fail.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/unexpected_groupowner_unknown_gid.fail.sh +new file mode 100644 +index 00000000000..7c1bcac44d6 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/unexpected_groupowner_unknown_gid.fail.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++touch /home/$USER/.bashrc ++chgrp 10005 /home/$USER/.bashrc +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/warning_swapped_groupowners.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/warning_swapped_groupowners.pass.sh +new file mode 100644 +index 00000000000..d58a9dd63bf +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_group_ownership/tests/warning_swapped_groupowners.pass.sh +@@ -0,0 +1,15 @@ ++#!/bin/bash ++ ++USER1="cac_user1" ++USER2="cac_user2" ++ ++useradd -m $USER1 ++useradd -m $USER2 ++touch /home/$USER1/.bashrc ++touch /home/$USER2/.bashrc ++ ++# Swap the ownership of files in two home directories ++# WARNING: This test scenario will report a false negative, as explained in the ++# warning section of this rule. ++chgrp -f $USER2 /home/$USER1/.bashrc ++chgrp -f $USER1 /home/$USER2/.bashrc + +From 2e28bd10bfec8466362e74b7c5d95481e95d0ae9 Mon Sep 17 00:00:00 2001 +From: Marcus Burghardt +Date: Fri, 5 Nov 2021 14:06:56 +0100 +Subject: [PATCH 3/4] OVAL, tests and remediation for rule: + +accounts_user_dot_no_world_writable_programs +--- + .../ansible/shared.yml | 10 ++++ + .../bash/shared.sh | 7 +++ + .../oval/shared.xml | 52 +++++++++++++++++++ + .../tests/expected_permissions.pass.sh | 6 +++ + .../tests/home_dirs_absent.pass.sh | 6 +++ + .../tests/interactive_users_absent.pass.sh | 4 ++ + .../tests/lenient_permission.fail.sh | 6 +++ + .../tests/more_restrictive_permission.pass.sh | 6 +++ + .../tests/no_dot_file_ignored.pass.sh | 6 +++ + 9 files changed, 103 insertions(+) + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/ansible/shared.yml + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/bash/shared.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/oval/shared.xml + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/tests/expected_permissions.pass.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/tests/home_dirs_absent.pass.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/tests/interactive_users_absent.pass.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/tests/lenient_permission.fail.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/tests/more_restrictive_permission.pass.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/tests/no_dot_file_ignored.pass.sh + +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/ansible/shared.yml b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/ansible/shared.yml +new file mode 100644 +index 00000000000..210d12a53fe +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/ansible/shared.yml +@@ -0,0 +1,10 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++- name: Ensure interactive local users are the group-owners of their respective initialization files ++ ansible.builtin.command: ++ cmd: | ++ awk -F':' '{ if ($3 >= {{{ gid_min }}} && $3 != 65534) system("chmod -f g-w,o-w "$6"/.[^\.]?*") }' /etc/passwd +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/bash/shared.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/bash/shared.sh +new file mode 100644 +index 00000000000..24ff95c6cd7 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/bash/shared.sh +@@ -0,0 +1,7 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++awk -F':' '{ if ($4 >= {{{ uid_min }}} && $4 != 65534) system("chmod -f g-w,o-w "$6"/.[^\.]?*") }' /etc/passwd +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/oval/shared.xml b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/oval/shared.xml +new file mode 100644 +index 00000000000..ca8ecb2b447 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/oval/shared.xml +@@ -0,0 +1,52 @@ ++ ++ ++ {{{ oval_metadata("User Initialization Files Must Not Run World-Writable Programs") }}} ++ ++ ++ ++ ++ ++ ++ nobody ++ state_accounts_user_dot_no_world_writable_programs_interactive_uids ++ ++ ++ ++ {{{ uid_min }}} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ^\..* ++ ++ ++ ++ ++ false ++ false ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/tests/expected_permissions.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/tests/expected_permissions.pass.sh +new file mode 100644 +index 00000000000..7a2b35eba77 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/tests/expected_permissions.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++echo "$USER" > /home/$USER/$USER.txt ++chmod -f 755 /home/$USER/.* +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/tests/home_dirs_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/tests/home_dirs_absent.pass.sh +new file mode 100644 +index 00000000000..af240252de3 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/tests/home_dirs_absent.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -M $USER ++# This make sure home dirs related to test environment users are also removed. ++rm -Rf /home/* +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/tests/interactive_users_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/tests/interactive_users_absent.pass.sh +new file mode 100644 +index 00000000000..ed34f0940a7 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/tests/interactive_users_absent.pass.sh +@@ -0,0 +1,4 @@ ++#!/bin/bash ++ ++# remove all interactive users (ID >= 1000) from /etc/passwd ++sed -i '/.*:[0-9]\{4,\}:/d' /etc/passwd +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/tests/lenient_permission.fail.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/tests/lenient_permission.fail.sh +new file mode 100644 +index 00000000000..5fcf95f5f96 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/tests/lenient_permission.fail.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++touch /home/$USER/.bashrc ++chmod -f o+w /home/$USER/.bashrc +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/tests/more_restrictive_permission.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/tests/more_restrictive_permission.pass.sh +new file mode 100644 +index 00000000000..655c6d32e47 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/tests/more_restrictive_permission.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++echo "$USER" > /home/$USER/$USER.txt ++chmod -f 700 /home/$USER/.* +diff --git a/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/tests/no_dot_file_ignored.pass.sh b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/tests/no_dot_file_ignored.pass.sh +new file mode 100644 +index 00000000000..66439b768ca +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/accounts_user_dot_no_world_writable_programs/tests/no_dot_file_ignored.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++echo "$USER" > /home/$USER/$USER.txt ++chmod -f o+w /home/$USER/$USER.txt + +From f7f5735115ad3fa98fac8644aa844ed54d4d5dd7 Mon Sep 17 00:00:00 2001 +From: Marcus Burghardt +Date: Fri, 5 Nov 2021 14:07:55 +0100 +Subject: [PATCH 4/4] OVAL, tests and remediation for rule: + +accounts_umask_interactive_users +--- + .../ansible/shared.yml | 12 ++++++ + .../bash/shared.sh | 9 +++++ + .../oval/shared.xml | 40 +++++++++++++++++++ + .../tests/home_dirs_all_absent.pass.sh | 6 +++ + .../tests/home_dirs_one_absent.pass.sh | 10 +++++ + .../tests/interactive_users_absent.pass.sh | 4 ++ + .../tests/no_dot_file_ignored.pass.sh | 5 +++ + .../tests/umask_defined.fail.sh | 5 +++ + 8 files changed, 91 insertions(+) + create mode 100644 linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/ansible/shared.yml + create mode 100644 linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/bash/shared.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/oval/shared.xml + create mode 100644 linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/tests/home_dirs_all_absent.pass.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/tests/home_dirs_one_absent.pass.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/tests/interactive_users_absent.pass.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/tests/no_dot_file_ignored.pass.sh + create mode 100644 linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/tests/umask_defined.fail.sh + +diff --git a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/ansible/shared.yml b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/ansible/shared.yml +new file mode 100644 +index 00000000000..142f10a2157 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/ansible/shared.yml +@@ -0,0 +1,12 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++- name: Ensure interactive local users are the owners of their respective initialization files ++ ansible.builtin.shell: ++ cmd: | ++ for dir in $(awk -F':' '{ if ($3 >= {{{ uid_min }}} && $3 != 65534) print $6}' /etc/passwd); do ++ sed -i 's/^\([\s]*umask\s*\)/#\1/g' $dir/.[^\.]?* ++ done +diff --git a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/bash/shared.sh b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/bash/shared.sh +new file mode 100644 +index 00000000000..0644b221df8 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/bash/shared.sh +@@ -0,0 +1,9 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++for dir in $(awk -F':' '{ if ($3 >= {{{ uid_min }}} && $3 != 65534) print $6}' /etc/passwd); do ++ sed -i 's/^\([\s]*umask\s*\)/#\1/g' $dir/.[^\.]?* ++done +diff --git a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/oval/shared.xml b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/oval/shared.xml +new file mode 100644 +index 00000000000..42dbdbbae46 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/oval/shared.xml +@@ -0,0 +1,40 @@ ++ ++ ++ {{{ oval_metadata("Ensure the Default Umask is Set Correctly For Interactive Users") }}} ++ ++ ++ ++ ++ ++ ++ nobody ++ state_accounts_umask_interactive_users_interactive_uids ++ ++ ++ ++ {{{ uid_min }}} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ^\..* ++ ^[\s]*umask\s* ++ 1 ++ ++ ++ ++ ++ ++ ++ +diff --git a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/tests/home_dirs_all_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/tests/home_dirs_all_absent.pass.sh +new file mode 100644 +index 00000000000..af240252de3 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/tests/home_dirs_all_absent.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -M $USER ++# This make sure home dirs related to test environment users are also removed. ++rm -Rf /home/* +diff --git a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/tests/home_dirs_one_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/tests/home_dirs_one_absent.pass.sh +new file mode 100644 +index 00000000000..0ad9248d14b +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/tests/home_dirs_one_absent.pass.sh +@@ -0,0 +1,10 @@ ++#!/bin/bash ++ ++USER1="cac_user1" ++USER2="cac_user2" ++ ++useradd -m $USER1 ++useradd -M $USER2 ++ ++# Make sure no umask definition exists in the startup files ++sed -i 's/^\([\s]*umask\s*\)/#\1/g' /home/$USER1/.[^\.]?* +diff --git a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/tests/interactive_users_absent.pass.sh b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/tests/interactive_users_absent.pass.sh +new file mode 100644 +index 00000000000..ed34f0940a7 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/tests/interactive_users_absent.pass.sh +@@ -0,0 +1,4 @@ ++#!/bin/bash ++ ++# remove all interactive users (ID >= 1000) from /etc/passwd ++sed -i '/.*:[0-9]\{4,\}:/d' /etc/passwd +diff --git a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/tests/no_dot_file_ignored.pass.sh b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/tests/no_dot_file_ignored.pass.sh +new file mode 100644 +index 00000000000..27f580ae45a +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/tests/no_dot_file_ignored.pass.sh +@@ -0,0 +1,5 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++echo "umask 022" > /home/$USER/nodotfile +diff --git a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/tests/umask_defined.fail.sh b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/tests/umask_defined.fail.sh +new file mode 100644 +index 00000000000..f7835392acf +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/tests/umask_defined.fail.sh +@@ -0,0 +1,5 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++echo "umask 022" >> /home/$USER/.bashrc diff --git a/SOURCES/scap-security-guide-0.1.59-add_missing_stig_ids-PR_7597.patch b/SOURCES/scap-security-guide-0.1.59-add_missing_stig_ids-PR_7597.patch new file mode 100644 index 0000000..5344d00 --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.59-add_missing_stig_ids-PR_7597.patch @@ -0,0 +1,74 @@ +From 1b7bd47bd8fa3f828aca0bf0add7fc188893ef11 Mon Sep 17 00:00:00 2001 +From: Matthew Burket +Date: Tue, 21 Sep 2021 07:44:29 -0500 +Subject: [PATCH 1/2] Add STIG references for FIPS + +--- + .../integrity/crypto/configure_bind_crypto_policy/rule.yml | 1 + + .../software/integrity/crypto/configure_crypto_policy/rule.yml | 1 + + .../integrity/crypto/configure_kerberos_crypto_policy/rule.yml | 1 + + .../integrity/crypto/configure_libreswan_crypto_policy/rule.yml | 1 + + .../software/integrity/fips/enable_dracut_fips_module/rule.yml | 1 + + 5 files changed, 5 insertions(+) + +diff --git a/linux_os/guide/system/software/integrity/crypto/configure_bind_crypto_policy/rule.yml b/linux_os/guide/system/software/integrity/crypto/configure_bind_crypto_policy/rule.yml +index 5484e11ad9f..e58c9506083 100644 +--- a/linux_os/guide/system/software/integrity/crypto/configure_bind_crypto_policy/rule.yml ++++ b/linux_os/guide/system/software/integrity/crypto/configure_bind_crypto_policy/rule.yml +@@ -29,6 +29,7 @@ identifiers: + references: + nerc-cip: CIP-003-3 R4.2,CIP-007-3 R5.1 + nist: SC-13,SC-12(2),SC-12(3) ++ stigid@rhel8: RHEL-08-010020 + srg: SRG-OS-000423-GPOS-00187,SRG-OS-000426-GPOS-00190 + + ocil_clause: |- +diff --git a/linux_os/guide/system/software/integrity/crypto/configure_crypto_policy/rule.yml b/linux_os/guide/system/software/integrity/crypto/configure_crypto_policy/rule.yml +index d4ea4db6c14..5eea87ac006 100644 +--- a/linux_os/guide/system/software/integrity/crypto/configure_crypto_policy/rule.yml ++++ b/linux_os/guide/system/software/integrity/crypto/configure_crypto_policy/rule.yml +@@ -65,6 +65,7 @@ references: + nerc-cip: CIP-003-3 R4.2,CIP-007-3 R5.1,CIP-007-3 R7.1 + nist: AC-17(a),AC-17(2),CM-6(a),MA-4(6),SC-13,SC-12(2),SC-12(3) + ospp: FCS_COP.1(1),FCS_COP.1(2),FCS_COP.1(3),FCS_COP.1(4),FCS_CKM.1,FCS_CKM.2,FCS_TLSC_EXT.1 ++ stigid@rhel8: RHEL-08-010020 + srg: SRG-OS-000396-GPOS-00176,SRG-OS-000393-GPOS-00173,SRG-OS-000394-GPOS-00174 + + ocil_clause: 'cryptographic policy is not configured or is configured incorrectly' +diff --git a/linux_os/guide/system/software/integrity/crypto/configure_kerberos_crypto_policy/rule.yml b/linux_os/guide/system/software/integrity/crypto/configure_kerberos_crypto_policy/rule.yml +index b219c9d2801..e1f5e55e8cd 100644 +--- a/linux_os/guide/system/software/integrity/crypto/configure_kerberos_crypto_policy/rule.yml ++++ b/linux_os/guide/system/software/integrity/crypto/configure_kerberos_crypto_policy/rule.yml +@@ -28,6 +28,7 @@ references: + nerc-cip: CIP-003-3 R4.2,CIP-007-3 R5.1 + nist: SC-13,SC-12(2),SC-12(3) + srg: SRG-OS-000120-GPOS-00061 ++ stigid@rhel8: RHEL-08-010020 + + ocil_clause: 'the symlink does not exist or points to a different target' + +diff --git a/linux_os/guide/system/software/integrity/crypto/configure_libreswan_crypto_policy/rule.yml b/linux_os/guide/system/software/integrity/crypto/configure_libreswan_crypto_policy/rule.yml +index cd03ecf30d1..1fffb2ad2b7 100644 +--- a/linux_os/guide/system/software/integrity/crypto/configure_libreswan_crypto_policy/rule.yml ++++ b/linux_os/guide/system/software/integrity/crypto/configure_libreswan_crypto_policy/rule.yml +@@ -33,6 +33,7 @@ references: + nist: CM-6(a),MA-4(6),SC-13,SC-12(2),SC-12(3) + ospp: FCS_IPSEC_EXT.1.4,FCS_IPSEC_EXT.1.6 + srg: SRG-OS-000033-GPOS-00014 ++ stigid@rhel8: RHEL-08-010020 + + ocil_clause: |- + Libreswan is installed and /etc/ipsec.conf does not contain include /etc/crypto-policies/back-ends/libreswan.config +diff --git a/linux_os/guide/system/software/integrity/fips/enable_dracut_fips_module/rule.yml b/linux_os/guide/system/software/integrity/fips/enable_dracut_fips_module/rule.yml +index 9486031be54..fe20c1958a6 100644 +--- a/linux_os/guide/system/software/integrity/fips/enable_dracut_fips_module/rule.yml ++++ b/linux_os/guide/system/software/integrity/fips/enable_dracut_fips_module/rule.yml +@@ -30,6 +30,7 @@ references: + nerc-cip: CIP-003-3 R4.2,CIP-007-3 R5.1 + nist: SC-12(2),SC-12(3),IA-7,SC-13,CM-6(a),SC-12 + srg: SRG-OS-000478-GPOS-00223 ++ stigid@rhel8: RHEL-08-010020 + vmmsrg: SRG-OS-000120-VMM-000600,SRG-OS-000478-VMM-001980,SRG-OS-000396-VMM-001590 + + ocil_clause: 'the Dracut FIPS module is not enabled' + diff --git a/SOURCES/scap-security-guide-0.1.59-fix_6844-PR_7673.patch b/SOURCES/scap-security-guide-0.1.59-fix_6844-PR_7673.patch new file mode 100644 index 0000000..b20d6ca --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.59-fix_6844-PR_7673.patch @@ -0,0 +1,47 @@ +From 155a46f32b02fec3fa9a99d2a6fa2f1a5287fcaf Mon Sep 17 00:00:00 2001 +From: Matthew Burket +Date: Wed, 29 Sep 2021 09:43:56 -0500 +Subject: [PATCH] Add RHEL8 FIPS STIG ID to few rules + +--- + .../integrity/crypto/configure_ssh_crypto_policy/rule.yml | 1 + + .../harden_sshd_ciphers_openssh_conf_crypto_policy/rule.yml | 1 + + .../crypto/harden_sshd_macs_openssh_conf_crypto_policy/rule.yml | 1 + + 3 files changed, 3 insertions(+) + +diff --git a/linux_os/guide/system/software/integrity/crypto/configure_ssh_crypto_policy/rule.yml b/linux_os/guide/system/software/integrity/crypto/configure_ssh_crypto_policy/rule.yml +index 9ac0b55f65a..2f4fb79eb54 100644 +--- a/linux_os/guide/system/software/integrity/crypto/configure_ssh_crypto_policy/rule.yml ++++ b/linux_os/guide/system/software/integrity/crypto/configure_ssh_crypto_policy/rule.yml +@@ -29,6 +29,7 @@ references: + nerc-cip: CIP-003-3 R4.2,CIP-007-3 R5.1,CIP-007-3 R7.1 + nist: AC-17(a),AC-17(2),CM-6(a),MA-4(6),SC-13 + srg: SRG-OS-000250-GPOS-00093 ++ stigid@rhel8: RHEL-08-010020 + + ocil_clause: 'the CRYPTO_POLICY variable is not set or is commented in the /etc/sysconfig/sshd' + +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 +index 682ca436b8d..adeae314fff 100644 +--- 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 +@@ -30,6 +30,7 @@ references: + disa: CCI-001453 + nist: AC-17(2) + srg: SRG-OS-000250-GPOS-00093 ++ stigid@rhel8: RHEL-08-010020 + + ocil_clause: 'Crypto Policy for OpenSSH client is not configured correctly' + +diff --git a/linux_os/guide/system/software/integrity/crypto/harden_sshd_macs_openssh_conf_crypto_policy/rule.yml b/linux_os/guide/system/software/integrity/crypto/harden_sshd_macs_openssh_conf_crypto_policy/rule.yml +index d21f68ac17a..12e527ca33d 100644 +--- a/linux_os/guide/system/software/integrity/crypto/harden_sshd_macs_openssh_conf_crypto_policy/rule.yml ++++ b/linux_os/guide/system/software/integrity/crypto/harden_sshd_macs_openssh_conf_crypto_policy/rule.yml +@@ -28,6 +28,7 @@ references: + disa: CCI-001453 + nist: AC-17(2) + srg: SRG-OS-000250-GPOS-00093 ++ stigid@rhel8: RHEL-08-010020 + + ocil_clause: 'Crypto Policy for OpenSSH client is not configured correctly' + diff --git a/SOURCES/scap-security-guide-0.1.59-fix_7333-PR_7692.patch b/SOURCES/scap-security-guide-0.1.59-fix_7333-PR_7692.patch new file mode 100644 index 0000000..5b0f50f --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.59-fix_7333-PR_7692.patch @@ -0,0 +1,91 @@ +From c988807382a5c0e307567def55fcedcb2e3b75b7 Mon Sep 17 00:00:00 2001 +From: Matthew Burket +Date: Mon, 4 Oct 2021 12:18:05 -0500 +Subject: [PATCH 1/4] Update rsyslog_remote_loghost to match STIG and CIS + +STIG and CIS only match *.conf files and we matched all files. +Moving to match the benchmarks. + +Fixes #7333 +--- + .../rsyslog_remote_loghost/oval/shared.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/linux_os/guide/system/logging/rsyslog_sending_messages/rsyslog_remote_loghost/oval/shared.xml b/linux_os/guide/system/logging/rsyslog_sending_messages/rsyslog_remote_loghost/oval/shared.xml +index 5895b7fab24..7b5d4968886 100644 +--- a/linux_os/guide/system/logging/rsyslog_sending_messages/rsyslog_remote_loghost/oval/shared.xml ++++ b/linux_os/guide/system/logging/rsyslog_sending_messages/rsyslog_remote_loghost/oval/shared.xml +@@ -39,7 +39,7 @@ + + + /etc/rsyslog.d +- .* ++ *.conf + ^\*\.\*[\s]+(?:@|\:omrelp\:) + 1 + + +From 19d72d76e6818f47e71245dece0d6faa62cfcdb1 Mon Sep 17 00:00:00 2001 +From: Matthew Burket +Date: Mon, 4 Oct 2021 13:11:10 -0500 +Subject: [PATCH 3/4] Add packages so that test suite pass in a container + +--- + .../rsyslog_remote_loghost/tests/line_commented.fail.sh | 1 + + .../rsyslog_remote_loghost/tests/line_not_there.fail.sh | 1 + + .../rsyslog_remote_loghost/tests/remote_configured.pass.sh | 1 + + 3 files changed, 3 insertions(+) + +diff --git a/linux_os/guide/system/logging/rsyslog_sending_messages/rsyslog_remote_loghost/tests/line_commented.fail.sh b/linux_os/guide/system/logging/rsyslog_sending_messages/rsyslog_remote_loghost/tests/line_commented.fail.sh +index 52376effea2..760606278b3 100644 +--- a/linux_os/guide/system/logging/rsyslog_sending_messages/rsyslog_remote_loghost/tests/line_commented.fail.sh ++++ b/linux_os/guide/system/logging/rsyslog_sending_messages/rsyslog_remote_loghost/tests/line_commented.fail.sh +@@ -1,4 +1,5 @@ + #!/bin/bash ++# packages = rsyslog + + CONF_FILE="/etc/rsyslog.conf" + LOGHOST_LINE="*.* @@192.168.122.1:5000" +diff --git a/linux_os/guide/system/logging/rsyslog_sending_messages/rsyslog_remote_loghost/tests/line_not_there.fail.sh b/linux_os/guide/system/logging/rsyslog_sending_messages/rsyslog_remote_loghost/tests/line_not_there.fail.sh +index 8a55da88c8d..ac82180f21c 100644 +--- a/linux_os/guide/system/logging/rsyslog_sending_messages/rsyslog_remote_loghost/tests/line_not_there.fail.sh ++++ b/linux_os/guide/system/logging/rsyslog_sending_messages/rsyslog_remote_loghost/tests/line_not_there.fail.sh +@@ -1,4 +1,5 @@ + #!/bin/bash ++# packages = rsyslog + + CONF_FILE="/etc/rsyslog.conf" + sed -i "/^\*\.\*.*/d" "$CONF_FILE" +diff --git a/linux_os/guide/system/logging/rsyslog_sending_messages/rsyslog_remote_loghost/tests/remote_configured.pass.sh b/linux_os/guide/system/logging/rsyslog_sending_messages/rsyslog_remote_loghost/tests/remote_configured.pass.sh +index 8122a490f25..3c396b4e52a 100644 +--- a/linux_os/guide/system/logging/rsyslog_sending_messages/rsyslog_remote_loghost/tests/remote_configured.pass.sh ++++ b/linux_os/guide/system/logging/rsyslog_sending_messages/rsyslog_remote_loghost/tests/remote_configured.pass.sh +@@ -1,4 +1,5 @@ + #!/bin/bash ++# packages = rsyslog + + CONF_FILE="/etc/rsyslog.conf" + LOGHOST_LINE="*.* @@192.168.122.1:5000" + +From e7110e97c808b82a8d6d91c9da42f6c5422747cf Mon Sep 17 00:00:00 2001 +From: Matthew Burket +Date: Mon, 11 Oct 2021 11:33:13 -0500 +Subject: [PATCH 4/4] Fix regex on rsyslog_remote_loghost + +--- + .../rsyslog_remote_loghost/oval/shared.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/linux_os/guide/system/logging/rsyslog_sending_messages/rsyslog_remote_loghost/oval/shared.xml b/linux_os/guide/system/logging/rsyslog_sending_messages/rsyslog_remote_loghost/oval/shared.xml +index 7b5d4968886..0fdd24e18c2 100644 +--- a/linux_os/guide/system/logging/rsyslog_sending_messages/rsyslog_remote_loghost/oval/shared.xml ++++ b/linux_os/guide/system/logging/rsyslog_sending_messages/rsyslog_remote_loghost/oval/shared.xml +@@ -39,7 +39,7 @@ + + + /etc/rsyslog.d +- *.conf ++ ^.+\.conf$ + ^\*\.\*[\s]+(?:@|\:omrelp\:) + 1 + diff --git a/SOURCES/scap-security-guide-0.1.59-fix_accounts_umask_interactive_users-PR_7898.patch b/SOURCES/scap-security-guide-0.1.59-fix_accounts_umask_interactive_users-PR_7898.patch new file mode 100644 index 0000000..e61643e --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.59-fix_accounts_umask_interactive_users-PR_7898.patch @@ -0,0 +1,51 @@ +From f74121fc8b4074854e7cd96cc276711e80b54131 Mon Sep 17 00:00:00 2001 +From: Marcus Burghardt +Date: Thu, 18 Nov 2021 10:23:10 +0100 +Subject: [PATCH] Fix remediation for accounts_umask_interactive_users + +Included logic to ensure sed command considers only hidden files, +ignoring possible hidden folders. +--- + .../accounts_umask_interactive_users/ansible/shared.yml | 4 +++- + .../accounts_umask_interactive_users/bash/shared.sh | 4 +++- + .../tests/hidden_folder_ignored.pass.sh | 5 +++++ + 3 files changed, 11 insertions(+), 2 deletions(-) + create mode 100644 linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/tests/hidden_folder_ignored.pass.sh + +diff --git a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/ansible/shared.yml b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/ansible/shared.yml +index 142f10a2157..67064ac4a3b 100644 +--- a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/ansible/shared.yml ++++ b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/ansible/shared.yml +@@ -8,5 +8,7 @@ + ansible.builtin.shell: + cmd: | + for dir in $(awk -F':' '{ if ($3 >= {{{ uid_min }}} && $3 != 65534) print $6}' /etc/passwd); do +- sed -i 's/^\([\s]*umask\s*\)/#\1/g' $dir/.[^\.]?* ++ for file in $(find $dir -maxdepth 1 -type f -name ".*"); do ++ sed -i 's/^\([\s]*umask\s*\)/#\1/g' $file ++ done + done +diff --git a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/bash/shared.sh b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/bash/shared.sh +index 0644b221df8..f81fdfe41fd 100644 +--- a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/bash/shared.sh ++++ b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/bash/shared.sh +@@ -5,5 +5,7 @@ + # disruption = low + + for dir in $(awk -F':' '{ if ($3 >= {{{ uid_min }}} && $3 != 65534) print $6}' /etc/passwd); do +- sed -i 's/^\([\s]*umask\s*\)/#\1/g' $dir/.[^\.]?* ++ for file in $(find $dir -maxdepth 1 -type f -name ".*"); do ++ sed -i 's/^\([\s]*umask\s*\)/#\1/g' $file ++ done + done +diff --git a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/tests/hidden_folder_ignored.pass.sh b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/tests/hidden_folder_ignored.pass.sh +new file mode 100644 +index 00000000000..b9e1b7519ef +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/tests/hidden_folder_ignored.pass.sh +@@ -0,0 +1,5 @@ ++#!/bin/bash ++ ++USER="cac_user" ++useradd -m $USER ++mkdir /home/$USER/.hiddenfolder diff --git a/SOURCES/scap-security-guide-0.1.59-multifile_templates-PR_7405.patch b/SOURCES/scap-security-guide-0.1.59-multifile_templates-PR_7405.patch new file mode 100644 index 0000000..f626da8 --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.59-multifile_templates-PR_7405.patch @@ -0,0 +1,759 @@ +commit 26f72c842ec184ed517fbf0d3224c421ad7cc9c6 +Author: Gabriel Becker +Date: Thu Feb 24 18:33:50 2022 +0100 + + Manual edited patch scap-security-guide-0.1.59-multifile_templates-PR_7405.patch. + +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/ansible/shared.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/ansible/shared.yml +deleted file mode 100644 +index f6f2ab4..0000000 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/ansible/shared.yml ++++ /dev/null +@@ -1,25 +0,0 @@ +-# platform = multi_platform_sle,Red Hat Enterprise Linux 8,multi_platform_fedora +-# reboot = false +-# strategy = restrict +-# complexity = medium +-# disruption = medium +-- name: "Read list libraries without root ownership" +- find: +- paths: +- - "/usr/lib" +- - "/usr/lib64" +- - "/lib" +- - "/lib64" +- file_type: "directory" +- register: library_dirs_not_group_owned_by_root +- +-- name: "Set group ownership of system library dirs to root" +- file: +- path: "{{ item.path }}" +- group: "root" +- state: "directory" +- mode: "{{ item.mode }}" +- with_items: "{{ library_dirs_not_group_owned_by_root.files }}" +- when: +- - library_dirs_not_group_owned_by_root.matched > 0 +- - item.gid != 0 +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/bash/shared.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/bash/shared.sh +deleted file mode 100644 +index 365b983..0000000 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/bash/shared.sh ++++ /dev/null +@@ -1,7 +0,0 @@ +-# platform = multi_platform_sle,Red Hat Enterprise Linux 8,multi_platform_fedora +- +-find /lib \ +-/lib64 \ +-/usr/lib \ +-/usr/lib64 \ +-\! -group root -type d -exec chgrp root '{}' \; +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/oval/shared.xml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/oval/shared.xml +deleted file mode 100644 +index 3af60ff..0000000 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/oval/shared.xml ++++ /dev/null +@@ -1,27 +0,0 @@ +- +- +- {{{ oval_metadata(" +- Checks that /lib, /lib64, /usr/lib, /usr/lib64, /lib/modules, and +- directories therein, are group-owned by root. +- ") }}} +- +- +- +- +- +- +- +- +- +- +- +- (^\/lib(|64)\/|^\/usr\/lib(|64)\/) +- +- state_group_owner_library_dirs_not_root +- +- +- +- 0 +- +- +- +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/rule.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/rule.yml +index 8c0acc0..10203c9 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/rule.yml ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/rule.yml +@@ -1,6 +1,6 @@ + documentation_complete: true + +-prodtype: sle12,sle15,rhel8,fedora ++prodtype: fedora,rhel8,sle12,sle15,ubuntu2004 + + title: 'Verify that Shared Library Directories Have Root Group Ownership' + +@@ -40,6 +40,7 @@ references: + stigid@rhel8: RHEL-08-010350 + stigid@sle12: SLES-12-010876 + stigid@sle15: SLES-15-010356 ++ stigid@ubuntu2004: UBTU-20-010431 + + ocil_clause: 'any of these directories are not group-owned by root' + +@@ -52,3 +53,14 @@ ocil: |- + For each of these directories, run the following command to find files not + owned by root: +
$ sudo find -L $DIR ! -user root -type d -exec chgrp root {} \;
++ ++template: ++ name: file_groupowner ++ vars: ++ filepath: ++ - /lib/ ++ - /lib64/ ++ - /usr/lib/ ++ - /usr/lib64/ ++ recursive: 'true' ++ filegid: '0' +diff --git a/products/ubuntu2004/profiles/stig.profile b/products/ubuntu2004/profiles/stig.profile +index ac96858..4c76824 100644 +--- a/products/ubuntu2004/profiles/stig.profile ++++ b/products/ubuntu2004/profiles/stig.profile +@@ -470,6 +470,7 @@ selections: + # UBTU-20-010430 The Ubuntu operating system library files must be group-owned by root. + + # UBTU-20-010431 The Ubuntu operating system library directories must be group-owned by root. ++ - dir_group_ownership_library_dirs + + # UBTU-20-010432 The Ubuntu operating system must be configured to preserve log records from failure events. + - service_rsyslog_enabled +diff --git a/shared/templates/file_groupowner/ansible.template b/shared/templates/file_groupowner/ansible.template +index 073d356..68fc2e1 100644 +--- a/shared/templates/file_groupowner/ansible.template ++++ b/shared/templates/file_groupowner/ansible.template +@@ -4,33 +4,44 @@ + # complexity = low + # disruption = low + ++{{% for path in FILEPATH %}} + {{% if IS_DIRECTORY and FILE_REGEX %}} + +-- name: Find {{{ FILEPATH }}} file(s) matching {{{ FILE_REGEX }}} ++- name: Find {{{ path }}} file(s) matching {{{ FILE_REGEX[loop.index0] }}} + find: +- paths: "{{{ FILEPATH }}}" +- patterns: "{{{ FILE_REGEX }}}" ++ paths: "{{{ path }}}" ++ patterns: {{{ FILE_REGEX[loop.index0] }}} + use_regex: yes + register: files_found + +-- name: Ensure group owner on {{{ FILEPATH }}} file(s) matching {{{ FILE_REGEX }}} ++- name: Ensure group owner on {{{ path }}} file(s) matching {{{ FILE_REGEX[loop.index0] }}} + file: + path: "{{ item.path }}" + group: "{{{ FILEGID }}}" + with_items: + - "{{ files_found.files }}" + ++{{% elif IS_DIRECTORY and RECURSIVE %}} ++ ++- name: Ensure group owner on {{{ path }}} recursively ++ file: ++ path: "{{{ path }}}" ++ state: directory ++ recurse: yes ++ group: "{{{ FILEGID }}}" ++ + {{% else %}} + +-- name: Test for existence {{{ FILEPATH }}} ++- name: Test for existence {{{ path }}} + stat: +- path: "{{{ FILEPATH }}}" ++ path: "{{{ path }}}" + register: file_exists + +-- name: Ensure group owner {{{ FILEGID }}} on {{{ FILEPATH }}} ++- name: Ensure group owner {{{ FILEGID }}} on {{{ path }}} + file: +- path: "{{{ FILEPATH }}}" ++ path: "{{{ path }}}" + group: "{{{ FILEGID }}}" + when: file_exists.stat is defined and file_exists.stat.exists + + {{% endif %}} ++{{% endfor %}} +diff --git a/shared/templates/file_groupowner/bash.template b/shared/templates/file_groupowner/bash.template +index 442e015..982d2f3 100644 +--- a/shared/templates/file_groupowner/bash.template ++++ b/shared/templates/file_groupowner/bash.template +@@ -4,13 +4,17 @@ + # complexity = low + # disruption = low + ++{{% for path in FILEPATH %}} + {{% if IS_DIRECTORY and FILE_REGEX %}} +-readarray -t files < <(find {{{ FILEPATH }}}) ++readarray -t files < <(find {{{ path }}}) + for file in "${files[@]}"; do +- if basename $file | grep -q '{{{ FILE_REGEX }}}'; then ++ if basename $file | grep -qE '{{{ FILE_REGEX[loop.index0] }}}'; then + chgrp {{{ FILEGID }}} $file + fi + done ++{{% elif IS_DIRECTORY and RECURSIVE %}} ++find -L {{{ path }}} -type d -exec chgrp {{{ FILEGID }}} {} \; + {{% else %}} +-chgrp {{{ FILEGID }}} {{{ FILEPATH }}} ++chgrp {{{ FILEGID }}} {{{ path }}} + {{% endif %}} ++{{% endfor %}} +diff --git a/shared/templates/file_groupowner/oval.template b/shared/templates/file_groupowner/oval.template +index 1b637a6..fd2e5db 100644 +--- a/shared/templates/file_groupowner/oval.template ++++ b/shared/templates/file_groupowner/oval.template +@@ -1,8 +1,16 @@ + + ++ {{% if FILEPATH is not string %}} ++ {{{ oval_metadata("This test makes sure that FILEPATH is group owned by " + FILEGID + ".") }}} ++ ++ {{% for filepath in FILEPATH %}} ++ ++ {{% endfor %}} ++ {{% else %}} + {{{ oval_metadata("This test makes sure that " + FILEPATH + " is group owned by " + FILEGID + ".") }}} + + ++ {{% endif %}} + + + {{%- if MISSING_FILE_PASS -%}} +@@ -12,23 +20,31 @@ + {{# All defined files must exist. When using regex, at least one file must match #}} + {{% set FILE_EXISTENCE = "all_exist" %}} + {{%- endif -%}} +- +- +- ++ ++ ++ {{% for filepath in FILEPATH %}} ++ ++ ++ + +- ++ + {{{ FILEGID }}} + +- ++ + {{%- if IS_DIRECTORY -%}} +- {{{ FILEPATH }}} +- {{%- if FILE_REGEX -%}} +- {{{ FILE_REGEX }}} +- {{%- else -%}} +- +- {{%- endif -%}} +- {{%- else -%}} +- {{{ FILEPATH }}} +- {{%- endif -%}} ++ {{%- if FILE_REGEX %}} ++ {{{ filepath[:-1] }}} ++ {{{ FILE_REGEX[loop.index0] }}} ++ {{%- elif RECURSIVE %}} ++ {{{ filepath[:-1] }}} ++ ++ {{%- else %}} ++ {{{ filepath[:-1] }}} ++ ++ {{%- endif %}} ++ {{%- else %}} ++ {{{ filepath }}} ++ {{%- endif %}} + ++ {{% endfor %}} + +diff --git a/shared/templates/file_groupowner/template.py b/shared/templates/file_groupowner/template.py +index 2263ae8..10baed9 100644 +--- a/shared/templates/file_groupowner/template.py ++++ b/shared/templates/file_groupowner/template.py +@@ -1,12 +1,25 @@ +-from ssg.utils import parse_template_boolean_value ++from ssg.utils import parse_template_boolean_value, check_conflict_regex_directory + + def _file_owner_groupowner_permissions_regex(data): +- data["is_directory"] = data["filepath"].endswith("/") +- if "file_regex" in data and not data["is_directory"]: +- raise ValueError( +- "Used 'file_regex' key in rule '{0}' but filepath '{1}' does not " +- "specify a directory. Append '/' to the filepath or remove the " +- "'file_regex' key.".format(data["_rule_id"], data["filepath"])) ++ # this avoids code duplicates ++ if isinstance(data["filepath"], str): ++ data["filepath"] = [data["filepath"]] ++ ++ if "file_regex" in data: ++ # we can have a list of filepaths, but only one regex ++ # instead of declaring the same regex multiple times ++ if isinstance(data["file_regex"], str): ++ data["file_regex"] = [data["file_regex"]] * len(data["filepath"]) ++ ++ # if the length of filepaths and file_regex are not the same, then error. ++ # in case we have multiple regexes for just one filepath, than we need ++ # to declare that filepath multiple times ++ if len(data["filepath"]) != len(data["file_regex"]): ++ raise ValueError( ++ "You should have one file_path per file_regex. Please check " ++ "rule '{0}'".format(data["_rule_id"])) ++ ++ check_conflict_regex_directory(data) + + + def preprocess(data, lang): +@@ -14,6 +27,10 @@ def preprocess(data, lang): + + data["missing_file_pass"] = parse_template_boolean_value(data, parameter="missing_file_pass", default_value=False) + ++ data["recursive"] = parse_template_boolean_value(data, ++ parameter="recursive", ++ default_value=False) ++ + if lang == "oval": + data["fileid"] = data["_rule_id"].replace("file_groupowner", "") + return data +diff --git a/shared/templates/file_owner/ansible.template b/shared/templates/file_owner/ansible.template +index 6083fbe..80eaae8 100644 +--- a/shared/templates/file_owner/ansible.template ++++ b/shared/templates/file_owner/ansible.template +@@ -4,33 +4,44 @@ + # complexity = low + # disruption = low + ++{{% for path in FILEPATH %}} + {{% if IS_DIRECTORY and FILE_REGEX %}} + +-- name: Find {{{ FILEPATH }}} file(s) matching {{{ FILE_REGEX }}} ++- name: Find {{{ path }}} file(s) matching {{{ FILE_REGEX[loop.index0] }}} + find: +- paths: "{{{ FILEPATH }}}" +- patterns: "{{{ FILE_REGEX }}}" ++ paths: "{{{ path }}}" ++ patterns: {{{ FILE_REGEX[loop.index0] }}} + use_regex: yes + register: files_found + +-- name: Ensure group owner on {{{ FILEPATH }}} file(s) matching {{{ FILE_REGEX }}} ++- name: Ensure group owner on {{{ path }}} file(s) matching {{{ FILE_REGEX[loop.index0] }}} + file: + path: "{{ item.path }}" + owner: "{{{ FILEUID }}}" + with_items: + - "{{ files_found.files }}" + ++{{% elif IS_DIRECTORY and RECURSIVE %}} ++ ++- name: Ensure owner on {{{ path }}} recursively ++ file: ++ paths "{{{ path }}}" ++ state: directory ++ recurse: yes ++ owner: "{{{ FILEUID }}}" ++ + {{% else %}} + +-- name: Test for existence {{{ FILEPATH }}} ++- name: Test for existence {{{ path }}} + stat: +- path: "{{{ FILEPATH }}}" ++ path: "{{{ path }}}" + register: file_exists + +-- name: Ensure owner {{{ FILEUID }}} on {{{ FILEPATH }}} ++- name: Ensure owner {{{ FILEUID }}} on {{{ path }}} + file: +- path: "{{{ FILEPATH }}}" ++ path: "{{{ path }}}" + owner: "{{{ FILEUID }}}" + when: file_exists.stat is defined and file_exists.stat.exists + + {{% endif %}} ++{{% endfor %}} +diff --git a/shared/templates/file_owner/bash.template b/shared/templates/file_owner/bash.template +index 16025b7..27b5a2a 100644 +--- a/shared/templates/file_owner/bash.template ++++ b/shared/templates/file_owner/bash.template +@@ -4,13 +4,17 @@ + # complexity = low + # disruption = low + ++{{% for path in FILEPATH %}} + {{% if IS_DIRECTORY and FILE_REGEX %}} +-readarray -t files < <(find {{{ FILEPATH }}}) ++readarray -t files < <(find {{{ path }}}) + for file in "${files[@]}"; do +- if basename $file | grep -q '{{{ FILE_REGEX }}}'; then ++ if basename $file | grep -qE '{{{ FILE_REGEX[loop.index0] }}}'; then + chown {{{ FILEUID }}} $file + fi + done ++{{% elif IS_DIRECTORY and RECURSIVE %}} ++find -L {{{ path }}} -type d -exec chown {{{ FILEUID }}} {} \; + {{% else %}} +-chown {{{ FILEUID }}} {{{ FILEPATH }}} ++chown {{{ FILEUID }}} {{{ path }}} + {{% endif %}} ++{{% endfor %}} +diff --git a/shared/templates/file_owner/oval.template b/shared/templates/file_owner/oval.template +index 23ac161..105e29c 100644 +--- a/shared/templates/file_owner/oval.template ++++ b/shared/templates/file_owner/oval.template +@@ -1,8 +1,16 @@ + + ++ {{% if FILEPATH is not string %}} ++ {{{ oval_metadata("This test makes sure that FILEPATH is owned by " + FILEUID + ".") }}} ++ ++ {{% for filepath in FILEPATH %}} ++ ++ {{% endfor %}} ++ {{% else %}} + {{{ oval_metadata("This test makes sure that " + FILEPATH + " is owned by " + FILEUID + ".") }}} + + ++ {{% endif %}} + + + {{%- if MISSING_FILE_PASS -%}} +@@ -12,23 +20,30 @@ + {{# All defined files must exist. When using regex, at least one file must match #}} + {{% set FILE_EXISTENCE = "all_exist" %}} + {{%- endif -%}} +- +- +- ++ ++ {{% for filepath in FILEPATH %}} ++ ++ ++ + +- ++ + {{{ FILEUID }}} + +- ++ + {{%- if IS_DIRECTORY -%}} +- {{{ FILEPATH }}} +- {{%- if FILE_REGEX -%}} +- {{{ FILE_REGEX }}} +- {{%- else -%}} +- +- {{%- endif -%}} +- {{%- else -%}} +- {{{ FILEPATH }}} +- {{%- endif -%}} ++ {{%- if FILE_REGEX %}} ++ {{{ filepath[:-1] }}} ++ {{{ FILE_REGEX[loop.index0] }}} ++ {{%- elif RECURSIVE %}} ++ {{{ filepath[:-1] }}} ++ ++ {{%- else %}} ++ {{{ filepath[:-1] }}} ++ ++ {{%- endif %}} ++ {{%- else %}} ++ {{{ filepath }}} ++ {{%- endif %}} + ++ {{% endfor %}} + +diff --git a/shared/templates/file_owner/template.py b/shared/templates/file_owner/template.py +index 0dd0008..1391dcf 100644 +--- a/shared/templates/file_owner/template.py ++++ b/shared/templates/file_owner/template.py +@@ -1,12 +1,25 @@ +-from ssg.utils import parse_template_boolean_value ++from ssg.utils import parse_template_boolean_value, check_conflict_regex_directory + + def _file_owner_groupowner_permissions_regex(data): +- data["is_directory"] = data["filepath"].endswith("/") +- if "file_regex" in data and not data["is_directory"]: +- raise ValueError( +- "Used 'file_regex' key in rule '{0}' but filepath '{1}' does not " +- "specify a directory. Append '/' to the filepath or remove the " +- "'file_regex' key.".format(data["_rule_id"], data["filepath"])) ++ # this avoids code duplicates ++ if isinstance(data["filepath"], str): ++ data["filepath"] = [data["filepath"]] ++ ++ if "file_regex" in data: ++ # we can have a list of filepaths, but only one regex ++ # instead of declaring the same regex multiple times ++ if isinstance(data["file_regex"], str): ++ data["file_regex"] = [data["file_regex"]] * len(data["filepath"]) ++ ++ # if the length of filepaths and file_regex are not the same, then error. ++ # in case we have multiple regexes for just one filepath, than we need ++ # to declare that filepath multiple times ++ if len(data["filepath"]) != len(data["file_regex"]): ++ raise ValueError( ++ "You should have one file_path per file_regex. Please check " ++ "rule '{0}'".format(data["_rule_id"])) ++ ++ check_conflict_regex_directory(data) + + + def preprocess(data, lang): +@@ -14,6 +27,10 @@ def preprocess(data, lang): + + data["missing_file_pass"] = parse_template_boolean_value(data, parameter="missing_file_pass", default_value=False) + ++ data["recursive"] = parse_template_boolean_value(data, ++ parameter="recursive", ++ default_value=False) ++ + if lang == "oval": + data["fileid"] = data["_rule_id"].replace("file_owner", "") + return data +diff --git a/shared/templates/file_permissions/ansible.template b/shared/templates/file_permissions/ansible.template +index 029d03f..fc211bd 100644 +--- a/shared/templates/file_permissions/ansible.template ++++ b/shared/templates/file_permissions/ansible.template +@@ -3,33 +3,45 @@ + # strategy = configure + # complexity = low + # disruption = low ++ ++{{% for path in FILEPATH %}} + {{% if IS_DIRECTORY and FILE_REGEX %}} + +-- name: Find {{{ FILEPATH }}} file(s) ++- name: Find {{{ path }}} file(s) + find: +- paths: "{{{ FILEPATH }}}" +- patterns: "{{{ FILE_REGEX }}}" ++ paths: "{{{ path }}}" ++ patterns: {{{ FILE_REGEX[loop.index0] }}} + use_regex: yes + register: files_found + +-- name: Set permissions for {{{ FILEPATH }}} file(s) ++- name: Set permissions for {{{ path }}} file(s) + file: + path: "{{ item.path }}" + mode: "{{{ FILEMODE }}}" + with_items: + - "{{ files_found.files }}" + ++{{% elif IS_DIRECTORY and RECURSIVE %}} ++ ++- name: Set permissions for {{{ path }}} recursively ++ file: ++ path: "{{{ path }}}" ++ state: directory ++ recurse: yes ++ mode: "{{{ FILEMODE }}}" ++ + {{% else %}} + +-- name: Test for existence {{{ FILEPATH }}} ++- name: Test for existence {{{ path }}} + stat: +- path: "{{{ FILEPATH }}}" ++ path: "{{{ path }}}" + register: file_exists + +-- name: Ensure permission {{{ FILEMODE }}} on {{{ FILEPATH }}} ++- name: Ensure permission {{{ FILEMODE }}} on {{{ path }}} + file: +- path: "{{{ FILEPATH }}}" ++ path: "{{{ path }}}" + mode: "{{{ FILEMODE }}}" + when: file_exists.stat is defined and file_exists.stat.exists + + {{% endif %}} ++{{% endfor %}} +diff --git a/shared/templates/file_permissions/bash.template b/shared/templates/file_permissions/bash.template +index af9cf4e..e0d8fe9 100644 +--- a/shared/templates/file_permissions/bash.template ++++ b/shared/templates/file_permissions/bash.template +@@ -4,13 +4,17 @@ + # complexity = low + # disruption = low + ++{{% for path in FILEPATH %}} + {{% if IS_DIRECTORY and FILE_REGEX %}} +-readarray -t files < <(find {{{ FILEPATH }}}) ++readarray -t files < <(find {{{ path }}}) + for file in "${files[@]}"; do +- if basename $file | grep -q '{{{ FILE_REGEX }}}'; then ++ if basename $file | grep -qE '{{{ FILE_REGEX[loop.index0] }}}'; then + chmod {{{ FILEMODE }}} $file + fi + done ++{{% elif IS_DIRECTORY and RECURSIVE %}} ++find -L {{{ path }}} -type d -exec chmod {{{ FILEMODE }}} {} \; + {{% else %}} +-chmod {{{ FILEMODE }}} {{{ FILEPATH }}} ++chmod {{{ FILEMODE }}} {{{ path }}} + {{% endif %}} ++{{% endfor %}} +diff --git a/shared/templates/file_permissions/oval.template b/shared/templates/file_permissions/oval.template +index f570ff8..89083e8 100644 +--- a/shared/templates/file_permissions/oval.template ++++ b/shared/templates/file_permissions/oval.template +@@ -16,31 +16,47 @@ + {{%- endif -%}} + + +- {{{ oval_metadata("This test makes sure that " + FILEPATH + " has mode " + FILEMODE + ". ++ {{% if FILEPATH is not string %}} ++ {{{ oval_metadata("This test makes sure that FILEPATH has mode " + FILEMODE + ". ++ If the target file or directory has an extended ACL, then it will fail the mode check. ++ ") }}} ++ ++ {{% for filepath in FILEPATH %}} ++ ++ {{% endfor %}} ++ {{% else %}} ++ {{{ oval_metadata("This test makes sure that " + FILEPATH + " has mode " + FILEMODE + ". + If the target file or directory has an extended ACL, then it will fail the mode check. + ") }}} + + ++ {{% endif %}} + + +- +- +- +- +- ++ ++ {{% for filepath in FILEPATH %}} ++ ++ ++ ++ ++ + {{{ STATEMODE | indent(6) }}} +- +- ++ ++ + + {{%- if IS_DIRECTORY %}} +- {{{ FILEPATH }}} + {{%- if FILE_REGEX %}} +- {{{ FILE_REGEX }}} ++ {{{ filepath[:-1] }}} ++ {{{ FILE_REGEX[loop.index0] }}} ++ {{%- elif RECURSIVE %}} ++ {{{ filepath[:-1] }}} ++ + {{%- else %}} ++ {{{ filepath[:-1] }}} + + {{%- endif %}} + {{%- else %}} +- {{{ FILEPATH }}} ++ {{{ filepath }}} + {{%- endif %}} + + {{%- if ALLOW_STRICTER_PERMISSIONS %}} +@@ -49,8 +65,8 @@ + https://github.com/OpenSCAP/openscap/pull/1709 but this line should be kept until the + fix is widely available. The fix is expected to be part of OpenSCAP >= 1.3.5. + #}} +- state_file_permissions{{{ FILEID }}}_mode_not_{{{ FILEMODE }}} ++ state_file_permissions{{{ FILEID }}}_{{{ loop.index0 }}}_mode_not_{{{ FILEMODE }}} + {{%- endif %}} +- +- ++ ++ {{% endfor %}} + +diff --git a/shared/templates/file_permissions/template.py b/shared/templates/file_permissions/template.py +index 677e083..6e20a62 100644 +--- a/shared/templates/file_permissions/template.py ++++ b/shared/templates/file_permissions/template.py +@@ -1,12 +1,25 @@ +-from ssg.utils import parse_template_boolean_value ++from ssg.utils import parse_template_boolean_value, check_conflict_regex_directory + + def _file_owner_groupowner_permissions_regex(data): +- data["is_directory"] = data["filepath"].endswith("/") +- if "file_regex" in data and not data["is_directory"]: +- raise ValueError( +- "Used 'file_regex' key in rule '{0}' but filepath '{1}' does not " +- "specify a directory. Append '/' to the filepath or remove the " +- "'file_regex' key.".format(data["_rule_id"], data["filepath"])) ++ # this avoids code duplicates ++ if isinstance(data["filepath"], str): ++ data["filepath"] = [data["filepath"]] ++ ++ if "file_regex" in data: ++ # we can have a list of filepaths, but only one regex ++ # instead of declaring the same regex multiple times ++ if isinstance(data["file_regex"], str): ++ data["file_regex"] = [data["file_regex"]] * len(data["filepath"]) ++ ++ # if the length of filepaths and file_regex are not the same, then error. ++ # in case we have multiple regexes for just one filepath, than we need ++ # to declare that filepath multiple times ++ if len(data["filepath"]) != len(data["file_regex"]): ++ raise ValueError( ++ "You should have one file_path per file_regex. Please check " ++ "rule '{0}'".format(data["_rule_id"])) ++ ++ check_conflict_regex_directory(data) + + + def preprocess(data, lang): +@@ -16,6 +29,10 @@ def preprocess(data, lang): + + data["missing_file_pass"] = parse_template_boolean_value(data, parameter="missing_file_pass", default_value=False) + ++ data["recursive"] = parse_template_boolean_value(data, ++ parameter="recursive", ++ default_value=False) ++ + if lang == "oval": + data["fileid"] = data["_rule_id"].replace("file_permissions", "") + # build the state that describes our mode +diff --git a/ssg/utils.py b/ssg/utils.py +index b0ded09..2248b1e 100644 +--- a/ssg/utils.py ++++ b/ssg/utils.py +@@ -303,3 +303,25 @@ def parse_template_boolean_value(data, parameter, default_value): + raise ValueError( + "Template parameter {} used in rule {} cannot accept the " + "value {}".format(parameter, data["_rule_id"], value)) ++ ++ ++def check_conflict_regex_directory(data): ++ """ ++ Validate that either all path are directories OR file_regex exists. ++ ++ Throws ValueError. ++ """ ++ for f in data["filepath"]: ++ if "is_directory" in data and data["is_directory"] != f.endswith("/"): ++ raise ValueError( ++ "If passing a list of filepaths, all of them need to be " ++ "either directories or files. Mixing is not possible. " ++ "Please fix rules '{0}' filepath '{1}'".format(data["_rule_id"], f)) ++ ++ data["is_directory"] = f.endswith("/") ++ ++ if "file_regex" in data and not data["is_directory"]: ++ raise ValueError( ++ "Used 'file_regex' key in rule '{0}' but filepath '{1}' does not " ++ "specify a directory. Append '/' to the filepath or remove the " ++ "'file_regex' key.".format(data["_rule_id"], f)) diff --git a/SOURCES/scap-security-guide-0.1.59-rsyslog_encrypt_offload_fix_7741-PR_7755.patch b/SOURCES/scap-security-guide-0.1.59-rsyslog_encrypt_offload_fix_7741-PR_7755.patch new file mode 100644 index 0000000..7291784 --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.59-rsyslog_encrypt_offload_fix_7741-PR_7755.patch @@ -0,0 +1,245 @@ +From b8fd95776ce894006163b2bb5e34682e5844ca1e Mon Sep 17 00:00:00 2001 +From: Matthew Burket +Date: Thu, 21 Oct 2021 14:43:51 -0500 +Subject: [PATCH 1/5] Always esacpe parameter in ansible_set_config_file + +--- + .../ansible/shared.yml | 5 +++-- + .../ansible/shared.yml | 5 +++-- + .../ansible/shared.yml | 5 +++-- + shared/macros-ansible.jinja | 17 ++++++++++------- + 4 files changed, 19 insertions(+), 13 deletions(-) + +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 +index 637f90003b2..ca5a405f877 100644 +--- 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 +@@ -5,5 +5,6 @@ + # disruption = low + + {{{ ansible_set_config_file_dir(msg, "/etc/rsyslog.conf", "/etc/rsyslog.d", "/etc/rsyslog.conf", +- "$ActionSendStreamDriverAuthMode", separator=' ', separator_regex='\s', +- value="x509/name", create='yes') }}} ++ "$ActionSendStreamDriverAuthMode", separator=' ', separator_regex='\s', ++ value="x509/name", create='yes') ++}}} +diff --git a/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdrivermode/ansible/shared.yml b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdrivermode/ansible/shared.yml +index 5d11103fc0f..1f001f47e07 100644 +--- a/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdrivermode/ansible/shared.yml ++++ b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_actionsendstreamdrivermode/ansible/shared.yml +@@ -4,6 +4,7 @@ + # complexity = low + # disruption = low + +-{{{ ansible_set_config_file(file="/etc/rsyslog.d/encrypt.conf", +- parameter="$ActionSendStreamDriverMode", value="1", create=true, separator=" ", separator_regex=" ") ++{{{ ansible_set_config_file_dir(msg, "/etc/rsyslog.conf", "/etc/rsyslog.d", "/etc/rsyslog.conf", ++ parameter="$ActionSendStreamDriverMode", value="1", create=true, separator=" ", ++ separator_regex=" ") + }}} +diff --git a/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_defaultnetstreamdriver/ansible/shared.yml b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_defaultnetstreamdriver/ansible/shared.yml +index 035ab152876..4016a08721e 100644 +--- a/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_defaultnetstreamdriver/ansible/shared.yml ++++ b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_defaultnetstreamdriver/ansible/shared.yml +@@ -4,6 +4,7 @@ + # complexity = low + # disruption = low + +-{{{ ansible_set_config_file(file="/etc/rsyslog.d/encrypt.conf", +- parameter="$DefaultNetstreamDriver", value="gtls", create=true, separator=" ", separator_regex=" ") ++{{{ ansible_set_config_file_dir(msg, "/etc/rsyslog.conf", "/etc/rsyslog.d", "/etc/rsyslog.conf", ++ parameter="$DefaultNetstreamDriver", value="gtls", create=true, separator=" " ++ , separator_regex=" ") + }}} +diff --git a/shared/macros-ansible.jinja b/shared/macros-ansible.jinja +index 563350743fe..0f8dba56dab 100644 +--- a/shared/macros-ansible.jinja ++++ b/shared/macros-ansible.jinja +@@ -25,14 +25,17 @@ value: "Setting={{ varname1 }}" + + Note that all string-like parameters are single quoted in the YAML. + #}} +-{{%- macro ansible_lineinfile(msg='', path='', regex='', new_line='', create='no', state='present', with_items='', register='', when='', validate='', insert_after='', insert_before='', check_mode=False) -%}} ++{{%- macro ansible_lineinfile(msg='', path='', regex='', new_line='', create='no', state='present', with_items='', register='', when='', validate='', insert_after='', insert_before='', check_mode=False, escape_regex=False) -%}} + - name: "{{{ msg or rule_title }}}" + lineinfile: + path: '{{{ path }}}' + create: {{{ create }}} +- {{%- if regex %}} ++ {{%- if regex and not escape_regex %}} + regexp: '{{{ regex }}}' + {{%- endif %}} ++ {{%- if regex and escape_regex %}} ++ regexp: '{{ {{{ regex }}} | regex_escape }}' ++ {{%- endif %}} + {{%- if state == 'present' %}} + line: '{{{ new_line }}}' + state: present +@@ -121,7 +124,7 @@ value: "Setting={{ varname1 }}" + ini configuration files are best served with the ini Ansible module + instead of lineinfile-based solutions. + #}} +-{{%- macro ansible_set_config_file(msg, file, parameter, separator=' ', separator_regex='\s+', value='', prefix_regex='^\s*', create='no', validate='', insert_after='', insert_before='') %}} ++{{%- macro ansible_set_config_file(msg, file, parameter, separator=' ', separator_regex='\s+', value='', prefix_regex='^\s*', create='no', validate='', insert_after='', insert_before='', escape_regex=False) %}} + {{{ ansible_only_lineinfile(msg, file, prefix_regex + parameter + separator_regex, parameter + separator + value, create=create, block=True, validate=validate, insert_after=insert_after, insert_before=insert_before) }}} + {{%- endmacro %}} + +@@ -143,12 +146,12 @@ value: "Setting={{ varname1 }}" + {{%- set new_line = parameter + separator + value -%}} + - name: '{{{ msg or rule_title }}}' + block: +- {{{ ansible_lineinfile("Check for duplicate values", config_file, regex=line_regex, create='no', state='absent', register='dupes', check_mode=True)|indent }}} +- {{{ ansible_lineinfile("Deduplicate values from " + config_file, config_file, regex=line_regex, create='no', state='absent', when='dupes.found is defined and dupes.found > 1')|indent }}} ++ {{{ ansible_lineinfile("Check for duplicate values", config_file, regex=line_regex, create='no', state='absent', register='dupes', check_mode=True, escape_regex=True)|indent }}} ++ {{{ ansible_lineinfile("Deduplicate values from " + config_file, config_file, regex=line_regex, create='no', state='absent', when='dupes.found is defined and dupes.found > 1', escape_regex=True)|indent }}} + {{{ ansible_stat("Check if " + config_dir + " exists", path=config_dir, register=dir_exists)|indent }}} + {{{ ansible_find("Check if the parameter " + parameter + " is present in " + config_dir, paths=config_dir, contains=line_regex, register=dir_parameter, when=find_when)|indent }}} +- {{{ ansible_lineinfile("Remove parameter from files in " + config_dir, path="{{ item.path }}", regex=line_regex, state="absent", with_items=lineinfile_items, when=lineinfile_when)|indent }}} +- {{{ ansible_lineinfile("Insert correct line to " + set_file, set_file, regex=line_regex, new_line=new_line, create=create, state='present', validate=validate, insert_after=insert_after, insert_before=insert_before)|indent }}} ++ {{{ ansible_lineinfile("Remove parameter from files in " + config_dir, path="{{ item.path }}", regex=line_regex, state="absent", with_items=lineinfile_items, when=lineinfile_when, escape_regex=True)|indent }}} ++ {{{ ansible_lineinfile("Insert correct line to " + set_file, set_file, regex=line_regex, new_line=new_line, create=create, state='present', validate=validate, insert_after=insert_after, insert_before=insert_before, escape_regex=True)|indent }}} + {{%- endmacro %}} + + {{# + +From 5635bf94c9274511e3d63feb8d4082c4ec9144f3 Mon Sep 17 00:00:00 2001 +From: Matthew Burket +Date: Tue, 26 Oct 2021 13:01:27 -0500 +Subject: [PATCH 2/5] Fix a couple items from reviewers on ansible_lineinfile + escaping + +--- + .../ansible/shared.yml | 4 ++-- + shared/macros-ansible.jinja | 3 +-- + 2 files changed, 3 insertions(+), 4 deletions(-) + +diff --git a/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_defaultnetstreamdriver/ansible/shared.yml b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_defaultnetstreamdriver/ansible/shared.yml +index 4016a08721e..3cc18d4476e 100644 +--- a/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_defaultnetstreamdriver/ansible/shared.yml ++++ b/linux_os/guide/system/logging/ensure_rsyslog_log_file_configuration/rsyslog_encrypt_offload_defaultnetstreamdriver/ansible/shared.yml +@@ -5,6 +5,6 @@ + # disruption = low + + {{{ ansible_set_config_file_dir(msg, "/etc/rsyslog.conf", "/etc/rsyslog.d", "/etc/rsyslog.conf", +- parameter="$DefaultNetstreamDriver", value="gtls", create=true, separator=" " +- , separator_regex=" ") ++ parameter="$DefaultNetstreamDriver", value="gtls", create=true, ++ separator=" ", separator_regex=" ") + }}} +diff --git a/shared/macros-ansible.jinja b/shared/macros-ansible.jinja +index 0f8dba56dab..752d220bbfc 100644 +--- a/shared/macros-ansible.jinja ++++ b/shared/macros-ansible.jinja +@@ -32,8 +32,7 @@ value: "Setting={{ varname1 }}" + create: {{{ create }}} + {{%- if regex and not escape_regex %}} + regexp: '{{{ regex }}}' +- {{%- endif %}} +- {{%- if regex and escape_regex %}} ++ {{%- elif regex and escape_regex %}} + regexp: '{{ {{{ regex }}} | regex_escape }}' + {{%- endif %}} + {{%- if state == 'present' %}} + +From f6541126a4d19bfef8752028467659ab9d9f74ed Mon Sep 17 00:00:00 2001 +From: Matthew Burket +Date: Tue, 2 Nov 2021 08:32:18 -0500 +Subject: [PATCH 3/5] Fix escaping in ansible_lineinfile macro + +--- + shared/macros-ansible.jinja | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/shared/macros-ansible.jinja b/shared/macros-ansible.jinja +index 752d220bbfc..1e0ba6260bb 100644 +--- a/shared/macros-ansible.jinja ++++ b/shared/macros-ansible.jinja +@@ -33,7 +33,7 @@ value: "Setting={{ varname1 }}" + {{%- if regex and not escape_regex %}} + regexp: '{{{ regex }}}' + {{%- elif regex and escape_regex %}} +- regexp: '{{ {{{ regex }}} | regex_escape }}' ++ regexp: {{{ regex }}} | regex_escape + {{%- endif %}} + {{%- if state == 'present' %}} + line: '{{{ new_line }}}' + +From ef6d300a707dc272eaa9442ece135009287bfdf5 Mon Sep 17 00:00:00 2001 +From: Matthew Burket +Date: Wed, 3 Nov 2021 11:15:11 -0500 +Subject: [PATCH 4/5] Move regex_escape to ansible_set_config_file_dir + +--- + shared/macros-ansible.jinja | 16 +++++++--------- + 1 file changed, 7 insertions(+), 9 deletions(-) + +diff --git a/shared/macros-ansible.jinja b/shared/macros-ansible.jinja +index 1e0ba6260bb..8e7ce1a1206 100644 +--- a/shared/macros-ansible.jinja ++++ b/shared/macros-ansible.jinja +@@ -25,15 +25,13 @@ value: "Setting={{ varname1 }}" + + Note that all string-like parameters are single quoted in the YAML. + #}} +-{{%- macro ansible_lineinfile(msg='', path='', regex='', new_line='', create='no', state='present', with_items='', register='', when='', validate='', insert_after='', insert_before='', check_mode=False, escape_regex=False) -%}} ++{{%- macro ansible_lineinfile(msg='', path='', regex='', new_line='', create='no', state='present', with_items='', register='', when='', validate='', insert_after='', insert_before='', check_mode=False) -%}} + - name: "{{{ msg or rule_title }}}" + lineinfile: + path: '{{{ path }}}' + create: {{{ create }}} +- {{%- if regex and not escape_regex %}} ++ {{%- if regex %}} + regexp: '{{{ regex }}}' +- {{%- elif regex and escape_regex %}} +- regexp: {{{ regex }}} | regex_escape + {{%- endif %}} + {{%- if state == 'present' %}} + line: '{{{ new_line }}}' +@@ -138,19 +136,19 @@ value: "Setting={{ varname1 }}" + {{%- set var_dir = config_dir | replace("/", "_") | replace("-", "_") | replace(".", "_") -%}} + {{%- set dir_exists = var_dir + "_exists" -%}} + {{%- set dir_parameter = var_dir + "_has_parameter" -%}} +-{{%- set line_regex = prefix_regex + parameter + separator_regex -%}} ++{{%- set line_regex = prefix_regex + "{{\"" + parameter + "\"| regex_escape }}" + separator_regex -%}} + {{%- set find_when = dir_exists + ".stat.isdir is defined and " + dir_exists + ".stat.isdir" -%}} + {{%- set lineinfile_items = "{{ " + dir_parameter + ".files }}" -%}} + {{%- set lineinfile_when = dir_parameter + ".matched" -%}} + {{%- set new_line = parameter + separator + value -%}} + - name: '{{{ msg or rule_title }}}' + block: +- {{{ ansible_lineinfile("Check for duplicate values", config_file, regex=line_regex, create='no', state='absent', register='dupes', check_mode=True, escape_regex=True)|indent }}} +- {{{ ansible_lineinfile("Deduplicate values from " + config_file, config_file, regex=line_regex, create='no', state='absent', when='dupes.found is defined and dupes.found > 1', escape_regex=True)|indent }}} ++ {{{ ansible_lineinfile("Check for duplicate values", config_file, regex=line_regex, create='no', state='absent', register='dupes', check_mode=True)|indent }}} ++ {{{ ansible_lineinfile("Deduplicate values from " + config_file, config_file, regex=line_regex, create='no', state='absent', when='dupes.found is defined and dupes.found > 1')|indent }}} + {{{ ansible_stat("Check if " + config_dir + " exists", path=config_dir, register=dir_exists)|indent }}} + {{{ ansible_find("Check if the parameter " + parameter + " is present in " + config_dir, paths=config_dir, contains=line_regex, register=dir_parameter, when=find_when)|indent }}} +- {{{ ansible_lineinfile("Remove parameter from files in " + config_dir, path="{{ item.path }}", regex=line_regex, state="absent", with_items=lineinfile_items, when=lineinfile_when, escape_regex=True)|indent }}} +- {{{ ansible_lineinfile("Insert correct line to " + set_file, set_file, regex=line_regex, new_line=new_line, create=create, state='present', validate=validate, insert_after=insert_after, insert_before=insert_before, escape_regex=True)|indent }}} ++ {{{ ansible_lineinfile("Remove parameter from files in " + config_dir, path="{{ item.path }}", regex=line_regex, state="absent", with_items=lineinfile_items, when=lineinfile_when)|indent }}} ++ {{{ ansible_lineinfile("Insert correct line to " + set_file, set_file, regex=line_regex, new_line=new_line, create=create, state='present', validate=validate, insert_after=insert_after, insert_before=insert_before)|indent }}} + {{%- endmacro %}} + + {{# + +From c29550ef26fc283ce5e72038fddf70aa716f4d1c Mon Sep 17 00:00:00 2001 +From: Matthew Burket +Date: Thu, 4 Nov 2021 08:53:42 -0500 +Subject: [PATCH 5/5] Fix ansible-lint lint issues + +--- + shared/macros-ansible.jinja | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/shared/macros-ansible.jinja b/shared/macros-ansible.jinja +index 8e7ce1a1206..76f05e76b88 100644 +--- a/shared/macros-ansible.jinja ++++ b/shared/macros-ansible.jinja +@@ -136,7 +136,7 @@ value: "Setting={{ varname1 }}" + {{%- set var_dir = config_dir | replace("/", "_") | replace("-", "_") | replace(".", "_") -%}} + {{%- set dir_exists = var_dir + "_exists" -%}} + {{%- set dir_parameter = var_dir + "_has_parameter" -%}} +-{{%- set line_regex = prefix_regex + "{{\"" + parameter + "\"| regex_escape }}" + separator_regex -%}} ++{{%- set line_regex = prefix_regex + "{{ \"" + parameter + "\"| regex_escape }}" + separator_regex -%}} + {{%- set find_when = dir_exists + ".stat.isdir is defined and " + dir_exists + ".stat.isdir" -%}} + {{%- set lineinfile_items = "{{ " + dir_parameter + ".files }}" -%}} + {{%- set lineinfile_when = dir_parameter + ".matched" -%}} diff --git a/SOURCES/scap-security-guide-0.1.59-sshd_priv_keys_600-PR_7742.patch b/SOURCES/scap-security-guide-0.1.59-sshd_priv_keys_600-PR_7742.patch new file mode 100644 index 0000000..eb8b661 --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.59-sshd_priv_keys_600-PR_7742.patch @@ -0,0 +1,71 @@ +From a5cce64337e8b8617f3bf3ee1311e80d652754ea Mon Sep 17 00:00:00 2001 +From: Gabriel Becker +Date: Thu, 14 Oct 2021 12:12:16 +0200 +Subject: [PATCH] Set sshd priv keys permissions 600 for all products. + +--- + .../file_permissions_sshd_private_key/rule.yml | 15 +++------------ + .../tests/correct_value.pass.sh | 8 +------- + .../tests/multiple_keys.fail.sh | 2 +- + 4 files changed, 7 insertions(+), 21 deletions(-) + +diff --git a/linux_os/guide/services/ssh/file_permissions_sshd_private_key/rule.yml b/linux_os/guide/services/ssh/file_permissions_sshd_private_key/rule.yml +index bda7ae4d53b..ddda4075e21 100644 +--- a/linux_os/guide/services/ssh/file_permissions_sshd_private_key/rule.yml ++++ b/linux_os/guide/services/ssh/file_permissions_sshd_private_key/rule.yml +@@ -3,11 +3,7 @@ documentation_complete: true + title: 'Verify Permissions on SSH Server Private *_key Key Files' + + description: |- +- {{% if product in ['ubuntu1804','opensuse', 'sle12', 'sle15'] %}} + {{{ describe_file_permissions(file="/etc/ssh/*_key", perms="0600") }}} +- {{% else %}} +- {{{ describe_file_permissions(file="/etc/ssh/*_key", perms="0640") }}} +- {{% endif %}} + + rationale: |- + If an unauthorized user obtains the private SSH host key file, the host could be +@@ -45,10 +41,10 @@ references: + stigid@sle12: SLES-12-030220 + stigid@sle15: SLES-15-040250 + +-ocil_clause: '{{{ ocil_clause_file_permissions(file="/etc/ssh/*_key", perms="-rw-r-----") }}}' ++ocil_clause: '{{{ ocil_clause_file_permissions(file="/etc/ssh/*_key", perms="-rw-------") }}}' + + ocil: |- +- {{{ ocil_file_permissions(file="/etc/ssh/*_key", perms="-rw-r-----") }}} ++ {{{ ocil_file_permissions(file="/etc/ssh/*_key", perms="-rw-------") }}} + + template: + name: file_permissions +@@ -56,9 +52,4 @@ template: + filepath: /etc/ssh/ + missing_file_pass: 'true' + file_regex: ^.*_key$ +- filemode: '0640' +- filemode@sle12: '0600' +- filemode@sle15: '0600' +- filemode@ubuntu1604: '0600' +- filemode@ubuntu1804: '0600' +- filemode@ubuntu2004: '0600' ++ filemode: '0600' +diff --git a/linux_os/guide/services/ssh/file_permissions_sshd_private_key/tests/correct_value.pass.sh b/linux_os/guide/services/ssh/file_permissions_sshd_private_key/tests/correct_value.pass.sh +index 5790a48..f7cf8d9 100644 +--- a/linux_os/guide/services/ssh/file_permissions_sshd_private_key/tests/correct_value.pass.sh ++++ b/linux_os/guide/services/ssh/file_permissions_sshd_private_key/tests/correct_value.pass.sh +@@ -2,4 +2,4 @@ + # + + FAKE_KEY=$(mktemp -p /etc/ssh/ XXXX_key) +-chmod 0640 /etc/ssh/*_key ++chmod 0600 /etc/ssh/*_key +diff --git a/linux_os/guide/services/ssh/file_permissions_sshd_private_key/tests/multiple_keys.fail.sh b/linux_os/guide/services/ssh/file_permissions_sshd_private_key/tests/multiple_keys.fail.sh +index 6df9d61b715..7c0d6019702 100644 +--- a/linux_os/guide/services/ssh/file_permissions_sshd_private_key/tests/multiple_keys.fail.sh ++++ b/linux_os/guide/services/ssh/file_permissions_sshd_private_key/tests/multiple_keys.fail.sh +@@ -4,4 +4,4 @@ + FAKE_KEY=$(mktemp -p /etc/ssh/ XXXX_key) + chmod 0777 $FAKE_KEY + FAKE_KEY2=$(mktemp -p /etc/ssh/ XXXX_key) +-chmod 0640 $FAKE_KEY2 ++chmod 0600 $FAKE_KEY2 diff --git a/SOURCES/scap-security-guide-0.1.60-address_pool_directives_maxpoll_rule-PR_7910.patch b/SOURCES/scap-security-guide-0.1.60-address_pool_directives_maxpoll_rule-PR_7910.patch new file mode 100644 index 0000000..1b90441 --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.60-address_pool_directives_maxpoll_rule-PR_7910.patch @@ -0,0 +1,195 @@ +From bac8ca5091aa74eab66691fcb7a6ac0c944de9c6 Mon Sep 17 00:00:00 2001 +From: Gabriel Becker +Date: Wed, 23 Mar 2022 17:50:18 +0100 +Subject: [PATCH] Manually edited patch + scap-security-guide-0.1.60-address_pool_directives_maxpoll_rule-PR_7910.patch. + +--- + .../chronyd_or_ntpd_set_maxpoll/ansible/shared.yml | 6 +++--- + .../ntp/chronyd_or_ntpd_set_maxpoll/bash/shared.sh | 6 +++--- + .../chronyd_or_ntpd_set_maxpoll/oval/shared.xml | 4 ++-- + .../ntp/chronyd_or_ntpd_set_maxpoll/rule.yml | 4 +++- + .../tests/chrony.pass.sh | 3 +++ + .../tests/chrony_one_pool_configured.pass.sh | 14 ++++++++++++++ + .../tests/chrony_one_pool_misconfigured.fail.sh | 14 ++++++++++++++ + .../chrony_one_pool_missing_parameter.fail.sh | 14 ++++++++++++++ + .../tests/chrony_one_server_misconfigured.fail.sh | 3 +++ + 9 files changed, 59 insertions(+), 9 deletions(-) + create mode 100644 linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/tests/chrony_one_pool_configured.pass.sh + create mode 100644 linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/tests/chrony_one_pool_misconfigured.fail.sh + create mode 100644 linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/tests/chrony_one_pool_missing_parameter.fail.sh + +diff --git a/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/ansible/shared.yml b/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/ansible/shared.yml +index 3c83850..da0a622 100644 +--- a/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/ansible/shared.yml ++++ b/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/ansible/shared.yml +@@ -1,4 +1,4 @@ +-# platform = multi_platform_sle ++# platform = multi_platform_sle,multi_platform_rhel + # reboot = false + # strategy = restrict + # complexity = low +@@ -27,7 +27,7 @@ + - name: Update the maxpoll values in /etc/chrony.conf + lineinfile: + path: /etc/chrony.conf +- regex: '^(server.*maxpoll) [0-9]+(\s+.*)$' ++ regex: '^((?:server|pool).*maxpoll) [0-9]+(\s+.*)$' + line: '\1 {{ var_time_service_set_maxpoll }}\2' + backrefs: yes + when: chrony_conf_exist_result.stat.exists +@@ -43,7 +43,7 @@ + - name: Set the maxpoll values in /etc/chrony.conf + lineinfile: + path: /etc/chrony.conf +- regex: '(^server\s+((?!maxpoll).)*)$' ++ regex: '(^(?:server|pool)\s+((?!maxpoll).)*)$' + line: '\1 maxpoll {{ var_time_service_set_maxpoll }}\n' + backrefs: yes + when: chrony_conf_exist_result.stat.exists +diff --git a/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/bash/shared.sh b/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/bash/shared.sh +index b23deff..54b1b73 100644 +--- a/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/bash/shared.sh ++++ b/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/bash/shared.sh +@@ -8,9 +8,9 @@ config_file="/etc/ntp.conf" + + + # Set maxpoll values to var_time_service_set_maxpoll +-sed -i "s/^\(server.*maxpoll\) [0-9][0-9]*\(.*\)$/\1 $var_time_service_set_maxpoll \2/" "$config_file" ++sed -i "s/^\(\(server\|pool\).*maxpoll\) [0-9][0-9]*\(.*\)$/\1 $var_time_service_set_maxpoll \3/" "$config_file" + +-# Add maxpoll to server entries without maxpoll +-grep "^server" "$config_file" | grep -v maxpoll | while read -r line ; do ++# Add maxpoll to server or pool entries without maxpoll ++grep "^\(server\|pool\)" "$config_file" | grep -v maxpoll | while read -r line ; do + sed -i "s/$line/& maxpoll $var_time_service_set_maxpoll/" "$config_file" + done +diff --git a/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/oval/shared.xml b/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/oval/shared.xml +index 25a8589..76f8101 100644 +--- a/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/oval/shared.xml ++++ b/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/oval/shared.xml +@@ -46,7 +46,7 @@ + + + ^/etc/chrony\.(conf|d/.+\.conf)$ +- ^server[\s]+[\S]+.*maxpoll[\s]+(\d+) ++ ^(?:server|pool)[\s]+[\S]+.*maxpoll[\s]+(\d+) + 1 + + +@@ -77,7 +77,7 @@ + + + ^/etc/chrony\.(conf|d/.+\.conf)$ +- ^server[\s]+[\S]+[\s]+(.*) ++ ^(?:server|pool)[\s]+[\S]+[\s]+(.*) + 1 + + +diff --git a/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/rule.yml b/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/rule.yml +index 77af724..bd5150b 100644 +--- a/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/rule.yml ++++ b/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/rule.yml +@@ -9,8 +9,10 @@ description: |- + {{{ xccdf_value("var_time_service_set_maxpoll") }}} in /etc/ntp.conf or + /etc/chrony.conf to continuously poll time servers. To configure + maxpoll in /etc/ntp.conf or /etc/chrony.conf +- add the following: ++ add the following after each `server` or `pool` entry: +
maxpoll {{{ xccdf_value("var_time_service_set_maxpoll") }}}
++ to
server
directives. If using chrony any
pool
directives ++ should be configured too. + If no server or pool directives are configured, the rule evaluates + to pass. + {{% if product == "rhcos4" %}} +diff --git a/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/tests/chrony.pass.sh b/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/tests/chrony.pass.sh +index 38f5031..60dfc29 100644 +--- a/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/tests/chrony.pass.sh ++++ b/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/tests/chrony.pass.sh +@@ -5,6 +5,9 @@ + + yum remove -y ntp + ++# Remove all pool options ++sed -i "/^pool.*/d" /etc/chrony.conf ++ + if ! grep "^server" /etc/chrony.conf ; then + echo "server foo.example.net iburst maxpoll 10" >> /etc/chrony.conf + elif ! grep "^server.*maxpoll 10" /etc/chrony.conf; then +diff --git a/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/tests/chrony_one_pool_configured.pass.sh b/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/tests/chrony_one_pool_configured.pass.sh +new file mode 100644 +index 0000000..6cbeb0e +--- /dev/null ++++ b/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/tests/chrony_one_pool_configured.pass.sh +@@ -0,0 +1,14 @@ ++#!/bin/bash ++# packages = chrony ++# ++# profiles = xccdf_org.ssgproject.content_profile_stig ++ ++yum remove -y ntp ++ ++# Remove all server or pool options ++sed -i "/^\(server\|pool\).*/d" /etc/chrony.conf ++ ++echo "pool pool.ntp.org iburst maxpoll 16" >> /etc/chrony.conf ++ ++systemctl enable chronyd.service ++ +diff --git a/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/tests/chrony_one_pool_misconfigured.fail.sh b/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/tests/chrony_one_pool_misconfigured.fail.sh +new file mode 100644 +index 0000000..12f2cda +--- /dev/null ++++ b/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/tests/chrony_one_pool_misconfigured.fail.sh +@@ -0,0 +1,14 @@ ++#!/bin/bash ++# packages = chrony ++# ++# profiles = xccdf_org.ssgproject.content_profile_stig ++ ++yum remove -y ntp ++ ++# Remove all server or pool options ++sed -i "/^\(server\|pool\).*/d" /etc/chrony.conf ++ ++echo "pool pool.ntp.org iburst maxpoll 18" >> /etc/chrony.conf ++ ++systemctl enable chronyd.service ++ +diff --git a/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/tests/chrony_one_pool_missing_parameter.fail.sh b/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/tests/chrony_one_pool_missing_parameter.fail.sh +new file mode 100644 +index 0000000..1ef4798 +--- /dev/null ++++ b/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/tests/chrony_one_pool_missing_parameter.fail.sh +@@ -0,0 +1,14 @@ ++#!/bin/bash ++# packages = chrony ++# ++# profiles = xccdf_org.ssgproject.content_profile_stig ++ ++yum remove -y ntp ++ ++# Remove all server options ++sed -i "/^\(server\|pool\).*/d" /etc/chrony.conf ++ ++echo "pool pool.ntp.org iburst" >> /etc/chrony.conf ++ ++systemctl enable chronyd.service ++ +diff --git a/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/tests/chrony_one_server_misconfigured.fail.sh b/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/tests/chrony_one_server_misconfigured.fail.sh +index 0fc7840..6f86faf 100644 +--- a/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/tests/chrony_one_server_misconfigured.fail.sh ++++ b/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/tests/chrony_one_server_misconfigured.fail.sh +@@ -5,6 +5,9 @@ + + yum remove -y ntp + ++# Remove all pool options ++sed -i "/^pool.*/d" /etc/chrony.conf ++ + if ! grep "^server.*maxpoll 10" /etc/chrony.conf; then + sed -i "s/^server.*/& maxpoll 10/" /etc/chrony.conf + fi +-- +2.34.1 + diff --git a/SOURCES/scap-security-guide-0.1.60-rhel8_stig_v1r4-PR_7930.patch b/SOURCES/scap-security-guide-0.1.60-rhel8_stig_v1r4-PR_7930.patch new file mode 100644 index 0000000..f019b6b --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.60-rhel8_stig_v1r4-PR_7930.patch @@ -0,0 +1,2250 @@ +commit a9b9db2a5e9ad655258a0f8823f57519b6bb37f8 +Author: Gabriel Becker +Date: Thu Feb 24 17:40:22 2022 +0100 + + Manual edited patch scap-security-guide-0.1.60-rhel8_stig_v1r4-PR_7930.patch. + +diff --git a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_csh_cshrc/rule.yml b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_csh_cshrc/rule.yml +index 1b71c7d..bccc7eb 100644 +--- a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_csh_cshrc/rule.yml ++++ b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_csh_cshrc/rule.yml +@@ -14,7 +14,7 @@ rationale: |- + A misconfigured umask value could result in files with excessive permissions that can be read or + written to by unauthorized users. + +-severity: unknown ++severity: medium + + identifiers: + cce@rhcos4: CCE-84261-7 +@@ -31,7 +31,8 @@ references: + nerc-cip: CIP-003-3 R5.1.1,CIP-003-3 R5.3,CIP-004-3 R2.3,CIP-007-3 R2.1,CIP-007-3 R2.2,CIP-007-3 R2.3,CIP-007-3 R5.1,CIP-007-3 R5.1.1,CIP-007-3 R5.1.2 + nist: AC-6(1),CM-6(a) + nist-csf: PR.IP-2 +- srg: SRG-OS-000480-GPOS-00228 ++ srg: SRG-OS-000480-GPOS-00228,SRG-OS-000480-GPOS-00227 ++ stigid@rhel8: RHEL-08-020353 + + ocil_clause: 'the above command returns no output, or if the umask is configured incorrectly' + +diff --git a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_profile/rule.yml b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_profile/rule.yml +index 85e98cf..822463e 100644 +--- a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_profile/rule.yml ++++ b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_profile/rule.yml +@@ -12,7 +12,7 @@ rationale: |- + A misconfigured umask value could result in files with excessive permissions that can be read or + written to by unauthorized users. + +-severity: unknown ++severity: medium + + identifiers: + cce@rhcos4: CCE-84262-5 +@@ -33,7 +33,8 @@ references: + nerc-cip: CIP-003-3 R5.1.1,CIP-003-3 R5.3,CIP-004-3 R2.3,CIP-007-3 R2.1,CIP-007-3 R2.2,CIP-007-3 R2.3,CIP-007-3 R5.1,CIP-007-3 R5.1.1,CIP-007-3 R5.1.2 + nist: AC-6(1),CM-6(a) + nist-csf: PR.IP-2 +- srg: SRG-OS-000480-GPOS-00228 ++ srg: SRG-OS-000480-GPOS-00228,SRG-OS-000480-GPOS-00227 ++ stigid@rhel8: RHEL-08-020353 + + ocil_clause: 'the above command returns no output, or if the umask is configured incorrectly' + +diff --git a/products/rhel8/profiles/stig.profile b/products/rhel8/profiles/stig.profile +index 5e9a221..3582e44 100644 +--- a/products/rhel8/profiles/stig.profile ++++ b/products/rhel8/profiles/stig.profile +@@ -1,7 +1,7 @@ + documentation_complete: true + + metadata: +- version: V1R3 ++ version: V1R4 + SMEs: + - ggbecker + +@@ -11,7 +11,7 @@ title: 'DISA STIG for Red Hat Enterprise Linux 8' + + description: |- + This profile contains configuration checks that align to the +- DISA STIG for Red Hat Enterprise Linux 8 V1R3. ++ DISA STIG for Red Hat Enterprise Linux 8 V1R4. + + In addition to being applicable to Red Hat Enterprise Linux 8, DISA recognizes this + configuration baseline as applicable to the operating system tier of +@@ -162,8 +162,6 @@ selections: + # RHEL-08-010171 + - package_policycoreutils_installed + +- # RHEL-08-010180 +- + # RHEL-08-010190 + - dir_perms_world_writable_sticky_bits + +@@ -352,7 +350,6 @@ selections: + - partition_for_tmp + + # RHEL-08-010544 +- ### NOTE: Will probably show up in V1R3 - Q3 of 21' + - partition_for_var_tmp + + # RHEL-08-010550 +@@ -621,6 +618,8 @@ selections: + + # RHEL-08-020353 + - accounts_umask_etc_bashrc ++ - accounts_umask_etc_csh_cshrc ++ - accounts_umask_etc_profile + + # RHEL-08-030000 + - audit_rules_suid_privilege_function +diff --git a/products/rhel8/profiles/stig_gui.profile b/products/rhel8/profiles/stig_gui.profile +index 0fdd755..e1f0f71 100644 +--- a/products/rhel8/profiles/stig_gui.profile ++++ b/products/rhel8/profiles/stig_gui.profile +@@ -1,7 +1,7 @@ + documentation_complete: true + + metadata: +- version: V1R3 ++ version: V1R4 + SMEs: + - ggbecker + +@@ -11,7 +11,7 @@ title: 'DISA STIG with GUI for Red Hat Enterprise Linux 8' + + description: |- + This profile contains configuration checks that align to the +- DISA STIG with GUI for Red Hat Enterprise Linux 8 V1R3. ++ DISA STIG with GUI for Red Hat Enterprise Linux 8 V1R4. + + In addition to being applicable to Red Hat Enterprise Linux 8, DISA recognizes this + configuration baseline as applicable to the operating system tier of +diff --git a/products/rhel9/profiles/stig.profile b/products/rhel9/profiles/stig.profile +index 8d60468..9acb63a 100644 +--- a/products/rhel9/profiles/stig.profile ++++ b/products/rhel9/profiles/stig.profile +@@ -143,8 +143,6 @@ selections: + # RHEL-08-010171 + - package_policycoreutils_installed + +- # RHEL-08-010180 +- + # RHEL-08-010190 + - dir_perms_world_writable_sticky_bits + +@@ -309,7 +307,6 @@ selections: + - partition_for_tmp + + # RHEL-08-010544 +- ### NOTE: Will probably show up in V1R3 - Q3 of 21' + - partition_for_var_tmp + + # RHEL-08-010550 +@@ -566,6 +563,8 @@ selections: + + # RHEL-08-020353 + - accounts_umask_etc_bashrc ++ - accounts_umask_etc_csh_cshrc ++ - accounts_umask_etc_profile + + # RHEL-08-030000 + # - audit_rules_suid_privilege_function # not supported in RHEL9 ATM +diff --git a/shared/references/disa-stig-rhel8-v1r3-xccdf-manual.xml b/shared/references/disa-stig-rhel8-v1r4-xccdf-manual.xml +similarity index 80% +rename from shared/references/disa-stig-rhel8-v1r3-xccdf-manual.xml +rename to shared/references/disa-stig-rhel8-v1r4-xccdf-manual.xml +index abff501..46c5fa1 100644 +--- a/shared/references/disa-stig-rhel8-v1r3-xccdf-manual.xml ++++ b/shared/references/disa-stig-rhel8-v1r4-xccdf-manual.xml +@@ -1,4 +1,4 @@ +-acceptedRed Hat Enterprise Linux 8 Security Technical Implementation GuideThis Security Technical Implementation Guide is published as a tool to improve the security of Department of Defense (DoD) information systems. The requirements are derived from the National Institute of Standards and Technology (NIST) 800-53 and related documents. Comments or proposed revisions to this document should be sent via email to the following address: disa.stig_spt@mail.mil.DISASTIG.DOD.MILRelease: 3 Benchmark Date: 23 Jul 20213.2.2.360791.10.01I - Mission Critical Classified<ProfileDescription></ProfileDescription>I - Mission Critical Sensitive<ProfileDescription></ProfileDescription>II - Mission Support Public<ProfileDescription></ProfileDescription>III - Administrative Classified<ProfileDescription></ProfileDescription>III - Administrative Sensitive<ProfileDescription></ProfileDescription>I - Mission Critical Public<ProfileDescription></ProfileDescription>II - Mission Support Classified<ProfileDescription></ProfileDescription>II - Mission Support Sensitive<ProfileDescription></ProfileDescription>III - Administrative Public<ProfileDescription></ProfileDescription>SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-010000RHEL 8 must be a vendor-supported release.<VulnDiscussion>An operating system release is considered "supported" if the vendor continues to provide security patches for the product. With an unsupported release, it will not be possible to resolve security issues discovered in the system software. + + Red Hat offers the Extended Update Support (EUS) ad-on to a Red Hat Enterprise Linux subscription, for a fee, for those customers who wish to standardize on a specific minor release for an extended period. The RHEL 8 minor releases eligible for EUS are 8.1, 8.2, 8.4, 8.6, and 8.8. Each RHEL 8 EUS stream is available for 24 months from the availability of the minor release. RHEL 8.10 will be the final minor release overall. For more details on the Red Hat Enterprise Linux Life Cycle visit https://access.redhat.com/support/policy/updates/errata.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Upgrade to a supported version of RHEL 8.Verify the version of the operating system is vendor supported. + +@@ -46,7 +46,7 @@ If package updates have not been performed on the system within the timeframe th + + Typical update frequency may be overridden by Information Assurance Vulnerability Alert (IAVA) notifications from CYBERCOM. + +-If the operating system is in non-compliance with the Information Assurance Vulnerability Management (IAVM) process, this is a finding.SRG-OS-000033-GPOS-00014<GroupDescription></GroupDescription>RHEL-08-010020RHEL 8 must implement NIST FIPS-validated cryptography for the following: to provision digital signatures, to generate cryptographic hashes, and to protect data requiring data-at-rest protections in accordance with applicable federal laws, Executive Orders, directives, policies, regulations, and standards.<VulnDiscussion>Use of weak or untested encryption algorithms undermines the purposes of using encryption to protect data. The operating system must implement cryptographic modules adhering to the higher standards approved by the Federal Government since this provides assurance they have been tested and validated. ++If the operating system is in non-compliance with the Information Assurance Vulnerability Management (IAVM) process, this is a finding.SRG-OS-000033-GPOS-00014<GroupDescription></GroupDescription>RHEL-08-010020RHEL 8 must implement NIST FIPS-validated cryptography for the following: to provision digital signatures, to generate cryptographic hashes, and to protect data requiring data-at-rest protections in accordance with applicable federal laws, Executive Orders, directives, policies, regulations, and standards.<VulnDiscussion>Use of weak or untested encryption algorithms undermines the purposes of using encryption to protect data. The operating system must implement cryptographic modules adhering to the higher standards approved by the Federal Government since this provides assurance they have been tested and validated. + + RHEL 8 utilizes GRUB 2 as the default bootloader. Note that GRUB 2 command-line parameters are defined in the "kernelopts" variable of the /boot/grub2/grubenv file for all kernel boot entries. The command "fips-mode-setup" modifies the "kernelopts" variable, which in turn updates all kernel boot entries. + +@@ -60,19 +60,17 @@ Enable FIPS mode after installation (not strict FIPS compliant) with the followi + + $ sudo fips-mode-setup --enable + +-Reboot the system for the changes to take effect.Verify the operating system implements DoD-approved encryption to protect the confidentiality of remote access sessions. ++Reboot the system for the changes to take effect.Verify the operating system implements DoD-approved encryption to protect the confidentiality of remote access sessions. + + Check to see if FIPS mode is enabled with the following command: + +-$ sudo fipscheck ++$ fips-mode-setup --check + +-usage: fipscheck [-s <hmac-suffix>] <paths-to-files> ++FIPS mode is enabled + +-fips mode is on ++If FIPS mode is "enabled", check to see if the kernel boot parameter is configured for FIPS mode with the following command: + +-If FIPS mode is "on", check to see if the kernel boot parameter is configured for FIPS mode with the following command: +- +-$ sudo grub2-editenv - list | grep fips ++$ sudo grub2-editenv list | grep fips + + kernelopts=root=/dev/mapper/rhel-root ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet fips=1 boot=UUID=8d171156-cd61-421c-ba41-1c021ac29e82 + +@@ -480,21 +478,7 @@ $ sudo yum list installed policycoreutils + + policycoreutils.x86_64 2.9-3.el8 @anaconda + +-If the policycoreutils package is not installed, this is a finding.SRG-OS-000138-GPOS-00069<GroupDescription></GroupDescription>RHEL-08-010180All RHEL 8 public directories must be owned by root or a system account to prevent unauthorized and unintended information transferred via shared system resources.<VulnDiscussion>Preventing unauthorized information transfers mitigates the risk of information, including encrypted representations of information, produced by the actions of prior users/roles (or the actions of processes acting on behalf of prior users/roles) from being available to any current users/roles (or current processes) that obtain access to shared system resources (e.g., registers, main memory, hard disks) after those resources have been released back to information systems. The control of information in shared resources is also commonly referred to as object reuse and residual information protection. +- +-This requirement generally applies to the design of an information technology product, but it can also apply to the configuration of particular information system components that are, or use, such products. This can be verified by acceptance/validation processes in DoD or other government agencies. +- +-There may be shared resources with configurable protections (e.g., files in storage) that may be assessed on specific information system components.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001090Configure all public directories to be owned by root or a system account to prevent unauthorized and unintended information transferred via shared system resources. +- +-Set the owner of all public directories as root or a system account using the command, replace "[Public Directory]" with any directory path not owned by root or a system account: +- +-$ sudo chown root [Public Directory]Check to see that all public directories are owned by root or a system account with the following command: +- +-$ sudo find / -type d -perm -0002 -exec ls -lLd {} \; +- +-drwxrwxrwxt 7 root root 4096 Jul 26 11:19 /tmp +- +-If any of the returned directories are not owned by root or a system account, this is a finding.SRG-OS-000138-GPOS-00069<GroupDescription></GroupDescription>RHEL-08-010190A sticky bit must be set on all RHEL 8 public directories to prevent unauthorized and unintended information transferred via shared system resources.<VulnDiscussion>Preventing unauthorized information transfers mitigates the risk of information, including encrypted representations of information, produced by the actions of prior users/roles (or the actions of processes acting on behalf of prior users/roles) from being available to any current users/roles (or current processes) that obtain access to shared system resources (e.g., registers, main memory, hard disks) after those resources have been released back to information systems. The control of information in shared resources is also commonly referred to as object reuse and residual information protection. ++If the policycoreutils package is not installed, this is a finding.SRG-OS-000138-GPOS-00069<GroupDescription></GroupDescription>RHEL-08-010190A sticky bit must be set on all RHEL 8 public directories to prevent unauthorized and unintended information transferred via shared system resources.<VulnDiscussion>Preventing unauthorized information transfers mitigates the risk of information, including encrypted representations of information, produced by the actions of prior users/roles (or the actions of processes acting on behalf of prior users/roles) from being available to any current users/roles (or current processes) that obtain access to shared system resources (e.g., registers, main memory, hard disks) after those resources have been released back to information systems. The control of information in shared resources is also commonly referred to as object reuse and residual information protection. + + This requirement generally applies to the design of an information technology product, but it can also apply to the configuration of particular information system components that are, or use, such products. This can be verified by acceptance/validation processes in DoD or other government agencies. + +@@ -502,13 +486,13 @@ There may be shared resources with configurable protections (e.g., files in stor + + Set the sticky bit on all world-writable directories using the command, replace "[World-Writable Directory]" with any directory path missing the sticky bit: + +-$ sudo chmod 1777 [World-Writable Directory]Verify that all world-writable directories have the sticky bit set. ++$ sudo chmod 1777 [World-Writable Directory]Verify that all world-writable directories have the sticky bit set. + + Check to see that all world-writable directories have the sticky bit set by running the following command: + + $ sudo find / -type d \( -perm -0002 -a ! -perm -1000 \) -print 2>/dev/null + +-drwxrwxrwxt 7 root root 4096 Jul 26 11:19 /tmp ++drwxrwxrwt 7 root root 4096 Jul 26 11:19 /tmp + + If any of the returned directories are world-writable and do not have the sticky bit set, this is a finding.SRG-OS-000163-GPOS-00072<GroupDescription></GroupDescription>RHEL-08-010200RHEL 8 must be configured so that all network connections associated with SSH traffic are terminated at the end of the session or after 10 minutes of inactivity, except to fulfill documented and validated mission requirements.<VulnDiscussion>Terminating an idle SSH session within a short time period reduces the window of opportunity for unauthorized personnel to take control of a management session enabled on the console or console port that has been left unattended. In addition, quickly terminating an idle SSH session will also free up resources committed by the managed network element. + +@@ -695,7 +679,7 @@ $ sudo grep -i MinProtocol /etc/crypto-policies/back-ends/opensslcnf.config + + MinProtocol = TLSv1.2 + +-If the "MinProtocol" is set to anything older than "TLSv1.2", this is a finding.SRG-OS-000250-GPOS-00093<GroupDescription></GroupDescription>RHEL-08-010295The RHEL 8 operating system must implement DoD-approved TLS encryption in the GnuTLS package.<VulnDiscussion>Without cryptographic integrity protections, information can be altered by unauthorized users without detection. ++If the "MinProtocol" is set to anything older than "TLSv1.2", this is a finding.SRG-OS-000250-GPOS-00093<GroupDescription></GroupDescription>RHEL-08-010295The RHEL 8 operating system must implement DoD-approved TLS encryption in the GnuTLS package.<VulnDiscussion>Without cryptographic integrity protections, information can be altered by unauthorized users without detection. + + Transport Layer Security (TLS) encryption is a required security setting as a number of known vulnerabilities have been reported against Secure Sockets Layer (SSL) and earlier versions of TLS. Encryption of private information is essential to ensuring data confidentiality. If private information is not encrypted, it can be intercepted and easily read by an unauthorized party. SQL Server must use a minimum of FIPS 140-2-approved TLS version 1.2, and all non-FIPS-approved SSL and TLS versions must be disabled. NIST SP 800-52 specifies the preferred configurations for government systems. + +@@ -707,21 +691,21 @@ Satisfies: SRG-OS-000250-GPOS-00093, SRG-OS-000423-GPOS-00187</VulnDiscussion + + +VERS-ALL:-VERS-DTLS0.9:-VERS-SSL3.0:-VERS-TLS1.0:-VERS-TLS1.1:-VERS-DTLS1.0 + +-A reboot is required for the changes to take effect.Verify the GnuTLS library is configured to only allow DoD-approved SSL/TLS Versions: ++A reboot is required for the changes to take effect.Verify the GnuTLS library is configured to only allow DoD-approved SSL/TLS Versions: + + $ sudo grep -io +vers.* /etc/crypto-policies/back-ends/gnutls.config + + +VERS-ALL:-VERS-DTLS0.9:-VERS-SSL3.0:-VERS-TLS1.0:-VERS-TLS1.1:-VERS-DTLS1.0:+COMP-NULL:%PROFILE_MEDIUM + +-If the "gnutls.config" does not list "-VERS-DTLS0.9:-VERS-SSL3.0:-VERS-TLS1.0:-VERS-TLS1.1:VERS-DTLS1.0" to disable unapproved SSL/TLS versions, this is a finding.SRG-OS-000259-GPOS-00100<GroupDescription></GroupDescription>RHEL-08-010300RHEL 8 system commands must have mode 0755 or less permissive.<VulnDiscussion>If RHEL 8 were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. ++If the "gnutls.config" does not list "-VERS-DTLS0.9:-VERS-SSL3.0:-VERS-TLS1.0:-VERS-TLS1.1:-VERS-DTLS1.0" to disable unapproved SSL/TLS versions, this is a finding.SRG-OS-000259-GPOS-00100<GroupDescription></GroupDescription>RHEL-08-010300RHEL 8 system commands must have mode 755 or less permissive.<VulnDiscussion>If RHEL 8 were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. + +-This requirement applies to RHEL 8 with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals will be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001499Configure the system commands to be protected from unauthorized access. ++This requirement applies to RHEL 8 with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals will be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001499Configure the system commands to be protected from unauthorized access. + +-Run the following command, replacing "[FILE]" with any system command with a mode more permissive than "0755". ++Run the following command, replacing "[FILE]" with any system command with a mode more permissive than "755". + +-$ sudo chmod 0755 [FILE]Verify the system commands contained in the following directories have mode "0755" or less permissive with the following command: ++$ sudo chmod 755 [FILE]Verify the system commands contained in the following directories have mode "755" or less permissive with the following command: + +-$ sudo find -L /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin -perm /0022 -exec ls -l {} \; ++$ sudo find -L /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin -perm /022 -exec ls -l {} \; + + If any system commands are found to be group-writable or world-writable, this is a finding.SRG-OS-000259-GPOS-00100<GroupDescription></GroupDescription>RHEL-08-010310RHEL 8 system commands must be owned by root.<VulnDiscussion>If RHEL 8 were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. + +@@ -733,23 +717,23 @@ $ sudo chown root [FILE]SRG-OS-000259-GPOS-00100<GroupDescription></GroupDescription>RHEL-08-010320RHEL 8 system commands must be group-owned by root or a system account.<VulnDiscussion>If RHEL 8 were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. ++If any system commands are returned, this is a finding.SRG-OS-000259-GPOS-00100<GroupDescription></GroupDescription>RHEL-08-010320RHEL 8 system commands must be group-owned by root or a system account.<VulnDiscussion>If RHEL 8 were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. + + This requirement applies to RHEL 8 with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals will be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001499Configure the system commands to be protected from unauthorized access. + + Run the following command, replacing "[FILE]" with any system command file not group-owned by "root" or a required system account. + +-$ sudo chgrp root [FILE]Verify the system commands contained in the following directories are group-owned by "root" with the following command: ++$ sudo chgrp root [FILE]Verify the system commands contained in the following directories are group-owned by "root", or a required system account, with the following command: + + $ sudo find -L /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin ! -group root -exec ls -l {} \; + +-If any system commands are returned and is not owned by a required system account, this is a finding.SRG-OS-000259-GPOS-00100<GroupDescription></GroupDescription>RHEL-08-010330RHEL 8 library files must have mode 0755 or less permissive.<VulnDiscussion>If RHEL 8 were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. ++If any system commands are returned and is not group-owned by a required system account, this is a finding.SRG-OS-000259-GPOS-00100<GroupDescription></GroupDescription>RHEL-08-010330RHEL 8 library files must have mode 755 or less permissive.<VulnDiscussion>If RHEL 8 were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. + +-This requirement applies to RHEL 8 with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals will be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001499Configure the library files to be protected from unauthorized access. Run the following command, replacing "[FILE]" with any library file with a mode more permissive than 0755. ++This requirement applies to RHEL 8 with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals will be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001499Configure the library files to be protected from unauthorized access. Run the following command, replacing "[FILE]" with any library file with a mode more permissive than 755. + +-$ sudo chmod 0755 [FILE]Verify the system-wide shared library files contained in the following directories have mode "0755" or less permissive with the following command: ++$ sudo chmod 755 [FILE]Verify the system-wide shared library files contained in the following directories have mode "755" or less permissive with the following command: + +-$ sudo find -L /lib /lib64 /usr/lib /usr/lib64 -perm /0022 -type f -exec ls -l {} \; ++$ sudo find -L /lib /lib64 /usr/lib /usr/lib64 -perm /022 -type f -exec ls -l {} \; + + If any system-wide shared library file is found to be group-writable or world-writable, this is a finding.SRG-OS-000259-GPOS-00100<GroupDescription></GroupDescription>RHEL-08-010340RHEL 8 library files must be owned by root.<VulnDiscussion>If RHEL 8 were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. + +@@ -850,19 +834,28 @@ $ sudo grep -i localpkg_gpgcheck /etc/dnf/dnf.conf + + localpkg_gpgcheck =True + +-If "localpkg_gpgcheck" is not set to either "1", "True", or "yes", commented out, or is missing from "/etc/dnf/dnf.conf", this is a finding.SRG-OS-000366-GPOS-00153<GroupDescription></GroupDescription>RHEL-08-010372RHEL 8 must prevent the loading of a new kernel for later execution.<VulnDiscussion>Changes to any software components can have significant effects on the overall security of the operating system. This requirement ensures the software has not been tampered with and that it has been provided by a trusted vendor. ++If "localpkg_gpgcheck" is not set to either "1", "True", or "yes", commented out, or is missing from "/etc/dnf/dnf.conf", this is a finding.SRG-OS-000366-GPOS-00153<GroupDescription></GroupDescription>RHEL-08-010372RHEL 8 must prevent the loading of a new kernel for later execution.<VulnDiscussion>Changes to any software components can have significant effects on the overall security of the operating system. This requirement ensures the software has not been tampered with and that it has been provided by a trusted vendor. + +-Disabling kexec_load prevents an unsigned kernel image (that could be a windows kernel or modified vulnerable kernel) from being loaded. Kexec can be used subvert the entire secureboot process and should be avoided at all costs especially since it can load unsigned kernel images.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001749Configure the operating system to disable kernel image loading. ++Disabling kexec_load prevents an unsigned kernel image (that could be a windows kernel or modified vulnerable kernel) from being loaded. Kexec can be used subvert the entire secureboot process and should be avoided at all costs especially since it can load unsigned kernel images. + +-Add or edit the following line in a system configuration file in the "/etc/sysctl.d/" directory: ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001749Configure the operating system to disable kernel image loading. ++ ++Add or edit the following line in a system configuration file, which begins with "99-", in the "/etc/sysctl.d/" directory: + + kernel.kexec_load_disabled = 1 + + Load settings from all system configuration files with the following command: + +-$ sudo sysctl --systemVerify the operating system is configured to disable kernel image loading with the following commands: ++$ sudo sysctl --systemVerify the operating system is configured to disable kernel image loading with the following commands: + +-Check the status of the kernel.kexec_load_disabled kernel parameter ++Check the status of the kernel.kexec_load_disabled kernel parameter. + + $ sudo sysctl kernel.kexec_load_disabled + +@@ -870,29 +863,41 @@ kernel.kexec_load_disabled = 1 + + If "kernel.kexec_load_disabled" is not set to "1" or is missing, this is a finding. + +-Check that the configuration files are present to enable this kernel parameter ++Check that the configuration files are present to enable this kernel parameter. + +-$ sudo grep -r kernel.kexec_load_disabled /etc/sysctl.conf /etc/sysctl.d/*.conf ++$ sudo grep -r kernel.kexec_load_disabled /etc/sysctl.d/*.conf + + /etc/sysctl.d/99-sysctl.conf:kernel.kexec_load_disabled = 1 + +-If "kernel.kexec_load_disabled" is not set to "1", is missing or commented out, this is a finding.SRG-OS-000312-GPOS-00122<GroupDescription></GroupDescription>RHEL-08-010373RHEL 8 must enable kernel parameters to enforce discretionary access control on symlinks.<VulnDiscussion>Discretionary Access Control (DAC) is based on the notion that individual users are "owners" of objects and therefore have discretion over who should be authorized to access the object and in which mode (e.g., read or write). Ownership is usually acquired as a consequence of creating the object or via specified ownership assignment. DAC allows the owner to determine who will have access to objects they control. An example of DAC includes user-controlled file permissions. ++If "kernel.kexec_load_disabled" is not set to "1", is missing or commented out, this is a finding. ++ ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000312-GPOS-00122<GroupDescription></GroupDescription>RHEL-08-010373RHEL 8 must enable kernel parameters to enforce discretionary access control on symlinks.<VulnDiscussion>Discretionary Access Control (DAC) is based on the notion that individual users are "owners" of objects and therefore have discretion over who should be authorized to access the object and in which mode (e.g., read or write). Ownership is usually acquired as a consequence of creating the object or via specified ownership assignment. DAC allows the owner to determine who will have access to objects they control. An example of DAC includes user-controlled file permissions. + + When discretionary access control policies are implemented, subjects are not constrained with regard to what actions they can take with information for which they have already been granted access. Thus, subjects that have been granted access to information are not prevented from passing (i.e., the subjects have the discretion to pass) the information to other subjects or objects. A subject that is constrained in its operation by Mandatory Access Control policies is still able to operate under the less rigorous constraints of this requirement. Thus, while Mandatory Access Control imposes constraints preventing a subject from passing information to another subject operating at a different sensitivity level, this requirement permits the subject to pass the information to any subject at the same sensitivity level. The policy is bounded by the information system boundary. Once the information is passed outside the control of the information system, additional means may be required to ensure the constraints remain in effect. While the older, more traditional definitions of discretionary access control require identity-based access control, that limitation is not required for this use of discretionary access control. + + By enabling the fs.protected_symlinks kernel parameter, symbolic links are permitted to be followed only when outside a sticky world-writable directory, or when the UID of the link and follower match, or when the directory owner matches the symlink's owner. Disallowing such symlinks helps mitigate vulnerabilities based on insecure file system accessed by privileged programs, avoiding an exploitation vector exploiting unsafe use of open() or creat(). + +-Satisfies: SRG-OS-000312-GPOS-00122, SRG-OS-000312-GPOS-00123, SRG-OS-000312-GPOS-00124, SRG-OS-000324-GPOS-00125</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-002165Configure the operating system to enable DAC on symlinks. ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf ++ ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system. + +-Add or edit the following line in a system configuration file in the "/etc/sysctl.d/" directory: ++Satisfies: SRG-OS-000312-GPOS-00122, SRG-OS-000312-GPOS-00123, SRG-OS-000312-GPOS-00124, SRG-OS-000324-GPOS-00125</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-002165Configure the operating system to enable DAC on symlinks. ++ ++Add or edit the following line in a system configuration file, which begins with "99-", in the "/etc/sysctl.d/" directory: + + fs.protected_symlinks = 1 + + Load settings from all system configuration files with the following command: + +-$ sudo sysctl --systemVerify the operating system is configured to enable DAC on symlinks with the following commands: ++$ sudo sysctl --systemVerify the operating system is configured to enable DAC on symlinks with the following commands: + +-Check the status of the fs.protected_symlinks kernel parameter ++Check the status of the fs.protected_symlinks kernel parameter. + + $ sudo sysctl fs.protected_symlinks + +@@ -900,103 +905,141 @@ fs.protected_symlinks = 1 + + If "fs.protected_symlinks" is not set to "1" or is missing, this is a finding. + +-Check that the configuration files are present to enable this kernel parameter ++Check that the configuration files are present to enable this kernel parameter. + +-$ sudo grep -r fs.protected_symlinks /etc/sysctl.conf /etc/sysctl.d/*.conf ++$ sudo grep -r fs.protected_symlinks /etc/sysctl.d/*.conf + + /etc/sysctl.d/99-sysctl.conf:fs.protected_symlinks = 1 + +-If "fs.protected_symlinks" is not set to "1", is missing or commented out, this is a finding.SRG-OS-000312-GPOS-00122<GroupDescription></GroupDescription>RHEL-08-010374RHEL 8 must enable kernel parameters to enforce discretionary access control on hardlinks.<VulnDiscussion>Discretionary Access Control (DAC) is based on the notion that individual users are "owners" of objects and therefore have discretion over who should be authorized to access the object and in which mode (e.g., read or write). Ownership is usually acquired as a consequence of creating the object or via specified ownership assignment. DAC allows the owner to determine who will have access to objects they control. An example of DAC includes user-controlled file permissions. +- +-When discretionary access control policies are implemented, subjects are not constrained with regard to what actions they can take with information for which they have already been granted access. Thus, subjects that have been granted access to information are not prevented from passing (i.e., the subjects have the discretion to pass) the information to other subjects or objects. A subject that is constrained in its operation by Mandatory Access Control policies is still able to operate under the less rigorous constraints of this requirement. Thus, while Mandatory Access Control imposes constraints preventing a subject from passing information to another subject operating at a different sensitivity level, this requirement permits the subject to pass the information to any subject at the same sensitivity level. The policy is bounded by the information system boundary. Once the information is passed outside the control of the information system, additional means may be required to ensure the constraints remain in effect. While the older, more traditional definitions of discretionary access control require identity-based access control, that limitation is not required for this use of discretionary access control. +- +-By enabling the fs.protected_hardlinks kernel parameter, users can no longer create soft or hard links to files they do not own. Disallowing such hardlinks mitigate vulnerabilities based on insecure file system accessed by privileged programs, avoiding an exploitation vector exploiting unsafe use of open() or creat(). +- +-Satisfies: SRG-OS-000312-GPOS-00122, SRG-OS-000312-GPOS-00123, SRG-OS-000312-GPOS-00124, SRG-OS-000324-GPOS-00125</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-002165Configure the operating system to enable DAC on hardlinks. ++If "fs.protected_symlinks" is not set to "1", is missing or commented out, this is a finding. ++ ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000312-GPOS-00122<GroupDescription></GroupDescription>RHEL-08-010374RHEL 8 must enable kernel parameters to enforce discretionary access control on hardlinks.<VulnDiscussion>Discretionary Access Control (DAC) is based on the notion that individual users are "owners" of objects and therefore have discretion over who should be authorized to access the object and in which mode (e.g., read or write). Ownership is usually acquired as a consequence of creating the object or via specified ownership assignment. DAC allows the owner to determine who will have access to objects they control. An example of DAC includes user-controlled file permissions. ++ ++When discretionary access control policies are implemented, subjects are not constrained with regard to what actions they can take with information for which they have already been granted access. Thus, subjects that have been granted access to information are not prevented from passing (i.e., the subjects have the discretion to pass) the information to other subjects or objects. A subject that is constrained in its operation by Mandatory Access Control policies is still able to operate under the less rigorous constraints of this requirement. Thus, while Mandatory Access Control imposes constraints preventing a subject from passing information to another subject operating at a different sensitivity level, this requirement permits the subject to pass the information to any subject at the same sensitivity level. The policy is bounded by the information system boundary. Once the information is passed outside the control of the information system, additional means may be required to ensure the constraints remain in effect. While the older, more traditional definitions of discretionary access control require identity-based access control, that limitation is not required for this use of discretionary access control. ++ ++By enabling the fs.protected_hardlinks kernel parameter, users can no longer create soft or hard links to files they do not own. Disallowing such hardlinks mitigate vulnerabilities based on insecure file system accessed by privileged programs, avoiding an exploitation vector exploiting unsafe use of open() or creat(). ++ ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf + +-Add or edit the following line in a system configuration file in the "/etc/sysctl.d/" directory: ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system. ++ ++Satisfies: SRG-OS-000312-GPOS-00122, SRG-OS-000312-GPOS-00123, SRG-OS-000312-GPOS-00124, SRG-OS-000324-GPOS-00125</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-002165Configure the operating system to enable DAC on hardlinks. ++ ++Add or edit the following line in a system configuration file, which begins with "99-", in the "/etc/sysctl.d/" directory: + + fs.protected_hardlinks = 1 + + Load settings from all system configuration files with the following command: + +-$ sudo sysctl --systemVerify the operating system is configured to enable DAC on hardlinks with the following commands: +- +-Check the status of the fs.protected_hardlinks kernel parameter. +- +-$ sudo sysctl fs.protected_hardlinks +- +-fs.protected_hardlinks = 1 +- +-If "fs.protected_hardlinks" is not set to "1" or is missing, this is a finding. +- +-Check that the configuration files are present to enable this kernel parameter. +- +-$ sudo grep -r fs.protected_hardlinks /etc/sysctl.conf /etc/sysctl.d/*.conf +- +-/etc/sysctl.d/99-sysctl.conf:fs.protected_hardlinks = 1 +- +-If "fs.protected_hardlinks" is not set to "1", is missing or commented out, this is a finding.SRG-OS-000138-GPOS-00069<GroupDescription></GroupDescription>RHEL-08-010375RHEL 8 must restrict access to the kernel message buffer.<VulnDiscussion>Preventing unauthorized information transfers mitigates the risk of information, including encrypted representations of information, produced by the actions of prior users/roles (or the actions of processes acting on behalf of prior users/roles) from being available to any current users/roles (or current processes) that obtain access to shared system resources (e.g., registers, main memory, hard disks) after those resources have been released back to information systems. The control of information in shared resources is also commonly referred to as object reuse and residual information protection. +- +-This requirement generally applies to the design of an information technology product, but it can also apply to the configuration of particular information system components that are, or use, such products. This can be verified by acceptance/validation processes in DoD or other government agencies. +- +-There may be shared resources with configurable protections (e.g., files in storage) that may be assessed on specific information system components. +- +-Restricting access to the kernel message buffer limits access to only root. This prevents attackers from gaining additional system information as a non-privileged user.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001090Configure the operating system to restrict access to the kernel message buffer. ++$ sudo sysctl --systemVerify the operating system is configured to enable DAC on hardlinks with the following commands: ++ ++Check the status of the fs.protected_hardlinks kernel parameter. ++ ++$ sudo sysctl fs.protected_hardlinks ++ ++fs.protected_hardlinks = 1 ++ ++If "fs.protected_hardlinks" is not set to "1" or is missing, this is a finding. ++ ++Check that the configuration files are present to enable this kernel parameter. ++ ++$ sudo grep -r fs.protected_hardlinks /etc/sysctl.d/*.conf ++ ++/etc/sysctl.d/99-sysctl.conf:fs.protected_hardlinks = 1 ++ ++If "fs.protected_hardlinks" is not set to "1", is missing or commented out, this is a finding. ++ ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000138-GPOS-00069<GroupDescription></GroupDescription>RHEL-08-010375RHEL 8 must restrict access to the kernel message buffer.<VulnDiscussion>Preventing unauthorized information transfers mitigates the risk of information, including encrypted representations of information, produced by the actions of prior users/roles (or the actions of processes acting on behalf of prior users/roles) from being available to any current users/roles (or current processes) that obtain access to shared system resources (e.g., registers, main memory, hard disks) after those resources have been released back to information systems. The control of information in shared resources is also commonly referred to as object reuse and residual information protection. ++ ++This requirement generally applies to the design of an information technology product, but it can also apply to the configuration of particular information system components that are, or use, such products. This can be verified by acceptance/validation processes in DoD or other government agencies. ++ ++There may be shared resources with configurable protections (e.g., files in storage) that may be assessed on specific information system components. ++ ++Restricting access to the kernel message buffer limits access to only root. This prevents attackers from gaining additional system information as a non-privileged user. + +-Add or edit the following line in a system configuration file in the "/etc/sysctl.d/" directory: ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf ++ ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001090Configure the operating system to restrict access to the kernel message buffer. ++ ++Add or edit the following line in a system configuration file, which begins with "99-", in the "/etc/sysctl.d/" directory: + + kernel.dmesg_restrict = 1 + + Load settings from all system configuration files with the following command: + +-$ sudo sysctl --systemVerify the operating system is configured to restrict access to the kernel message buffer with the following commands: +- +-Check the status of the kernel.dmesg_restrict kernel parameter. +- +-$ sudo sysctl kernel.dmesg_restrict +- +-kernel.dmesg_restrict = 1 +- +-If "kernel.dmesg_restrict" is not set to "1" or is missing, this is a finding. +- +-Check that the configuration files are present to enable this kernel parameter. +- +-$ sudo grep -r kernel.dmesg_restrict /etc/sysctl.conf /etc/sysctl.d/*.conf +- +-/etc/sysctl.d/99-sysctl.conf:kernel.dmesg_restrict = 1 +- +-If "kernel.dmesg_restrict" is not set to "1", is missing or commented out, this is a finding.SRG-OS-000138-GPOS-00069<GroupDescription></GroupDescription>RHEL-08-010376RHEL 8 must prevent kernel profiling by unprivileged users.<VulnDiscussion>Preventing unauthorized information transfers mitigates the risk of information, including encrypted representations of information, produced by the actions of prior users/roles (or the actions of processes acting on behalf of prior users/roles) from being available to any current users/roles (or current processes) that obtain access to shared system resources (e.g., registers, main memory, hard disks) after those resources have been released back to information systems. The control of information in shared resources is also commonly referred to as object reuse and residual information protection. +- +-This requirement generally applies to the design of an information technology product, but it can also apply to the configuration of particular information system components that are, or use, such products. This can be verified by acceptance/validation processes in DoD or other government agencies. +- +-There may be shared resources with configurable protections (e.g., files in storage) that may be assessed on specific information system components. +- +-Setting the kernel.perf_event_paranoid kernel parameter to "2" prevents attackers from gaining additional system information as a non-privileged user.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001090Configure the operating system to prevent kernel profiling by unprivileged users. ++$ sudo sysctl --systemVerify the operating system is configured to restrict access to the kernel message buffer with the following commands: ++ ++Check the status of the kernel.dmesg_restrict kernel parameter. ++ ++$ sudo sysctl kernel.dmesg_restrict ++ ++kernel.dmesg_restrict = 1 ++ ++If "kernel.dmesg_restrict" is not set to "1" or is missing, this is a finding. ++ ++Check that the configuration files are present to enable this kernel parameter. ++ ++$ sudo grep -r kernel.dmesg_restrict /etc/sysctl.d/*.conf ++ ++/etc/sysctl.d/99-sysctl.conf:kernel.dmesg_restrict = 1 ++ ++If "kernel.dmesg_restrict" is not set to "1", is missing or commented out, this is a finding. ++ ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000138-GPOS-00069<GroupDescription></GroupDescription>RHEL-08-010376RHEL 8 must prevent kernel profiling by unprivileged users.<VulnDiscussion>Preventing unauthorized information transfers mitigates the risk of information, including encrypted representations of information, produced by the actions of prior users/roles (or the actions of processes acting on behalf of prior users/roles) from being available to any current users/roles (or current processes) that obtain access to shared system resources (e.g., registers, main memory, hard disks) after those resources have been released back to information systems. The control of information in shared resources is also commonly referred to as object reuse and residual information protection. ++ ++This requirement generally applies to the design of an information technology product, but it can also apply to the configuration of particular information system components that are, or use, such products. This can be verified by acceptance/validation processes in DoD or other government agencies. ++ ++There may be shared resources with configurable protections (e.g., files in storage) that may be assessed on specific information system components. ++ ++Setting the kernel.perf_event_paranoid kernel parameter to "2" prevents attackers from gaining additional system information as a non-privileged user. + +-Add or edit the following line in a system configuration file in the "/etc/sysctl.d/" directory: ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf ++ ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001090Configure the operating system to prevent kernel profiling by unprivileged users. ++ ++Add or edit the following line in a system configuration file, which begins with "99-", in the "/etc/sysctl.d/" directory: + + kernel.perf_event_paranoid = 2 + + Load settings from all system configuration files with the following command: + +-$ sudo sysctl --systemVerify the operating system is configured to prevent kernel profiling by unprivileged users with the following commands: +- +-Check the status of the kernel.perf_event_paranoid kernel parameter. +- +-$ sudo sysctl kernel.perf_event_paranoid +- +-kernel.perf_event_paranoid = 2 +- +-If "kernel.perf_event_paranoid" is not set to "2" or is missing, this is a finding. +- +-Check that the configuration files are present to enable this kernel parameter. +- +-$ sudo grep -r kernel.perf_event_paranoid /etc/sysctl.conf /etc/sysctl.d/*.conf +- +-/etc/sysctl.d/99-sysctl.conf:kernel.perf_event_paranoid = 2 +- +-If "kernel.perf_event_paranoid" is not set to "2", is missing or commented out, this is a finding.SRG-OS-000373-GPOS-00156<GroupDescription></GroupDescription>RHEL-08-010380RHEL 8 must require users to provide a password for privilege escalation.<VulnDiscussion>Without reauthentication, users may access resources or perform tasks for which they do not have authorization. ++$ sudo sysctl --systemVerify the operating system is configured to prevent kernel profiling by unprivileged users with the following commands: ++ ++Check the status of the kernel.perf_event_paranoid kernel parameter. ++ ++$ sudo sysctl kernel.perf_event_paranoid ++ ++kernel.perf_event_paranoid = 2 ++ ++If "kernel.perf_event_paranoid" is not set to "2" or is missing, this is a finding. ++ ++Check that the configuration files are present to enable this kernel parameter. ++ ++$ sudo grep -r kernel.perf_event_paranoid /etc/sysctl.d/*.conf ++ ++/etc/sysctl.d/99-sysctl.conf:kernel.perf_event_paranoid = 2 ++ ++If "kernel.perf_event_paranoid" is not set to "2", is missing or commented out, this is a finding. ++ ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000373-GPOS-00156<GroupDescription></GroupDescription>RHEL-08-010380RHEL 8 must require users to provide a password for privilege escalation.<VulnDiscussion>Without reauthentication, users may access resources or perform tasks for which they do not have authorization. + + When operating systems provide the capability to escalate a functional capability, it is critical the user reauthenticate. + +@@ -1093,7 +1136,7 @@ If "dmesg" does not show "NX (Execute Disable) protection" active, check the cpu + $ sudo less /proc/cpuinfo | grep -i flags + flags : fpu vme de pse tsc ms nx rdtscp lm constant_tsc + +-If "flags" does not contain the "nx" flag, this is a finding.SRG-OS-000134-GPOS-00068<GroupDescription></GroupDescription>RHEL-08-010421RHEL 8 must clear the page allocator to prevent use-after-free attacks.<VulnDiscussion>Some adversaries launch attacks with the intent of executing code in non-executable regions of memory or in memory locations that are prohibited. Security safeguards employed to protect memory include, for example, data execution prevention and address space layout randomization. Data execution prevention safeguards can be either hardware-enforced or software-enforced with hardware providing the greater strength of mechanism. ++If "flags" does not contain the "nx" flag, this is a finding.SRG-OS-000134-GPOS-00068<GroupDescription></GroupDescription>RHEL-08-010421RHEL 8 must clear the page allocator to prevent use-after-free attacks.<VulnDiscussion>Some adversaries launch attacks with the intent of executing code in non-executable regions of memory or in memory locations that are prohibited. Security safeguards employed to protect memory include, for example, data execution prevention and address space layout randomization. Data execution prevention safeguards can be either hardware-enforced or software-enforced with hardware providing the greater strength of mechanism. + + Poisoning writes an arbitrary value to freed pages, so any modification or reference to that page after being freed or before being initialized will be detected and prevented. This prevents many types of use-after-free vulnerabilities at little performance cost. Also prevents leak of data and detection of corrupted memory. + +@@ -1103,11 +1146,11 @@ $ sudo grubby --update-kernel=ALL --args="page_poison=1" + + Add or modify the following line in "/etc/default/grub" to ensure the configuration survives kernel updates: + +-GRUB_CMDLINE_LINUX="page_poison=1"Verify that GRUB 2 is configured to enable page poisoning to mitigate use-after-free vulnerabilities with the following commands: ++GRUB_CMDLINE_LINUX="page_poison=1"Verify that GRUB 2 is configured to enable page poisoning to mitigate use-after-free vulnerabilities with the following commands: + + Check that the current GRUB 2 configuration has page poisoning enabled: + +-$ sudo grub2-editenv - list | grep page_poison ++$ sudo grub2-editenv list | grep page_poison + + kernelopts=root=/dev/mapper/rhel-root ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet fips=1 page_poison=1 vsyscall=none audit=1 audit_backlog_limit=8192 boot=UUID=8d171156-cd61-421c-ba41-1c021ac29e82 + +@@ -1119,7 +1162,7 @@ $ sudo grep page_poison /etc/default/grub + + GRUB_CMDLINE_LINUX="page_poison=1" + +-If "page_poison" is not set to "1", is missing or commented out, this is a finding.SRG-OS-000134-GPOS-00068<GroupDescription></GroupDescription>RHEL-08-010422RHEL 8 must disable virtual syscalls.<VulnDiscussion>Syscalls are special routines in the Linux kernel, which userspace applications ask to do privileged tasks. Invoking a system call is an expensive operation because the processor must interrupt the currently executing task and switch context to kernel mode and then back to userspace after the system call completes. Virtual Syscalls map into user space a page that contains some variables and the implementation of some system calls. This allows the system calls to be executed in userspace to alleviate the context switching expense. ++If "page_poison" is not set to "1", is missing or commented out, this is a finding.SRG-OS-000134-GPOS-00068<GroupDescription></GroupDescription>RHEL-08-010422RHEL 8 must disable virtual syscalls.<VulnDiscussion>Syscalls are special routines in the Linux kernel, which userspace applications ask to do privileged tasks. Invoking a system call is an expensive operation because the processor must interrupt the currently executing task and switch context to kernel mode and then back to userspace after the system call completes. Virtual Syscalls map into user space a page that contains some variables and the implementation of some system calls. This allows the system calls to be executed in userspace to alleviate the context switching expense. + + Virtual Syscalls provide an opportunity of attack for a user who has control of the return instruction pointer. Disabling vsyscalls help to prevent return oriented programming (ROP) attacks via buffer overflows and overruns. If the system intends to run containers based on RHEL 6 components, then virtual syscalls will need enabled so the components function properly. + +@@ -1129,11 +1172,11 @@ $ sudo grubby --update-kernel=ALL --args="vsyscall=none" + + Add or modify the following line in "/etc/default/grub" to ensure the configuration survives kernel updates: + +-GRUB_CMDLINE_LINUX="vsyscall=none"Verify that GRUB 2 is configured to disable vsyscalls with the following commands: ++GRUB_CMDLINE_LINUX="vsyscall=none"Verify that GRUB 2 is configured to disable vsyscalls with the following commands: + + Check that the current GRUB 2 configuration disables vsyscalls: + +-$ sudo grub2-editenv - list | grep vsyscall ++$ sudo grub2-editenv list | grep vsyscall + + kernelopts=root=/dev/mapper/rhel-root ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet fips=1 page_poison=1 vsyscall=none audit=1 audit_backlog_limit=8192 boot=UUID=8d171156-cd61-421c-ba41-1c021ac29e82 + +@@ -1145,7 +1188,7 @@ $ sudo grep vsyscall /etc/default/grub + + GRUB_CMDLINE_LINUX="vsyscall=none" + +-If "vsyscall" is not set to "none", is missing or commented out and is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000134-GPOS-00068<GroupDescription></GroupDescription>RHEL-08-010423RHEL 8 must clear SLUB/SLAB objects to prevent use-after-free attacks.<VulnDiscussion>Some adversaries launch attacks with the intent of executing code in non-executable regions of memory or in memory locations that are prohibited. Security safeguards employed to protect memory include, for example, data execution prevention and address space layout randomization. Data execution prevention safeguards can be either hardware-enforced or software-enforced with hardware providing the greater strength of mechanism. ++If "vsyscall" is not set to "none", is missing or commented out and is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000134-GPOS-00068<GroupDescription></GroupDescription>RHEL-08-010423RHEL 8 must clear SLUB/SLAB objects to prevent use-after-free attacks.<VulnDiscussion>Some adversaries launch attacks with the intent of executing code in non-executable regions of memory or in memory locations that are prohibited. Security safeguards employed to protect memory include, for example, data execution prevention and address space layout randomization. Data execution prevention safeguards can be either hardware-enforced or software-enforced with hardware providing the greater strength of mechanism. + + Poisoning writes an arbitrary value to freed pages, so any modification or reference to that page after being freed or before being initialized will be detected and prevented. This prevents many types of use-after-free vulnerabilities at little performance cost. Also prevents leak of data and detection of corrupted memory. + +@@ -1157,11 +1200,11 @@ $ sudo grubby --update-kernel=ALL --args="slub_debug=P" + + Add or modify the following line in "/etc/default/grub" to ensure the configuration survives kernel updates: + +-GRUB_CMDLINE_LINUX="slub_debug=P"Verify that GRUB 2 is configured to enable poisoning of SLUB/SLAB objects to mitigate use-after-free vulnerabilities with the following commands: ++GRUB_CMDLINE_LINUX="slub_debug=P"Verify that GRUB 2 is configured to enable poisoning of SLUB/SLAB objects to mitigate use-after-free vulnerabilities with the following commands: + + Check that the current GRUB 2 configuration has poisoning of SLUB/SLAB objects enabled: + +-$ sudo grub2-editenv - list | grep slub_debug ++$ sudo grub2-editenv list | grep slub_debug + + kernelopts=root=/dev/mapper/rhel-root ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet fips=1 slub_debug=P page_poison=1 vsyscall=none audit=1 audit_backlog_limit=8192 boot=UUID=8d171156-cd61-421c-ba41-1c021ac29e82 + +@@ -1173,29 +1216,43 @@ $ sudo grep slub_debug /etc/default/grub + + GRUB_CMDLINE_LINUX="slub_debug=P" + +-If "slub_debug" is not set to "P", is missing or commented out, this is a finding.SRG-OS-000433-GPOS-00193<GroupDescription></GroupDescription>RHEL-08-010430RHEL 8 must implement address space layout randomization (ASLR) to protect its memory from unauthorized code execution.<VulnDiscussion>Some adversaries launch attacks with the intent of executing code in non-executable regions of memory or in memory locations that are prohibited. Security safeguards employed to protect memory include, for example, data execution prevention and address space layout randomization. Data execution prevention safeguards can be either hardware-enforced or software-enforced with hardware providing the greater strength of mechanism. ++If "slub_debug" is not set to "P", is missing or commented out, this is a finding.SRG-OS-000433-GPOS-00193<GroupDescription></GroupDescription>RHEL-08-010430RHEL 8 must implement address space layout randomization (ASLR) to protect its memory from unauthorized code execution.<VulnDiscussion>Some adversaries launch attacks with the intent of executing code in non-executable regions of memory or in memory locations that are prohibited. Security safeguards employed to protect memory include, for example, data execution prevention and address space layout randomization. Data execution prevention safeguards can be either hardware-enforced or software-enforced with hardware providing the greater strength of mechanism. ++ ++Examples of attacks are buffer overflow attacks. + +-Examples of attacks are buffer overflow attacks.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-002824Configure the operating system to implement virtual address space randomization. ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf + +-Set the system to the required kernel parameter by adding the following line to "/etc/sysctl.d/*.conf"(or modify the line to have the required value): ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-002824Configure the operating system to implement virtual address space randomization. ++ ++Add or edit the following line in a system configuration file, which begins with "99-", in the "/etc/sysctl.d/" directory: + + kernel.randomize_va_space=2 + + Issue the following command to make the changes take effect: + +-$ sudo sysctl --systemVerify RHEL 8 implements ASLR with the following command: ++$ sudo sysctl --systemVerify RHEL 8 implements ASLR with the following command: + + $ sudo sysctl kernel.randomize_va_space + + kernel.randomize_va_space = 2 + +-If nothing is returned, verify the kernel parameter "randomize_va_space" is set to "2" with the following command: ++If "kernel.randomize_va_space" is not set to "2", this is a finding. ++ ++Check that the configuration files are present to enable this kernel parameter. ++ ++$ sudo grep -r kernel.randomize_va_space /etc/sysctl.d/*.conf + +-$ sudo cat /proc/sys/kernel/randomize_va_space ++/etc/sysctl.d/99-sysctl.conf:kernel.randomize_va_space = 2 + +-2 ++If "kernel.randomize_va_space" is not set to "2", is missing or commented out, this is a finding. + +-If "kernel.randomize_va_space" is not set to "2", this is a finding.SRG-OS-000437-GPOS-00194<GroupDescription></GroupDescription>RHEL-08-010440YUM must remove all software components after updated versions have been installed on RHEL 8.<VulnDiscussion>Previous versions of software components that are not removed from the information system after updates have been installed may be exploited by adversaries. Some information technology products may remove older versions of software automatically from the information system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-002617Configure the operating system to remove all software components after updated versions have been installed. ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000437-GPOS-00194<GroupDescription></GroupDescription>RHEL-08-010440YUM must remove all software components after updated versions have been installed on RHEL 8.<VulnDiscussion>Previous versions of software components that are not removed from the information system after updates have been installed may be exploited by adversaries. Some information technology products may remove older versions of software automatically from the information system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-002617Configure the operating system to remove all software components after updated versions have been installed. + + Set the "clean_requirements_on_remove" option to "True" in the "/etc/dnf/dnf.conf" file: + +@@ -1545,19 +1602,41 @@ Main PID: 1130 (code=exited, status=0/SUCCESS) + + If the "kdump" service is active, ask the System Administrator if the use of the service is required and documented with the Information System Security Officer (ISSO). + +-If the service is active and is not documented, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-010671RHEL 8 must disable the kernel.core_pattern.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to disable storing core dumps by adding the following line to a file in the "/etc/sysctl.d" directory: ++If the service is active and is not documented, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-010671RHEL 8 must disable the kernel.core_pattern.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. ++ ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf ++ ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to disable storing core dumps. ++ ++Add or edit the following line in a system configuration file, which begins with "99-", in the "/etc/sysctl.d/" directory: + + kernel.core_pattern = |/bin/false + + The system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command: + +-$ sudo sysctl --systemVerify RHEL 8 disables storing core dumps with the following commands: ++$ sudo sysctl --systemVerify RHEL 8 disables storing core dumps with the following commands: + + $ sudo sysctl kernel.core_pattern + + kernel.core_pattern = |/bin/false + +-If the returned line does not have a value of "|/bin/false", or a line is not returned and the need for core dumps is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-010672RHEL 8 must disable acquiring, saving, and processing core dumps.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. ++If the returned line does not have a value of "|/bin/false", or a line is not returned and the need for core dumps is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding. ++ ++Check that the configuration files are present to enable this kernel parameter. ++ ++$ sudo grep -r kernel.core_pattern /etc/sysctl.d/*.conf ++ ++/etc/sysctl.d/99-sysctl.conf:kernel.core_pattern = |/bin/false ++ ++If "kernel.core_pattern" is not set to "|/bin/false", is missing or commented out, this is a finding. ++ ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-010672RHEL 8 must disable acquiring, saving, and processing core dumps.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. + + A core dump includes a memory image taken at the time the operating system terminates an application. The memory image could contain sensitive data and is generally useful only for developers trying to debug problems. + +@@ -1646,14 +1725,13 @@ $ sudo grep nameserver /etc/resolv.conf + nameserver 192.168.1.2 + nameserver 192.168.1.3 + +-If less than two lines are returned that are not commented out, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-010690Executable search paths within the initialization files of all local interactive RHEL 8 users must only contain paths that resolve to the system default or the users home directory.<VulnDiscussion>The executable search path (typically the PATH environment variable) contains a list of directories for the shell to search to find executables. If this path includes the current working directory (other than the user's home directory), executables in these directories may be executed instead of system commands. This variable is formatted as a colon-separated list of directories. If there is an empty entry, such as a leading or trailing colon or two consecutive colons, this is interpreted as the current working directory. If deviations from the default system search path for the local interactive user are required, they must be documented with the Information System Security Officer (ISSO).</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Edit the local interactive user initialization files to change any PATH variable statements that reference directories other than their home directory. ++If less than two lines are returned that are not commented out, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-010690Executable search paths within the initialization files of all local interactive RHEL 8 users must only contain paths that resolve to the system default or the users home directory.<VulnDiscussion>The executable search path (typically the PATH environment variable) contains a list of directories for the shell to search to find executables. If this path includes the current working directory (other than the user's home directory), executables in these directories may be executed instead of system commands. This variable is formatted as a colon-separated list of directories. If there is an empty entry, such as a leading or trailing colon or two consecutive colons, this is interpreted as the current working directory. If deviations from the default system search path for the local interactive user are required, they must be documented with the Information System Security Officer (ISSO).</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Edit the local interactive user initialization files to change any PATH variable statements that reference directories other than their home directory. + +-If a local interactive user requires path variables to reference a directory owned by the application, it must be documented with the ISSO.Verify that all local interactive user initialization file executable search path statements do not contain statements that will reference a working directory other than user home directories with the following commands: ++If a local interactive user requires path variables to reference a directory owned by the application, it must be documented with the ISSO.Verify that all local interactive user initialization file executable search path statements do not contain statements that will reference a working directory other than user home directories with the following commands: + +-$ sudo grep -i path /home/*/.* ++$ sudo grep -i path= /home/*/.* + + /home/[localinteractiveuser]/.bash_profile:PATH=$PATH:$HOME/.local/bin:$HOME/bin +-/home/[localinteractiveuser]/.bash_profile:export PATH + + If any local interactive user initialization files have executable search path statements that include directories outside of their home directory and is not documented with the ISSO as an operational requirement, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-010700All RHEL 8 world-writable directories must be owned by root, sys, bin, or an application user.<VulnDiscussion>If a world-writable directory is not owned by root, sys, bin, or an application User Identifier (UID), unauthorized users may be able to modify files created by others. + +@@ -2309,27 +2387,27 @@ Satisfies: SRG-OS-000028-GPOS-00009, SRG-OS-000030-GPOS-00011</VulnDiscussion + + $ sudo grep -i tmux /etc/shells + +-If any output is produced, this is a finding.SRG-OS-000028-GPOS-00009<GroupDescription></GroupDescription>RHEL-08-020050RHEL 8 must be able to initiate directly a session lock for all connection types using smartcard when the smartcard is removed.<VulnDiscussion>A session lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not want to log out because of the temporary nature of the absence. +- +-The session lock is implemented at the point where session activity can be determined. Rather than be forced to wait for a period of time to expire before the user session can be locked, RHEL 8 needs to provide users with the ability to manually invoke a session lock so users can secure their session if it is necessary to temporarily vacate the immediate physical vicinity. +- +-Tmux is a terminal multiplexer that enables a number of terminals to be created, accessed, and controlled from a single screen. Red Hat endorses tmux as the recommended session controlling package. +- +-Satisfies: SRG-OS-000028-GPOS-00009, SRG-OS-000030-GPOS-00011</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000056Configure the operating system to enable a user's session lock until that user re-establishes access using established identification and authentication procedures. +- +-Select/Create an authselect profile and incorporate the "with-smartcard-lock-on-removal" feature with the following example: +- +-$ sudo authselect select sssd with-smartcard with-smartcard-lock-on-removal +- +-Alternatively, the dconf settings can be edited in the /etc/dconf/db/* location. +- +-Edit or add the "[org/gnome/settings-daemon/peripherals/smartcard]" section of the database file and add or update the following lines: +- +-removal-action='lock-screen' +- +-Update the system databases: +- +-$ sudo dconf updateVerify the operating system enables a user's session lock until that user re-establishes access using established identification and authentication procedures with the following command: ++If any output is produced, this is a finding.SRG-OS-000028-GPOS-00009<GroupDescription></GroupDescription>RHEL-08-020050RHEL 8 must be able to initiate directly a session lock for all connection types using smartcard when the smartcard is removed.<VulnDiscussion>A session lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not want to log out because of the temporary nature of the absence. ++ ++The session lock is implemented at the point where session activity can be determined. Rather than be forced to wait for a period of time to expire before the user session can be locked, RHEL 8 needs to provide users with the ability to manually invoke a session lock so users can secure their session if it is necessary to temporarily vacate the immediate physical vicinity. ++ ++Satisfies: SRG-OS-000028-GPOS-00009, SRG-OS-000030-GPOS-00011</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000056Configure the operating system to enable a user's session lock until that user re-establishes access using established identification and authentication procedures. ++ ++Select/Create an authselect profile and incorporate the "with-smartcard-lock-on-removal" feature with the following example: ++ ++$ sudo authselect select sssd with-smartcard with-smartcard-lock-on-removal ++ ++Alternatively, the dconf settings can be edited in the /etc/dconf/db/* location. ++ ++Edit or add the "[org/gnome/settings-daemon/peripherals/smartcard]" section of the database file and add or update the following lines: ++ ++removal-action='lock-screen' ++ ++Update the system databases: ++ ++$ sudo dconf updateVerify the operating system enables a user's session lock until that user re-establishes access using established identification and authentication procedures with the following command: ++ ++This requirement assumes the use of the RHEL 8 default graphical user interface, Gnome Shell. If the system does not have any graphical user interface installed, this requirement is Not Applicable. + + $ sudo grep -R removal-action /etc/dconf/db/* + +@@ -2875,22 +2953,24 @@ Note: The example is for a system that is configured to create users home direct + + # grep -i umask /home/*/.* + +-If any local interactive user initialization files are found to have a umask statement that has a value less restrictive than "077", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-020353RHEL 8 must define default permissions for logon and non-logon shells.<VulnDiscussion>The umask controls the default access mode assigned to newly created files. A umask of 077 limits new files to mode 600 or less permissive. Although umask can be represented as a four-digit number, the first digit representing special access modes is typically ignored or required to be "0". This requirement applies to the globally configured system defaults and the local interactive user defaults for each account on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure the operating system to define default permissions for all authenticated users in such a way that the user can only read and modify their own files. ++If any local interactive user initialization files are found to have a umask statement that has a value less restrictive than "077", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-020353RHEL 8 must define default permissions for logon and non-logon shells.<VulnDiscussion>The umask controls the default access mode assigned to newly created files. A umask of 077 limits new files to mode 600 or less permissive. Although umask can be represented as a four-digit number, the first digit representing special access modes is typically ignored or required to be "0". This requirement applies to the globally configured system defaults and the local interactive user defaults for each account on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure the operating system to define default permissions for all authenticated users in such a way that the user can only read and modify their own files. + +-Add or edit the lines for the "UMASK" parameter in the "/etc/bashrc" and "etc/csh.cshrc" files to "077": ++Add or edit the lines for the "UMASK" parameter in the "/etc/bashrc", "/etc/csh.cshrc" and "/etc/profile"files to "077": + +-UMASK 077Verify that the umask default for installed shells is "077". ++UMASK 077Verify that the umask default for installed shells is "077". + +-Check for the value of the "UMASK" parameter in the "/etc/bashrc" and "/etc/csh.cshrc" files with the following command: ++Check for the value of the "UMASK" parameter in the "/etc/bashrc", "/etc/csh.cshrc" and "/etc/profile" files with the following command: + +-Note: If the value of the "UMASK" parameter is set to "000" in either the "/etc/bashrc" or the "/etc/csh.cshrc" files, the Severity is raised to a CAT I. ++Note: If the value of the "UMASK" parameter is set to "000" in the "/etc/bashrc" the "/etc/csh.cshrc" or the "/etc/profile" files, the Severity is raised to a CAT I. + +-# grep -i umask /etc/bashrc /etc/csh.cshrc ++# grep -i umask /etc/bashrc /etc/csh.cshrc /etc/profile + + /etc/bashrc: umask 077 + /etc/bashrc: umask 077 + /etc/csh.cshrc: umask 077 + /etc/csh.cshrc: umask 077 ++/etc/profile: umask 077 ++/etc/profile: umask 077 + + If the value for the "UMASK" parameter is not "077", or the "UMASK" parameter is missing or is commented out, this is a finding.SRG-OS-000326-GPOS-00126<GroupDescription></GroupDescription>RHEL-08-030000The RHEL 8 audit system must be configured to audit the execution of privileged functions and prevent all software from executing at higher privilege levels than users executing the software.<VulnDiscussion>Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised information system accounts, is a serious and ongoing concern and can have significant adverse impacts on organizations. Auditing the use of privileged functions is one way to detect such misuse and identify the risk from insider threats and the advanced persistent threat. + +@@ -4427,7 +4507,7 @@ $ sudo grep -w lastlog /etc/audit/audit.rules + + -w /var/log/lastlog -p wa -k logins + +-If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030601RHEL 8 must enable auditing of processes that start prior to the audit daemon.<VulnDiscussion>Without the capability to generate audit records, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. ++If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030601RHEL 8 must enable auditing of processes that start prior to the audit daemon.<VulnDiscussion>Without the capability to generate audit records, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. + + If auditing is enabled late in the startup process, the actions of some startup processes may not be audited. Some audit systems also maintain state information only available if auditing is enabled before a given process is created. + +@@ -4451,9 +4531,9 @@ $ sudo grubby --update-kernel=ALL --args="audit=1" + + Add or modify the following line in "/etc/default/grub" to ensure the configuration survives kernel updates: + +-GRUB_CMDLINE_LINUX="audit=1"Verify RHEL 8 enables auditing of processes that start prior to the audit daemon with the following commands: ++GRUB_CMDLINE_LINUX="audit=1"Verify RHEL 8 enables auditing of processes that start prior to the audit daemon with the following commands: + +-$ sudo grub2-editenv - list | grep audit ++$ sudo grub2-editenv list | grep audit + + kernelopts=root=/dev/mapper/rhel-root ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet fips=1 audit=1 audit_backlog_limit=8192 boot=UUID=8d171156-cd61-421c-ba41-1c021ac29e82 + +@@ -4465,7 +4545,7 @@ $ sudo grep audit /etc/default/grub + + GRUB_CMDLINE_LINUX="audit=1" + +-If "audit" is not set to "1", is missing or commented out, this is a finding.SRG-OS-000341-GPOS-00132<GroupDescription></GroupDescription>RHEL-08-030602RHEL 8 must allocate an audit_backlog_limit of sufficient size to capture processes that start prior to the audit daemon.<VulnDiscussion>Without the capability to generate audit records, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. ++If "audit" is not set to "1", is missing or commented out, this is a finding.SRG-OS-000341-GPOS-00132<GroupDescription></GroupDescription>RHEL-08-030602RHEL 8 must allocate an audit_backlog_limit of sufficient size to capture processes that start prior to the audit daemon.<VulnDiscussion>Without the capability to generate audit records, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. + + If auditing is enabled late in the startup process, the actions of some startup processes may not be audited. Some audit systems also maintain state information only available if auditing is enabled before a given process is created. + +@@ -4477,9 +4557,9 @@ $ sudo grubby --update-kernel=ALL --args="audit_backlog_limit=8192" + + Add or modify the following line in "/etc/default/grub" to ensure the configuration survives kernel updates: + +-GRUB_CMDLINE_LINUX="audit_backlog_limit=8192"Verify RHEL 8 allocates a sufficient audit_backlog_limit to capture processes that start prior to the audit daemon with the following commands: ++GRUB_CMDLINE_LINUX="audit_backlog_limit=8192"Verify RHEL 8 allocates a sufficient audit_backlog_limit to capture processes that start prior to the audit daemon with the following commands: + +-$ sudo grub2-editenv - list | grep audit ++$ sudo grub2-editenv list | grep audit + + kernelopts=root=/dev/mapper/rhel-root ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet fips=1 audit=1 audit_backlog_limit=8192 boot=UUID=8d171156-cd61-421c-ba41-1c021ac29e82 + +@@ -4894,7 +4974,7 @@ $ sudo yum remove sendmailSRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-08-040004RHEL 8 must enable mitigations against processor-based vulnerabilities.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. ++If the sendmail package is installed, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-08-040004RHEL 8 must enable mitigations against processor-based vulnerabilities.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. + + Operating systems are capable of providing a wide variety of functions and services. Some of the functions and services, provided by default, may not be necessary to support essential organizational operations (e.g., key missions, functions). + +@@ -4908,9 +4988,9 @@ $ sudo grubby --update-kernel=ALL --args="pti=on" + + Add or modify the following line in "/etc/default/grub" to ensure the configuration survives kernel updates: + +-GRUB_CMDLINE_LINUX="pti=on"Verify RHEL 8 enables kernel page-table isolation with the following commands: ++GRUB_CMDLINE_LINUX="pti=on"Verify RHEL 8 enables kernel page-table isolation with the following commands: + +-$ sudo grub2-editenv - list | grep pti ++$ sudo grub2-editenv list | grep pti + + kernelopts=root=/dev/mapper/rhel-root ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet fips=1 audit=1 audit_backlog_limit=8192 pti=on boot=UUID=8d171156-cd61-421c-ba41-1c021ac29e82 + +@@ -4987,22 +5067,22 @@ $ sudo dmesg | grep -i video + [ 47.235752] usbcore: registered new interface driver uvcvideo + [ 47.235756] USB Video Class driver (1.1.1) + +-If the camera driver blacklist is missing, a camera driver is determined to be in use, and the collaborative computing device has not been authorized for use, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-08-040021RHEL 8 must disable the asynchronous transfer mode (ATM) protocol.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. ++If the camera driver blacklist is missing, a camera driver is determined to be in use, and the collaborative computing device has not been authorized for use, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-08-040021RHEL 8 must disable the asynchronous transfer mode (ATM) protocol.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. + + Failing to disconnect unused protocols can result in a system compromise. + +-The Asynchronous Transfer Mode (ATM) is a protocol operating on network, data link, and physical layers, based on virtual circuits and virtual paths. Disabling ATM protects the system against exploitation of any laws in its implementation.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000381Configure the operating system to disable the ability to use the ATM protocol kernel module. ++The Asynchronous Transfer Mode (ATM) is a protocol operating on network, data link, and physical layers, based on virtual circuits and virtual paths. Disabling ATM protects the system against exploitation of any laws in its implementation.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000381Configure the operating system to disable the ability to use the ATM protocol kernel module. + + Add or update the following lines in the file "/etc/modprobe.d/blacklist.conf": + +-install ATM /bin/true +-blacklist ATM ++install atm /bin/true ++blacklist atm + +-Reboot the system for the settings to take effect.Verify the operating system disables the ability to load the ATM protocol kernel module. ++Reboot the system for the settings to take effect.Verify the operating system disables the ability to load the ATM protocol kernel module. + +-$ sudo grep -ri ATM /etc/modprobe.d/* | grep -i "/bin/true" ++$ sudo grep -r atm /etc/modprobe.d/* | grep "/bin/true" + +-install ATM /bin/true ++install atm /bin/true + + If the command does not return any output, or the line is commented out, and use of the ATM protocol is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding. + +@@ -5010,26 +5090,26 @@ Verify the operating system disables the ability to use the ATM protocol. + + Check to see if the ATM protocol is disabled with the following command: + +-$ sudo grep -ri ATM /etc/modprobe.d/* | grep -i "blacklist" ++$ sudo grep -r atm /etc/modprobe.d/* | grep "blacklist" + +-blacklist ATM ++blacklist atm + +-If the command does not return any output or the output is not "blacklist atm", and use of the ATM protocol is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-08-040022RHEL 8 must disable the controller area network (CAN) protocol.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. ++If the command does not return any output or the output is not "blacklist atm", and use of the ATM protocol is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-08-040022RHEL 8 must disable the controller area network (CAN) protocol.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. + + Failing to disconnect unused protocols can result in a system compromise. + +-The Controller Area Network (CAN) is a serial communications protocol, which was initially developed for automotive and is now also used in marine, industrial, and medical applications. Disabling CAN protects the system against exploitation of any flaws in its implementation.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000381Configure the operating system to disable the ability to use the CAN protocol kernel module. ++The Controller Area Network (CAN) is a serial communications protocol, which was initially developed for automotive and is now also used in marine, industrial, and medical applications. Disabling CAN protects the system against exploitation of any flaws in its implementation.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000381Configure the operating system to disable the ability to use the CAN protocol kernel module. + + Add or update the following lines in the file "/etc/modprobe.d/blacklist.conf": + +-install CAN /bin/true +-blacklist CAN ++install can /bin/true ++blacklist can + +-Reboot the system for the settings to take effect.Verify the operating system disables the ability to load the CAN protocol kernel module. ++Reboot the system for the settings to take effect.Verify the operating system disables the ability to load the CAN protocol kernel module. + +-$ sudo grep -ri CAN /etc/modprobe.d/* | grep -i "/bin/true" ++$ sudo grep -r can /etc/modprobe.d/* | grep "/bin/true" + +-install CAN /bin/true ++install can /bin/true + + If the command does not return any output, or the line is commented out, and use of the CAN protocol is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding. + +@@ -5037,26 +5117,26 @@ Verify the operating system disables the ability to use the CAN protocol. + + Check to see if the CAN protocol is disabled with the following command: + +-$ sudo grep -ri CAN /etc/modprobe.d/* | grep -i "blacklist" ++$ sudo grep -r can /etc/modprobe.d/* | grep "blacklist" + +-blacklist CAN ++blacklist can + +-If the command does not return any output or the output is not "blacklist CAN", and use of the CAN protocol is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-08-040023RHEL 8 must disable the stream control transmission protocol (SCTP).<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. ++If the command does not return any output or the output is not "blacklist can", and use of the CAN protocol is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-08-040023RHEL 8 must disable the stream control transmission protocol (SCTP).<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. + + Failing to disconnect unused protocols can result in a system compromise. + +-The Stream Control Transmission Protocol (SCTP) is a transport layer protocol, designed to support the idea of message-oriented communication, with several streams of messages within one connection. Disabling SCTP protects the system against exploitation of any flaws in its implementation.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000381Configure the operating system to disable the ability to use the SCTP kernel module. ++The Stream Control Transmission Protocol (SCTP) is a transport layer protocol, designed to support the idea of message-oriented communication, with several streams of messages within one connection. Disabling SCTP protects the system against exploitation of any flaws in its implementation.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000381Configure the operating system to disable the ability to use the SCTP kernel module. + + Add or update the following lines in the file "/etc/modprobe.d/blacklist.conf": + +-install SCTP /bin/true +-blacklist SCTP ++install sctp /bin/true ++blacklist sctp + +-Reboot the system for the settings to take effect.Verify the operating system disables the ability to load the SCTP kernel module. ++Reboot the system for the settings to take effect.Verify the operating system disables the ability to load the SCTP kernel module. + +-$ sudo grep -ri SCTP /etc/modprobe.d/* | grep -i "/bin/true" ++$ sudo grep -r sctp /etc/modprobe.d/* | grep "/bin/true" + +-install SCTP /bin/true ++install sctp /bin/true + + If the command does not return any output, or the line is commented out, and use of the SCTP is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding. + +@@ -5064,26 +5144,26 @@ Verify the operating system disables the ability to use the SCTP. + + Check to see if the SCTP is disabled with the following command: + +-$ sudo grep -ri SCTP /etc/modprobe.d/* | grep -i "blacklist" ++$ sudo grep -r sctp /etc/modprobe.d/* | grep "blacklist" + +-blacklist SCTP ++blacklist sctp + +-If the command does not return any output or the output is not "blacklist SCTP", and use of the SCTP is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-08-040024RHEL 8 must disable the transparent inter-process communication (TIPC) protocol.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. ++If the command does not return any output or the output is not "blacklist sctp", and use of the SCTP is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-08-040024RHEL 8 must disable the transparent inter-process communication (TIPC) protocol.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. + + Failing to disconnect unused protocols can result in a system compromise. + +-The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communications between nodes in a cluster. Disabling TIPC protects the system against exploitation of any flaws in its implementation.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000381Configure the operating system to disable the ability to use the TIPC protocol kernel module. ++The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communications between nodes in a cluster. Disabling TIPC protects the system against exploitation of any flaws in its implementation.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000381Configure the operating system to disable the ability to use the TIPC protocol kernel module. + + Add or update the following lines in the file "/etc/modprobe.d/blacklist.conf": + +-install TIPC /bin/true +-blacklist TIPC ++install tipc /bin/true ++blacklist tipc + +-Reboot the system for the settings to take effect.Verify the operating system disables the ability to load the TIPC protocol kernel module. ++Reboot the system for the settings to take effect.Verify the operating system disables the ability to load the TIPC protocol kernel module. + +-$ sudo grep -ri TIPC /etc/modprobe.d/* | grep -i "/bin/true" ++$ sudo grep -r tipc /etc/modprobe.d/* | grep "/bin/true" + +-install TIPC /bin/true ++install tipc /bin/true + + If the command does not return any output, or the line is commented out, and use of the TIPC protocol is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding. + +@@ -5091,11 +5171,11 @@ Verify the operating system disables the ability to use the TIPC protocol. + + Check to see if the TIPC protocol is disabled with the following command: + +-$ sudo grep -ri TIPC /etc/modprobe.d/* | grep -i "blacklist" ++$ sudo grep -r tipc /etc/modprobe.d/* | grep "blacklist" + +-blacklist TIPC ++blacklist tipc + +-If the command does not return any output or the output is not "blacklist TIPC", and use of the TIPC protocol is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-08-040025RHEL 8 must disable mounting of cramfs.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. ++If the command does not return any output or the output is not "blacklist tipc", and use of the TIPC protocol is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-08-040025RHEL 8 must disable mounting of cramfs.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. + + Removing support for unneeded filesystem types reduces the local attack surface of the server. + +@@ -5106,9 +5186,9 @@ Add or update the following lines in the file "/etc/modprobe.d/blacklist.conf": + install cramfs /bin/true + blacklist cramfs + +-Reboot the system for the settings to take effect.Verify the operating system disables the ability to load the cramfs kernel module. ++Reboot the system for the settings to take effect.Verify the operating system disables the ability to load the cramfs kernel module. + +-$ sudo grep -ri cramfs /etc/modprobe.d/* | grep -i "/bin/true" ++$ sudo grep -r cramfs /etc/modprobe.d/* | grep "/bin/true" + + install cramfs /bin/true + +@@ -5118,11 +5198,11 @@ Verify the operating system disables the ability to use the cramfs kernel module + + Check to see if the cramfs kernel module is disabled with the following command: + +-$ sudo grep -ri cramfs /etc/modprobe.d/* | grep -i "blacklist" ++$ sudo grep -r cramfs /etc/modprobe.d/* | grep "blacklist" + + blacklist cramfs + +-If the command does not return any output or the output is not "blacklist cramfs", and use of the cramfs kernel module is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-08-040026RHEL 8 must disable IEEE 1394 (FireWire) Support.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. ++If the command does not return any output or the output is not "blacklist cramfs", and use of the cramfs kernel module is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-08-040026RHEL 8 must disable IEEE 1394 (FireWire) Support.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. + + The IEEE 1394 (FireWire) is a serial bus standard for high-speed real-time communication. Disabling FireWire protects the system against exploitation of any flaws in its implementation.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000381Configure the operating system to disable the ability to use the firewire-core kernel module. + +@@ -5131,9 +5211,9 @@ Add or update the following lines in the file "/etc/modprobe.d/blacklist.conf": + install firewire-core /bin/true + blacklist firewire-core + +-Reboot the system for the settings to take effect.Verify the operating system disables the ability to load the firewire-core kernel module. ++Reboot the system for the settings to take effect.Verify the operating system disables the ability to load the firewire-core kernel module. + +-$ sudo grep -ri firewire-core /etc/modprobe.d/* | grep -i "/bin/true" ++$ sudo grep -r firewire-core /etc/modprobe.d/* | grep "/bin/true" + + install firewire-core /bin/true + +@@ -5143,7 +5223,7 @@ Verify the operating system disables the ability to use the firewire-core kernel + + Check to see if the firewire-core kernel module is disabled with the following command: + +-$ sudo grep -ri firewire-core /etc/modprobe.d/* | grep -i "blacklist" ++$ sudo grep -r firewire-core /etc/modprobe.d/* | grep "blacklist" + + blacklist firewire-core + +@@ -5543,65 +5623,65 @@ $ sudo cat /etc/fstab | grep /var/log/audit + + /dev/mapper/rhel-var-log-audit /var/log/audit xfs defaults,nodev,nosuid,noexec 0 0 + +-If results are returned and the "noexec" option is missing, or if /var/log/audit is mounted without the "noexec" option, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-08-040132RHEL 8 must mount /var/tmp with the nodev option.<VulnDiscussion>The organization must identify authorized software programs and permit execution of authorized software. The process used to identify software programs that are authorized to execute on organizational information systems is commonly referred to as whitelisting. +- +-The "noexec" mount option causes the system to not execute binary files. This option must be used for mounting any file system not containing approved binary files, as they may be incompatible. Executing files from untrusted file systems increases the opportunity for unprivileged users to attain unauthorized administrative access. +- +-The "nodev" mount option causes the system to not interpret character or block special devices. Executing character or block special devices from untrusted file systems increases the opportunity for unprivileged users to attain unauthorized administrative access. +- +-The "nosuid" mount option causes the system to not execute "setuid" and "setgid" files with owner privileges. This option must be used for mounting any file system not containing approved "setuid" and "setguid" files. Executing files from untrusted file systems increases the opportunity for unprivileged users to attain unauthorized administrative access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001764Configure the system so that /var/tmp is mounted with the "nodev" option by adding /modifying the /etc/fstab with the following line: ++If results are returned and the "noexec" option is missing, or if /var/log/audit is mounted without the "noexec" option, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-08-040132RHEL 8 must mount /var/tmp with the nodev option.<VulnDiscussion>The organization must identify authorized software programs and permit execution of authorized software. The process used to identify software programs that are authorized to execute on organizational information systems is commonly referred to as whitelisting. ++ ++The "noexec" mount option causes the system to not execute binary files. This option must be used for mounting any file system not containing approved binary files, as they may be incompatible. Executing files from untrusted file systems increases the opportunity for unprivileged users to attain unauthorized administrative access. ++ ++The "nodev" mount option causes the system to not interpret character or block special devices. Executing character or block special devices from untrusted file systems increases the opportunity for unprivileged users to attain unauthorized administrative access. ++ ++The "nosuid" mount option causes the system to not execute "setuid" and "setgid" files with owner privileges. This option must be used for mounting any file system not containing approved "setuid" and "setguid" files. Executing files from untrusted file systems increases the opportunity for unprivileged users to attain unauthorized administrative access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001764Configure the system so that /var/tmp is mounted with the "nodev" option by adding /modifying the /etc/fstab with the following line: + +-/dev/mapper/rhel-var-log-audit /var/tmp xfs defaults,nodev,nosuid,noexec 0 0Verify "/var/tmp" is mounted with the "nodev" option: ++/dev/mapper/rhel-var-tmp /var/tmp xfs defaults,nodev,nosuid,noexec 0 0Verify "/var/tmp" is mounted with the "nodev" option: + + $ sudo mount | grep /var/tmp + +-/dev/mapper/rhel-var-log-audit on /var/tmp type xfs (rw,nodev,nosuid,noexec,seclabel) ++/dev/mapper/rhel-var-tmp on /var/tmp type xfs (rw,nodev,nosuid,noexec,seclabel) + + Verify that the "nodev" option is configured for /var/tmp: + + $ sudo cat /etc/fstab | grep /var/tmp + +-/dev/mapper/rhel-var-log-audit /var/tmp xfs defaults,nodev,nosuid,noexec 0 0 ++/dev/mapper/rhel-var-tmp /var/tmp xfs defaults,nodev,nosuid,noexec 0 0 + +-If results are returned and the "nodev" option is missing, or if /var/tmp is mounted without the "nodev" option, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-08-040133RHEL 8 must mount /var/tmp with the nosuid option.<VulnDiscussion>The organization must identify authorized software programs and permit execution of authorized software. The process used to identify software programs that are authorized to execute on organizational information systems is commonly referred to as whitelisting. +- +-The "noexec" mount option causes the system to not execute binary files. This option must be used for mounting any file system not containing approved binary files, as they may be incompatible. Executing files from untrusted file systems increases the opportunity for unprivileged users to attain unauthorized administrative access. +- +-The "nodev" mount option causes the system to not interpret character or block special devices. Executing character or block special devices from untrusted file systems increases the opportunity for unprivileged users to attain unauthorized administrative access. +- +-The "nosuid" mount option causes the system to not execute "setuid" and "setgid" files with owner privileges. This option must be used for mounting any file system not containing approved "setuid" and "setguid" files. Executing files from untrusted file systems increases the opportunity for unprivileged users to attain unauthorized administrative access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001764Configure the system so that /var/tmp is mounted with the "nosuid" option by adding /modifying the /etc/fstab with the following line: ++If results are returned and the "nodev" option is missing, or if /var/tmp is mounted without the "nodev" option, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-08-040133RHEL 8 must mount /var/tmp with the nosuid option.<VulnDiscussion>The organization must identify authorized software programs and permit execution of authorized software. The process used to identify software programs that are authorized to execute on organizational information systems is commonly referred to as whitelisting. ++ ++The "noexec" mount option causes the system to not execute binary files. This option must be used for mounting any file system not containing approved binary files, as they may be incompatible. Executing files from untrusted file systems increases the opportunity for unprivileged users to attain unauthorized administrative access. ++ ++The "nodev" mount option causes the system to not interpret character or block special devices. Executing character or block special devices from untrusted file systems increases the opportunity for unprivileged users to attain unauthorized administrative access. ++ ++The "nosuid" mount option causes the system to not execute "setuid" and "setgid" files with owner privileges. This option must be used for mounting any file system not containing approved "setuid" and "setguid" files. Executing files from untrusted file systems increases the opportunity for unprivileged users to attain unauthorized administrative access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001764Configure the system so that /var/tmp is mounted with the "nosuid" option by adding /modifying the /etc/fstab with the following line: + +-/dev/mapper/rhel-var-log-audit /var/tmp xfs defaults,nodev,nosuid,noexec 0 0Verify "/var/tmp" is mounted with the "nosuid" option: ++/dev/mapper/rhel-var-tmp /var/tmp xfs defaults,nodev,nosuid,noexec 0 0Verify "/var/tmp" is mounted with the "nosuid" option: + + $ sudo mount | grep /var/tmp + +-/dev/mapper/rhel-var-log-audit on /var/tmp type xfs (rw,nodev,nosuid,noexec,seclabel) ++/dev/mapper/rhel-var-tmp on /var/tmp type xfs (rw,nodev,nosuid,noexec,seclabel) + + Verify that the "nosuid" option is configured for /var/tmp: + + $ sudo cat /etc/fstab | grep /var/tmp + +-/dev/mapper/rhel-var-log-audit /var/tmp xfs defaults,nodev,nosuid,noexec 0 0 ++/dev/mapper/rhel-var-tmp /var/tmp xfs defaults,nodev,nosuid,noexec 0 0 + +-If results are returned and the "nosuid" option is missing, or if /var/tmp is mounted without the "nosuid" option, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-08-040134RHEL 8 must mount /var/tmp with the noexec option.<VulnDiscussion>The organization must identify authorized software programs and permit execution of authorized software. The process used to identify software programs that are authorized to execute on organizational information systems is commonly referred to as whitelisting. +- +-The "noexec" mount option causes the system to not execute binary files. This option must be used for mounting any file system not containing approved binary files, as they may be incompatible. Executing files from untrusted file systems increases the opportunity for unprivileged users to attain unauthorized administrative access. +- +-The "nodev" mount option causes the system to not interpret character or block special devices. Executing character or block special devices from untrusted file systems increases the opportunity for unprivileged users to attain unauthorized administrative access. +- +-The "nosuid" mount option causes the system to not execute "setuid" and "setgid" files with owner privileges. This option must be used for mounting any file system not containing approved "setuid" and "setguid" files. Executing files from untrusted file systems increases the opportunity for unprivileged users to attain unauthorized administrative access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001764Configure the system so that /var/tmp is mounted with the "noexec" option by adding /modifying the /etc/fstab with the following line: ++If results are returned and the "nosuid" option is missing, or if /var/tmp is mounted without the "nosuid" option, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-08-040134RHEL 8 must mount /var/tmp with the noexec option.<VulnDiscussion>The organization must identify authorized software programs and permit execution of authorized software. The process used to identify software programs that are authorized to execute on organizational information systems is commonly referred to as whitelisting. ++ ++The "noexec" mount option causes the system to not execute binary files. This option must be used for mounting any file system not containing approved binary files, as they may be incompatible. Executing files from untrusted file systems increases the opportunity for unprivileged users to attain unauthorized administrative access. ++ ++The "nodev" mount option causes the system to not interpret character or block special devices. Executing character or block special devices from untrusted file systems increases the opportunity for unprivileged users to attain unauthorized administrative access. + +-/dev/mapper/rhel-var-log-audit /var/tmp xfs defaults,nodev,nosuid,noexec 0 0Verify "/var/tmp" is mounted with the "noexec" option: ++The "nosuid" mount option causes the system to not execute "setuid" and "setgid" files with owner privileges. This option must be used for mounting any file system not containing approved "setuid" and "setguid" files. Executing files from untrusted file systems increases the opportunity for unprivileged users to attain unauthorized administrative access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001764Configure the system so that /var/tmp is mounted with the "noexec" option by adding /modifying the /etc/fstab with the following line: ++ ++/dev/mapper/rhel-var-tmp /var/tmp xfs defaults,nodev,nosuid,noexec 0 0Verify "/var/tmp" is mounted with the "noexec" option: + + $ sudo mount | grep /var/tmp + +-/dev/mapper/rhel-var-log-audit on /var/tmp type xfs (rw,nodev,nosuid,noexec,seclabel) ++/dev/mapper/rhel-var-tmp on /var/tmp type xfs (rw,nodev,nosuid,noexec,seclabel) + + Verify that the "noexec" option is configured for /var/tmp: + + $ sudo cat /etc/fstab | grep /var/tmp + +-/dev/mapper/rhel-var-log-audit /var/tmp xfs defaults,nodev,nosuid,noexec 0 0 ++/dev/mapper/rhel-var-tmp /var/tmp xfs defaults,nodev,nosuid,noexec 0 0 + + If results are returned and the "noexec" option is missing, or if /var/tmp is mounted without the "noexec" option, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-08-040135The RHEL 8 fapolicy module must be installed.<VulnDiscussion>The organization must identify authorized software programs and permit execution of authorized software. The process used to identify software programs that are authorized to execute on organizational information systems is commonly referred to as whitelisting. + +@@ -5774,13 +5854,25 @@ If the account is associated with system commands or applications, the UID shoul + + $ sudo awk -F: '$3 == 0 {print $1}' /etc/passwd + +-If any accounts other than root have a UID of "0", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040210RHEL 8 must prevent IPv6 Internet Control Message Protocol (ICMP) redirect messages from being accepted.<VulnDiscussion>ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages modify the host's route table and are unauthenticated. An illicit ICMP redirect message could result in a man-in-the-middle attack.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to prevent IPv6 ICMP redirect messages from being accepted with the following command: ++If any accounts other than root have a UID of "0", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040210RHEL 8 must prevent IPv6 Internet Control Message Protocol (ICMP) redirect messages from being accepted.<VulnDiscussion>ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages modify the host's route table and are unauthenticated. An illicit ICMP redirect message could result in a man-in-the-middle attack. ++ ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf ++ ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to prevent IPv6 ICMP redirect messages from being accepted. + +-$ sudo sysctl -w net.ipv6.conf.default.accept_redirects=0 ++Add or edit the following line in a system configuration file, which begins with "99-", in the "/etc/sysctl.d/" directory: + +-If "0" is not the system's default value then add or update the following line in the appropriate file under "/etc/sysctl.d": ++net.ipv6.conf.default.accept_redirects = 0 ++ ++Load settings from all system configuration files with the following command: + +-net.ipv6.conf.default.accept_redirects=0Verify RHEL 8 will not accept IPv6 ICMP redirect messages. ++$ sudo sysctl --systemVerify RHEL 8 will not accept IPv6 ICMP redirect messages. + + Note: If IPv6 is disabled on the system, this requirement is Not Applicable. + +@@ -5790,15 +5882,37 @@ $ sudo sysctl net.ipv6.conf.default.accept_redirects + + net.ipv6.conf.default.accept_redirects = 0 + +-If the returned line does not have a value of "0", a line is not returned, or the line is commented out, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040220RHEL 8 must not send Internet Control Message Protocol (ICMP) redirects.<VulnDiscussion>ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages contain information from the system's route table, possibly revealing portions of the network topology. ++If the returned line does not have a value of "0", a line is not returned, or the line is commented out, this is a finding. ++ ++Check that the configuration files are present to enable this network parameter. ++ ++$ sudo grep -r net.ipv6.conf.default.accept_redirects /etc/sysctl.d/*.conf ++ ++/etc/sysctl.d/99-sysctl.conf: net.ipv6.conf.default.accept_redirects = 0 + +-There are notable differences between Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6). There is only a directive to disable sending of IPv4 redirected packets. Refer to RFC4294 for an explanation of "IPv6 Node Requirements", which resulted in this difference between IPv4 and IPv6.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to not allow interfaces to perform IPv4 ICMP redirects with the following command: ++If "net.ipv6.conf.default.accept_redirects" is not set to "0", is missing or commented out, this is a finding. + +-$ sudo sysctl -w net.ipv4.conf.all.send_redirects=0 ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040220RHEL 8 must not send Internet Control Message Protocol (ICMP) redirects.<VulnDiscussion>ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages contain information from the system's route table, possibly revealing portions of the network topology. + +-If "0" is not the system's default value then add or update the following line in the appropriate file under "/etc/sysctl.d": ++There are notable differences between Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6). There is only a directive to disable sending of IPv4 redirected packets. Refer to RFC4294 for an explanation of "IPv6 Node Requirements", which resulted in this difference between IPv4 and IPv6. + +-net.ipv4.conf.all.send_redirects=0Verify RHEL 8 does not IPv4 ICMP redirect messages. ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf ++ ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to not allow interfaces to perform IPv4 ICMP redirects. ++ ++Add or edit the following line in a system configuration file, which begins with "99-", in the "/etc/sysctl.d/" directory: ++ ++net.ipv4.conf.all.send_redirects=0 ++ ++Load settings from all system configuration files with the following command: ++ ++$ sudo sysctl --systemVerify RHEL 8 does not IPv4 ICMP redirect messages. + + Note: If IPv4 is disabled on the system, this requirement is Not Applicable. + +@@ -5808,30 +5922,74 @@ $ sudo sysctl net.ipv4.conf.all.send_redirects + + net.ipv4.conf.all.send_redirects = 0 + +-If the returned line does not have a value of "0", or a line is not returned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040230RHEL 8 must not respond to Internet Control Message Protocol (ICMP) echoes sent to a broadcast address.<VulnDiscussion>Responding to broadcast ICMP echoes facilitates network mapping and provides a vector for amplification attacks. ++If the returned line does not have a value of "0", or a line is not returned, this is a finding. + +-There are notable differences between Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6). IPv6 does not implement the same method of broadcast as IPv4. Instead, IPv6 uses multicast addressing to the all-hosts multicast group. Refer to RFC4294 for an explanation of "IPv6 Node Requirements", which resulted in this difference between IPv4 and IPv6.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to not respond to IPv4 ICMP echoes sent to a broadcast address with the following command: ++Check that the configuration files are present to enable this network parameter. + +-$ sudo sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 ++$ sudo grep -r net.ipv4.conf.all.send_redirects /etc/sysctl.d/*.conf + +-If "1" is not the system's default value then add or update the following line in the appropriate file under "/etc/sysctl.d": ++/etc/sysctl.d/99-sysctl.conf: net.ipv4.conf.all.send_redirects = 0 + +-net.ipv4.icmp_echo_ignore_broadcasts=1Verify RHEL 8 does not respond to ICMP echoes sent to a broadcast address. ++If "net.ipv4.conf.all.send_redirects" is not set to "0", is missing or commented out, this is a finding. ++ ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040230RHEL 8 must not respond to Internet Control Message Protocol (ICMP) echoes sent to a broadcast address.<VulnDiscussion>Responding to broadcast ICMP echoes facilitates network mapping and provides a vector for amplification attacks. ++ ++There are notable differences between Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6). IPv6 does not implement the same method of broadcast as IPv4. Instead, IPv6 uses multicast addressing to the all-hosts multicast group. Refer to RFC4294 for an explanation of "IPv6 Node Requirements", which resulted in this difference between IPv4 and IPv6. ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf ++ ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to not respond to IPv4 ICMP echoes sent to a broadcast address. ++ ++Add or edit the following line in a system configuration file, which begins with "99-", in the "/etc/sysctl.d/" directory: ++ ++net.ipv4.icmp_echo_ignore_broadcasts=1 ++ ++Load settings from all system configuration files with the following command: ++ ++$ sudo sysctl --systemVerify RHEL 8 does not respond to ICMP echoes sent to a broadcast address. + + Note: If IPv4 is disabled on the system, this requirement is Not Applicable. ++ + Check the value of the "icmp_echo_ignore_broadcasts" variable with the following command: + + $ sudo sysctl net.ipv4.icmp_echo_ignore_broadcasts + + net.ipv4.icmp_echo_ignore_broadcasts = 1 + +-If the returned line does not have a value of "1", a line is not returned, or the retuned line is commented out, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040240RHEL 8 must not forward IPv6 source-routed packets.<VulnDiscussion>Source-routed packets allow the source of the packet to suggest that routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routed traffic, such as when forwarding is enabled and the system is functioning as a router.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to not forward IPv6 source-routed packets with the following command: ++If the returned line does not have a value of "1", a line is not returned, or the retuned line is commented out, this is a finding. ++ ++Check that the configuration files are present to enable this network parameter. ++ ++$ sudo grep -r net.ipv4.icmp_echo_ignore_broadcasts /etc/sysctl.d/*.conf ++ ++/etc/sysctl.d/99-sysctl.conf: net.ipv4.icmp_echo_ignore_broadcasts = 1 ++ ++If "net.ipv4.icmp_echo_ignore_broadcasts" is not set to "1", is missing or commented out, this is a finding. ++ ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040240RHEL 8 must not forward IPv6 source-routed packets.<VulnDiscussion>Source-routed packets allow the source of the packet to suggest that routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routed traffic, such as when forwarding is enabled and the system is functioning as a router. ++ ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf ++ ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to not forward IPv6 source-routed packets. ++ ++Add or edit the following line in a system configuration file, which begins with "99-", in the "/etc/sysctl.d/" directory: + +-$ sudo sysctl -w net.ipv6.conf.all.accept_source_route=0 ++net.ipv6.conf.all.accept_source_route=0 + +-If "0" is not the system's all value then add or update the following line in the appropriate file under "/etc/sysctl.d": ++Load settings from all system configuration files with the following command: + +-net.ipv6.conf.all.accept_source_route=0Verify RHEL 8 does not accept IPv6 source-routed packets. ++$ sudo sysctl --systemVerify RHEL 8 does not accept IPv6 source-routed packets. + + Note: If IPv6 is disabled on the system, this requirement is Not Applicable. + +@@ -5841,13 +5999,35 @@ $ sudo sysctl net.ipv6.conf.all.accept_source_route + + net.ipv6.conf.all.accept_source_route = 0 + +-If the returned line does not have a value of "0", a line is not returned, or the line is commented out, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040250RHEL 8 must not forward IPv6 source-routed packets by default.<VulnDiscussion>Source-routed packets allow the source of the packet to suggest that routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routed traffic, such as when forwarding is enabled and the system is functioning as a router.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to not forward IPv6 source-routed packets by default with the following command: ++If the returned line does not have a value of "0", a line is not returned, or the line is commented out, this is a finding. ++ ++Check that the configuration files are present to enable this network parameter. ++ ++$ sudo grep -r net.ipv6.conf.all.accept_source_route /etc/sysctl.d/*.conf ++ ++/etc/sysctl.d/99-sysctl.conf: net.ipv6.conf.all.accept_source_route = 0 ++ ++If "net.ipv6.conf.all.accept_source_route" is not set to "0", is missing or commented out, this is a finding. ++ ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040250RHEL 8 must not forward IPv6 source-routed packets by default.<VulnDiscussion>Source-routed packets allow the source of the packet to suggest that routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routed traffic, such as when forwarding is enabled and the system is functioning as a router. + +-$ sudo sysctl -w net.ipv6.conf.default.accept_source_route=0 ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf + +-If "0" is not the system's default value then add or update the following line in the appropriate file under "/etc/sysctl.d": ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to not forward IPv6 source-routed packets by default. + +-net.ipv6.conf.default.accept_source_route=0Verify RHEL 8 does not accept IPv6 source-routed packets by default. ++Add or edit the following line in a system configuration file, which begins with "99-", in the "/etc/sysctl.d/" directory: ++ ++net.ipv6.conf.default.accept_source_route=0 ++ ++Load settings from all system configuration files with the following command: ++ ++$ sudo sysctl --systemVerify RHEL 8 does not accept IPv6 source-routed packets by default. + + Note: If IPv6 is disabled on the system, this requirement is Not Applicable. + +@@ -5857,39 +6037,75 @@ $ sudo sysctl net.ipv6.conf.default.accept_source_route + + net.ipv6.conf.default.accept_source_route = 0 + +-If the returned line does not have a value of "0", a line is not returned, or the line is commented out, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040260RHEL 8 must not be performing packet forwarding unless the system is a router.<VulnDiscussion>Routing protocol daemons are typically used on routers to exchange network topology information with other routers. If this software is used when not required, system network information may be unnecessarily transmitted across the network.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to not allow packet forwarding, unless the system is a router with the following commands: ++If the returned line does not have a value of "0", a line is not returned, or the line is commented out, this is a finding. + +-$ sudo sysctl -w net.ipv4.ip_forward=0 ++Check that the configuration files are present to enable this network parameter. + +-$ sudo sysctl -w net.ipv6.conf.all.forwarding=0 ++$ sudo grep -r net.ipv6.conf.default.accept_source_route /etc/sysctl.d/*.conf + +-If "0" is not the system's default value then add or update the following lines in the appropriate file under "/etc/sysctl.d": ++/etc/sysctl.d/99-sysctl.conf: net.ipv6.conf.default.accept_source_route = 0 + +-net.ipv4.ip_forward=0 ++If "net.ipv6.conf.default.accept_source_route" is not set to "0", is missing or commented out, this is a finding. + +-net.ipv6.conf.all.forwarding=0Verify RHEL 8 is not performing packet forwarding, unless the system is a router. ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040260RHEL 8 must not enable IPv6 packet forwarding unless the system is a router.<VulnDiscussion>Routing protocol daemons are typically used on routers to exchange network topology information with other routers. If this software is used when not required, system network information may be unnecessarily transmitted across the network. + +-Note: If either IPv4 or IPv6 is disabled on the system, this requirement only applies to the active internet protocol version. ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf + +-Check to see if IP forwarding is enabled using the following commands: ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to not allow IPv6 packet forwarding, unless the system is a router. + +-$ sudo sysctl net.ipv4.ip_forward ++Add or edit the following line in a system configuration file, which begins with "99-", in the "/etc/sysctl.d/" directory: + +-net.ipv4.ip_forward = 0 ++net.ipv6.conf.all.forwarding=0 ++ ++Load settings from all system configuration files with the following command: ++ ++$ sudo sysctl --systemVerify RHEL 8 is not performing IPv6 packet forwarding, unless the system is a router. ++ ++Note: If IPv6 is disabled on the system, this requirement is Not Applicable. ++ ++Check that IPv6 forwarding is disabled using the following commands: + + $ sudo sysctl net.ipv6.conf.all.forwarding + + net.ipv6.conf.all.forwarding = 0 + +-If IP forwarding value is not "0" and is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040261RHEL 8 must not accept router advertisements on all IPv6 interfaces.<VulnDiscussion>Routing protocol daemons are typically used on routers to exchange network topology information with other routers. If this software is used when not required, system network information may be unnecessarily transmitted across the network. ++If the IPv6 forwarding value is not "0" and is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding. ++ ++Check that the configuration files are present to enable this network parameter. ++ ++$ sudo grep -r net.ipv6.conf.all.forwarding /etc/sysctl.d/*.conf ++ ++/etc/sysctl.d/99-sysctl.conf: net.ipv6.conf.all.forwarding = 0 ++ ++If "net.ipv6.conf.all.forwarding" is not set to "0", is missing or commented out, this is a finding. ++ ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040261RHEL 8 must not accept router advertisements on all IPv6 interfaces.<VulnDiscussion>Routing protocol daemons are typically used on routers to exchange network topology information with other routers. If this software is used when not required, system network information may be unnecessarily transmitted across the network. ++ ++An illicit router advertisement message could result in a man-in-the-middle attack. + +-An illicit router advertisement message could result in a man-in-the-middle attack.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to not accept router advertisements on all IPv6 interfaces unless the system is a router with the following commands: ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf + +-$ sudo sysctl -w net.ipv6.conf.all.accept_ra=0 ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to not accept router advertisements on all IPv6 interfaces unless the system is a router. + +-If "0" is not the system's default value then add or update the following lines in the appropriate file under "/etc/sysctl.d": ++Add or edit the following line in a system configuration file, which begins with "99-", in the "/etc/sysctl.d/" directory: + +-net.ipv6.conf.all.accept_ra=0Verify RHEL 8 does not accept router advertisements on all IPv6 interfaces, unless the system is a router. ++net.ipv6.conf.all.accept_ra=0 ++ ++Load settings from all system configuration files with the following command: ++ ++$ sudo sysctl --systemVerify RHEL 8 does not accept router advertisements on all IPv6 interfaces, unless the system is a router. + + Note: If IPv6 is disabled on the system, this requirement is not applicable. + +@@ -5899,15 +6115,37 @@ $ sudo sysctl net.ipv6.conf.all.accept_ra + + net.ipv6.conf.all.accept_ra = 0 + +-If the "accept_ra" value is not "0" and is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040262RHEL 8 must not accept router advertisements on all IPv6 interfaces by default.<VulnDiscussion>Routing protocol daemons are typically used on routers to exchange network topology information with other routers. If this software is used when not required, system network information may be unnecessarily transmitted across the network. ++If the "accept_ra" value is not "0" and is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding. ++ ++Check that the configuration files are present to enable this network parameter. ++ ++$ sudo grep -r net.ipv6.conf.all.accept_ra /etc/sysctl.d/*.conf ++ ++/etc/sysctl.d/99-sysctl.conf: net.ipv6.conf.all.accept_ra = 0 + +-An illicit router advertisement message could result in a man-in-the-middle attack.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to not accept router advertisements on all IPv6 interfaces by default unless the system is a router with the following commands: ++If "net.ipv6.conf.all.accept_ra" is not set to "0", is missing or commented out, this is a finding. + +-$ sudo sysctl -w net.ipv6.conf.default.accept_ra=0 ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040262RHEL 8 must not accept router advertisements on all IPv6 interfaces by default.<VulnDiscussion>Routing protocol daemons are typically used on routers to exchange network topology information with other routers. If this software is used when not required, system network information may be unnecessarily transmitted across the network. + +-If "0" is not the system's default value then add or update the following lines in the appropriate file under "/etc/sysctl.d": ++An illicit router advertisement message could result in a man-in-the-middle attack. ++ ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf ++ ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to not accept router advertisements on all IPv6 interfaces by default unless the system is a router. ++ ++Add or edit the following line in a system configuration file, which begins with "99-", in the "/etc/sysctl.d/" directory: ++ ++net.ipv6.conf.default.accept_ra=0 ++ ++Load settings from all system configuration files with the following command: + +-net.ipv6.conf.default.accept_ra=0Verify RHEL 8 does not accept router advertisements on all IPv6 interfaces by default, unless the system is a router. ++$ sudo sysctl --systemVerify RHEL 8 does not accept router advertisements on all IPv6 interfaces by default, unless the system is a router. + + Note: If IPv6 is disabled on the system, this requirement is not applicable. + +@@ -5917,15 +6155,37 @@ $ sudo sysctl net.ipv6.conf.default.accept_ra + + net.ipv6.conf.default.accept_ra = 0 + +-If the "accept_ra" value is not "0" and is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040270RHEL 8 must not allow interfaces to perform Internet Control Message Protocol (ICMP) redirects by default.<VulnDiscussion>ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages contain information from the system's route table, possibly revealing portions of the network topology. ++If the "accept_ra" value is not "0" and is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding. + +-There are notable differences between Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6). There is only a directive to disable sending of IPv4 redirected packets. Refer to RFC4294 for an explanation of "IPv6 Node Requirements", which resulted in this difference between IPv4 and IPv6.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to not allow interfaces to perform Internet Protocol version 4 (IPv4) ICMP redirects by default with the following command: ++Check that the configuration files are present to enable this network parameter. + +-$ sudo sysctl -w net.ipv4.conf.default.send_redirects=0 ++$ sudo grep -r net.ipv6.conf.default.accept_ra /etc/sysctl.d/*.conf + +-If "0" is not the system's default value then add or update the following line in the appropriate file under "/etc/sysctl.d": ++/etc/sysctl.d/99-sysctl.conf: net.ipv6.conf.default.accept_ra = 0 + +-net.ipv4.conf.default.send_redirects=0Verify RHEL 8 does not allow interfaces to perform Internet Protocol version 4 (IPv4) ICMP redirects by default. ++If "net.ipv6.conf.default.accept_ra" is not set to "0", is missing or commented out, this is a finding. ++ ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040270RHEL 8 must not allow interfaces to perform Internet Control Message Protocol (ICMP) redirects by default.<VulnDiscussion>ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages contain information from the system's route table, possibly revealing portions of the network topology. ++ ++There are notable differences between Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6). There is only a directive to disable sending of IPv4 redirected packets. Refer to RFC4294 for an explanation of "IPv6 Node Requirements", which resulted in this difference between IPv4 and IPv6. ++ ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf ++ ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to not allow interfaces to perform Internet Protocol version 4 (IPv4) ICMP redirects by default. ++ ++Add or edit the following line in a system configuration file, which begins with "99-", in the "/etc/sysctl.d/" directory: ++ ++net.ipv4.conf.default.send_redirects = 0 ++ ++Load settings from all system configuration files with the following command: ++ ++$ sudo sysctl --systemVerify RHEL 8 does not allow interfaces to perform Internet Protocol version 4 (IPv4) ICMP redirects by default. + + Note: If IPv4 is disabled on the system, this requirement is Not Applicable. + +@@ -5935,13 +6195,35 @@ $ sudo sysctl net.ipv4.conf.default.send_redirects + + net.ipv4.conf.default.send_redirects=0 + +-If the returned line does not have a value of "0", or a line is not returned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040280RHEL 8 must ignore IPv6 Internet Control Message Protocol (ICMP) redirect messages.<VulnDiscussion>ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages modify the host's route table and are unauthenticated. An illicit ICMP redirect message could result in a man-in-the-middle attack.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to ignore IPv6 ICMP redirect messages with the following command: ++If the returned line does not have a value of "0", or a line is not returned, this is a finding. ++ ++Check that the configuration files are present to enable this network parameter. ++ ++$ sudo grep -r net.ipv4.conf.default.send_redirects /etc/sysctl.d/*.conf ++ ++/etc/sysctl.d/99-sysctl.conf: net.ipv4.conf.default.send_redirects = 0 + +-$ sudo sysctl -w net.ipv6.conf.all.accept_redirects=0 ++If "net.ipv4.conf.default.send_redirects" is not set to "0", is missing or commented out, this is a finding. + +-If "0" is not the system's default value then add or update the following line in the appropriate file under "/etc/sysctl.d": ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040280RHEL 8 must ignore IPv6 Internet Control Message Protocol (ICMP) redirect messages.<VulnDiscussion>ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages modify the host's route table and are unauthenticated. An illicit ICMP redirect message could result in a man-in-the-middle attack. + +-net.ipv6.conf.all.accept_redirects = 0Verify RHEL 8 ignores IPv6 ICMP redirect messages. ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf ++ ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to ignore IPv6 ICMP redirect messages. ++ ++Add or edit the following line in a system configuration file, which begins with "99-", in the "/etc/sysctl.d/" directory: ++ ++net.ipv6.conf.all.accept_redirects = 0 ++ ++Load settings from all system configuration files with the following command: ++ ++$ sudo sysctl --systemVerify RHEL 8 ignores IPv6 ICMP redirect messages. + + Note: If IPv6 is disabled on the system, this requirement is Not Applicable. + +@@ -5951,75 +6233,181 @@ $ sudo sysctl net.ipv6.conf.all.accept_redirects + + net.ipv6.conf.all.accept_redirects = 0 + +-If the returned line does not have a value of "0", a line is not returned, or the line is commented out, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040281RHEL 8 must disable access to network bpf syscall from unprivileged processes.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to prevent privilege escalation thru the kernel by disabling access to the bpf syscall by adding the following line to a file in the "/etc/sysctl.d" directory: ++If the returned line does not have a value of "0", a line is not returned, or the line is commented out, this is a finding. ++ ++Check that the configuration files are present to enable this network parameter. ++ ++$ sudo grep -r net.ipv6.conf.all.accept_redirects /etc/sysctl.d/*.conf ++ ++/etc/sysctl.d/99-sysctl.conf: net.ipv6.conf.all.accept_redirects = 0 ++ ++If "net.ipv6.conf.all.accept_redirects" is not set to "0", is missing or commented out, this is a finding. ++ ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040281RHEL 8 must disable access to network bpf syscall from unprivileged processes.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. ++ ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf ++ ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to prevent privilege escalation thru the kernel by disabling access to the bpf syscall by adding the following line to a file, which begins with "99-", in the "/etc/sysctl.d" directory: + + kernel.unprivileged_bpf_disabled = 1 + + The system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command: + +-$ sudo sysctl --systemVerify RHEL 8 prevents privilege escalation thru the kernel by disabling access to the bpf syscall with the following commands: ++$ sudo sysctl --systemVerify RHEL 8 prevents privilege escalation thru the kernel by disabling access to the bpf syscall with the following commands: + + $ sudo sysctl kernel.unprivileged_bpf_disabled + + kernel.unprivileged_bpf_disabled = 1 + +-If the returned line does not have a value of "1", or a line is not returned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040282RHEL 8 must restrict usage of ptrace to descendant processes.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to restrict usage of ptrace to descendant processes by adding the following line to a file in the "/etc/sysctl.d" directory: ++If the returned line does not have a value of "1", or a line is not returned, this is a finding. ++ ++Check that the configuration files are present to enable this network parameter. ++ ++$ sudo grep -r kernel.unprivileged_bpf_disabled /etc/sysctl.d/*.conf ++ ++/etc/sysctl.d/99-sysctl.conf: kernel.unprivileged_bpf_disabled = 1 ++ ++If "kernel.unprivileged_bpf_disabled" is not set to "1", is missing or commented out, this is a finding. ++ ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040282RHEL 8 must restrict usage of ptrace to descendant processes.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. ++ ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf ++ ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to restrict usage of ptrace to descendant processes by adding the following line to a file, which begins with "99-", in the "/etc/sysctl.d" directory: + + kernel.yama.ptrace_scope = 1 + + The system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command: + +-$ sudo sysctl --systemVerify RHEL 8 restricts usage of ptrace to descendant processes with the following commands: ++$ sudo sysctl --systemVerify RHEL 8 restricts usage of ptrace to descendant processes with the following commands: + + $ sudo sysctl kernel.yama.ptrace_scope + + kernel.yama.ptrace_scope = 1 + +-If the returned line does not have a value of "1", or a line is not returned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040283RHEL 8 must restrict exposed kernel pointer addresses access.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to restrict exposed kernel pointer addresses access by adding the following line to a file in the "/etc/sysctl.d" directory: ++If the returned line does not have a value of "1", or a line is not returned, this is a finding. ++ ++Check that the configuration files are present to enable this network parameter. ++ ++$ sudo grep -r kernel.yama.ptrace_scope /etc/sysctl.d/*.conf ++ ++/etc/sysctl.d/99-sysctl.conf: kernel.yama.ptrace_scope = 1 ++ ++If "kernel.yama.ptrace_scope" is not set to "1", is missing or commented out, this is a finding. ++ ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040283RHEL 8 must restrict exposed kernel pointer addresses access.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. ++ ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf ++ ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to restrict exposed kernel pointer addresses access by adding the following line to a file, which begins with "99-", in the "/etc/sysctl.d" directory: + + kernel.kptr_restrict = 1 + + The system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command: + +-$ sudo sysctl --systemVerify RHEL 8 restricts exposed kernel pointer addresses access with the following commands: ++$ sudo sysctl --systemVerify RHEL 8 restricts exposed kernel pointer addresses access with the following commands: + + $ sudo sysctl kernel.kptr_restrict + + kernel.kptr_restrict = 1 + +-If the returned line does not have a value of "1", or a line is not returned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040284RHEL 8 must disable the use of user namespaces.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. ++If the returned line does not have a value of "1", or a line is not returned, this is a finding. ++ ++Check that the configuration files are present to enable this network parameter. ++ ++$ sudo grep -r kernel.kptr_restrict /etc/sysctl.d/*.conf + +-User namespaces are used primarily for Linux container. The value 0 disallows the use of user namespaces. When containers are not in use, namespaces should be disallowed. When containers are deployed on a system, the value should be set to a large non-zero value. The default value is 7182.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to disable the use of user namespaces by adding the following line to a file in the "/etc/sysctl.d" directory: ++/etc/sysctl.d/99-sysctl.conf: kernel.kptr_restrict = 1 + +-Note: User namespaces are used primarily for Linux containers. If containers are in use, this requirement is not applicable. ++If "kernel.kptr_restrict" is not set to "1", is missing or commented out, this is a finding. ++ ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040284RHEL 8 must disable the use of user namespaces.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. ++ ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf ++ ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to disable the use of user namespaces by adding the following line to a file, which begins with "99-", in the "/etc/sysctl.d" directory: ++ ++Note: User namespaces are used primarily for Linux containers. If containers are in use, this requirement is not applicable. + + user.max_user_namespaces = 0 + + The system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command: + +-$ sudo sysctl --systemVerify RHEL 8 disables the use of user namespaces with the following commands: ++$ sudo sysctl --systemVerify RHEL 8 disables the use of user namespaces with the following commands: + +-Note: User namespaces are used primarily for Linux containers. If containers are in use, this requirement is not applicable. ++Note: User namespaces are used primarily for Linux containers. If containers are in use, this requirement is not applicable. + + $ sudo sysctl user.max_user_namespaces + + user.max_user_namespaces = 0 + +-If the returned line does not have a value of "0", or a line is not returned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040285RHEL 8 must use reverse path filtering on all IPv4 interfaces.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. ++If the returned line does not have a value of "0", or a line is not returned, this is a finding. ++ ++Check that the configuration files are present to enable this network parameter. ++ ++$ sudo grep -r user.max_user_namespaces /etc/sysctl.d/*.conf + +-Enabling reverse path filtering drops packets with source addresses that are not routable. There is not an equivalent filter for IPv6 traffic.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to use reverse path filtering on all IPv4 interfaces by adding the following line to a file in the "/etc/sysctl.d" directory: ++/etc/sysctl.d/99-sysctl.conf: user.max_user_namespaces = 0 ++ ++If "user.max_user_namespaces" is not set to "0", is missing or commented out, this is a finding. ++ ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040285RHEL 8 must use reverse path filtering on all IPv4 interfaces.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. ++ ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf ++ ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to use reverse path filtering on all IPv4 interfaces by adding the following line to a file, which begins with "99-", in the "/etc/sysctl.d" directory: + + net.ipv4.conf.all.rp_filter = 1 + + The system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command: + +-$ sudo sysctl --systemVerify RHEL 8 uses reverse path filtering on all IPv4 interfaces with the following commands: ++$ sudo sysctl --systemVerify RHEL 8 uses reverse path filtering on all IPv4 interfaces with the following commands: + + $ sudo sysctl net.ipv4.conf.all.rp_filter + + net.ipv4.conf.all.rp_filter = 1 + +-If the returned line does not have a value of "1", or a line is not returned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040290RHEL 8 must be configured to prevent unrestricted mail relaying.<VulnDiscussion>If unrestricted mail relaying is permitted, unauthorized senders could use this host as a mail relay for the purpose of sending spam or other unauthorized activity.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366If "postfix" is installed, modify the "/etc/postfix/main.cf" file to restrict client connections to the local network with the following command: ++If the returned line does not have a value of "1", or a line is not returned, this is a finding. ++ ++Check that the configuration files are present to enable this network parameter. ++ ++$ sudo grep -r net.ipv4.conf.all.rp_filter /etc/sysctl.d/*.conf ++ ++/etc/sysctl.d/99-sysctl.conf: net.ipv4.conf.all.rp_filter = 1 ++ ++If "net.ipv4.conf.all.rp_filter" is not set to "1", is missing or commented out, this is a finding. ++ ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040290RHEL 8 must be configured to prevent unrestricted mail relaying.<VulnDiscussion>If unrestricted mail relaying is permitted, unauthorized senders could use this host as a mail relay for the purpose of sending spam or other unauthorized activity.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366If "postfix" is installed, modify the "/etc/postfix/main.cf" file to restrict client connections to the local network with the following command: + + $ sudo postconf -e 'smtpd_client_restrictions = permit_mynetworks,reject'Verify the system is configured to prevent unrestricted mail relaying. + +@@ -6237,7 +6625,7 @@ $ sudo egrep -i '(!rootpw|!targetpw|!runaspw)' /etc/sudoers /etc/sudoers.d/* | g + If no results are returned, this is a finding + If "Defaults !targetpw" is not defined, this is a finding. + If "Defaults !rootpw" is not defined, this is a finding. +-If "Defaults !runaspw" is not defined, this is a finding.SRG-OS-000373-GPOS-00156<GroupDescription></GroupDescription>RHEL-08-010384RHEL 8 must require re-authentication when using the "sudo" command.<VulnDiscussion>Without re-authentication, users may access resources or perform tasks for which they do not have authorization. ++If "Defaults !runaspw" is not defined, this is a finding.SRG-OS-000373-GPOS-00156<GroupDescription></GroupDescription>RHEL-08-010384RHEL 8 must require re-authentication when using the "sudo" command.<VulnDiscussion>Without re-authentication, users may access resources or perform tasks for which they do not have authorization. + + When operating systems provide the capability to escalate a functional capability, it is critical the organization requires the user to re-authenticate when using the "sudo" command. + +@@ -6247,10 +6635,10 @@ $ sudo visudo + + Add or modify the following line: + Defaults timestamp_timeout=[value] +-Note: The "[value]" must be a number that is greater than or equal to "0".Verify the operating system requires re-authentication when using the "sudo" command to elevate privileges. ++Note: The "[value]" must be a number that is greater than or equal to "0".Verify the operating system requires re-authentication when using the "sudo" command to elevate privileges. + + $ sudo grep -i 'timestamp_timeout' /etc/sudoers /etc/sudoers.d/* +-/etc/sudoers:Defaults timestamp_timout=0 ++/etc/sudoers:Defaults timestamp_timeout=0 + + If "timestamp_timeout" is set to a negative number, is commented out, or no results are returned, this is a finding.SRG-OS-000023-GPOS-00006<GroupDescription></GroupDescription>RHEL-08-010049RHEL 8 must display a banner before granting local or remote access to the system via a graphical user logon.<VulnDiscussion>Display of a standardized and approved use notification before granting access to the operating system ensures privacy and security notification verbiage used is consistent with applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance. + +@@ -6294,7 +6682,9 @@ $ sudo grep rounds /etc/pam.d/system-auth + + password sufficient pam_unix.so sha512 rounds=5000 + +-If "rounds" has a value below "5000", or is commented out, this is a finding.SRG-OS-000080-GPOS-00048<GroupDescription></GroupDescription>RHEL-08-010141RHEL 8 operating systems booted with United Extensible Firmware Interface (UEFI) must require a unique superusers name upon booting into single-user mode and maintenance.<VulnDiscussion>If the system does not require valid authentication before it boots into single-user or maintenance mode, anyone who invokes single-user or maintenance mode is granted privileged access to all files on the system. GRUB 2 is the default boot loader for RHEL 8 and is designed to require a password to boot into single-user mode or make modifications to the boot menu.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000213Configure the system to have a unique name for the grub superusers account. ++If "rounds" has a value below "5000", or is commented out, this is a finding.SRG-OS-000080-GPOS-00048<GroupDescription></GroupDescription>RHEL-08-010141RHEL 8 operating systems booted with United Extensible Firmware Interface (UEFI) must require a unique superusers name upon booting into single-user mode and maintenance.<VulnDiscussion>If the system does not require valid authentication before it boots into single-user or maintenance mode, anyone who invokes single-user or maintenance mode is granted privileged access to all files on the system. GRUB 2 is the default boot loader for RHEL 8 and is designed to require a password to boot into single-user mode or make modifications to the boot menu. ++ ++The GRUB 2 superuser account is an account of last resort. Establishing a unique username for this account hardens the boot loader against brute force attacks. Due to the nature of the superuser account database being distinct from the OS account database, this allows the use of a username that is not among those within the OS account database. Examples of non-unique superusers names are root, superuser, unlock, etc.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000213Configure the system to have a unique name for the grub superusers account. + + Edit the /etc/grub.d/01_users file and add or modify the following lines: + +@@ -6304,7 +6694,7 @@ password_pbkdf2 [someuniquestringhere] ${GRUB2_PASSWORD} + + Generate a new grub.cfg file with the following command: + +-$ sudo grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfgFor systems that use BIOS, this is Not Applicable. ++$ sudo grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfgFor systems that use BIOS, this is Not Applicable. + + Verify that a unique name is set as the "superusers" account: + +@@ -6312,7 +6702,9 @@ $ sudo grep -iw "superusers" /boot/efi/EFI/redhat/grub.cfg + set superusers="[someuniquestringhere]" + export superusers + +-If "superusers" is not set to a unique name or is missing a name, this is a finding.SRG-OS-000080-GPOS-00048<GroupDescription></GroupDescription>RHEL-08-010149RHEL 8 operating systems booted with a BIOS must require a unique superusers name upon booting into single-user and maintenance modes.<VulnDiscussion>If the system does not require valid authentication before it boots into single-user or maintenance mode, anyone who invokes single-user or maintenance mode is granted privileged access to all files on the system. GRUB 2 is the default boot loader for RHEL 8 and is designed to require a password to boot into single-user mode or make modifications to the boot menu.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000213Configure the system to have a unique name for the grub superusers account. ++If "superusers" is identical to any OS account name or is missing a name, this is a finding.SRG-OS-000080-GPOS-00048<GroupDescription></GroupDescription>RHEL-08-010149RHEL 8 operating systems booted with a BIOS must require a unique superusers name upon booting into single-user and maintenance modes.<VulnDiscussion>If the system does not require valid authentication before it boots into single-user or maintenance mode, anyone who invokes single-user or maintenance mode is granted privileged access to all files on the system. GRUB 2 is the default boot loader for RHEL 8 and is designed to require a password to boot into single-user mode or make modifications to the boot menu. ++ ++The GRUB 2 superuser account is an account of last resort. Establishing a unique username for this account hardens the boot loader against brute force attacks. Due to the nature of the superuser account database being distinct from the OS account database, this allows the use of a username that is not among those within the OS account database. Examples of non-unique superusers names are root, superuser, unlock, etc.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000213Configure the system to have a unique name for the grub superusers account. + + Edit the /etc/grub.d/01_users file and add or modify the following lines: + +@@ -6322,7 +6714,7 @@ password_pbkdf2 [someuniquestringhere] ${GRUB2_PASSWORD} + + Generate a new grub.cfg file with the following command: + +-$ sudo grub2-mkconfig -o /boot/grub2/grub.cfgFor systems that use UEFI, this is Not Applicable. ++$ sudo grub2-mkconfig -o /boot/grub2/grub.cfgFor systems that use UEFI, this is Not Applicable. + + Verify that a unique name is set as the "superusers" account: + +@@ -6330,7 +6722,7 @@ $ sudo grep -iw "superusers" /boot/grub2/grub.cfg + set superusers="[someuniquestringhere]" + export superusers + +-If "superusers" is not set to a unique name or is missing a name, this is a finding.SRG-OS-000080-GPOS-00048<GroupDescription></GroupDescription>RHEL-08-010152RHEL 8 operating systems must require authentication upon booting into emergency mode.<VulnDiscussion>If the system does not require valid root authentication before it boots into emergency or rescue mode, anyone who invokes emergency or rescue mode is granted privileged access to all files on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000213Configure the system to require authentication upon booting into emergency mode by adding the following line to the "/usr/lib/systemd/system/emergency.service" file. ++If "superusers" is identical to any OS account name or is missing a name, this is a finding.SRG-OS-000080-GPOS-00048<GroupDescription></GroupDescription>RHEL-08-010152RHEL 8 operating systems must require authentication upon booting into emergency mode.<VulnDiscussion>If the system does not require valid root authentication before it boots into emergency or rescue mode, anyone who invokes emergency or rescue mode is granted privileged access to all files on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000213Configure the system to require authentication upon booting into emergency mode by adding the following line to the "/usr/lib/systemd/system/emergency.service" file. + + ExecStart=-/usr/lib/systemd/systemd-sulogin-shell emergencyCheck to see if the system requires authentication for emergency mode with the following command: + +@@ -6822,13 +7214,25 @@ $ sudo yum list installed openssh-server + + openssh-server.x86_64 8.0p1-5.el8 @anaconda + +-If the "SSH server" package is not installed, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040209RHEL 8 must prevent IPv4 Internet Control Message Protocol (ICMP) redirect messages from being accepted.<VulnDiscussion>ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages modify the host's route table and are unauthenticated. An illicit ICMP redirect message could result in a man-in-the-middle attack.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to prevent IPv4 ICMP redirect messages from being accepted with the following command: ++If the "SSH server" package is not installed, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040209RHEL 8 must prevent IPv4 Internet Control Message Protocol (ICMP) redirect messages from being accepted.<VulnDiscussion>ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages modify the host's route table and are unauthenticated. An illicit ICMP redirect message could result in a man-in-the-middle attack. + +-$ sudo sysctl -w net.ipv4.conf.default.accept_redirects=0 ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf + +-If "0" is not the system's default value then add or update the following line in the appropriate file under "/etc/sysctl.d": ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to prevent IPv4 ICMP redirect messages from being accepted. + +-net.ipv4.conf.default.accept_redirects=0Verify RHEL 8 will not accept IPv4 ICMP redirect messages. ++Add or edit the following line in a system configuration file, which begins with "99-", in the "/etc/sysctl.d/" directory: ++ ++net.ipv4.conf.default.accept_redirects = 0 ++ ++Load settings from all system configuration files with the following command: ++ ++$ sudo sysctl --systemVerify RHEL 8 will not accept IPv4 ICMP redirect messages. + + Note: If IPv4 is disabled on the system, this requirement is Not Applicable. + +@@ -6838,13 +7242,35 @@ $ sudo sysctl net.ipv4.conf.default.accept_redirects + + net.ipv4.conf.default.accept_redirects = 0 + +-If the returned line does not have a value of "0", a line is not returned, or the line is commented out, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040239RHEL 8 must not forward IPv4 source-routed packets.<VulnDiscussion>Source-routed packets allow the source of the packet to suggest that routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routed traffic, such as when forwarding is enabled and the system is functioning as a router.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to not forward IPv4 source-routed packets with the following command: ++If the returned line does not have a value of "0", a line is not returned, or the line is commented out, this is a finding. ++ ++Check that the configuration files are present to enable this network parameter. ++ ++$ sudo grep -r net.ipv4.conf.default.accept_redirects /etc/sysctl.d/*.conf ++ ++/etc/sysctl.d/99-sysctl.conf: net.ipv4.conf.default.accept_redirects = 0 ++ ++If "net.ipv4.conf.default.accept_redirects" is not set to "0", is missing or commented out, this is a finding. ++ ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040239RHEL 8 must not forward IPv4 source-routed packets.<VulnDiscussion>Source-routed packets allow the source of the packet to suggest that routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routed traffic, such as when forwarding is enabled and the system is functioning as a router. ++ ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf ++ ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to not forward IPv4 source-routed packets. ++ ++Add or edit the following line in a system configuration file, which begins with "99-", in the "/etc/sysctl.d/" directory: + +-$ sudo sysctl -w net.ipv4.conf.all.accept_source_route=0 ++net.ipv4.conf.all.accept_source_route=0 + +-If "0" is not the system's all value then add or update the following line in the appropriate file under "/etc/sysctl.d": ++Load settings from all system configuration files with the following command: + +-net.ipv4.conf.all.accept_source_route=0Verify RHEL 8 does not accept IPv4 source-routed packets. ++$ sudo sysctl --systemVerify RHEL 8 does not accept IPv4 source-routed packets. + + Note: If IPv4 is disabled on the system, this requirement is Not Applicable. + +@@ -6854,13 +7280,35 @@ $ sudo sysctl net.ipv4.conf.all.accept_source_route + + net.ipv4.conf.all.accept_source_route = 0 + +-If the returned line does not have a value of "0", a line is not returned, or the line is commented out, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040249RHEL 8 must not forward IPv4 source-routed packets by default.<VulnDiscussion>Source-routed packets allow the source of the packet to suggest that routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routed traffic, such as when forwarding is enabled and the system is functioning as a router.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to not forward IPv4 source-routed packets by default with the following command: ++If the returned line does not have a value of "0", a line is not returned, or the line is commented out, this is a finding. ++ ++Check that the configuration files are present to enable this network parameter. ++ ++$ sudo grep -r net.ipv4.conf.all.accept_source_route /etc/sysctl.d/*.conf ++ ++/etc/sysctl.d/99-sysctl.conf: net.ipv4.conf.all.accept_source_route = 0 ++ ++If "net.ipv4.conf.all.accept_source_route" is not set to "0", is missing or commented out, this is a finding. ++ ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040249RHEL 8 must not forward IPv4 source-routed packets by default.<VulnDiscussion>Source-routed packets allow the source of the packet to suggest that routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routed traffic, such as when forwarding is enabled and the system is functioning as a router. + +-$ sudo sysctl -w net.ipv4.conf.default.accept_source_route=0 ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf + +-If "0" is not the system's default value then add or update the following line in the appropriate file under "/etc/sysctl.d": ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to not forward IPv4 source-routed packets by default. + +-net.ipv4.conf.default.accept_source_route=0Verify RHEL 8 does not accept IPv4 source-routed packets by default. ++Add or edit the following line in a system configuration file, which begins with "99-", in the "/etc/sysctl.d/" directory: ++ ++net.ipv4.conf.default.accept_source_route=0 ++ ++Load settings from all system configuration files with the following command: ++ ++$ sudo sysctl --systemVerify RHEL 8 does not accept IPv4 source-routed packets by default. + + Note: If IPv4 is disabled on the system, this requirement is Not Applicable. + +@@ -6870,13 +7318,35 @@ $ sudo sysctl net.ipv4.conf.default.accept_source_route + + net.ipv4.conf.default.accept_source_route = 0 + +-If the returned line does not have a value of "0", a line is not returned, or the line is commented out, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040279RHEL 8 must ignore IPv4 Internet Control Message Protocol (ICMP) redirect messages.<VulnDiscussion>ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages modify the host's route table and are unauthenticated. An illicit ICMP redirect message could result in a man-in-the-middle attack.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to ignore IPv4 ICMP redirect messages with the following command: ++If the returned line does not have a value of "0", a line is not returned, or the line is commented out, this is a finding. ++ ++Check that the configuration files are present to enable this network parameter. ++ ++$ sudo grep -r net.ipv4.conf.default.accept_source_route /etc/sysctl.d/*.conf + +-$ sudo sysctl -w net.ipv4.conf.all.accept_redirects=0 ++/etc/sysctl.d/99-sysctl.conf: net.ipv4.conf.default.accept_source_route = 0 + +-If "0" is not the system's default value then add or update the following line in the appropriate file under "/etc/sysctl.d": ++If "net.ipv4.conf.default.accept_source_route" is not set to "0", is missing or commented out, this is a finding. + +-net.ipv4.conf.all.accept_redirects = 0Verify RHEL 8 ignores IPv4 ICMP redirect messages. ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040279RHEL 8 must ignore IPv4 Internet Control Message Protocol (ICMP) redirect messages.<VulnDiscussion>ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages modify the host's route table and are unauthenticated. An illicit ICMP redirect message could result in a man-in-the-middle attack. ++ ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf ++ ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to ignore IPv4 ICMP redirect messages. ++ ++Add or edit the following line in a system configuration file, which begins with "99-", in the "/etc/sysctl.d/" directory: ++ ++net.ipv4.conf.all.accept_redirects = 0 ++ ++Load settings from all system configuration files with the following command: ++ ++$ sudo sysctl --systemVerify RHEL 8 ignores IPv4 ICMP redirect messages. + + Note: If IPv4 is disabled on the system, this requirement is Not Applicable. + +@@ -6886,20 +7356,51 @@ $ sudo sysctl net.ipv4.conf.all.accept_redirects + + net.ipv4.conf.all.accept_redirects = 0 + +-If the returned line does not have a value of "0", a line is not returned, or the line is commented out, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040286RHEL 8 must enable hardening for the Berkeley Packet Filter Just-in-time compiler.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. +-Enabling hardening for the Berkeley Packet Filter (BPF) Just-in-time (JIT) compiler aids in mitigating JIT spraying attacks. Setting the value to "2" enables JIT hardening for all users.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to enable hardening for the BPF JIT compiler by adding the following line to a file in the "/etc/sysctl.d" directory: ++If the returned line does not have a value of "0", a line is not returned, or the line is commented out, this is a finding. ++ ++Check that the configuration files are present to enable this network parameter. ++ ++$ sudo grep -r net.ipv4.conf.all.accept_redirects /etc/sysctl.d/*.conf ++ ++/etc/sysctl.d/99-sysctl.conf: net.ipv4.conf.all.accept_redirects = 0 ++ ++If "net.ipv4.conf.all.accept_redirects" is not set to "0", is missing or commented out, this is a finding. ++ ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040286RHEL 8 must enable hardening for the Berkeley Packet Filter Just-in-time compiler.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. ++ ++Enabling hardening for the Berkeley Packet Filter (BPF) Just-in-time (JIT) compiler aids in mitigating JIT spraying attacks. Setting the value to "2" enables JIT hardening for all users. ++ ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf ++ ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to enable hardening for the BPF JIT compiler by adding the following line to a file, which begins with "99-", in the "/etc/sysctl.d" directory: + + net.core.bpf_jit_harden = 2 + + The system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command: + +-$ sudo sysctl --systemVerify RHEL 8 enables hardening for the BPF JIT with the following commands: ++$ sudo sysctl --systemVerify RHEL 8 enables hardening for the BPF JIT with the following commands: + + $ sudo sysctl net.core.bpf_jit_harden + + net.core.bpf_jit_harden = 2 + +-If the returned line does not have a value of "2", or a line is not returned, this is a finding.SRG-OS-000191-GPOS-00080<GroupDescription></GroupDescription>RHEL-08-010001The RHEL 8 operating system must implement the Endpoint Security for Linux Threat Prevention tool.<VulnDiscussion>Adding endpoint security tools can provide the capability to automatically take actions in response to malicious behavior, which can provide additional agility in reacting to network threats. These tools also often include a reporting capability to provide network awareness of the system, which may not otherwise exist in an organization's systems management regime.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001233Install and enable the latest McAfee ENSLTP package.Per OPORD 16-0080, the preferred endpoint security tool is McAfee Endpoint Security for Linux (ENSL) in conjunction with SELinux. ++If the returned line does not have a value of "2", or a line is not returned, this is a finding. ++ ++Check that the configuration files are present to enable this network parameter. ++ ++$ sudo grep -r net.core.bpf_jit_harden /etc/sysctl.d/*.conf ++ ++/etc/sysctl.d/99-sysctl.conf: net.core.bpf_jit_harden = 2 ++ ++If "net.core.bpf_jit_harden" is not set to "2", is missing or commented out, this is a finding. ++ ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000191-GPOS-00080<GroupDescription></GroupDescription>RHEL-08-010001The RHEL 8 operating system must implement the Endpoint Security for Linux Threat Prevention tool.<VulnDiscussion>Adding endpoint security tools can provide the capability to automatically take actions in response to malicious behavior, which can provide additional agility in reacting to network threats. These tools also often include a reporting capability to provide network awareness of the system, which may not otherwise exist in an organization's systems management regime.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001233Install and enable the latest McAfee ENSLTP package.Per OPORD 16-0080, the preferred endpoint security tool is McAfee Endpoint Security for Linux (ENSL) in conjunction with SELinux. + + Procedure: + Check that the following package has been installed: +@@ -6912,4 +7413,102 @@ Verify that the daemon is running: + + $ sudo ps -ef | grep -i mfetpd + +-If the daemon is not running, this is a finding. +\ No newline at end of file ++If the daemon is not running, this is a finding.SRG-OS-000021-GPOS-00005<GroupDescription></GroupDescription>RHEL-08-020027RHEL 8 systems, versions 8.2 and above, must configure SELinux context type to allow the use of a non-default faillock tally directory.<VulnDiscussion>By limiting the number of failed logon attempts, the risk of unauthorized system access via user password guessing, otherwise known as brute-force attacks, is reduced. Limits are imposed by locking the account. ++ ++From "faillock.conf" man pages: Note that the default directory that "pam_faillock" uses is usually cleared on system boot so the access will be re-enabled after system reboot. If that is undesirable, a different tally directory must be set with the "dir" option. ++ ++SELinux, enforcing a targeted policy, will require any non-default tally directory's security context type to match the default directory's security context type. Without updating the security context type, the pam_faillock module will not write failed login attempts to the non-default tally directory.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000044CCI-002238Configure RHEL 8 to allow the use of a non-default faillock tally directory while SELinux enforces a targeted policy. ++ ++Create a non-default faillock tally directory (if it does not already exist) with the following example: ++ ++$ sudo mkdir /var/log/faillock ++ ++Update the /etc/selinux/targeted/contexts/files/file_contexts.local with "faillog_t" context type for the non-default faillock tally directory with the following command: ++ ++$ sudo semanage fcontext -a -t faillog_t "/var/log/faillock(/.*)?" ++ ++Next, update the context type of the non-default faillock directory/subdirectories and files with the following command: ++ ++$ sudo restorecon -R -v /var/log/faillockIf the system does not have SELinux enabled and enforcing a targeted policy, or if the pam_faillock module is not configured for use, this requirement is not applicable. ++ ++Note: This check applies to RHEL versions 8.2 or newer. If the system is RHEL version 8.0 or 8.1, this check is not applicable. ++ ++Verify the location of the non-default tally directory for the pam_faillock module with the following command: ++ ++$ sudo grep -w dir /etc/security/faillock.conf ++ ++dir = /var/log/faillock ++ ++Check the security context type of the non-default tally directory with the following command: ++ ++$ sudo ls -Zd /var/log/faillock ++ ++unconfined_u:object_r:faillog_t:s0 /var/log/faillock ++ ++If the security context type of the non-default tally directory is not "faillog_t", this is a finding.SRG-OS-000021-GPOS-00005<GroupDescription></GroupDescription>RHEL-08-020028RHEL 8 systems below version 8.2 must configure SELinux context type to allow the use of a non-default faillock tally directory.<VulnDiscussion>By limiting the number of failed logon attempts, the risk of unauthorized system access via user password guessing, otherwise known as brute-force attacks, is reduced. Limits are imposed by locking the account. ++ ++From "Pam_Faillock" man pages: Note that the default directory that "pam_faillock" uses is usually cleared on system boot so the access will be reenabled after system reboot. If that is undesirable, a different tally directory must be set with the "dir" option. ++ ++SELinux, enforcing a targeted policy, will require any non-default tally directory's security context type to match the default directory's security context type. Without updating the security context type, the pam_faillock module will not write failed login attempts to the non-default tally directory.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000044CCI-002238Configure RHEL 8 to allow the use of a non-default faillock tally directory while SELinux enforces a targeted policy. ++ ++Update the /etc/selinux/targeted/contexts/files/file_contexts.local with "faillog_t" context type for the non-default faillock tally directory with the following command: ++ ++$ sudo semanage fcontext -a -t faillog_t "/var/log/faillock(/.*)?" ++ ++Next, update the context type of the non-default faillock directory/subdirectories and files with the following command: ++ ++$ sudo restorecon -R -v /var/log/faillockIf the system does not have SELinux enabled and enforcing a targeted policy, or if the pam_faillock module is not configured for use, this requirement is not applicable. ++ ++Note: This check applies to RHEL versions 8.0 and 8.1. If the system is RHEL version 8.2 or newer, this check is not applicable. ++ ++Verify the location of the non-default tally directory for the pam_faillock module with the following command: ++ ++$ sudo grep -w dir /etc/pam.d/password-auth ++ ++auth required pam_faillock.so preauth dir=/var/log/faillock ++auth required pam_faillock.so authfail dir=/var/log/faillock ++ ++Check the security context type of the non-default tally directory with the following command: ++ ++$ sudo ls -Zd /var/log/faillock ++ ++unconfined_u:object_r:faillog_t:s0 /var/log/faillock ++ ++If the security context type of the non-default tally directory is not "faillog_t", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040259RHEL 8 must not enable IPv4 packet forwarding unless the system is a router.<VulnDiscussion>Routing protocol daemons are typically used on routers to exchange network topology information with other routers. If this software is used when not required, system network information may be unnecessarily transmitted across the network. ++ ++The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. ++/etc/sysctl.d/*.conf ++/run/sysctl.d/*.conf ++/usr/local/lib/sysctl.d/*.conf ++/usr/lib/sysctl.d/*.conf ++/lib/sysctl.d/*.conf ++/etc/sysctl.conf ++ ++Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure RHEL 8 to not allow IPv4 packet forwarding, unless the system is a router. ++ ++Add or edit the following line in a system configuration file, which begins with "99-", in the "/etc/sysctl.d/" directory: ++ ++net.ipv4.conf.all.forwarding=0 ++ ++Load settings from all system configuration files with the following command: ++ ++$ sudo sysctl --systemVerify RHEL 8 is not performing IPv4 packet forwarding, unless the system is a router. ++ ++Note: If IPv4 is disabled on the system, this requirement is Not Applicable. ++ ++Check that IPv4 forwarding is disabled using the following command: ++ ++$ sudo sysctl net.ipv4.ip_forward ++ ++net.ipv4.ip_forward = 0 ++If the IPv4 forwarding value is not "0" and is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding. ++ ++Check that the configuration files are present to enable this network parameter. ++ ++$ sudo grep -r net.ipv4.conf.all.forwarding /etc/sysctl.d/*.conf ++ ++/etc/sysctl.d/99-sysctl.conf: net.ipv4.conf.all.forwarding = 0 ++ ++If "net.ipv4.conf.all.forwarding" is not set to "0", is missing or commented out, this is a finding. ++ ++If the configuration file does not begin with "99-", this is a finding. +\ No newline at end of file +diff --git a/tests/data/profile_stability/rhel8/stig.profile b/tests/data/profile_stability/rhel8/stig.profile +index ca0097b..e4f9dd8 100644 +--- a/tests/data/profile_stability/rhel8/stig.profile ++++ b/tests/data/profile_stability/rhel8/stig.profile +@@ -58,7 +58,9 @@ selections: + - accounts_passwords_pam_faillock_interval + - accounts_passwords_pam_faillock_unlock_time + - accounts_umask_etc_bashrc ++- accounts_umask_etc_csh_cshrc + - accounts_umask_etc_login_defs ++- accounts_umask_etc_profile + - accounts_umask_interactive_users + - accounts_user_dot_no_world_writable_programs + - accounts_user_home_paths_only +diff --git a/tests/data/profile_stability/rhel8/stig_gui.profile b/tests/data/profile_stability/rhel8/stig_gui.profile +index 3533208..d37d2ec 100644 +--- a/tests/data/profile_stability/rhel8/stig_gui.profile ++++ b/tests/data/profile_stability/rhel8/stig_gui.profile +@@ -69,7 +69,9 @@ selections: + - accounts_passwords_pam_faillock_interval + - accounts_passwords_pam_faillock_unlock_time + - accounts_umask_etc_bashrc ++- accounts_umask_etc_csh_cshrc + - accounts_umask_etc_login_defs ++- accounts_umask_etc_profile + - accounts_umask_interactive_users + - accounts_user_dot_no_world_writable_programs + - accounts_user_home_paths_only diff --git a/SOURCES/scap-security-guide-0.1.60-rhel9_stig_grub-PR_7931.patch b/SOURCES/scap-security-guide-0.1.60-rhel9_stig_grub-PR_7931.patch new file mode 100644 index 0000000..a2ebc9a --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.60-rhel9_stig_grub-PR_7931.patch @@ -0,0 +1,324 @@ +commit 2e1eeff365be8fde302620fae6691ccc523f6f9e +Author: Gabriel Becker +Date: Thu Feb 24 18:19:45 2022 +0100 + + Manual edited patch scap-security-guide-0.1.60-rhel9_stig_grub-PR_7931.patch. + +diff --git a/linux_os/guide/system/bootloader-grub2/grub2_kernel_trust_cpu_rng/oval/shared.xml b/linux_os/guide/system/bootloader-grub2/grub2_kernel_trust_cpu_rng/oval/shared.xml +index c95f1d4..9035eee 100644 +--- a/linux_os/guide/system/bootloader-grub2/grub2_kernel_trust_cpu_rng/oval/shared.xml ++++ b/linux_os/guide/system/bootloader-grub2/grub2_kernel_trust_cpu_rng/oval/shared.xml +@@ -29,11 +29,34 @@ + 1 + + +- +- +- ++ {{% if product in ['rhel9'] %}} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ /boot/loader/entries/ ++ ^.*\.conf$ ++ ^options (.*)$ ++ 1 ++ ++ {{% else %}} ++ ++ ++ ++ + + + +@@ -50,6 +73,7 @@ + ^kernelopts=(.*)$ + 1 + ++ {{% endif %}} + + +@@ -61,5 +85,4 @@ + ^(?:.*\s)?random\.trust_cpu=off(?:\s.*)?$ + + +- + +diff --git a/linux_os/guide/system/network/network-ipv6/disabling_ipv6/grub2_ipv6_disable_argument/rule.yml b/linux_os/guide/system/network/network-ipv6/disabling_ipv6/grub2_ipv6_disable_argument/rule.yml +index dae640f..b8ff66c 100644 +--- a/linux_os/guide/system/network/network-ipv6/disabling_ipv6/grub2_ipv6_disable_argument/rule.yml ++++ b/linux_os/guide/system/network/network-ipv6/disabling_ipv6/grub2_ipv6_disable_argument/rule.yml +@@ -1,6 +1,6 @@ + documentation_complete: true + +-prodtype: fedora,rhcos4,ol7,ol8,rhel7,rhel8,rhv4,sle15 ++prodtype: fedora,ol7,ol8,rhcos4,rhel7,rhel8,rhel9,rhv4,sle15 + + title: 'Ensure IPv6 is disabled through kernel boot parameter' + +diff --git a/linux_os/guide/system/network/network-ipv6/disabling_ipv6/grub2_ipv6_disable_argument/tests/arg_not_there_rhel9.fail.sh b/linux_os/guide/system/network/network-ipv6/disabling_ipv6/grub2_ipv6_disable_argument/tests/arg_not_there_rhel9.fail.sh +new file mode 100644 +index 0000000..fc649d7 +--- /dev/null ++++ b/linux_os/guide/system/network/network-ipv6/disabling_ipv6/grub2_ipv6_disable_argument/tests/arg_not_there_rhel9.fail.sh +@@ -0,0 +1,10 @@ ++#!/bin/bash ++# platform = Red Hat Enterprise Linux 9 ++ ++# Removes ipv6.disable argument from kernel command line in //boot/loader/entries/*.conf ++ ++for file in /boot/loader/entries/*.conf ; do ++ if grep -q '^.*ipv6\.disable=.*' "$file" ; then ++ sed -i 's/\(^.*\)ipv6\.disable=[^[:space:]]*\(.*\)/\1 \2/' "$file" ++ fi ++done +diff --git a/linux_os/guide/system/network/network-ipv6/disabling_ipv6/grub2_ipv6_disable_argument/tests/wrong_value_rhel9.fail.sh b/linux_os/guide/system/network/network-ipv6/disabling_ipv6/grub2_ipv6_disable_argument/tests/wrong_value_rhel9.fail.sh +new file mode 100644 +index 0000000..3c1cde1 +--- /dev/null ++++ b/linux_os/guide/system/network/network-ipv6/disabling_ipv6/grub2_ipv6_disable_argument/tests/wrong_value_rhel9.fail.sh +@@ -0,0 +1,14 @@ ++#!/bin/bash ++# platform = Red Hat Enterprise Linux 9 ++ ++# Break the ipv6.disable argument in kernel command line in /boot/loader/entries/*.conf ++ ++for file in /boot/loader/entries/*.conf ; do ++ if grep -q '^.*ipv6\.disable=.*' "$file" ; then ++ # modify the GRUB command-line if an ipv6.disable= arg already exists ++ sed -i 's/\(^.*\)ipv6\.disable=[^[:space:]]*\(.*\)/\1 ipv6\.disable=0 \2/' "$file" ++ else ++ # no ipv6.disable=arg is present, append it ++ sed -i 's/\(^.*\(vmlinuz\|kernelopts|options\).*\)/\1 ipv6\.disable=0/' "$file" ++ fi ++done +diff --git a/shared/macros-bash.jinja b/shared/macros-bash.jinja +index b5f55ae..3eebbd9 100644 +--- a/shared/macros-bash.jinja ++++ b/shared/macros-bash.jinja +@@ -684,3 +684,43 @@ dpkg-query --show --showformat='${db:Status-Status}\n' "{{{ pkgname }}}" 2>/dev/ + rpm --quiet -q "{{{ pkgname }}}" + {{%- endif -%}} + {{%- endmacro -%}} ++ ++{{# ++ ++ Remediation for grub2 bootloader arguments ++#}} ++{{% macro grub2_bootloader_argument_remediation(ARG_NAME, ARG_NAME_VALUE) %}} ++{{% if product in ["rhel7", "ol7", "rhel9"] or 'ubuntu' in product %}} ++{{% if '/' in ARG_NAME %}} ++{{{ raise("ARG_NAME (" + ARG_NAME + ") uses sed path separator (/) in " + rule_id) }}} ++{{% elif '/' in ARG_NAME_VALUE %}} ++{{{ raise("ARG_NAME_VALUE (" + ARG_NAME_VALUE + ") uses sed path separator (/) in " + rule_id) }}} ++{{% endif %}} ++# Correct the form of default kernel command line in GRUB ++if grep -q '^GRUB_CMDLINE_LINUX=.*{{{ ARG_NAME }}}=.*"' '/etc/default/grub' ; then ++ # modify the GRUB command-line if an {{{ ARG_NAME }}}= arg already exists ++ sed -i 's/\(^GRUB_CMDLINE_LINUX=".*\){{{ ARG_NAME }}}=[^[:space:]]*\(.*"\)/\1 {{{ ARG_NAME_VALUE }}} \2/' '/etc/default/grub' ++else ++ # no {{{ ARG_NAME }}}=arg is present, append it ++ sed -i 's/\(^GRUB_CMDLINE_LINUX=".*\)"/\1 {{{ ARG_NAME_VALUE }}}"/' '/etc/default/grub' ++fi ++ ++{{% if 'ubuntu' in product %}} ++update-grub ++{{% else %}} ++# Correct the form of kernel command line for each installed kernel in the bootloader ++grubby --update-kernel=ALL --args="{{{ ARG_NAME_VALUE }}}" ++{{% endif %}} ++{{% else %}} ++# Correct grub2 kernelopts value using grub2-editenv ++existing_kernelopts="$(grub2-editenv - list | grep kernelopts)" ++if ! printf '%s' "$existing_kernelopts" | grep -qE '^kernelopts=(.*\s)?{{{ ARG_NAME_VALUE }}}(\s.*)?$'; then ++ if test -n "$existing_kernelopts"; then ++ grub2-editenv - set "$existing_kernelopts {{{ ARG_NAME_VALUE }}}" ++ else ++ grub2-editenv - set "kernelopts={{{ ARG_NAME_VALUE }}}" ++ fi ++fi ++{{% endif %}} ++ ++{{% endmacro %}} +diff --git a/shared/templates/grub2_bootloader_argument/bash.template b/shared/templates/grub2_bootloader_argument/bash.template +index cecd1f9..fd75db4 100644 +--- a/shared/templates/grub2_bootloader_argument/bash.template ++++ b/shared/templates/grub2_bootloader_argument/bash.template +@@ -1,6 +1,6 @@ + # platform = multi_platform_rhel,multi_platform_fedora,multi_platform_ol,multi_platform_rhv,multi_platform_ubuntu + +-{{% if product in ["rhel7", "ol7"] or 'ubuntu' in product %}} ++{{% if product in ["rhel7", "ol7", "rhel9"] or 'ubuntu' in product %}} + {{% if '/' in ARG_NAME %}} + {{{ raise("ARG_NAME (" + ARG_NAME + ") uses sed path separator (/) in " + rule_id) }}} + {{% elif '/' in ARG_NAME_VALUE %}} +diff --git a/shared/templates/grub2_bootloader_argument/oval.template b/shared/templates/grub2_bootloader_argument/oval.template +index e8da1fe..3ea8acb 100644 +--- a/shared/templates/grub2_bootloader_argument/oval.template ++++ b/shared/templates/grub2_bootloader_argument/oval.template +@@ -2,9 +2,14 @@ + + {{{ oval_metadata("Ensure " + ARG_NAME_VALUE + " is configured in the kernel line in /etc/default/grub.") }}} + +- {{% if product in ["rhel7", "ol7"] or 'ubuntu' in product %}} +- ++ {{% if product in ["rhel7", "ol7", "rhel9"] or 'ubuntu' in product %}} ++ {{% if product in ['rhel9'] %}} ++ ++ {{% else %}} ++ ++ {{% endif %}} + + +@@ -22,7 +27,7 @@ + + + +-{{% if product in ["rhel7", "ol7"] or 'ubuntu' in product %}} ++{{% if product in ["rhel7", "ol7", "rhel9"] or 'ubuntu' in product %}} + +@@ -50,6 +55,21 @@ + 1 + + ++ {{% if product in ["rhel9"] %}} ++ ++ ++ ++ ++ ++ ++ /boot/loader/entries/ ++ ^.*\.conf$ ++ ^options (.*)$ ++ 1 ++ ++ {{% else %}} + +@@ -68,6 +88,8 @@ + 1 + + ++ {{% endif %}} ++ + {{% else %}} + + +Date: Thu Feb 24 18:15:07 2022 +0100 + + Manual edited patch scap-security-guide-0.1.60-sysctl_d_directories-PR_7999.patch. + +diff --git a/linux_os/guide/system/permissions/restrictions/enable_execshield_settings/sysctl_kernel_randomize_va_space/tests/wrong_value_d_directory.fail.sh b/linux_os/guide/system/permissions/restrictions/enable_execshield_settings/sysctl_kernel_randomize_va_space/tests/wrong_value_d_directory.fail.sh +new file mode 100644 +index 0000000..48a2665 +--- /dev/null ++++ b/linux_os/guide/system/permissions/restrictions/enable_execshield_settings/sysctl_kernel_randomize_va_space/tests/wrong_value_d_directory.fail.sh +@@ -0,0 +1,23 @@ ++#!/bin/bash ++ ++. $SHARED/sysctl.sh ++ ++setting_name="kernel.randomize_va_space" ++setting_value="2" ++# sysctl -w "$setting_name=$setting_value" ++if grep -q "^$setting_name" /usr/lib/sysctl.d/50-sysctl.conf; then ++ sed -i "s/^$setting_name.*/$setting_name = $setting_value/" /usr/lib/sysctl.d/50-sysctl.conf ++else ++ echo "$setting_name = $setting_value" >> /usr/lib/sysctl.d/50-sysctl.conf ++fi ++ ++setting_name="kernel.randomize_va_space" ++setting_value="0" ++# sysctl -w "$setting_name=$setting_value" ++if grep -q "^$setting_name" /etc/sysctl.d/99-sysctl.conf; then ++ sed -i "s/^$setting_name.*/$setting_name = $setting_value/" /etc/sysctl.d/99-sysctl.conf ++else ++ echo "$setting_name = $setting_value" >> /etc/sysctl.d/99-sysctl.conf ++fi ++ ++sysctl --system +diff --git a/shared/templates/sysctl/ansible.template b/shared/templates/sysctl/ansible.template +index e4ccd84..3837b31 100644 +--- a/shared/templates/sysctl/ansible.template ++++ b/shared/templates/sysctl/ansible.template +@@ -3,6 +3,21 @@ + # strategy = disable + # complexity = low + # disruption = medium ++ ++- name: List /etc/sysctl.d/*.conf files ++ find: ++ paths: "/etc/sysctl.d/" ++ contains: '^[\s]*{{{ SYSCTLVAR }}}.*$' ++ patterns: "*.conf" ++ register: find_sysctl_d ++ ++- name: Comment out any occurrences of {{{ SYSCTLVAR }}} from /etc/sysctl.d/*.conf files ++ replace: ++ path: "{{ item }}" ++ regexp: '^[\s]*{{{ SYSCTLVAR }}}' ++ replace: '#{{{ SYSCTLVAR }}}' ++ loop: "{{ find_sysctl_d.files }}" ++ + {{%- if SYSCTLVAL == "" %}} + - (xccdf-var sysctl_{{{ SYSCTLID }}}_value) + +diff --git a/shared/templates/sysctl/bash.template b/shared/templates/sysctl/bash.template +index a762794..5ec56fd 100644 +--- a/shared/templates/sysctl/bash.template ++++ b/shared/templates/sysctl/bash.template +@@ -4,6 +4,18 @@ + # complexity = low + # disruption = medium + . /usr/share/scap-security-guide/remediation_functions ++ ++# Comment out any occurrences of {{{ SYSCTLVAR }}} from /etc/sysctl.d/*.conf files ++for f in /etc/sysctl.d/*.conf ; do ++ matching_list=$(grep -P '^(?!#).*[\s]+{{{ SYSCTLVAR }}}.*$' $f | uniq ) ++ if ! test -z "$matching_list"; then ++ while IFS= read -r entry; do ++ # comment out "{{{ SYSCTLVAR }}}" matches to preserve user data ++ sed -i "s/^${entry}$/# &/g" $f ++ done <<< "$matching_list" ++ fi ++done ++ + {{%- if SYSCTLVAL == "" %}} + {{{ bash_instantiate_variables("sysctl_" + SYSCTLID + "_value") }}} + diff --git a/SOURCES/scap-security-guide-0.1.61-add_RHEL_08_010331-PR_8055.patch b/SOURCES/scap-security-guide-0.1.61-add_RHEL_08_010331-PR_8055.patch new file mode 100644 index 0000000..3be366d --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.61-add_RHEL_08_010331-PR_8055.patch @@ -0,0 +1,155 @@ +commit 3c9a97de3a91b2a8fd85f13bb902e2529dd6fa67 +Author: Watson Sato +Date: Fri Feb 25 13:51:41 2022 +0100 + + Manual edited patch scap-security-guide-0.1.61-add_RHEL_08_010331-PR_8055.patch. + +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/ansible/shared.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/ansible/shared.yml +index 8a28af0..02c69bd 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/ansible/shared.yml ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/ansible/shared.yml +@@ -1,4 +1,4 @@ +-# platform = multi_platform_sle ++# platform = multi_platform_all + # reboot = false + # strategy = restrict + # complexity = high +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/rule.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/rule.yml +index a0f5aeb..853f8ac 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/rule.yml ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/rule.yml +@@ -31,6 +31,8 @@ rationale: |- + of initiating changes, including upgrades and modifications. + + identifiers: ++ cce@rhel8: CCE-88692-9 ++ cce@rhel9: CCE-88693-7 + cce@sle12: CCE-83234-5 + cce@sle15: CCE-85753-2 + +@@ -40,6 +42,8 @@ references: + disa: CCI-001499 + nerc-cip: CIP-003-3 R6 + nist: CM-5,CM-5(6),CM-5(6).1 ++ srg: SRG-OS-000259-GPOS-00100 ++ stigid@rhel8: RHEL-08-010331 + stigid@sle12: SLES-12-010872 + stigid@sle15: SLES-15-010352 + stigid@ubuntu2004: UBTU-20-010427 +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/all_dirs_ok.pass.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/all_dirs_ok.pass.sh +index af07846..6e957c3 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/all_dirs_ok.pass.sh ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/all_dirs_ok.pass.sh +@@ -1,4 +1,4 @@ +-# platform = multi_platform_sle,multi_platform_ubuntu ++# platform = multi_platform_sle,multi_platform_ubuntu,multi_platform_rhel + DIRS="/lib /lib64 /usr/lib /usr/lib64" + for dirPath in $DIRS; do + find "$dirPath" -perm /022 -type d -exec chmod go-w '{}' \; +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/owner_only_writable_dir.pass.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/owner_only_writable_dir.pass.sh +index d58616b..55ff9ce 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/owner_only_writable_dir.pass.sh ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/owner_only_writable_dir.pass.sh +@@ -1,4 +1,4 @@ +-# platform = multi_platform_sle,multi_platform_ubuntu ++# platform = multi_platform_sle,multi_platform_ubuntu,multi_platform_rhel + DIRS="/lib /lib64 /usr/lib /usr/lib64" + for dirPath in $DIRS; do + chmod -R 755 "$dirPath" +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/world_writable_dir_on_lib.fail.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/world_writable_dir_on_lib.fail.sh +index 98d18cd..c2b5b6b 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/world_writable_dir_on_lib.fail.sh ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/world_writable_dir_on_lib.fail.sh +@@ -1,4 +1,4 @@ +-# platform = multi_platform_sle,multi_platform_ubuntu ++# platform = multi_platform_sle,multi_platform_ubuntu,multi_platform_rhel + DIRS="/lib /lib64" + for dirPath in $DIRS; do + mkdir -p "$dirPath/testme" && chmod 777 "$dirPath/testme" +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/world_writable_dir_on_usr_lib.fail.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/world_writable_dir_on_usr_lib.fail.sh +index 6df6e2f..40e6c42 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/world_writable_dir_on_usr_lib.fail.sh ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/world_writable_dir_on_usr_lib.fail.sh +@@ -1,4 +1,4 @@ +-# platform = multi_platform_sle,multi_platform_ubuntu ++# platform = multi_platform_sle,multi_platform_ubuntu,multi_platform_rhel + DIRS="/usr/lib /usr/lib64" + for dirPath in $DIRS; do + mkdir -p "$dirPath/testme" && chmod 777 "$dirPath/testme" +diff --git a/products/rhel8/profiles/cjis.profile b/products/rhel8/profiles/cjis.profile +index adeae4a..fab5f3f 100644 +--- a/products/rhel8/profiles/cjis.profile ++++ b/products/rhel8/profiles/cjis.profile +@@ -77,6 +77,7 @@ selections: + - accounts_password_pam_difok + - accounts_max_concurrent_login_sessions + - set_password_hashing_algorithm_systemauth ++ - set_password_hashing_algorithm_passwordauth + - set_password_hashing_algorithm_logindefs + - set_password_hashing_algorithm_libuserconf + - file_owner_etc_shadow +diff --git a/products/rhel8/profiles/stig.profile b/products/rhel8/profiles/stig.profile +index 5d03125..d51e53a 100644 +--- a/products/rhel8/profiles/stig.profile ++++ b/products/rhel8/profiles/stig.profile +@@ -224,6 +224,9 @@ selections: + # RHEL-08-010330 + - file_permissions_library_dirs + ++ # RHEL-08-010331 ++ - dir_permissions_library_dirs ++ + # RHEL-08-010340 + - file_ownership_library_dirs + +diff --git a/products/rhel9/profiles/stig.profile b/products/rhel9/profiles/stig.profile +index 9acb63a..b751a74 100644 +--- a/products/rhel9/profiles/stig.profile ++++ b/products/rhel9/profiles/stig.profile +@@ -195,6 +195,9 @@ selections: + # RHEL-08-010330 + - file_permissions_library_dirs + ++ # RHEL-08-010331 ++ - dir_permissions_library_dirs ++ + # RHEL-08-010340 + - file_ownership_library_dirs + +diff --git a/shared/references/cce-redhat-avail.txt b/shared/references/cce-redhat-avail.txt +index 1b83798..fef5fd8 100644 +--- a/shared/references/cce-redhat-avail.txt ++++ b/shared/references/cce-redhat-avail.txt +@@ -2758,8 +2758,6 @@ CCE-88688-7 + CCE-88689-5 + CCE-88690-3 + CCE-88691-1 +-CCE-88692-9 +-CCE-88693-7 + CCE-88694-5 + CCE-88695-2 + CCE-88696-0 +diff --git a/tests/data/profile_stability/rhel8/stig.profile b/tests/data/profile_stability/rhel8/stig.profile +index e4f9dd8..3b4b43a 100644 +--- a/tests/data/profile_stability/rhel8/stig.profile ++++ b/tests/data/profile_stability/rhel8/stig.profile +@@ -175,6 +175,7 @@ selections: + - dconf_gnome_screensaver_idle_delay + - dconf_gnome_screensaver_lock_enabled + - dir_group_ownership_library_dirs ++- dir_permissions_library_dirs + - dir_perms_world_writable_root_owned + - dir_perms_world_writable_sticky_bits + - directory_group_ownership_var_log_audit +diff --git a/tests/data/profile_stability/rhel8/stig_gui.profile b/tests/data/profile_stability/rhel8/stig_gui.profile +index d37d2ec..2e0e161 100644 +--- a/tests/data/profile_stability/rhel8/stig_gui.profile ++++ b/tests/data/profile_stability/rhel8/stig_gui.profile +@@ -186,6 +186,7 @@ selections: + - dconf_gnome_screensaver_idle_delay + - dconf_gnome_screensaver_lock_enabled + - dir_group_ownership_library_dirs ++- dir_permissions_library_dirs + - dir_perms_world_writable_root_owned + - dir_perms_world_writable_sticky_bits + - directory_group_ownership_var_log_audit diff --git a/SOURCES/scap-security-guide-0.1.61-add_RHEL_08_010359-PR_8131.patch b/SOURCES/scap-security-guide-0.1.61-add_RHEL_08_010359-PR_8131.patch new file mode 100644 index 0000000..e7e69fa --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.61-add_RHEL_08_010359-PR_8131.patch @@ -0,0 +1,46 @@ +commit ae056f1639768deba6f51427419eb73f2e6e7626 +Author: Gabriel Becker +Date: Fri Feb 25 14:20:55 2022 +0100 + + Manual edited patch scap-security-guide-0.1.61-add_RHEL_08_010359-PR_8131.patch. + +diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/package_aide_installed/rule.yml b/linux_os/guide/system/software/integrity/software-integrity/aide/package_aide_installed/rule.yml +index 51adb67..ed2734c 100644 +--- a/linux_os/guide/system/software/integrity/software-integrity/aide/package_aide_installed/rule.yml ++++ b/linux_os/guide/system/software/integrity/software-integrity/aide/package_aide_installed/rule.yml +@@ -27,7 +27,7 @@ references: + cis@ubuntu2004: 1.4.1 + cjis: 5.10.1.3 + cobit5: APO01.06,BAI01.06,BAI02.01,BAI03.05,BAI06.01,BAI10.01,BAI10.02,BAI10.03,BAI10.05,DSS01.03,DSS03.05,DSS04.07,DSS05.02,DSS05.03,DSS05.05,DSS05.07,DSS06.02,DSS06.06 +- disa: CCI-002699,CCI-001744 ++ disa: CCI-002696,CCI-002699,CCI-001744 + isa-62443-2009: 4.3.4.3.2,4.3.4.3.3,4.3.4.4.4 + isa-62443-2013: 'SR 3.1,SR 3.3,SR 3.4,SR 3.8,SR 4.1,SR 6.2,SR 7.6' + ism: 1034,1288,1341,1417 +@@ -35,8 +35,8 @@ references: + nist: CM-6(a) + nist-csf: DE.CM-1,DE.CM-7,PR.DS-1,PR.DS-6,PR.DS-8,PR.IP-1,PR.IP-3 + pcidss: Req-11.5 +- srg: SRG-OS-000363-GPOS-00150 +- stigid@rhel8: RHEL-08-010360 ++ srg: SRG-OS-000363-GPOS-00150,SRG-OS-000445-GPOS-00199 ++ stigid@rhel8: RHEL-08-010359 + stigid@sle12: SLES-12-010500 + stigid@sle15: SLES-15-010420 + stigid@ubuntu2004: UBTU-20-010450 +diff --git a/products/rhel8/profiles/stig.profile b/products/rhel8/profiles/stig.profile +index 705caa8..d6f0793 100644 +--- a/products/rhel8/profiles/stig.profile ++++ b/products/rhel8/profiles/stig.profile +@@ -237,8 +237,10 @@ selections: + - root_permissions_syslibrary_files + - dir_group_ownership_library_dirs + +- # RHEL-08-010360 ++ # RHEL-08-010359 + - package_aide_installed ++ ++ # RHEL-08-010360 + - aide_scan_notification + + # RHEL-08-010370 diff --git a/SOURCES/scap-security-guide-0.1.61-add_RHEL_08_0103789_include_sudoers-PR_8196.patch b/SOURCES/scap-security-guide-0.1.61-add_RHEL_08_0103789_include_sudoers-PR_8196.patch new file mode 100644 index 0000000..95f7bda --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.61-add_RHEL_08_0103789_include_sudoers-PR_8196.patch @@ -0,0 +1,326 @@ +commit 804ab7d7e48d3d6a93aab8c99a1b71410553983b +Author: Watson Sato +Date: Mon Feb 28 11:44:13 2022 +0100 + + Manual edited patch scap-security-guide-0.1.61-add_RHEL_08_0103789_include_sudoers-PR_8196.patch. + +diff --git a/linux_os/guide/system/software/sudo/sudoers_default_includedir/ansible/shared.yml b/linux_os/guide/system/software/sudo/sudoers_default_includedir/ansible/shared.yml +new file mode 100644 +index 0000000..0d8c9e7 +--- /dev/null ++++ b/linux_os/guide/system/software/sudo/sudoers_default_includedir/ansible/shared.yml +@@ -0,0 +1,21 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = configure ++# complexity = low ++# disruption = low ++ ++{{{ ansible_only_lineinfile(msg='Ensure sudo only has the default includedir', line_regex='^#includedir.*$', path='/etc/sudoers', new_line='#includedir /etc/sudoers.d') }}} ++{{{ ansible_lineinfile(msg='Ensure sudoers doesn\'t include other non-default file', regex='^#include[\s]+.*$', path='/etc/sudoers', state='absent') }}} ++- name: "Find out if /etc/sudoers.d/* files contain file or directory includes" ++ find: ++ path: "/etc/sudoers.d" ++ patterns: "*" ++ contains: '^#include(dir)?\s.*$' ++ register: sudoers_d_includes ++ ++- name: "Remove found occurrences of file and directory inclues from /etc/sudoers.d/* files" ++ lineinfile: ++ path: "{{ item.path }}" ++ regexp: '^#include(dir)?\s.*$' ++ state: absent ++ with_items: "{{ sudoers_d_includes.files }}" +diff --git a/linux_os/guide/system/software/sudo/sudoers_default_includedir/bash/shared.sh b/linux_os/guide/system/software/sudo/sudoers_default_includedir/bash/shared.sh +new file mode 100644 +index 0000000..fbff5eb +--- /dev/null ++++ b/linux_os/guide/system/software/sudo/sudoers_default_includedir/bash/shared.sh +@@ -0,0 +1,21 @@ ++# platform = multi_platform_all ++ ++sudoers_config_file="/etc/sudoers" ++sudoers_config_dir="/etc/sudoers.d" ++sudoers_includedir_count=$(grep -c "#includedir" "$sudoers_config_file") ++if [ "$sudoers_includedir_count" -gt 1 ]; then ++ sed -i "/#includedir.*/d" "$sudoers_config_file" ++ echo "#includedir /etc/sudoers.d" >> "$sudoers_config_file" ++elif [ "$sudoers_includedir_count" -eq 0 ]; then ++ echo "#includedir /etc/sudoers.d" >> "$sudoers_config_file" ++else ++ if ! grep -q "^#includedir /etc/sudoers.d" "$sudoers_config_file"; then ++ sed -i "s|^#includedir.*|#includedir /etc/sudoers.d|g" "$sudoers_config_file" ++ fi ++fi ++ ++sed -i "/^#include\s\+.*/d" "$sudoers_config_file" ++ ++if grep -Pr "^#include(dir)? .*" "$sudoers_config_dir" ; then ++ sed -i "/^#include\(dir\)\?\s\+.*/d" "$sudoers_config_dir"/* ++fi +diff --git a/linux_os/guide/system/software/sudo/sudoers_default_includedir/oval/shared.xml b/linux_os/guide/system/software/sudo/sudoers_default_includedir/oval/shared.xml +new file mode 100644 +index 0000000..59cab0b +--- /dev/null ++++ b/linux_os/guide/system/software/sudo/sudoers_default_includedir/oval/shared.xml +@@ -0,0 +1,46 @@ ++ ++ ++ {{{ oval_metadata("Check if sudo includes only the default includedir") }}} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ /etc/sudoers ++ ^#includedir[\s]+(.*)$ ++ 1 ++ ++ ++ /etc/sudoers.d ++ ++ ++ ++ ++ ++ ++ /etc/sudoers ++ ^#include[\s]+.*$ ++ 1 ++ ++ ++ ++ ++ ++ ++ /etc/sudoers.d/ ++ .* ++ ^#include(dir)?[\s]+.*$ ++ 1 ++ ++ ++ +diff --git a/linux_os/guide/system/software/sudo/sudoers_default_includedir/rule.yml b/linux_os/guide/system/software/sudo/sudoers_default_includedir/rule.yml +new file mode 100644 +index 0000000..a97bd3e +--- /dev/null ++++ b/linux_os/guide/system/software/sudo/sudoers_default_includedir/rule.yml +@@ -0,0 +1,40 @@ ++documentation_complete: true ++ ++prodtype: fedora,rhel7,rhel8,rhel9 ++ ++title: 'Ensure sudo only includes the default configuration directory' ++ ++description: |- ++ Administrators can configure authorized sudo users via drop-in files, and it is possible to include ++ other directories and configuration files from the file currently being parsed. ++ ++ Make sure that /etc/sudoers only includes drop-in configuration files from /etc/sudoers.d. ++ The /etc/sudoers should contain only one #includedir directive pointing to ++ /etc/sudoers.d, and no file in /etc/sudoers.d/ should include other files or directories. ++ Note that the '#' character doesn't denote a comment in the configuration file. ++ ++rationale: |- ++ Some sudo configurtion options allow users to run programs without re-authenticating. ++ Use of these configuration options makes it easier for one compromised accound to be used to ++ compromise other accounts. ++ ++severity: medium ++ ++identifiers: ++ cce@rhel7: CCE-86277-1 ++ cce@rhel8: CCE-86377-9 ++ cce@rhel9: CCE-86477-7 ++ ++references: ++ disa: CCI-000366 ++ srg: SRG-OS-000480-GPOS-00227 ++ stigid@rhel8: RHEL-08-010379 ++ ++ocil_clause: "the /etc/sudoers doesn't include /etc/sudores.d or includes other directories?" ++ ++ocil: |- ++ To determine whether sudo command includes configuration files from the appropriate directory, ++ run the following command: ++
$ sudo grep -rP '^#include(dir)?' /etc/sudoers /etc/sudoers.d
++ If only the line /etc/sudoers:#includedir /etc/sudoers.d is returned, then the drop-in include configuration is set correctly. ++ Any other line returned is a finding. +diff --git a/linux_os/guide/system/software/sudo/sudoers_default_includedir/tests/default_includedir.pass.sh b/linux_os/guide/system/software/sudo/sudoers_default_includedir/tests/default_includedir.pass.sh +new file mode 100644 +index 0000000..ac0c808 +--- /dev/null ++++ b/linux_os/guide/system/software/sudo/sudoers_default_includedir/tests/default_includedir.pass.sh +@@ -0,0 +1,7 @@ ++#!/bin/bash ++# platform = multi_platform_all ++ ++# Ensure default config is there ++if ! grep -q "#includedir /etc/sudoers.d" /etc/sudoers; then ++ echo "#includedir /etc/sudoers.d" >> /etc/sudoers ++fi +diff --git a/linux_os/guide/system/software/sudo/sudoers_default_includedir/tests/duplicate_includedir.fail.sh b/linux_os/guide/system/software/sudo/sudoers_default_includedir/tests/duplicate_includedir.fail.sh +new file mode 100644 +index 0000000..5bad822 +--- /dev/null ++++ b/linux_os/guide/system/software/sudo/sudoers_default_includedir/tests/duplicate_includedir.fail.sh +@@ -0,0 +1,7 @@ ++#!/bin/bash ++# platform = multi_platform_all ++ ++# duplicate default entry ++if grep -q "#includedir /etc/sudoers.d" /etc/sudoers; then ++ echo "#includedir /etc/sudoers.d" >> /etc/sudoers ++fi +diff --git a/linux_os/guide/system/software/sudo/sudoers_default_includedir/tests/no_includedir.fail.sh b/linux_os/guide/system/software/sudo/sudoers_default_includedir/tests/no_includedir.fail.sh +new file mode 100644 +index 0000000..1e0ab8a +--- /dev/null ++++ b/linux_os/guide/system/software/sudo/sudoers_default_includedir/tests/no_includedir.fail.sh +@@ -0,0 +1,4 @@ ++#!/bin/bash ++# platform = multi_platform_all ++ ++sed -i "/#includedir.*/d" /etc/sudoers +diff --git a/linux_os/guide/system/software/sudo/sudoers_default_includedir/tests/sudoers.d_with_include.fail.sh b/linux_os/guide/system/software/sudo/sudoers_default_includedir/tests/sudoers.d_with_include.fail.sh +new file mode 100644 +index 0000000..3f14ecc +--- /dev/null ++++ b/linux_os/guide/system/software/sudo/sudoers_default_includedir/tests/sudoers.d_with_include.fail.sh +@@ -0,0 +1,10 @@ ++#!/bin/bash ++# platform = multi_platform_all ++ ++mkdir -p /etc/sudoers.d ++# Ensure default config is there ++if ! grep -q "#includedir /etc/sudoers.d" /etc/sudoers; then ++ echo "#includedir /etc/sudoers.d" >> /etc/sudoers ++fi ++ ++echo "#include /etc/my-sudoers" > /etc/sudoers.d/my-sudoers +diff --git a/linux_os/guide/system/software/sudo/sudoers_default_includedir/tests/sudoers.d_with_includedir.fail.sh b/linux_os/guide/system/software/sudo/sudoers_default_includedir/tests/sudoers.d_with_includedir.fail.sh +new file mode 100644 +index 0000000..8951507 +--- /dev/null ++++ b/linux_os/guide/system/software/sudo/sudoers_default_includedir/tests/sudoers.d_with_includedir.fail.sh +@@ -0,0 +1,10 @@ ++#!/bin/bash ++# platform = multi_platform_all ++ ++mkdir -p /etc/sudoers.d ++# Ensure default config is there ++if ! grep -q "#includedir /etc/sudoers.d" /etc/sudoers; then ++ echo "#includedir /etc/sudoers.d" >> /etc/sudoers ++fi ++ ++echo "#includedir /etc/my-sudoers.d" > /etc/sudoers.d/my-sudoers +diff --git a/linux_os/guide/system/software/sudo/sudoers_default_includedir/tests/sudoers_with_include.fail.sh b/linux_os/guide/system/software/sudo/sudoers_default_includedir/tests/sudoers_with_include.fail.sh +new file mode 100644 +index 0000000..ad04880 +--- /dev/null ++++ b/linux_os/guide/system/software/sudo/sudoers_default_includedir/tests/sudoers_with_include.fail.sh +@@ -0,0 +1,11 @@ ++#!/bin/bash ++# platform = multi_platform_all ++ ++# Ensure default config is there ++if ! grep -q "#includedir /etc/sudoers.d" /etc/sudoers; then ++ echo "#includedir /etc/sudoers.d" >> /etc/sudoers ++fi ++ ++if ! grep -q "#include " /etc/sudoers; then ++ echo "#include /etc/my-sudoers" >> /etc/sudoers ++fi +diff --git a/linux_os/guide/system/software/sudo/sudoers_default_includedir/tests/two_includedir.fail.sh b/linux_os/guide/system/software/sudo/sudoers_default_includedir/tests/two_includedir.fail.sh +new file mode 100644 +index 0000000..09d14ea +--- /dev/null ++++ b/linux_os/guide/system/software/sudo/sudoers_default_includedir/tests/two_includedir.fail.sh +@@ -0,0 +1,8 @@ ++#!/bin/bash ++# platform = multi_platform_all ++ ++# Ensure that there are two different indludedirs ++if ! grep -q "#includedir /etc/sudoers.d" /etc/sudoers; then ++ echo "#includedir /etc/sudoers.d" >> /etc/sudoers ++fi ++echo "#includedir /opt/extra_config.d" >> /etc/sudoers +diff --git a/linux_os/guide/system/software/sudo/sudoers_default_includedir/tests/wrong_includedir.fail.sh b/linux_os/guide/system/software/sudo/sudoers_default_includedir/tests/wrong_includedir.fail.sh +new file mode 100644 +index 0000000..55a072a +--- /dev/null ++++ b/linux_os/guide/system/software/sudo/sudoers_default_includedir/tests/wrong_includedir.fail.sh +@@ -0,0 +1,5 @@ ++#!/bin/bash ++# platform = multi_platform_all ++ ++sed -i "/#includedir.*/d" /etc/sudoers ++echo "#includedir /opt/extra_config.d" >> /etc/sudoers +diff --git a/products/rhel8/profiles/stig.profile b/products/rhel8/profiles/stig.profile +index bfb3753..f5fed4a 100644 +--- a/products/rhel8/profiles/stig.profile ++++ b/products/rhel8/profiles/stig.profile +@@ -271,6 +271,9 @@ selections: + # RHEL-08-010376 + - sysctl_kernel_perf_event_paranoid + ++ # RHEL-08-010379 ++ - sudoers_default_includedir ++ + # RHEL-08-010380 + - sudo_remove_nopasswd + +diff --git a/shared/references/cce-redhat-avail.txt b/shared/references/cce-redhat-avail.txt +index ec92589..99bccc7 100644 +--- a/shared/references/cce-redhat-avail.txt ++++ b/shared/references/cce-redhat-avail.txt +@@ -478,7 +478,6 @@ CCE-86373-8 + CCE-86374-6 + CCE-86375-3 + CCE-86376-1 +-CCE-86377-9 + CCE-86378-7 + CCE-86379-5 + CCE-86380-3 +@@ -576,7 +575,6 @@ CCE-86473-6 + CCE-86474-4 + CCE-86475-1 + CCE-86476-9 +-CCE-86477-7 + CCE-86478-5 + CCE-86479-3 + CCE-86480-1 +diff --git a/tests/data/profile_stability/rhel8/stig.profile b/tests/data/profile_stability/rhel8/stig.profile +index 2411f02..2dbc2e4 100644 +--- a/tests/data/profile_stability/rhel8/stig.profile ++++ b/tests/data/profile_stability/rhel8/stig.profile +@@ -360,6 +360,7 @@ selections: + - sudo_remove_nopasswd + - sudo_require_reauthentication + - sudo_restrict_privilege_elevation_to_authorized ++- sudoers_default_includedir + - sudoers_validate_passwd + - sysctl_crypto_fips_enabled + - sysctl_fs_protected_hardlinks +diff --git a/tests/data/profile_stability/rhel8/stig_gui.profile b/tests/data/profile_stability/rhel8/stig_gui.profile +index f0a9601..cd76884 100644 +--- a/tests/data/profile_stability/rhel8/stig_gui.profile ++++ b/tests/data/profile_stability/rhel8/stig_gui.profile +@@ -371,6 +371,7 @@ selections: + - sudo_remove_nopasswd + - sudo_require_reauthentication + - sudo_restrict_privilege_elevation_to_authorized ++- sudoers_default_includedir + - sudoers_validate_passwd + - sysctl_crypto_fips_enabled + - sysctl_fs_protected_hardlinks diff --git a/SOURCES/scap-security-guide-0.1.61-add_RHEL_08_020221-PR_8173.patch b/SOURCES/scap-security-guide-0.1.61-add_RHEL_08_020221-PR_8173.patch new file mode 100644 index 0000000..acc2c6f --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.61-add_RHEL_08_020221-PR_8173.patch @@ -0,0 +1,19 @@ +commit b7f5c68f8172e88aed6ce22fb70dc48ef3148ffa +Author: Watson Sato +Date: Fri Feb 25 18:23:41 2022 +0100 + + Manual edited patch scap-security-guide-0.1.61-add_RHEL_08_020221-PR_8173.patch. + +diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_password_pam_pwhistory_remember_password_auth/rule.yml b/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_password_pam_pwhistory_remember_password_auth/rule.yml +index 62b6f55..523ab62 100644 +--- a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_password_pam_pwhistory_remember_password_auth/rule.yml ++++ b/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_password_pam_pwhistory_remember_password_auth/rule.yml +@@ -41,7 +41,7 @@ references: + srg: SRG-OS-000077-GPOS-00045 + stigid@ol7: OL07-00-010270 + stigid@rhel7: RHEL-07-010270 +- stigid@rhel8: RHEL-08-020220 ++ stigid@rhel8: RHEL-08-020221 + vmmsrg: SRG-OS-000077-VMM-000440 + + ocil_clause: |- diff --git a/SOURCES/scap-security-guide-0.1.61-add_RHEL_08_040321-PR_8169.patch b/SOURCES/scap-security-guide-0.1.61-add_RHEL_08_040321-PR_8169.patch new file mode 100644 index 0000000..dfa9b8b --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.61-add_RHEL_08_040321-PR_8169.patch @@ -0,0 +1,63 @@ +From f284885e417d86c408c9f94db02b4b7066d316be Mon Sep 17 00:00:00 2001 +From: Watson Sato +Date: Mon, 7 Feb 2022 11:34:16 +0100 +Subject: [PATCH] Add RHEL-08-040321 to RHEL8 STIG profile + +The STIG doesn't recommend the systems to target the graphical +environment by default. +--- + .../disabling_xwindows/xwindows_runlevel_target/rule.yml | 1 + + products/rhel8/profiles/stig.profile | 3 +++ + products/rhel8/profiles/stig_gui.profile | 3 +++ + tests/data/profile_stability/rhel8/stig.profile | 1 + + 4 files changed, 8 insertions(+) + +diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_runlevel_target/rule.yml b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_runlevel_target/rule.yml +index de0e359a44e..df56a30be80 100644 +--- a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_runlevel_target/rule.yml ++++ b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_runlevel_target/rule.yml +@@ -39,6 +39,7 @@ references: + nist: CM-7(a),CM-7(b),CM-6(a) + nist-csf: PR.AC-3,PR.PT-4 + srg: SRG-OS-000480-GPOS-00227 ++ stigid@rhel8: RHEL-08-040321 + + ocil_clause: 'the X windows display server is running and/or has not been disabled' + +diff --git a/products/rhel8/profiles/stig.profile b/products/rhel8/profiles/stig.profile +index 09fa85df181..ffca983d0bd 100644 +--- a/products/rhel8/profiles/stig.profile ++++ b/products/rhel8/profiles/stig.profile +@@ -1169,6 +1169,9 @@ selections: + # RHEL-08-040320 + - xwindows_remove_packages + ++ # RHEL-08-040321 ++ - xwindows_runlevel_target ++ + # RHEL-08-040330 + - network_sniffer_disabled + +diff --git a/products/rhel8/profiles/stig_gui.profile b/products/rhel8/profiles/stig_gui.profile +index d1577215b07..d29ceb9c54e 100644 +--- a/products/rhel8/profiles/stig_gui.profile ++++ b/products/rhel8/profiles/stig_gui.profile +@@ -35,3 +35,6 @@ extends: stig + selections: + # RHEL-08-040320 + - '!xwindows_remove_packages' ++ ++ # RHEL-08-040321 ++ - '!xwindows_runlevel_target' +diff --git a/tests/data/profile_stability/rhel8/stig.profile b/tests/data/profile_stability/rhel8/stig.profile +index 9c05c27117c..e4fee44f9f9 100644 +--- a/tests/data/profile_stability/rhel8/stig.profile ++++ b/tests/data/profile_stability/rhel8/stig.profile +@@ -398,6 +398,7 @@ selections: + - usbguard_generate_policy + - wireless_disable_interfaces + - xwindows_remove_packages ++- xwindows_runlevel_target + - var_rekey_limit_size=1G + - var_rekey_limit_time=1hour + - var_accounts_user_umask=077 diff --git a/SOURCES/scap-security-guide-0.1.61-file_groupowner-PR_7791.patch b/SOURCES/scap-security-guide-0.1.61-file_groupowner-PR_7791.patch new file mode 100644 index 0000000..0e44dc0 --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.61-file_groupowner-PR_7791.patch @@ -0,0 +1,492 @@ +commit 3cd2b8efbf9d91967e3e65bd2029f7ab3d400314 +Author: Gabriel Becker +Date: Thu Feb 24 18:22:28 2022 +0100 + + Manual edited patch scap-security-guide-0.1.61-file_groupowner-PR_7791.patch. + +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/file_groupownership_audit_configuration/rule.yml b/linux_os/guide/system/auditing/auditd_configure_rules/file_groupownership_audit_configuration/rule.yml +new file mode 100644 +index 0000000..de85c89 +--- /dev/null ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/file_groupownership_audit_configuration/rule.yml +@@ -0,0 +1,38 @@ ++documentation_complete: true ++ ++title: 'Audit Configuration Files Must Be Owned By Group root' ++ ++description: |- ++ All audit configuration files must be owned by group root. ++
chown :root /etc/audit/audit*.{rules,conf} /etc/audit/rules.d/*
++ ++rationale: |- ++ Without the capability to restrict which roles and individuals can ++ select which events are audited, unauthorized personnel may be able ++ to prevent the auditing of critical events. ++ Misconfigured audits may degrade the system's performance by ++ overwhelming the audit log. Misconfigured audits may also make it more ++ difficult to establish, correlate, and investigate the events relating ++ to an incident or identify those responsible for one. ++ ++severity: medium ++ ++references: ++ disa: CCI-000171 ++ srg: SRG-OS-000063-GPOS-00032 ++ stigid@ubuntu2004: UBTU-20-010135 ++ ++ocil: |- ++ {{{ describe_file_group_owner(file="/etc/audit/", group="root") }}} ++ {{{ describe_file_group_owner(file="/etc/audit/rules.d/", group="root") }}} ++ ++template: ++ name: file_groupowner ++ vars: ++ filepath: ++ - /etc/audit/ ++ - /etc/audit/rules.d/ ++ file_regex: ++ - ^audit(\.rules|d\.conf)$ ++ - ^.*\.rules$ ++ filegid: '0' +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/file_groupownership_audit_configuration/tests/correct_groupowner.pass.sh b/linux_os/guide/system/auditing/auditd_configure_rules/file_groupownership_audit_configuration/tests/correct_groupowner.pass.sh +new file mode 100644 +index 0000000..5235e0d +--- /dev/null ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/file_groupownership_audit_configuration/tests/correct_groupowner.pass.sh +@@ -0,0 +1,9 @@ ++#!/bin/bash ++ ++export TESTFILE=/etc/audit/rules.d/test_rule.rules ++export AUDITFILE=/etc/audit/auditd.conf ++mkdir -p /etc/audit/rules.d/ ++touch $TESTFILE ++touch $AUDITFILE ++chgrp root $TESTFILE ++chgrp root $AUDITFILE +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/file_groupownership_audit_configuration/tests/incorrect_groupowner.fail.sh b/linux_os/guide/system/auditing/auditd_configure_rules/file_groupownership_audit_configuration/tests/incorrect_groupowner.fail.sh +new file mode 100644 +index 0000000..52378d8 +--- /dev/null ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/file_groupownership_audit_configuration/tests/incorrect_groupowner.fail.sh +@@ -0,0 +1,10 @@ ++#!/bin/bash ++ ++groupadd group_test ++export TESTFILLE=/etc/audit/rules.d/test_rule.rules ++export AUDITFILE=/etc/audit/auditd.conf ++mkdir -p /etc/audit/rules.d/ ++touch $TESTFILLE ++touch $AUDITFILE ++chgrp group_test $TESTFILLE ++chgrp group_test $AUDITFILE +diff --git a/linux_os/guide/system/permissions/files/permissions_var_log_dir/file_groupowner_var_log/rule.yml b/linux_os/guide/system/permissions/files/permissions_var_log_dir/file_groupowner_var_log/rule.yml +index 5ddaf9f..b99705d 100644 +--- a/linux_os/guide/system/permissions/files/permissions_var_log_dir/file_groupowner_var_log/rule.yml ++++ b/linux_os/guide/system/permissions/files/permissions_var_log_dir/file_groupowner_var_log/rule.yml +@@ -1,8 +1,15 @@ ++{{% if 'ubuntu' in product %}} ++{{% set gid = 'syslog' %}} ++{{% else %}} ++{{% set gid = 'root' %}} ++{{% endif %}} ++ ++ + documentation_complete: true + + title: 'Verify Group Who Owns /var/log Directory' + +-description: '{{{ describe_file_group_owner(file="/var/log", group="root") }}}' ++description: '{{{ describe_file_group_owner(file="/var/log", group=gid) }}}' + + rationale: |- + The /var/log directory contains files with logs of error +@@ -21,13 +28,16 @@ references: + stigid@rhel8: RHEL-08-010260 + stigid@ubuntu2004: UBTU-20-010417 + +-ocil_clause: '{{{ ocil_clause_file_group_owner(file="/var/log", group="root") }}}' ++ocil_clause: '{{{ ocil_clause_file_group_owner(file="/var/log", group=gid) }}}' + + ocil: |- +- {{{ ocil_file_group_owner(file="/var/log", group="root") }}} ++ {{{ ocil_file_group_owner(file="/var/log", group=gid) }}} + + template: + name: file_groupowner + vars: + filepath: /var/log/ + filegid: '0' ++ filegid@ubuntu1604: '110' ++ filegid@ubuntu1804: '110' ++ filegid@ubuntu2004: '110' +diff --git a/linux_os/guide/system/permissions/files/permissions_var_log_dir/file_groupowner_var_log_syslog/rule.yml b/linux_os/guide/system/permissions/files/permissions_var_log_dir/file_groupowner_var_log_syslog/rule.yml +new file mode 100644 +index 0000000..f654279 +--- /dev/null ++++ b/linux_os/guide/system/permissions/files/permissions_var_log_dir/file_groupowner_var_log_syslog/rule.yml +@@ -0,0 +1,27 @@ ++documentation_complete: true ++ ++title: 'Verify Group Who Owns /var/log/syslog File' ++ ++description: '{{{ describe_file_group_owner(file="/var/log/syslog", group="adm") }}}' ++ ++rationale: |- ++ The /var/log/syslog file contains logs of error messages in ++ the system and should only be accessed by authorized personnel. ++ ++severity: medium ++ ++references: ++ disa: CCI-001314 ++ srg: SRG-OS-000206-GPOS-00084 ++ stigid@ubuntu2004: UBTU-20-010420 ++ ++ocil_clause: '{{{ ocil_clause_file_group_owner(file="/var/log/syslog", group="adm") }}}' ++ ++ocil: |- ++ {{{ ocil_file_group_owner(file="/var/log/syslog", group="adm") }}} ++ ++template: ++ name: file_groupowner ++ vars: ++ filepath: /var/log/syslog ++ filegid: '4' +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_groupownership_binary_dirs/rule.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_groupownership_binary_dirs/rule.yml +new file mode 100644 +index 0000000..655b2cd +--- /dev/null ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_groupownership_binary_dirs/rule.yml +@@ -0,0 +1,65 @@ ++documentation_complete: true ++ ++prodtype: ubuntu2004 ++ ++title: 'Verify that system commands directories are group owned by root' ++ ++description: |- ++ System commands files are stored in the following directories by default: ++
/bin
++    /sbin
++    /usr/bin
++    /usr/sbin
++    /usr/local/bin
++    /usr/local/sbin
++    
++ All these directories should be owned by the root group. ++ If the directory is found to be owned by a group other than root correct ++ its ownership with the following command: ++
$ sudo chgrp root DIR
++ ++rationale: |- ++ If the operating system allows any user to make changes to software ++ libraries, then those changes might be implemented without undergoing the ++ appropriate testing and approvals that are part of a robust change management ++ process. ++ This requirement applies to operating systems with software libraries ++ that are accessible and configurable, as in the case of interpreted languages. ++ Software libraries also include privileged programs which execute with ++ escalated privileges. Only qualified and authorized individuals must be ++ allowed to obtain access to information system components for purposes ++ of initiating changes, including upgrades and modifications. ++ ++severity: medium ++ ++references: ++ disa: CCI-001495 ++ srg: SRG-OS-000258-GPOS-00099 ++ stigid@ubuntu2004: UBTU-20-010425 ++ ++ocil_clause: 'any of these directories are not owned by root group' ++ ++ocil: |- ++ System commands are stored in the following directories: ++
/bin
++    /sbin
++    /usr/bin
++    /usr/sbin
++    /usr/local/bin
++    /usr/local/sbin
++ For each of these directories, run the following command to find files not ++ owned by root group: ++
$ sudo find -L $DIR ! -group root -type d \;
++ ++template: ++ name: file_groupowner ++ vars: ++ filepath: ++ - /bin/ ++ - /sbin/ ++ - /usr/bin/ ++ - /usr/sbin/ ++ - /usr/local/bin/ ++ - /usr/local/sbin/ ++ recursive: 'true' ++ filegid: '0' +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/ansible/shared.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/ansible/shared.yml +deleted file mode 100644 +index 28df783..0000000 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/ansible/shared.yml ++++ /dev/null +@@ -1,23 +0,0 @@ +-# platform = multi_platform_sle +-# reboot = false +-# strategy = restrict +-# complexity = medium +-# disruption = medium +-- name: "Read list libraries without root ownership" +- find: +- paths: +- - "/usr/lib" +- - "/usr/lib64" +- - "/lib" +- - "/lib64" +- file_type: "directory" +- register: library_dirs_not_owned_by_root +- +-- name: "Set ownership of system library dirs to root" +- file: +- path: "{{ item.path }}" +- owner: "root" +- state: "directory" +- mode: "{{ item.mode }}" +- with_items: "{{ library_dirs_not_owned_by_root.files }}" +- when: library_dirs_not_owned_by_root.matched > 0 +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_audit_binaries/rule.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_audit_binaries/rule.yml +new file mode 100644 +index 0000000..f61a5f9 +--- /dev/null ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_audit_binaries/rule.yml +@@ -0,0 +1,77 @@ ++documentation_complete: true ++ ++prodtype: ubuntu2004 ++ ++title: 'Verify that audit tools are owned by group root' ++ ++description: |- ++ The {{{ full_name }}} operating system audit tools must have the proper ++ ownership configured to protected against unauthorized access. ++ ++ Verify it by running the following command: ++
$ stat -c "%n %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/audispd /sbin/augenrules
++
++    /sbin/auditctl root
++    /sbin/aureport root
++    /sbin/ausearch root
++    /sbin/autrace root
++    /sbin/auditd root
++    /sbin/audispd root
++    /sbin/augenrules root
++    
++ ++ Audit tools needed to successfully view and manipulate audit information ++ system activity and records. Audit tools include custom queries and report ++ generators ++ ++rationale: |- ++ Protecting audit information also includes identifying and protecting the ++ tools used to view and manipulate log data. Therefore, protecting audit ++ tools is necessary to prevent unauthorized operation on audit information. ++ ++ Operating systems providing tools to interface with audit information ++ will leverage user permissions and roles identifying the user accessing the ++ tools and the corresponding rights the user enjoys to make access decisions ++ regarding the access to audit tools. ++ ++severity: medium ++ ++references: ++ disa: CCI-001493,CCI-001494 ++ srg: SRG-OS-000256-GPiOS-00097,SRG-OS-000257-GPOS-00098 ++ stigid@ubuntu2004: UBTU-20-010201 ++ ++ocil: |- ++ Verify it by running the following command: ++
$ stat -c "%n %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/audispd /sbin/augenrules
++
++    /sbin/auditctl root
++    /sbin/aureport root
++    /sbin/ausearch root
++    /sbin/autrace root
++    /sbin/auditd root
++    /sbin/audispd root
++    /sbin/augenrules root
++    
++ ++ If the command does not return all the above lines, the missing ones ++ need to be added. ++ ++ Run the following command to correct the permissions of the missing ++ entries: ++
$ sudo chown :root [audit_tool] 
++ ++ Replace "[audit_tool]" with each audit tool not group-owned by root. ++ ++template: ++ name: file_groupowner ++ vars: ++ filepath: ++ - /sbin/auditctl ++ - /sbin/aureport ++ - /sbin/ausearch ++ - /sbin/autrace ++ - /sbin/auditd ++ - /sbin/audispd ++ - /sbin/augenrules ++ filegid: '0' +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_system_commands_dirs/bash/shared.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_system_commands_dirs/bash/shared.sh +index 5598e47..a9e8c7d 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_system_commands_dirs/bash/shared.sh ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_system_commands_dirs/bash/shared.sh +@@ -1,4 +1,4 @@ +-# platform = multi_platform_sle,Red Hat Enterprise Linux 8,multi_platform_fedora ++# platform = multi_platform_sle,Oracle Linux 8,Red Hat Enterprise Linux 8,multi_platform_fedora,multi_platform_ubuntu + + for SYSCMDFILES in /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin + do +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_system_commands_dirs/tests/incorrect_groupownership.fail.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_system_commands_dirs/tests/incorrect_groupownership.fail.sh +index 7cf507c..33a0c85 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_system_commands_dirs/tests/incorrect_groupownership.fail.sh ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_system_commands_dirs/tests/incorrect_groupownership.fail.sh +@@ -1,10 +1,12 @@ + #!/bin/bash + ++groupadd group_test ++ + for TESTFILE in /bin/test_me /sbin/test_me /usr/bin/test_me /usr/sbin/test_me /usr/local/bin/test_me /usr/local/sbin/test_me + do + if [[ ! -f $TESTFILE ]] + then + touch $TESTFILE + fi +- chown nobody.nobody $TESTFILE ++ chgrp group_test $TESTFILE + done +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/oval/shared.xml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/oval/shared.xml +deleted file mode 100644 +index f5ca938..0000000 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/oval/shared.xml ++++ /dev/null +@@ -1,27 +0,0 @@ +- +- +- {{{ oval_metadata(" +- Checks that system-wide library files in /lib, /lib64, /usr/lib, /usr/lib64 +- are owned by root. +- ") }}} +- +- +- +- +- +- +- +- +- +- +- +- ^\/lib(|64)?$|^\/usr\/lib(|64)?$ +- ^.*$ +- group_permissions_for_system_wide_files_are_not_root +- +- +- +- 0 +- +- +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/rule.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/rule.yml +index 83371b8..3b983de 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/rule.yml ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/rule.yml +@@ -1,6 +1,6 @@ + documentation_complete: true + +-prodtype: sle12,sle15,rhel8,fedora ++prodtype: fedora,ol8,rhel8,rhel9,sle12,sle15,ubuntu2004 + + title: |- + Verify the system-wide library files in directories +@@ -44,6 +44,7 @@ references: + stigid@rhel8: RHEL-08-010350 + stigid@sle12: SLES-12-010875 + stigid@sle15: SLES-15-010355 ++ stigid@ubuntu2004: UBTU-20-01430 + + ocil_clause: 'system wide library files are not group owned by root' + +@@ -57,3 +58,14 @@ ocil: |- + To find if system-wide library files stored in these directories are not group-owned by + root run the following command for each directory DIR: +
$ sudo find -L DIR ! -group root -type f 
++ ++template: ++ name: file_groupowner ++ vars: ++ filepath: ++ - /lib/ ++ - /lib64/ ++ - /usr/lib/ ++ - /usr/lib64/ ++ file_regex: ^.*$ ++ filegid: '0' +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/correct_group.pass.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/correct_group.pass.sh +index a4ae285..0e982c3 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/correct_group.pass.sh ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/correct_group.pass.sh +@@ -1,4 +1,4 @@ +-# platform = multi_platform_sle,Red Hat Enterprise Linux 8,multi_platform_fedora ++# platform = multi_platform_sle,Red Hat Enterprise Linux 8,multi_platform_fedora,multi_platform_ubuntu + + for SYSLIBDIRS in /lib /lib64 /usr/lib /usr/lib64 + do +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/correct_groupowner.pass.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/correct_groupowner.pass.sh +new file mode 100644 +index 0000000..a4ae285 +--- /dev/null ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/correct_groupowner.pass.sh +@@ -0,0 +1,9 @@ ++# platform = multi_platform_sle,Red Hat Enterprise Linux 8,multi_platform_fedora ++ ++for SYSLIBDIRS in /lib /lib64 /usr/lib /usr/lib64 ++do ++ if [[ -d $SYSLIBDIRS ]] ++ then ++ find $SYSLIBDIRS ! -group root -type f -exec chgrp root '{}' \; ++ fi ++done +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/incorrect_group.fail.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/incorrect_group.fail.sh +index c96f65b..23a7703 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/incorrect_group.fail.sh ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/incorrect_group.fail.sh +@@ -1,10 +1,11 @@ +-# platform = multi_platform_sle,Red Hat Enterprise Linux 8,multi_platform_fedora ++# platform = multi_platform_sle,Red Hat Enterprise Linux 8,multi_platform_fedora,multi_platform_ubuntu + ++groupadd group_test + for TESTFILE in /lib/test_me /lib64/test_me /usr/lib/test_me /usr/lib64/test_me + do + if [[ ! -f $TESTFILE ]] + then + touch $TESTFILE + fi +- chown nobody.nobody $TESTFILE ++ chgrp group_test $TESTFILE + done +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/incorrect_groupowner.fail.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/incorrect_groupowner.fail.sh +new file mode 100644 +index 0000000..c96f65b +--- /dev/null ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/incorrect_groupowner.fail.sh +@@ -0,0 +1,10 @@ ++# platform = multi_platform_sle,Red Hat Enterprise Linux 8,multi_platform_fedora ++ ++for TESTFILE in /lib/test_me /lib64/test_me /usr/lib/test_me /usr/lib64/test_me ++do ++ if [[ ! -f $TESTFILE ]] ++ then ++ touch $TESTFILE ++ fi ++ chown nobody.nobody $TESTFILE ++done diff --git a/SOURCES/scap-security-guide-0.1.61-file_owner-PR_7789.patch b/SOURCES/scap-security-guide-0.1.61-file_owner-PR_7789.patch new file mode 100644 index 0000000..3dd4f70 --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.61-file_owner-PR_7789.patch @@ -0,0 +1,278 @@ +commit 74bab352f4bb5b52beaf70c6f23f60d4af4f9518 +Author: Gabriel Becker +Date: Thu Feb 24 18:42:09 2022 +0100 + + Manual edited scap-security-guide-0.1.61-file_owner-PR_7789.patch. + +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/file_ownership_audit_configuration/rule.yml b/linux_os/guide/system/auditing/auditd_configure_rules/file_ownership_audit_configuration/rule.yml +new file mode 100644 +index 0000000..968ef33 +--- /dev/null ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/file_ownership_audit_configuration/rule.yml +@@ -0,0 +1,39 @@ ++documentation_complete: true ++ ++title: 'Audit Configuration Files Must Be Owned By Root' ++ ++description: |- ++ All audit configuration files must be owned by root user. ++ {{{ describe_file_owner(file="/etc/audit/", owner="root") }}} ++ {{{ describe_file_owner(file="/etc/audit/rules.d/", owner="root") }}} ++ ++rationale: |- ++ Without the capability to restrict which roles and individuals can ++ select which events are audited, unauthorized personnel may be able ++ to prevent the auditing of critical events. ++ Misconfigured audits may degrade the system's performance by ++ overwhelming the audit log. Misconfigured audits may also make it more ++ difficult to establish, correlate, and investigate the events relating ++ to an incident or identify those responsible for one. ++ ++severity: medium ++ ++references: ++ disa: CCI-000171 ++ srg: SRG-OS-000063-GPOS-00032 ++ stigid@ubuntu2004: UBTU-20-010134 ++ ++ocil: |- ++ {{{ describe_file_owner(file="/etc/audit/", owner="root") }}} ++ {{{ describe_file_owner(file="/etc/audit/rules.d/", owner="root") }}} ++ ++template: ++ name: file_owner ++ vars: ++ filepath: ++ - /etc/audit/ ++ - /etc/audit/rules.d/ ++ file_regex: ++ - ^audit(\.rules|d\.conf)$ ++ - ^.*\.rules$ ++ fileuid: '0' +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/file_ownership_audit_configuration/tests/correct_owner.pass.sh b/linux_os/guide/system/auditing/auditd_configure_rules/file_ownership_audit_configuration/tests/correct_owner.pass.sh +new file mode 100644 +index 0000000..4d67307 +--- /dev/null ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/file_ownership_audit_configuration/tests/correct_owner.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++# packages = audit ++ ++chown 0 /etc/audit/audit.rules ++chown 0 /etc/audit/auditd.conf ++chown 0 -R /etc/audit/rules.d/ +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/file_ownership_audit_configuration/tests/incorrect_owner.fail.sh b/linux_os/guide/system/auditing/auditd_configure_rules/file_ownership_audit_configuration/tests/incorrect_owner.fail.sh +new file mode 100644 +index 0000000..337074f +--- /dev/null ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/file_ownership_audit_configuration/tests/incorrect_owner.fail.sh +@@ -0,0 +1,7 @@ ++#!/bin/bash ++# packages = audit ++ ++useradd testuser_123 ++chown testuser_123 /etc/audit/audit.rules ++chown testuser_123 /etc/audit/auditd.conf ++chown testuser_123 -R /etc/audit/rules.d/ +diff --git a/linux_os/guide/system/permissions/files/permissions_var_log_dir/file_owner_var_log_syslog/rule.yml b/linux_os/guide/system/permissions/files/permissions_var_log_dir/file_owner_var_log_syslog/rule.yml +new file mode 100644 +index 0000000..f1bf515 +--- /dev/null ++++ b/linux_os/guide/system/permissions/files/permissions_var_log_dir/file_owner_var_log_syslog/rule.yml +@@ -0,0 +1,27 @@ ++documentation_complete: true ++ ++title: 'Verify User Who Owns /var/log/syslog File' ++ ++description: '{{{ describe_file_owner(file="/var/log/syslog", owner="syslog") }}}' ++ ++rationale: |- ++ The /var/log/syslog file contains logs of error messages in ++ the system and should only be accessed by authorized personnel. ++ ++severity: medium ++ ++references: ++ disa: CCI-001314 ++ srg: SRG-OS-000206-GPOS-00084 ++ stigid@ubuntu2004: UBTU-20-010421 ++ ++ocil_clause: '{{{ ocil_clause_file_owner(file="/var/log/syslog", owner="syslog") }}}' ++ ++ocil: |- ++ {{{ ocil_file_owner(file="/var/log/syslog", owner="syslog") }}} ++ ++template: ++ name: file_owner ++ vars: ++ filepath: /var/log/syslog ++ fileuid: '104' +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_binary_dirs/rule.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_binary_dirs/rule.yml +new file mode 100644 +index 0000000..e236238 +--- /dev/null ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_binary_dirs/rule.yml +@@ -0,0 +1,55 @@ ++documentation_complete: true ++ ++title: 'Verify that System Executable Have Root Ownership' ++ ++description: |- ++
/bin
++    /sbin
++    /usr/bin
++    /usr/sbin
++    /usr/local/bin
++    /usr/local/sbin
++ All these directories should be owned by the root user. ++ If any directory DIR in these directories is found ++ to be owned by a user other than root, correct its ownership with the ++ following command: ++
$ sudo chown root DIR
++ ++rationale: |- ++ System binaries are executed by privileged users as well as system services, ++ and restrictive permissions are necessary to ensure that their ++ execution of these programs cannot be co-opted. ++ ++severity: medium ++ ++references: ++ disa: CCI-001495 ++ srg: SRG-OS-000258-GPOS-00099 ++ stigid@ubuntu2004: UBTU-20-010424 ++ ++ocil_clause: 'any system exectables directories are found to not be owned by root' ++ ++ocil: |- ++ System executables are stored in the following directories by default: ++
/bin
++    /sbin
++    /usr/bin
++    /usr/local/bin
++    /usr/local/sbin
++    /usr/sbin
++ For each of these directories, run the following command to find files ++ not owned by root: ++
$ sudo find -L DIR/ ! -user root -type d -exec chown root {} \;
++ ++template: ++ name: file_owner ++ vars: ++ filepath: ++ - /bin/ ++ - /sbin/ ++ - /usr/bin/ ++ - /usr/sbin/ ++ - /usr/local/bin/ ++ - /usr/local/sbin/ ++ recursive: 'true' ++ fileuid: '0' +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_audit_binaries/rule.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_audit_binaries/rule.yml +new file mode 100644 +index 0000000..0c7d9b3 +--- /dev/null ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_audit_binaries/rule.yml +@@ -0,0 +1,77 @@ ++documentation_complete: true ++ ++prodtype: ubuntu2004 ++ ++title: 'Verify that audit tools are owned by root' ++ ++description: |- ++ The {{{ full_name }}} operating system audit tools must have the proper ++ ownership configured to protected against unauthorized access. ++ ++ Verify it by running the following command: ++
$ stat -c "%n %U" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/audispd /sbin/augenrules
++
++    /sbin/auditctl root
++    /sbin/aureport root
++    /sbin/ausearch root
++    /sbin/autrace root
++    /sbin/auditd root
++    /sbin/audispd root
++    /sbin/augenrules root
++    
++ ++ Audit tools needed to successfully view and manipulate audit information ++ system activity and records. Audit tools include custom queries and report ++ generators ++ ++rationale: |- ++ Protecting audit information also includes identifying and protecting the ++ tools used to view and manipulate log data. Therefore, protecting audit ++ tools is necessary to prevent unauthorized operation on audit information. ++ ++ Operating systems providing tools to interface with audit information ++ will leverage user permissions and roles identifying the user accessing the ++ tools and the corresponding rights the user enjoys to make access decisions ++ regarding the access to audit tools. ++ ++severity: medium ++ ++references: ++ disa: CCI-001493,CCI-001494 ++ srg: SRG-OS-000256-GPiOS-00097,SRG-OS-000257-GPOS-00098 ++ stigid@ubuntu2004: UBTU-20-010200 ++ ++ocil: |- ++ Verify it by running the following command: ++
$ stat -c "%n %U" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/audispd /sbin/augenrules
++
++    /sbin/auditctl root
++    /sbin/aureport root
++    /sbin/ausearch root
++    /sbin/autrace root
++    /sbin/auditd root
++    /sbin/audispd root
++    /sbin/augenrules root
++    
++ ++ If the command does not return all the above lines, the missing ones ++ need to be added. ++ ++ Run the following command to correct the permissions of the missing ++ entries: ++
$ sudo chown root [audit_tool] 
++ ++ Replace "[audit_tool]" with each audit tool not owned by root. ++ ++template: ++ name: file_owner ++ vars: ++ filepath: ++ - /sbin/auditctl ++ - /sbin/aureport ++ - /sbin/ausearch ++ - /sbin/autrace ++ - /sbin/auditd ++ - /sbin/audispd ++ - /sbin/augenrules ++ fileuid: '0' +diff --git a/products/ubuntu2004/profiles/stig.profile b/products/ubuntu2004/profiles/stig.profile +index 4c76824..487de82 100644 +--- a/products/ubuntu2004/profiles/stig.profile ++++ b/products/ubuntu2004/profiles/stig.profile +@@ -452,6 +452,7 @@ selections: + # UBTU-20-010423 The Ubuntu operating system must have directories that contain system commands set to a mode of 0755 or less permissive. + + # UBTU-20-010424 The Ubuntu operating system must have directories that contain system commands owned by root. ++ - dir_ownership_binary_dirs + + # UBTU-20-010425 The Ubuntu operating system must have directories that contain system commands group-owned by root. + +diff --git a/shared/templates/file_owner/ansible.template b/shared/templates/file_owner/ansible.template +index 80eaae8..590c9fc 100644 +--- a/shared/templates/file_owner/ansible.template ++++ b/shared/templates/file_owner/ansible.template +@@ -25,7 +25,7 @@ + + - name: Ensure owner on {{{ path }}} recursively + file: +- paths "{{{ path }}}" ++ path: "{{{ path }}}" + state: directory + recurse: yes + owner: "{{{ FILEUID }}}" diff --git a/SOURCES/scap-security-guide-0.1.61-file_permissions-PR_7788.patch b/SOURCES/scap-security-guide-0.1.61-file_permissions-PR_7788.patch new file mode 100644 index 0000000..14d5b86 --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.61-file_permissions-PR_7788.patch @@ -0,0 +1,430 @@ +commit b56ce1b9070236c1f44e936548d9ff44b2ebe8a3 +Author: Gabriel Becker +Date: Thu Feb 24 18:44:02 2022 +0100 + + Manual edited patch scap-security-guide-0.1.61-file_permissions-PR_7788.patch. + +diff --git a/linux_os/guide/system/permissions/files/permissions_local_var_log/bash/ubuntu.sh b/linux_os/guide/system/permissions/files/permissions_local_var_log/bash/ubuntu.sh +new file mode 100644 +index 0000000..93fd73e +--- /dev/null ++++ b/linux_os/guide/system/permissions/files/permissions_local_var_log/bash/ubuntu.sh +@@ -0,0 +1,14 @@ ++# platform = multi_platform_ubuntu ++ ++readarray -t files < <(find /var/log/) ++for file in "${files[@]}"; do ++ if basename $file | grep -qE '^.*$'; then ++ chmod 0640 $file ++ fi ++done ++ ++if grep -qE "^f \/var\/log\/(btmp|wtmp|lastlog)? " /usr/lib/tmpfiles.d/var.conf; then ++ sed -i --follow-symlinks "s/\(^f[[:space:]]\+\/var\/log\/btmp[[:space:]]\+\)\(\([[:digit:]]\+\)[^ $]*\)/\10640/" /usr/lib/tmpfiles.d/var.conf ++ sed -i --follow-symlinks "s/\(^f[[:space:]]\+\/var\/log\/wtmp[[:space:]]\+\)\(\([[:digit:]]\+\)[^ $]*\)/\10640/" /usr/lib/tmpfiles.d/var.conf ++ sed -i --follow-symlinks "s/\(^f[[:space:]]\+\/var\/log\/lastlog[[:space:]]\+\)\(\([[:digit:]]\+\)[^ $]*\)/\10640/" /usr/lib/tmpfiles.d/var.conf ++fi +diff --git a/linux_os/guide/system/permissions/files/permissions_local_var_log/oval/shared.xml b/linux_os/guide/system/permissions/files/permissions_local_var_log/oval/shared.xml +deleted file mode 100644 +index dd95ce0..0000000 +--- a/linux_os/guide/system/permissions/files/permissions_local_var_log/oval/shared.xml ++++ /dev/null +@@ -1,36 +0,0 @@ +- +- +- {{{ oval_metadata(" +- Checks that files in /var/log have permission at least 0640 +- ") }}} +- +- +- +- +- +- +- +- +- +- +- ^\/var\/log\/ +- ^.*$ +- log_files_permission_more_0640 +- var_log_symlinks +- +- +- +- +- true +- true +- true +- true +- true +- true +- +- +- +- symbolic link +- +- +- +diff --git a/linux_os/guide/system/permissions/files/permissions_local_var_log/rule.yml b/linux_os/guide/system/permissions/files/permissions_local_var_log/rule.yml +index 1939531..bd7e984 100644 +--- a/linux_os/guide/system/permissions/files/permissions_local_var_log/rule.yml ++++ b/linux_os/guide/system/permissions/files/permissions_local_var_log/rule.yml +@@ -46,3 +46,10 @@ ocil: |- +
+     sudo find /var/log -perm /137 -type f -exec stat -c "%n %a" {} \;
+     
++ ++template: ++ name: file_permissions ++ vars: ++ filepath: /var/log/ ++ file_regex: '.*' ++ filemode: '0640' +diff --git a/linux_os/guide/system/permissions/files/permissions_local_var_log/tests/var_logfile_correct_mode.pass.sh b/linux_os/guide/system/permissions/files/permissions_local_var_log/tests/var_logfile_correct_mode.pass.sh +index 5317ef2..1793259 100644 +--- a/linux_os/guide/system/permissions/files/permissions_local_var_log/tests/var_logfile_correct_mode.pass.sh ++++ b/linux_os/guide/system/permissions/files/permissions_local_var_log/tests/var_logfile_correct_mode.pass.sh +@@ -1,5 +1,6 @@ + #!/bin/bash + ++chmod -R 640 /var/log + mkdir -p /var/log/testme + touch /var/log/testme/test.log + chmod 640 /var/log/testme/test.log +diff --git a/linux_os/guide/system/permissions/files/permissions_local_var_log/tests/world_writable_dir.pass.sh b/linux_os/guide/system/permissions/files/permissions_local_var_log/tests/world_writable_dir.pass.sh +index 83db1ac..69b0814 100644 +--- a/linux_os/guide/system/permissions/files/permissions_local_var_log/tests/world_writable_dir.pass.sh ++++ b/linux_os/guide/system/permissions/files/permissions_local_var_log/tests/world_writable_dir.pass.sh +@@ -1,4 +1,5 @@ + #!/bin/bash + ++chmod -R 640 /var/log/ + mkdir -p /var/log/testme + chmod 777 /var/log/testme +diff --git a/linux_os/guide/system/permissions/files/permissions_var_log_dir/file_permissions_var_log/bash/ubuntu.sh b/linux_os/guide/system/permissions/files/permissions_var_log_dir/file_permissions_var_log/bash/ubuntu.sh +new file mode 100644 +index 0000000..93962ea +--- /dev/null ++++ b/linux_os/guide/system/permissions/files/permissions_var_log_dir/file_permissions_var_log/bash/ubuntu.sh +@@ -0,0 +1,7 @@ ++# platform = multi_platform_ubuntu ++ ++chmod 0755 /var/log/ ++ ++if grep -q "^z \/var\/log " /usr/lib/tmpfiles.d/00rsyslog.conf; then ++ sed -i --follow-symlinks "s/\(^z[[:space:]]\+\/var\/log[[:space:]]\+\)\(\([[:digit:]]\+\)[^ $]*\)/\10755/" /usr/lib/tmpfiles.d/00rsyslog.conf ++fi +diff --git a/linux_os/guide/system/permissions/files/permissions_var_log_dir/file_permissions_var_log_syslog/rule.yml b/linux_os/guide/system/permissions/files/permissions_var_log_dir/file_permissions_var_log_syslog/rule.yml +new file mode 100644 +index 0000000..73258d4 +--- /dev/null ++++ b/linux_os/guide/system/permissions/files/permissions_var_log_dir/file_permissions_var_log_syslog/rule.yml +@@ -0,0 +1,28 @@ ++documentation_complete: true ++ ++title: 'Verify Permissions on /var/log/syslog File' ++ ++description: |- ++ {{{ describe_file_permissions(file="/var/log/syslog", perms="0640") }}} ++ ++rationale: |- ++ The /var/log/syslog file contains logs of error messages in ++ the system and should only be accessed by authorized personnel. ++ ++severity: medium ++ ++references: ++ disa: CCI-001314 ++ srg: SRG-OS-000206-GPOS-00084 ++ stigid@ubuntu2004: UBTU-20-010422 ++ ++ocil_clause: '{{{ ocil_clause_file_permissions(file="/var/log/syslog", perms="-rw-r-----") }}}' ++ ++ocil: |- ++ {{{ ocil_file_permissions(file="/var/log/syslog", perms="-rw-r-----") }}} ++ ++template: ++ name: file_permissions ++ vars: ++ filepath: /var/log/syslog ++ filemode: '0640' +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_binary_dirs/rule.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_binary_dirs/rule.yml +new file mode 100644 +index 0000000..a666c76 +--- /dev/null ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_binary_dirs/rule.yml +@@ -0,0 +1,57 @@ ++documentation_complete: true ++ ++title: 'Verify that System Executable Directories Have Restrictive Permissions' ++ ++description: |- ++ System executables are stored in the following directories by default: ++
/bin
++    /sbin
++    /usr/bin
++    /usr/sbin
++    /usr/local/bin
++    /usr/local/sbin
++ These directories should not be group-writable or world-writable. ++ If any directory DIR in these directories is found to be ++ group-writable or world-writable, correct its permission with the ++ following command: ++
$ sudo chmod go-w DIR
++ ++rationale: |- ++ System binaries are executed by privileged users, as well as system services, ++ and restrictive permissions are necessary to ensure execution of these programs ++ cannot be co-opted. ++ ++severity: medium ++ ++references: ++ disa: CCI-001495 ++ srg: SRG-OS-000258-GPOS-00099 ++ stigid@ubuntu2004: UBTU-20-010423 ++ ++ocil_clause: 'any of these files are group-writable or world-writable' ++ ++ocil: |- ++ System executables are stored in the following directories by default: ++
/bin
++    /sbin
++    /usr/bin
++    /usr/sbin
++    /usr/local/bin
++    /usr/local/sbin
++ To find system executables directories that are group-writable or ++ world-writable, run the following command for each directory DIR ++ which contains system executables: ++
$ sudo find -L DIR -perm /022 -type d
++ ++template: ++ name: file_permissions ++ vars: ++ filepath: ++ - /bin/ ++ - /sbin/ ++ - /usr/bin/ ++ - /usr/sbin/ ++ - /usr/local/bin/ ++ - /usr/local/sbin/ ++ recursive: 'true' ++ filemode: '0755' +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/all_dirs_ok.pass.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/all_dirs_ok.pass.sh +index 3f7239d..af07846 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/all_dirs_ok.pass.sh ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/all_dirs_ok.pass.sh +@@ -1,4 +1,4 @@ +-# platform = multi_platform_sle ++# platform = multi_platform_sle,multi_platform_ubuntu + DIRS="/lib /lib64 /usr/lib /usr/lib64" + for dirPath in $DIRS; do + find "$dirPath" -perm /022 -type d -exec chmod go-w '{}' \; +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/owner_only_writable_dir.pass.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/owner_only_writable_dir.pass.sh +index 1f68586..d58616b 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/owner_only_writable_dir.pass.sh ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/owner_only_writable_dir.pass.sh +@@ -1,5 +1,6 @@ +-# platform = multi_platform_sle ++# platform = multi_platform_sle,multi_platform_ubuntu + DIRS="/lib /lib64 /usr/lib /usr/lib64" + for dirPath in $DIRS; do ++ chmod -R 755 "$dirPath" + mkdir -p "$dirPath/testme" && chmod 700 "$dirPath/testme" + done +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/world_writable_dir_on_lib.fail.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/world_writable_dir_on_lib.fail.sh +index b60a726..98d18cd 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/world_writable_dir_on_lib.fail.sh ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/world_writable_dir_on_lib.fail.sh +@@ -1,4 +1,4 @@ +-# platform = multi_platform_sle ++# platform = multi_platform_sle,multi_platform_ubuntu + DIRS="/lib /lib64" + for dirPath in $DIRS; do + mkdir -p "$dirPath/testme" && chmod 777 "$dirPath/testme" +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/world_writable_dir_on_usr_lib.fail.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/world_writable_dir_on_usr_lib.fail.sh +index 5438b51..6df6e2f 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/world_writable_dir_on_usr_lib.fail.sh ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/tests/world_writable_dir_on_usr_lib.fail.sh +@@ -1,4 +1,4 @@ +-# platform = multi_platform_sle ++# platform = multi_platform_sle,multi_platform_ubuntu + DIRS="/usr/lib /usr/lib64" + for dirPath in $DIRS; do + mkdir -p "$dirPath/testme" && chmod 777 "$dirPath/testme" +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_audit_binaries/rule.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_audit_binaries/rule.yml +new file mode 100644 +index 0000000..da42e99 +--- /dev/null ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_audit_binaries/rule.yml +@@ -0,0 +1,78 @@ ++documentation_complete: true ++ ++prodtype: ubuntu2004 ++ ++title: 'Verify that audit tools Have Mode 0755 or less' ++ ++description: |- ++ The {{{ full_name }}} operating system audit tools must have the proper ++ permissions configured to protected against unauthorized access. ++ ++ Verify it by running the following command: ++
$ stat -c "%n %a" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/audispd /sbin/augenrules
++
++    /sbin/auditctl 755
++    /sbin/aureport 755
++    /sbin/ausearch 755
++    /sbin/autrace 755
++    /sbin/auditd 755
++    /sbin/audispd 755
++    /sbin/augenrules 755
++    
++ ++ Audit tools needed to successfully view and manipulate audit information ++ system activity and records. Audit tools include custom queries and report ++ generators ++ ++rationale: |- ++ Protecting audit information also includes identifying and protecting the ++ tools used to view and manipulate log data. Therefore, protecting audit ++ tools is necessary to prevent unauthorized operation on audit information. ++ ++ Operating systems providing tools to interface with audit information ++ will leverage user permissions and roles identifying the user accessing the ++ tools and the corresponding rights the user enjoys to make access decisions ++ regarding the access to audit tools. ++ ++severity: medium ++ ++references: ++ disa: CCI-001493,CCI-001494 ++ srg: SRG-OS-000256-GPOS-00097,SRG-OS-000257-GPOS-00098 ++ stigid@ubuntu2004: UBTU-20-010199 ++ ++ocil: |- ++ Verify it by running the following command: ++
$ stat -c "%n %a" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/audispd /sbin/augenrules
++
++    /sbin/auditctl 755
++    /sbin/aureport 755
++    /sbin/ausearch 755
++    /sbin/autrace 755
++    /sbin/auditd 755
++    /sbin/audispd 755
++    /sbin/augenrules 755
++    
++ ++ If the command does not return all the above lines, the missing ones ++ need to be added. ++ ++ Run the following command to correct the permissions of the missing ++ entries: ++
$ sudo chmod 0755 [audit_tool] 
++ ++ Replace "[audit_tool]" with the audit tool that does not have the ++ correct permissions. ++ ++template: ++ name: file_permissions ++ vars: ++ filepath: ++ - /sbin/auditctl ++ - /sbin/aureport ++ - /sbin/ausearch ++ - /sbin/autrace ++ - /sbin/auditd ++ - /sbin/audispd ++ - /sbin/augenrules ++ filemode: '0755' +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_binary_dirs/bash/shared.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_binary_dirs/bash/shared.sh +index 5d95c98..ab89b27 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_binary_dirs/bash/shared.sh ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_binary_dirs/bash/shared.sh +@@ -1,4 +1,4 @@ +-# platform = Red Hat Virtualization 4,multi_platform_rhel,multi_platform_ol ++# platform = Red Hat Virtualization 4,multi_platform_rhel,multi_platform_ol,multi_platform_sle,multi_platform_ubuntu + DIRS="/bin /usr/bin /usr/local/bin /sbin /usr/sbin /usr/local/sbin /usr/libexec" + for dirPath in $DIRS; do + find "$dirPath" -perm /022 -exec chmod go-w '{}' \; +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_binary_dirs/tests/correct_permissions.pass.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_binary_dirs/tests/correct_permissions.pass.sh +new file mode 100644 +index 0000000..59b8838 +--- /dev/null ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_binary_dirs/tests/correct_permissions.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++DIRS="/bin /usr/bin /usr/local/bin /sbin /usr/sbin /usr/local/sbin /usr/libexec" ++for dirPath in $DIRS; do ++ find "$dirPath" -perm /022 -type f -exec chmod 0755 '{}' \; ++done +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_binary_dirs/tests/incorrect_permissions.fail.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_binary_dirs/tests/incorrect_permissions.fail.sh +new file mode 100644 +index 0000000..9d9ce30 +--- /dev/null ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_binary_dirs/tests/incorrect_permissions.fail.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++DIRS="/bin /usr/bin /usr/local/bin /sbin /usr/sbin /usr/local/sbin /usr/libexec" ++for dirPath in $DIRS; do ++ find "$dirPath" -type f -exec chmod 0777 '{}' \; ++done +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/tests/correct_permissions.pass.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/tests/correct_permissions.pass.sh +new file mode 100644 +index 0000000..de388e6 +--- /dev/null ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/tests/correct_permissions.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++ ++DIRS="/lib /lib64 /usr/lib /usr/lib64" ++for dirPath in $DIRS; do ++ chmod -R 755 "$dirPath" ++done +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/tests/incorrect_permissions.fail.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/tests/incorrect_permissions.fail.sh +new file mode 100644 +index 0000000..913e75e +--- /dev/null ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/tests/incorrect_permissions.fail.sh +@@ -0,0 +1,7 @@ ++#!/bin/bash ++ ++DIRS="/lib /lib64 /usr/lib /usr/lib64" ++for dirPath in $DIRS; do ++ find "$dirPath" -type d -exec chmod go-w '{}' \; ++ find "$dirPath" -type f -exec chmod go+w '{}' \; ++done +diff --git a/products/ubuntu2004/profiles/stig.profile b/products/ubuntu2004/profiles/stig.profile +index 487de82..091e472 100644 +--- a/products/ubuntu2004/profiles/stig.profile ++++ b/products/ubuntu2004/profiles/stig.profile +@@ -448,8 +448,10 @@ selections: + # UBTU-20-010421 The Ubuntu operating system must configure /var/log/syslog file to be owned by syslog. + + # UBTU-20-010422 The Ubuntu operating system must configure /var/log/syslog file with mode 0640 or less permissive. ++ - file_permissions_var_log_syslog + + # UBTU-20-010423 The Ubuntu operating system must have directories that contain system commands set to a mode of 0755 or less permissive. ++ - dir_permissions_binary_dirs + + # UBTU-20-010424 The Ubuntu operating system must have directories that contain system commands owned by root. + - dir_ownership_binary_dirs +diff --git a/shared/templates/file_permissions/oval.template b/shared/templates/file_permissions/oval.template +index 89083e8..6b3616a 100644 +--- a/shared/templates/file_permissions/oval.template ++++ b/shared/templates/file_permissions/oval.template +@@ -67,6 +67,11 @@ + #}} + state_file_permissions{{{ FILEID }}}_{{{ loop.index0 }}}_mode_not_{{{ FILEMODE }}} + {{%- endif %}} ++ exclude_symlinks_{{{ FILEID }}} + + {{% endfor %}} ++ ++ ++ symbolic link ++ + diff --git a/SOURCES/scap-security-guide-0.1.61-no_time_servers_chrony-PR_8187.patch b/SOURCES/scap-security-guide-0.1.61-no_time_servers_chrony-PR_8187.patch new file mode 100644 index 0000000..62a127f --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.61-no_time_servers_chrony-PR_8187.patch @@ -0,0 +1,315 @@ +commit ecedabee39e65415001ba59bf3c927329a10720f +Author: Watson Sato +Date: Mon Feb 28 11:40:02 2022 +0100 + + Manual edited patch scap-security-guide-0.1.61-no_time_servers_chrony-PR_8187.patch. + +diff --git a/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/oval/shared.xml b/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/oval/shared.xml +index a7b2a62..25a8589 100644 +--- a/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/oval/shared.xml ++++ b/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/oval/shared.xml +@@ -3,17 +3,25 @@ + {{{ oval_metadata("Configure the maxpoll setting in /etc/ntp.conf or chrony.conf + to continuously poll the time source servers.") }}} + +- +- +- ++ ++ ++ ++ ++ ++ + +- +- +- ++ ++ ++ ++ ++ ++ + + + +@@ -77,4 +85,26 @@ + maxpoll \d+ + + ++ ++ ++ ++ ++ ^/etc/chrony\.(conf|d/.+\.conf)$ ++ ^(?:server|pool).* ++ 1 ++ ++ ++ ++ ++ ++ ++ /etc/ntp.conf ++ ^server.* ++ 1 ++ ++ + +diff --git a/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/rule.yml b/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/rule.yml +index 854e8e8..77af724 100644 +--- a/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/rule.yml ++++ b/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/rule.yml +@@ -11,6 +11,8 @@ description: |- + maxpoll in /etc/ntp.conf or /etc/chrony.conf + add the following: +
maxpoll {{{ xccdf_value("var_time_service_set_maxpoll") }}}
++ If no server or pool directives are configured, the rule evaluates ++ to pass. + {{% if product == "rhcos4" %}} +

+ Note that if the remediation shipping with this content is being used, the +diff --git a/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/tests/chrony_no_pool_nor_servers.pass.sh b/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/tests/chrony_no_pool_nor_servers.pass.sh +new file mode 100644 +index 0000000..bbae20f +--- /dev/null ++++ b/linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/tests/chrony_no_pool_nor_servers.pass.sh +@@ -0,0 +1,12 @@ ++#!/bin/bash ++# packages = chrony ++# ++# profiles = xccdf_org.ssgproject.content_profile_stig ++ ++yum remove -y ntp ++ ++# Remove all pool and server options ++sed -i "/^pool.*/d" /etc/chrony.conf ++sed -i "/^server.*/d" /etc/chrony.conf ++ ++systemctl enable chronyd.service +diff --git a/linux_os/guide/services/ntp/chronyd_server_directive/oval/shared.xml b/linux_os/guide/services/ntp/chronyd_server_directive/oval/shared.xml +new file mode 100644 +index 0000000..2244e60 +--- /dev/null ++++ b/linux_os/guide/services/ntp/chronyd_server_directive/oval/shared.xml +@@ -0,0 +1,33 @@ ++ ++ ++ {{{ oval_metadata("Ensure Chrony has time sources configured with server directive") }}} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ^/etc/chrony\.(conf|d/.+\.conf)$ ++ ^[\s]*server.*$ ++ 1 ++ ++ ++ ++ ++ ++ ++ ^/etc/chrony\.(conf|d/.+\.conf)$ ++ ^[\s]+pool.*$ ++ 1 ++ ++ +diff --git a/linux_os/guide/services/ntp/chronyd_server_directive/rule.yml b/linux_os/guide/services/ntp/chronyd_server_directive/rule.yml +new file mode 100644 +index 0000000..6dc24f1 +--- /dev/null ++++ b/linux_os/guide/services/ntp/chronyd_server_directive/rule.yml +@@ -0,0 +1,32 @@ ++documentation_complete: true ++ ++title: 'Ensure Chrony is only configured with the server directive' ++ ++description: |- ++ Check that Chrony only has time sources configured with the server directive. ++ ++rationale: |- ++ Depending on the infrastruture being used the pool directive may not be supported. ++ ++severity: medium ++ ++platform: chrony ++ ++warnings: ++ - general: This rule doesn't come with a remediation, the time source needs to be added by the adminstrator. ++ ++identifiers: ++ cce@rhel8: CCE-86077-5 ++ cce@rhel9: CCE-87077-4 ++ ++references: ++ disa: CCI-001891 ++ srg: SRG-OS-000355-GPOS-00143,SRG-OS-000356-GPOS-00144,SRG-OS-000359-GPOS-00146 ++ stigid@rhel8: RHEL-08-030740 ++ ++ocil_clause: 'a remote time server is not configured or configured with pool directive' ++ ++ocil: |- ++ Run the following command and verify that time sources are only configure with server directive: ++

# grep -E "^(server|pool)" /etc/chrony.conf
++ A line with the appropriate server should be returned, any line returned starting with pool is a finding. +diff --git a/linux_os/guide/services/ntp/chronyd_server_directive/tests/file_empty.fail.sh b/linux_os/guide/services/ntp/chronyd_server_directive/tests/file_empty.fail.sh +new file mode 100644 +index 0000000..d1ba075 +--- /dev/null ++++ b/linux_os/guide/services/ntp/chronyd_server_directive/tests/file_empty.fail.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++# packages = chrony ++# platform = multi_platform_fedora,multi_platform_rhel ++# remediation = none ++ ++echo "" > /etc/chrony.conf +diff --git a/linux_os/guide/services/ntp/chronyd_server_directive/tests/file_missing.fail.sh b/linux_os/guide/services/ntp/chronyd_server_directive/tests/file_missing.fail.sh +new file mode 100644 +index 0000000..12a50eb +--- /dev/null ++++ b/linux_os/guide/services/ntp/chronyd_server_directive/tests/file_missing.fail.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++# packages = chrony ++# platform = multi_platform_fedora,multi_platform_rhel ++# remediation = none ++ ++rm -f /etc/chrony.conf +diff --git a/linux_os/guide/services/ntp/chronyd_server_directive/tests/line_missing.fail.sh b/linux_os/guide/services/ntp/chronyd_server_directive/tests/line_missing.fail.sh +new file mode 100644 +index 0000000..bffa8b6 +--- /dev/null ++++ b/linux_os/guide/services/ntp/chronyd_server_directive/tests/line_missing.fail.sh +@@ -0,0 +1,7 @@ ++#!/bin/bash ++# packages = chrony ++# platform = multi_platform_fedora,multi_platform_rhel ++# remediation = none ++ ++echo "some line" > /etc/chrony.conf ++echo "another line" >> /etc/chrony.conf +diff --git a/linux_os/guide/services/ntp/chronyd_server_directive/tests/multiple_servers.pass.sh b/linux_os/guide/services/ntp/chronyd_server_directive/tests/multiple_servers.pass.sh +new file mode 100644 +index 0000000..5527f38 +--- /dev/null ++++ b/linux_os/guide/services/ntp/chronyd_server_directive/tests/multiple_servers.pass.sh +@@ -0,0 +1,8 @@ ++#!/bin/bash ++# packages = chrony ++# platform = multi_platform_fedora,multi_platform_rhel ++# remediation = none ++ ++sed -i "^pool.*" /etc/chrony.conf ++echo "server 0.pool.ntp.org" > /etc/chrony.conf ++echo "server 1.pool.ntp.org" >> /etc/chrony.conf +diff --git a/linux_os/guide/services/ntp/chronyd_server_directive/tests/only_pool.fail.sh b/linux_os/guide/services/ntp/chronyd_server_directive/tests/only_pool.fail.sh +new file mode 100644 +index 0000000..616fe88 +--- /dev/null ++++ b/linux_os/guide/services/ntp/chronyd_server_directive/tests/only_pool.fail.sh +@@ -0,0 +1,9 @@ ++#!/bin/bash ++# packages = chrony ++# platform = multi_platform_fedora,multi_platform_rhel ++# remediation = none ++ ++sed -i "^server.*" /etc/chrony.conf ++if ! grep "^pool.*" /etc/chrony.conf; then ++ echo "pool 0.pool.ntp.org" > /etc/chrony.conf ++fi +diff --git a/linux_os/guide/services/ntp/chronyd_server_directive/tests/only_server.pass.sh b/linux_os/guide/services/ntp/chronyd_server_directive/tests/only_server.pass.sh +new file mode 100644 +index 0000000..21a70dc +--- /dev/null ++++ b/linux_os/guide/services/ntp/chronyd_server_directive/tests/only_server.pass.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++# packages = chrony ++# platform = multi_platform_fedora,multi_platform_rhel ++ ++sed -i "^pool.*" /etc/chrony.conf ++echo "server 0.pool.ntp.org" > /etc/chrony.conf +diff --git a/products/rhel8/profiles/stig.profile b/products/rhel8/profiles/stig.profile +index 7e142a9..bfb3753 100644 +--- a/products/rhel8/profiles/stig.profile ++++ b/products/rhel8/profiles/stig.profile +@@ -910,6 +910,7 @@ selections: + # RHEL-08-030740 + # remediation fails because default configuration file contains pool instead of server keyword + - chronyd_or_ntpd_set_maxpoll ++ - chronyd_server_directive + + # RHEL-08-030741 + - chronyd_client_only +diff --git a/shared/references/cce-redhat-avail.txt b/shared/references/cce-redhat-avail.txt +index 0584677..ec92589 100644 +--- a/shared/references/cce-redhat-avail.txt ++++ b/shared/references/cce-redhat-avail.txt +@@ -188,7 +188,6 @@ CCE-86073-4 + CCE-86074-2 + CCE-86075-9 + CCE-86076-7 +-CCE-86077-5 + CCE-86078-3 + CCE-86079-1 + CCE-86080-9 +@@ -1168,7 +1167,6 @@ CCE-87073-3 + CCE-87074-1 + CCE-87075-8 + CCE-87076-6 +-CCE-87077-4 + CCE-87078-2 + CCE-87079-0 + CCE-87080-8 +diff --git a/tests/data/profile_stability/rhel8/stig.profile b/tests/data/profile_stability/rhel8/stig.profile +index 26391b9..2411f02 100644 +--- a/tests/data/profile_stability/rhel8/stig.profile ++++ b/tests/data/profile_stability/rhel8/stig.profile +@@ -154,6 +154,7 @@ selections: + - chronyd_client_only + - chronyd_no_chronyc_network + - chronyd_or_ntpd_set_maxpoll ++- chronyd_server_directive + - clean_components_post_updating + - configure_bashrc_exec_tmux + - configure_bind_crypto_policy +diff --git a/tests/data/profile_stability/rhel8/stig_gui.profile b/tests/data/profile_stability/rhel8/stig_gui.profile +index 31a3264..f0a9601 100644 +--- a/tests/data/profile_stability/rhel8/stig_gui.profile ++++ b/tests/data/profile_stability/rhel8/stig_gui.profile +@@ -165,6 +165,7 @@ selections: + - chronyd_client_only + - chronyd_no_chronyc_network + - chronyd_or_ntpd_set_maxpoll ++- chronyd_server_directive + - clean_components_post_updating + - configure_bashrc_exec_tmux + - configure_bind_crypto_policy diff --git a/SOURCES/scap-security-guide-0.1.61-remove_client_alive_max-PR_8197.patch b/SOURCES/scap-security-guide-0.1.61-remove_client_alive_max-PR_8197.patch new file mode 100644 index 0000000..3efa3b3 --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.61-remove_client_alive_max-PR_8197.patch @@ -0,0 +1,80 @@ +commit 2a3e271027ddfef1b8ebf55f4d02a0c6a8eb445f +Author: Watson Sato +Date: Mon Feb 28 11:12:44 2022 +0100 + + Manual edited patch scap-security-guide-0.1.61-remove_client_alive_max-PR_8197.patch. + +diff --git a/products/rhel8/profiles/stig.profile b/products/rhel8/profiles/stig.profile +index 5829039..eb6cf83 100644 +--- a/products/rhel8/profiles/stig.profile ++++ b/products/rhel8/profiles/stig.profile +@@ -50,7 +50,7 @@ selections: + - var_password_pam_lcredit=1 + - var_password_pam_retry=3 + - var_password_pam_minlen=15 +- - var_sshd_set_keepalive=0 ++ # - var_sshd_set_keepalive=0 + - sshd_approved_macs=stig + - sshd_approved_ciphers=stig + - sshd_idle_timeout_value=10_minutes +@@ -168,11 +168,13 @@ selections: + # RHEL-08-010190 + - dir_perms_world_writable_sticky_bits + +- # RHEL-08-010200 +- - sshd_set_keepalive_0 +- +- # RHEL-08-010201 +- - sshd_set_idle_timeout ++ # These two items don't behave as they used to in RHEL8.6 and RHEL9 ++ # anymore. They will be disabled for now until an alternative ++ # solution is found. ++ # # RHEL-08-010200 ++ # - sshd_set_keepalive_0 ++ # # RHEL-08-010201 ++ # - sshd_set_idle_timeout + + # RHEL-08-010210 + - file_permissions_var_log_messages +diff --git a/tests/data/profile_stability/rhel8/stig.profile b/tests/data/profile_stability/rhel8/stig.profile +index b9eeff5..f181bd9 100644 +--- a/tests/data/profile_stability/rhel8/stig.profile ++++ b/tests/data/profile_stability/rhel8/stig.profile +@@ -347,8 +347,6 @@ selections: + - sshd_enable_warning_banner + - sshd_print_last_log + - sshd_rekey_limit +-- sshd_set_idle_timeout +-- sshd_set_keepalive_0 + - sshd_use_strong_rng + - sshd_x11_use_localhost + - sssd_certificate_verification +@@ -416,7 +414,6 @@ selections: + - var_password_pam_ucredit=1 + - var_password_pam_lcredit=1 + - var_password_pam_retry=3 +-- var_sshd_set_keepalive=0 + - sshd_approved_macs=stig + - sshd_approved_ciphers=stig + - sshd_idle_timeout_value=10_minutes +diff --git a/tests/data/profile_stability/rhel8/stig_gui.profile b/tests/data/profile_stability/rhel8/stig_gui.profile +index 54bf46d..48e7d03 100644 +--- a/tests/data/profile_stability/rhel8/stig_gui.profile ++++ b/tests/data/profile_stability/rhel8/stig_gui.profile +@@ -358,8 +358,6 @@ selections: + - sshd_enable_warning_banner + - sshd_print_last_log + - sshd_rekey_limit +-- sshd_set_idle_timeout +-- sshd_set_keepalive_0 + - sshd_use_strong_rng + - sshd_x11_use_localhost + - sssd_certificate_verification +@@ -426,7 +424,6 @@ selections: + - var_password_pam_ucredit=1 + - var_password_pam_lcredit=1 + - var_password_pam_retry=3 +-- var_sshd_set_keepalive=0 + - sshd_approved_macs=stig + - sshd_approved_ciphers=stig + - sshd_idle_timeout_value=10_minutes diff --git a/SOURCES/scap-security-guide-0.1.61-remove_tmux_process_running_check-PR_8246.patch b/SOURCES/scap-security-guide-0.1.61-remove_tmux_process_running_check-PR_8246.patch new file mode 100644 index 0000000..485235f --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.61-remove_tmux_process_running_check-PR_8246.patch @@ -0,0 +1,122 @@ +commit e5b8b968d882aa8fa1795dcabf185781f59b5671 +Author: Watson Sato +Date: Mon Feb 28 12:01:18 2022 +0100 + + Manual edited patch scap-security-guide-0.1.61-remove_tmux_process_running_check-PR_8246.patch. + +diff --git a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/oval/shared.xml b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/oval/shared.xml +index 4cb2f9e..58f91ea 100644 +--- a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/oval/shared.xml ++++ b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/oval/shared.xml +@@ -4,7 +4,6 @@ + + +- + + + if \[ "\$PS1" \]; then\n\s+parent=\$\(ps -o ppid= -p \$\$\)\n\s+name=\$\(ps -o comm= -p \$parent\)\n\s+case "\$name" in sshd\|login\) exec tmux ;; esac\nfi + 1 + +- +- +- +- +- +- +- ^tmux(?:|[\s]+.*)$ +- 0 +- + +diff --git a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/rule.yml b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/rule.yml +index 6be090b..0e4db6d 100644 +--- a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/rule.yml ++++ b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/rule.yml +@@ -8,19 +8,11 @@ description: |- + The tmux terminal multiplexer is used to implement + automatic session locking. It should be started from + /etc/bashrc or drop-in files within /etc/profile.d/. +- Additionally it must be ensured that the tmux process is running +- and it can be verified with the following command: +-
ps all | grep tmux | grep -v grep
+ + rationale: |- + Unlike bash itself, the tmux terminal multiplexer + provides a mechanism to lock sessions after period of inactivity. + +-warnings: +- - general: |- +- The remediation does not start the tmux process, so it must be +- manually started or have the system rebooted after applying the fix. +- + severity: medium + + identifiers: +@@ -33,7 +25,7 @@ references: + srg: SRG-OS-000031-GPOS-00012,SRG-OS-000028-GPOS-00009 + stigid@rhel8: RHEL-08-020041 + +-ocil_clause: 'exec tmux is not present at the end of bashrc or tmux process is not running' ++ocil_clause: 'exec tmux is not present at the end of bashrc' + + ocil: |- + To verify that tmux is configured to execute, +@@ -45,9 +37,5 @@ ocil: |- + name=$(ps -o comm= -p $parent) + case "$name" in sshd|login) exec tmux ;; esac + fi +- To verify that the tmux process is running, +- run the following command: +-
ps all | grep tmux | grep -v grep
+- If the command does not produce output, this is a finding. + + platform: machine +diff --git a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/correct_value.pass.sh b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/correct_value.pass.sh +index 221c186..fbc7590 100644 +--- a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/correct_value.pass.sh ++++ b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/correct_value.pass.sh +@@ -9,4 +9,3 @@ if [ "$PS1" ]; then + fi + EOF + +-tmux new-session -s root -d +diff --git a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/correct_value_d_directory.pass.sh b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/correct_value_d_directory.pass.sh +index 1702bb1..6107f86 100644 +--- a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/correct_value_d_directory.pass.sh ++++ b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/correct_value_d_directory.pass.sh +@@ -10,4 +10,3 @@ if [ "$PS1" ]; then + fi + EOF + +-tmux new-session -s root -d +diff --git a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/tmux_not_running.fail.sh b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/tmux_not_running.fail.sh +deleted file mode 100644 +index 6cb9d83..0000000 +--- a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/tmux_not_running.fail.sh ++++ /dev/null +@@ -1,13 +0,0 @@ +-#!/bin/bash +-# packages = tmux +-# remediation = none +- +-cat >> /etc/bashrc <<'EOF' +-if [ "$PS1" ]; then +- parent=$(ps -o ppid= -p $$) +- name=$(ps -o comm= -p $parent) +- case "$name" in sshd|login) exec tmux ;; esac +-fi +-EOF +- +-killall tmux || true +diff --git a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/wrong_value.fail.sh b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/wrong_value.fail.sh +index f13a8b0..9b46165 100644 +--- a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/wrong_value.fail.sh ++++ b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/wrong_value.fail.sh +@@ -101,5 +101,3 @@ if [ -z "$BASHRCSOURCED" ]; then + fi + # vim:ts=4:sw=4 + EOF +- +-tmux new-session -s root -d diff --git a/SOURCES/scap-security-guide-0.1.61-rhel8_stig_audit_rules-PR_8174.patch b/SOURCES/scap-security-guide-0.1.61-rhel8_stig_audit_rules-PR_8174.patch new file mode 100644 index 0000000..5b1c8e0 --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.61-rhel8_stig_audit_rules-PR_8174.patch @@ -0,0 +1,382 @@ +commit 3064c4bc94047b1ca4c91db6008ded0694121563 +Author: Watson Sato +Date: Mon Feb 28 10:57:59 2022 +0100 + + Manual edited patch scap-security-guide-0.1.61-rhel8_stig_audit_rules-PR_8174.patch. + +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_fchmod/rule.yml b/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_fchmod/rule.yml +index 6c3cc55..9208a17 100644 +--- a/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_fchmod/rule.yml ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_fchmod/rule.yml +@@ -55,7 +55,7 @@ references: + srg: SRG-OS-000037-GPOS-00015,SRG-OS-000042-GPOS-00020,SRG-OS-000062-GPOS-00031,SRG-OS-000392-GPOS-00172,SRG-OS-000462-GPOS-00206,SRG-OS-000471-GPOS-00215,SRG-OS-000064-GPOS-00033,SRG-OS-000466-GPOS-00210,SRG-OS-000458-GPOS-00203 + stigid@ol7: OL07-00-030420 + stigid@rhel7: RHEL-07-030420 +- stigid@rhel8: RHEL-08-030540 ++ stigid@rhel8: RHEL-08-030490 + stigid@sle12: SLES-12-020470 + stigid@sle15: SLES-15-030300 + stigid@ubuntu2004: UBTU-20-010153 +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_fchmodat/rule.yml b/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_fchmodat/rule.yml +index 3e51d48..595824c 100644 +--- a/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_fchmodat/rule.yml ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_fchmodat/rule.yml +@@ -55,7 +55,7 @@ references: + srg: SRG-OS-000037-GPOS-00015,SRG-OS-000042-GPOS-00020,SRG-OS-000062-GPOS-00031,SRG-OS-000392-GPOS-00172,SRG-OS-000462-GPOS-00206,SRG-OS-000471-GPOS-00215,SRG-OS-000064-GPOS-00033,SRG-OS-000466-GPOS-00210,SRG-OS-000458-GPOS-00203 + stigid@ol7: OL07-00-030430 + stigid@rhel7: RHEL-07-030430 +- stigid@rhel8: RHEL-08-030530 ++ stigid@rhel8: RHEL-08-030490 + stigid@sle12: SLES-12-020480 + stigid@sle15: SLES-12-030310 + stigid@ubuntu2004: UBTU-20-010154 +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_fchown/rule.yml b/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_fchown/rule.yml +index d89875f..470a995 100644 +--- a/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_fchown/rule.yml ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_fchown/rule.yml +@@ -58,7 +58,7 @@ references: + srg: SRG-OS-000037-GPOS-00015,SRG-OS-000042-GPOS-00020,SRG-OS-000062-GPOS-00031,SRG-OS-000392-GPOS-00172,SRG-OS-000462-GPOS-00206,SRG-OS-000471-GPOS-00215,SRG-OS-000064-GPOS-00033,SRG-OS-000466-GPOS-00210,SRG-OS-000458-GPOS-00203,SRG-OS-000474-GPOS-00219 + stigid@ol7: OL07-00-030380 + stigid@rhel7: RHEL-07-030380 +- stigid@rhel8: RHEL-08-030520 ++ stigid@rhel8: RHEL-08-030480 + stigid@sle12: SLES-12-020430 + stigid@sle15: SLES-15-030260 + stigid@ubuntu2004: UBTU-20-010149 +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_fchownat/rule.yml b/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_fchownat/rule.yml +index e6caaeb..4db008f 100644 +--- a/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_fchownat/rule.yml ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_fchownat/rule.yml +@@ -55,7 +55,7 @@ references: + srg: SRG-OS-000037-GPOS-00015,SRG-OS-000042-GPOS-00020,SRG-OS-000062-GPOS-00031,SRG-OS-000392-GPOS-00172,SRG-OS-000462-GPOS-00206,SRG-OS-000471-GPOS-00215,SRG-OS-000064-GPOS-00033,SRG-OS-000466-GPOS-00210,SRG-OS-000458-GPOS-00203,SRG-OS-000474-GPOS-00219 + stigid@ol7: OL07-00-030400 + stigid@rhel7: RHEL-07-030400 +- stigid@rhel8: RHEL-08-030510 ++ stigid@rhel8: RHEL-08-030480 + stigid@sle12: SLES-12-020450 + stigid@sle15: SLES-15-030280 + stigid@ubuntu2004: UBTU-20-010150 +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_fremovexattr/rule.yml b/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_fremovexattr/rule.yml +index b9ad3c7..cd4b200 100644 +--- a/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_fremovexattr/rule.yml ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_fremovexattr/rule.yml +@@ -72,7 +72,7 @@ references: + srg: SRG-OS-000037-GPOS-00015,SRG-OS-000042-GPOS-00020,SRG-OS-000062-GPOS-00031,SRG-OS-000392-GPOS-00172,SRG-OS-000458-GPOS-00203,SRG-OS-000462-GPOS-00206,SRG-OS-000463-GPOS-00207,SRG-OS-000471-GPOS-00215,SRG-OS-000474-GPOS-00219,SRG-OS-000466-GPOS-00210,SRG-OS-000064-GPOS-00033 + stigid@ol7: OL07-00-030480 + stigid@rhel7: RHEL-07-030480 +- stigid@rhel8: RHEL-08-030240 ++ stigid@rhel8: RHEL-08-030200 + stigid@sle12: SLES-12-020410 + stigid@sle15: SLES-15-030210 + stigid@ubuntu2004: UBTU-20-010147 +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_fsetxattr/rule.yml b/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_fsetxattr/rule.yml +index cedf05f..dc6ef7f 100644 +--- a/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_fsetxattr/rule.yml ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_fsetxattr/rule.yml +@@ -67,7 +67,7 @@ references: + srg: SRG-OS-000037-GPOS-00015,SRG-OS-000042-GPOS-00020,SRG-OS-000062-GPOS-00031,SRG-OS-000392-GPOS-00172,SRG-OS-000458-GPOS-00203,SRG-OS-000462-GPOS-00206,SRG-OS-000463-GPOS-00207,SRG-OS-000468-GPOS-00212,SRG-OS-000471-GPOS-00215,SRG-OS-000474-GPOS-00219,SRG-OS-000064-GPOS-00033 + stigid@ol7: OL07-00-030450 + stigid@rhel7: RHEL-07-030450 +- stigid@rhel8: RHEL-08-030230 ++ stigid@rhel8: RHEL-08-030200 + stigid@sle12: SLES-12-020380 + stigid@sle15: SLES-15-030230 + stigid@ubuntu2004: UBTU-20-010144 +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_lchown/rule.yml b/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_lchown/rule.yml +index 190509c..e57e177 100644 +--- a/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_lchown/rule.yml ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_lchown/rule.yml +@@ -55,7 +55,7 @@ references: + srg: SRG-OS-000037-GPOS-00015,SRG-OS-000042-GPOS-00020,SRG-OS-000062-GPOS-00031,SRG-OS-000392-GPOS-00172,SRG-OS-000462-GPOS-00206,SRG-OS-000471-GPOS-00215,SRG-OS-000064-GPOS-00033,SRG-OS-000466-GPOS-00210,SRG-OS-000458-GPOS-00203,SRG-OS-000474-GPOS-00219 + stigid@ol7: OL07-00-030390 + stigid@rhel7: RHEL-07-030390 +- stigid@rhel8: RHEL-08-030500 ++ stigid@rhel8: RHEL-08-030480 + stigid@sle12: SLES-12-020440 + stigid@sle15: SLES-15-030270 + stigid@ubuntu2004: UBTU-20-010151 +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_lsetxattr/rule.yml b/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_lsetxattr/rule.yml +index 3662262..52ee93a 100644 +--- a/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_lsetxattr/rule.yml ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_lsetxattr/rule.yml +@@ -66,7 +66,7 @@ references: + srg: SRG-OS-000037-GPOS-00015,SRG-OS-000042-GPOS-00020,SRG-OS-000062-GPOS-00031,SRG-OS-000392-GPOS-00172,SRG-OS-000458-GPOS-00203,SRG-OS-000462-GPOS-00206,SRG-OS-000463-GPOS-00207,SRG-OS-000468-GPOS-00212,SRG-OS-000471-GPOS-00215,SRG-OS-000474-GPOS-00219,SRG-OS-000064-GPOS-00033 + stigid@ol7: OL07-00-030460 + stigid@rhel7: RHEL-07-030460 +- stigid@rhel8: RHEL-08-030220 ++ stigid@rhel8: RHEL-08-030200 + stigid@sle15: SLES-15-030240 + stigid@ubuntu2004: UBTU-20-010143 + vmmsrg: SRG-OS-000458-VMM-001810,SRG-OS-000474-VMM-001940 +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_removexattr/rule.yml b/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_removexattr/rule.yml +index ac9d349..c462eb7 100644 +--- a/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_removexattr/rule.yml ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_removexattr/rule.yml +@@ -71,7 +71,7 @@ references: + srg: SRG-OS-000037-GPOS-00015,SRG-OS-000042-GPOS-00020,SRG-OS-000062-GPOS-00031,SRG-OS-000392-GPOS-00172,SRG-OS-000458-GPOS-00203,SRG-OS-000462-GPOS-00206,SRG-OS-000463-GPOS-00207,SRG-OS-000468-GPOS-00212,SRG-OS-000471-GPOS-00215,SRG-OS-000474-GPOS-00219,SRG-OS-000466-GPOS-00210,SRG-OS-000064-GPOS-00033 + stigid@ol7: OL07-00-030470 + stigid@rhel7: RHEL-07-030470 +- stigid@rhel8: RHEL-08-030210 ++ stigid@rhel8: RHEL-08-030200 + stigid@sle12: SLES-12-020390 + stigid@sle15: SLES-15-030190 + stigid@ubuntu2004: UBTU-20-010145 +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_setxattr/rule.yml b/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_setxattr/rule.yml +index b661a1f..23630ec 100644 +--- a/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_setxattr/rule.yml ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/audit_dac_actions/audit_rules_dac_modification_setxattr/rule.yml +@@ -67,7 +67,7 @@ references: + srg: SRG-OS-000037-GPOS-00015,SRG-OS-000042-GPOS-00020,SRG-OS-000062-GPOS-00031,SRG-OS-000392-GPOS-00172,SRG-OS-000462-GPOS-00206,SRG-OS-000471-GPOS-00215,SRG-OS-000064-GPOS-00033,SRG-OS-000458-GPOS-00203 + stigid@ol7: OL07-00-030440 + stigid@rhel7: RHEL-07-030440 +- stigid@rhel8: RHEL-08-030270 ++ stigid@rhel8: RHEL-08-030200 + stigid@sle12: SLES-12-020370 + stigid@sle15: SLES-15-030220 + stigid@ubuntu2004: UBTU-20-010142 +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_deletion_events/audit_rules_file_deletion_events_renameat/rule.yml b/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_deletion_events/audit_rules_file_deletion_events_renameat/rule.yml +index 37620a3..0f25e93 100644 +--- a/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_deletion_events/audit_rules_file_deletion_events_renameat/rule.yml ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_deletion_events/audit_rules_file_deletion_events_renameat/rule.yml +@@ -48,7 +48,7 @@ references: + srg: SRG-OS-000037-GPOS-00015,SRG-OS-000042-GPOS-00020,SRG-OS-000062-GPOS-00031,SRG-OS-000392-GPOS-00172,SRG-OS-000462-GPOS-00206,SRG-OS-000471-GPOS-00215,SRG-OS-000466-GPOS-00210,SRG-OS-000467-GPOS-00211,SRG-OS-000468-GPOS-00212 + stigid@ol7: OL07-00-030890 + stigid@rhel7: RHEL-07-030890 +- stigid@rhel8: RHEL-08-030362 ++ stigid@rhel8: RHEL-08-030361 + stigid@ubuntu2004: UBTU-20-010270 + vmmsrg: SRG-OS-000466-VMM-001870,SRG-OS-000468-VMM-001890 + +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_deletion_events/audit_rules_file_deletion_events_rmdir/rule.yml b/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_deletion_events/audit_rules_file_deletion_events_rmdir/rule.yml +index e6b4004..7c5b3b0 100644 +--- a/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_deletion_events/audit_rules_file_deletion_events_rmdir/rule.yml ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_deletion_events/audit_rules_file_deletion_events_rmdir/rule.yml +@@ -47,7 +47,7 @@ references: + srg: SRG-OS-000037-GPOS-00015,SRG-OS-000042-GPOS-00020,SRG-OS-000062-GPOS-00031,SRG-OS-000392-GPOS-00172,SRG-OS-000462-GPOS-00206,SRG-OS-000471-GPOS-00215,SRG-OS-000466-GPOS-00210,SRG-OS-000467-GPOS-00211,SRG-OS-000468-GPOS-00212 + stigid@ol7: OL07-00-030900 + stigid@rhel7: RHEL-07-030900 +- stigid@rhel8: RHEL-08-030363 ++ stigid@rhel8: RHEL-08-030361 + vmmsrg: SRG-OS-000466-VMM-001870,SRG-OS-000468-VMM-001890 + + {{{ complete_ocil_entry_audit_syscall(syscall="rmdir") }}} +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_deletion_events/audit_rules_file_deletion_events_unlink/rule.yml b/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_deletion_events/audit_rules_file_deletion_events_unlink/rule.yml +index bfe53b7..209c622 100644 +--- a/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_deletion_events/audit_rules_file_deletion_events_unlink/rule.yml ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_deletion_events/audit_rules_file_deletion_events_unlink/rule.yml +@@ -48,7 +48,7 @@ references: + srg: SRG-OS-000037-GPOS-00015,SRG-OS-000042-GPOS-00020,SRG-OS-000062-GPOS-00031,SRG-OS-000392-GPOS-00172,SRG-OS-000462-GPOS-00206,SRG-OS-000471-GPOS-00215,SRG-OS-000466-GPOS-00210,SRG-OS-000467-GPOS-00211,SRG-OS-000468-GPOS-00212 + stigid@ol7: OL07-00-030910 + stigid@rhel7: RHEL-07-030910 +- stigid@rhel8: RHEL-08-030364 ++ stigid@rhel8: RHEL-08-030361 + stigid@ubuntu2004: UBTU-20-010267 + vmmsrg: SRG-OS-000466-VMM-001870,SRG-OS-000468-VMM-001890 + +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_deletion_events/audit_rules_file_deletion_events_unlinkat/rule.yml b/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_deletion_events/audit_rules_file_deletion_events_unlinkat/rule.yml +index bd246f1..56c644e 100644 +--- a/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_deletion_events/audit_rules_file_deletion_events_unlinkat/rule.yml ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_deletion_events/audit_rules_file_deletion_events_unlinkat/rule.yml +@@ -48,7 +48,7 @@ references: + srg: SRG-OS-000037-GPOS-00015,SRG-OS-000042-GPOS-00020,SRG-OS-000062-GPOS-00031,SRG-OS-000392-GPOS-00172,SRG-OS-000462-GPOS-00206,SRG-OS-000471-GPOS-00215,SRG-OS-000466-GPOS-00210,SRG-OS-000467-GPOS-00211,SRG-OS-000468-GPOS-00212 + stigid@ol7: OL07-00-030920 + stigid@rhel7: RHEL-07-030920 +- stigid@rhel8: RHEL-08-030365 ++ stigid@rhel8: RHEL-08-030361 + stigid@ubuntu2004: UBTU-20-010268 + vmmsrg: SRG-OS-000466-VMM-001870,SRG-OS-000468-VMM-001890 + +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_modification/audit_rules_unsuccessful_file_modification_creat/rule.yml b/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_modification/audit_rules_unsuccessful_file_modification_creat/rule.yml +index 5c751cb..4516c7c 100644 +--- a/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_modification/audit_rules_unsuccessful_file_modification_creat/rule.yml ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_modification/audit_rules_unsuccessful_file_modification_creat/rule.yml +@@ -60,7 +60,7 @@ references: + srg: SRG-OS-000037-GPOS-00015,SRG-OS-000042-GPOS-00020,SRG-OS-000062-GPOS-00031,SRG-OS-000392-GPOS-00172,SRG-OS-000462-GPOS-00206,SRG-OS-000471-GPOS-00215,SRG-OS-000064-GPOS-00033,SRG-OS-000458-GPOS-00203,SRG-OS-000461-GPOS-00205 + stigid@ol7: OL07-00-030500 + stigid@rhel7: RHEL-07-030500 +- stigid@rhel8: RHEL-08-030470 ++ stigid@rhel8: RHEL-08-030420 + stigid@sle12: SLES-12-020520 + stigid@sle15: SLES-15-030160 + stigid@ubuntu2004: UBTU-20-010158 +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_modification/audit_rules_unsuccessful_file_modification_ftruncate/rule.yml b/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_modification/audit_rules_unsuccessful_file_modification_ftruncate/rule.yml +index 76bcea1..4a845c3 100644 +--- a/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_modification/audit_rules_unsuccessful_file_modification_ftruncate/rule.yml ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_modification/audit_rules_unsuccessful_file_modification_ftruncate/rule.yml +@@ -63,7 +63,7 @@ references: + srg: SRG-OS-000037-GPOS-00015,SRG-OS-000042-GPOS-00020,SRG-OS-000062-GPOS-00031,SRG-OS-000392-GPOS-00172,SRG-OS-000462-GPOS-00206,SRG-OS-000471-GPOS-00215,SRG-OS-000064-GPOS-00033,SRG-OS-000458-GPOS-00203,SRG-OS-000461-GPOS-00205 + stigid@ol7: OL07-00-030550 + stigid@rhel7: RHEL-07-030550 +- stigid@rhel8: RHEL-08-030460 ++ stigid@rhel8: RHEL-08-030420 + stigid@sle12: SLES-12-020510 + stigid@sle15: SLES-15-030320 + stigid@ubuntu2004: UBTU-20-010157 +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_modification/audit_rules_unsuccessful_file_modification_open/rule.yml b/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_modification/audit_rules_unsuccessful_file_modification_open/rule.yml +index 7c6764d..fc6cf35 100644 +--- a/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_modification/audit_rules_unsuccessful_file_modification_open/rule.yml ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_modification/audit_rules_unsuccessful_file_modification_open/rule.yml +@@ -63,7 +63,7 @@ references: + srg: SRG-OS-000037-GPOS-00015,SRG-OS-000042-GPOS-00020,SRG-OS-000062-GPOS-00031,SRG-OS-000392-GPOS-00172,SRG-OS-000462-GPOS-00206,SRG-OS-000471-GPOS-00215,SRG-OS-000064-GPOS-00033,SRG-OS-000458-GPOS-00203,SRG-OS-000461-GPOS-00205 + stigid@ol7: OL07-00-030510 + stigid@rhel7: RHEL-07-030510 +- stigid@rhel8: RHEL-08-030440 ++ stigid@rhel8: RHEL-08-030420 + stigid@sle12: SLES-12-020490 + stigid@sle15: SLES-15-030150 + stigid@ubuntu2004: UBTU-20-010155 +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_modification/audit_rules_unsuccessful_file_modification_open_by_handle_at/rule.yml b/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_modification/audit_rules_unsuccessful_file_modification_open_by_handle_at/rule.yml +index 9bb5ffe..be08972 100644 +--- a/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_modification/audit_rules_unsuccessful_file_modification_open_by_handle_at/rule.yml ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_modification/audit_rules_unsuccessful_file_modification_open_by_handle_at/rule.yml +@@ -59,7 +59,7 @@ references: + srg: SRG-OS-000037-GPOS-00015,SRG-OS-000042-GPOS-00020,SRG-OS-000062-GPOS-00031,SRG-OS-000392-GPOS-00172,SRG-OS-000462-GPOS-00206,SRG-OS-000471-GPOS-00215,SRG-OS-000064-GPOS-00033,SRG-OS-000458-GPOS-00203,SRG-OS-000461-GPOS-00205 + stigid@ol7: OL07-00-030530 + stigid@rhel7: RHEL-07-030530 +- stigid@rhel8: RHEL-08-030450 ++ stigid@rhel8: RHEL-08-030420 + stigid@sle12: SLES-12-020540 + stigid@sle15: SLES-15-030180 + stigid@ubuntu2004: UBTU-20-010160 +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_modification/audit_rules_unsuccessful_file_modification_openat/rule.yml b/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_modification/audit_rules_unsuccessful_file_modification_openat/rule.yml +index c99656c..63aa3f3 100644 +--- a/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_modification/audit_rules_unsuccessful_file_modification_openat/rule.yml ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/audit_file_modification/audit_rules_unsuccessful_file_modification_openat/rule.yml +@@ -63,7 +63,7 @@ references: + srg: SRG-OS-000037-GPOS-00015,SRG-OS-000042-GPOS-00020,SRG-OS-000062-GPOS-00031,SRG-OS-000392-GPOS-00172,SRG-OS-000462-GPOS-00206,SRG-OS-000471-GPOS-00215,SRG-OS-000064-GPOS-00033,SRG-OS-000458-GPOS-00203,SRG-OS-000461-GPOS-00205 + stigid@ol7: OL07-00-030520 + stigid@rhel7: RHEL-07-030520 +- stigid@rhel8: RHEL-08-030430 ++ stigid@rhel8: RHEL-08-030420 + stigid@sle12: SLES-12-020530 + stigid@sle15: SLES-15-030170 + stigid@ubuntu2004: UBTU-20-010159 +diff --git a/linux_os/guide/system/auditing/auditd_configure_rules/audit_kernel_module_loading/audit_rules_kernel_module_loading_finit/rule.yml b/linux_os/guide/system/auditing/auditd_configure_rules/audit_kernel_module_loading/audit_rules_kernel_module_loading_finit/rule.yml +index aa17002..62cc33d 100644 +--- a/linux_os/guide/system/auditing/auditd_configure_rules/audit_kernel_module_loading/audit_rules_kernel_module_loading_finit/rule.yml ++++ b/linux_os/guide/system/auditing/auditd_configure_rules/audit_kernel_module_loading/audit_rules_kernel_module_loading_finit/rule.yml +@@ -50,7 +50,7 @@ references: + srg: SRG-OS-000037-GPOS-00015,SRG-OS-000042-GPOS-00020,SRG-OS-000062-GPOS-00031,SRG-OS-000392-GPOS-00172,SRG-OS-000462-GPOS-00206,SRG-OS-000471-GPOS-00215,SRG-OS-000471-GPOS-00216,SRG-OS-000477-GPOS-00222 + stigid@ol7: OL07-00-030821 + stigid@rhel7: RHEL-07-030821 +- stigid@rhel8: RHEL-08-030380 ++ stigid@rhel8: RHEL-08-030360 + stigid@sle12: SLES-12-020740 + stigid@sle15: SLES-15-030530 + stigid@ubuntu2004: UBTU-20-010180 +diff --git a/products/rhel8/profiles/stig.profile b/products/rhel8/profiles/stig.profile +index a641eee..5829039 100644 +--- a/products/rhel8/profiles/stig.profile ++++ b/products/rhel8/profiles/stig.profile +@@ -561,6 +561,8 @@ selections: + + # RHEL-08-020220 + - accounts_password_pam_pwhistory_remember_system_auth ++ ++ # RHEL-08-020221 + - accounts_password_pam_pwhistory_remember_password_auth + + # RHEL-08-020230 +@@ -713,18 +715,11 @@ selections: + + # RHEL-08-030200 + - audit_rules_dac_modification_lremovexattr +- +- # RHEL-08-030210 + - audit_rules_dac_modification_removexattr +- +- # RHEL-08-030220 + - audit_rules_dac_modification_lsetxattr +- +- # RHEL-08-030230 + - audit_rules_dac_modification_fsetxattr +- +- # RHEL-08-030240 + - audit_rules_dac_modification_fremovexattr ++ - audit_rules_dac_modification_setxattr + + # RHEL-08-030250 + - audit_rules_privileged_commands_chage +@@ -732,8 +727,6 @@ selections: + # RHEL-08-030260 + - audit_rules_execution_chcon + +- # RHEL-08-030270 +- - audit_rules_dac_modification_setxattr + + # RHEL-08-030280 + - audit_rules_privileged_commands_ssh_agent +@@ -788,28 +781,18 @@ selections: + + # RHEL-08-030360 + - audit_rules_kernel_module_loading_init ++ - audit_rules_kernel_module_loading_finit + + # RHEL-08-030361 + - audit_rules_file_deletion_events_rename +- +- # RHEL-08-030362 + - audit_rules_file_deletion_events_renameat +- +- # RHEL-08-030363 + - audit_rules_file_deletion_events_rmdir +- +- # RHEL-08-030364 + - audit_rules_file_deletion_events_unlink +- +- # RHEL-08-030365 + - audit_rules_file_deletion_events_unlinkat + + # RHEL-08-030370 + - audit_rules_privileged_commands_gpasswd + +- # RHEL-08-030380 +- - audit_rules_kernel_module_loading_finit +- + # RHEL-08-030390 + - audit_rules_kernel_module_loading_delete + +@@ -821,41 +804,21 @@ selections: + + # RHEL-08-030420 + - audit_rules_unsuccessful_file_modification_truncate +- +- # RHEL-08-030430 + - audit_rules_unsuccessful_file_modification_openat +- +- # RHEL-08-030440 + - audit_rules_unsuccessful_file_modification_open +- +- # RHEL-08-030450 + - audit_rules_unsuccessful_file_modification_open_by_handle_at +- +- # RHEL-08-030460 + - audit_rules_unsuccessful_file_modification_ftruncate +- +- # RHEL-08-030470 + - audit_rules_unsuccessful_file_modification_creat + + # RHEL-08-030480 + - audit_rules_dac_modification_chown +- +- # RHEL-08-030490 +- - audit_rules_dac_modification_chmod +- +- # RHEL-08-030500 + - audit_rules_dac_modification_lchown +- +- # RHEL-08-030510 + - audit_rules_dac_modification_fchownat +- +- # RHEL-08-030520 + - audit_rules_dac_modification_fchown + +- # RHEL-08-030530 ++ # RHEL-08-030490 ++ - audit_rules_dac_modification_chmod + - audit_rules_dac_modification_fchmodat +- +- # RHEL-08-030540 + - audit_rules_dac_modification_fchmod + + # RHEL-08-030550 diff --git a/SOURCES/scap-security-guide-0.1.61-rhel8_stig_v1r5-PR_8050.patch b/SOURCES/scap-security-guide-0.1.61-rhel8_stig_v1r5-PR_8050.patch new file mode 100644 index 0000000..c03a033 --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.61-rhel8_stig_v1r5-PR_8050.patch @@ -0,0 +1,334 @@ +commit b2b8afa337bce598b9b56a243e7ad0be7ee9194e +Author: Gabriel Becker +Date: Fri Feb 25 14:18:51 2022 +0100 + + Manual edited patch scap-security-guide-0.1.61-rhel8_stig_v1r5-PR_8050.patch. + +diff --git a/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_passwordauth/bash/shared.sh b/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_passwordauth/bash/shared.sh +new file mode 100644 +index 0000000..1c151a1 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_passwordauth/bash/shared.sh +@@ -0,0 +1,5 @@ ++# platform = multi_platform_rhel,multi_platform_fedora,multi_platform_rhv ++ ++if ! grep -q "^password.*sufficient.*pam_unix.so.*sha512" "/etc/pam.d/password-auth"; then ++ sed -i --follow-symlinks "/^password.*sufficient.*pam_unix.so/ s/$/ sha512/" "/etc/pam.d/password-auth" ++fi +diff --git a/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_passwordauth/oval/shared.xml b/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_passwordauth/oval/shared.xml +new file mode 100644 +index 0000000..24fdbe4 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_passwordauth/oval/shared.xml +@@ -0,0 +1,19 @@ ++ ++ ++ {{{ oval_metadata("The password hashing algorithm should be set correctly in /etc/pam.d/password-auth.") }}} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ /etc/pam.d/password-auth ++ ^[\s]*password[\s]+(?:(?:required)|(?:sufficient))[\s]+pam_unix\.so[\s]+.*sha512.*$ ++ 1 ++ ++ ++ +diff --git a/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_passwordauth/rule.yml b/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_passwordauth/rule.yml +new file mode 100644 +index 0000000..9375269 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_passwordauth/rule.yml +@@ -0,0 +1,72 @@ ++documentation_complete: true ++ ++prodtype: fedora,rhel7,rhel8,rhel9,rhv4 ++ ++title: "Set PAM's Password Hashing Algorithm - password-auth" ++ ++description: |- ++ The PAM system service can be configured to only store encrypted ++ representations of passwords. In ++ /etc/pam.d/password-auth, ++ the ++ password section of the file controls which PAM modules execute ++ during a password change. Set the pam_unix.so module in the ++ password section to include the argument sha512, as shown ++ below: ++
++
password    sufficient    pam_unix.so sha512 other arguments...
++
++ This will help ensure when local users change their passwords, hashes for ++ the new passwords will be generated using the SHA-512 algorithm. This is ++ the default. ++ ++rationale: |- ++ Passwords need to be protected at all times, and encryption is the standard ++ method for protecting passwords. If passwords are not encrypted, they can ++ be plainly read (i.e., clear text) and easily compromised. Passwords that ++ are encrypted with a weak algorithm are no more protected than if they are ++ kepy in plain text. ++

++ This setting ensures user and group account administration utilities are ++ configured to store only encrypted representations of passwords. ++ Additionally, the crypt_style configuration option ensures the use ++ of a strong hashing algorithm that makes password cracking attacks more ++ difficult. ++ ++severity: medium ++ ++identifiers: ++ cce@rhel7: CCE-85943-9 ++ cce@rhel8: CCE-85945-4 ++ cce@rhel9: CCE-85946-2 ++ ++references: ++ anssi: BP28(R32) ++ cis-csc: 1,12,15,16,5 ++ cis@rhel7: 5.4.3 ++ cis@rhel8: 5.4.4 ++ cjis: 5.6.2.2 ++ cobit5: DSS05.04,DSS05.05,DSS05.07,DSS05.10,DSS06.03,DSS06.10 ++ cui: 3.13.11 ++ disa: CCI-000196 ++ isa-62443-2009: 4.3.3.2.2,4.3.3.5.1,4.3.3.5.2,4.3.3.6.1,4.3.3.6.2,4.3.3.6.3,4.3.3.6.4,4.3.3.6.5,4.3.3.6.6,4.3.3.6.7,4.3.3.6.8,4.3.3.6.9,4.3.3.7.2,4.3.3.7.4 ++ isa-62443-2013: 'SR 1.1,SR 1.10,SR 1.2,SR 1.3,SR 1.4,SR 1.5,SR 1.7,SR 1.8,SR 1.9,SR 2.1' ++ ism: 0418,1055,1402 ++ iso27001-2013: A.18.1.4,A.7.1.1,A.9.2.1,A.9.2.2,A.9.2.3,A.9.2.4,A.9.2.6,A.9.3.1,A.9.4.2,A.9.4.3 ++ nist: IA-5(c),IA-5(1)(c),CM-6(a) ++ nist-csf: PR.AC-1,PR.AC-6,PR.AC-7 ++ pcidss: Req-8.2.1 ++ srg: SRG-OS-000073-GPOS-00041 ++ stigid@rhel7: RHEL-07-010200 ++ stigid@rhel8: RHEL-08-010160 ++ vmmsrg: SRG-OS-000480-VMM-002000 ++ ++ocil_clause: 'it does not' ++ ++ocil: |- ++ Inspect the password section of /etc/pam.d/password-auth ++ and ensure that the pam_unix.so module includes the argument ++ sha512: ++
$ grep sha512 /etc/pam.d/password-auth
++ ++platform: pam +diff --git a/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_passwordauth/tests/correct.pass.sh b/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_passwordauth/tests/correct.pass.sh +new file mode 100644 +index 0000000..a924fe5 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_passwordauth/tests/correct.pass.sh +@@ -0,0 +1,5 @@ ++#!/bin/bash ++ ++if ! grep -q "^password.*sufficient.*pam_unix.so.*sha512" "/etc/pam.d/password-auth"; then ++ sed -i --follow-symlinks "/^password.*sufficient.*pam_unix.so/ s/$/ sha512/" "/etc/pam.d/password-auth" ++fi +diff --git a/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_passwordauth/tests/missing.fail.sh b/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_passwordauth/tests/missing.fail.sh +new file mode 100644 +index 0000000..68e925a +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_passwordauth/tests/missing.fail.sh +@@ -0,0 +1,3 @@ ++#!/bin/bash ++ ++sed -i --follow-symlinks "/^password.*sufficient.*pam_unix.so/ s/sha512//g" "/etc/pam.d/password-auth" +diff --git a/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_systemauth/bash/shared.sh b/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_systemauth/bash/shared.sh +index 02af406..e7503fe 100644 +--- a/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_systemauth/bash/shared.sh ++++ b/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_systemauth/bash/shared.sh +@@ -1,7 +1,9 @@ + # platform = multi_platform_wrlinux,multi_platform_rhel,multi_platform_fedora,multi_platform_ol,multi_platform_rhv + + AUTH_FILES[0]="/etc/pam.d/system-auth" ++{{%- if product == "rhel7" %}} + AUTH_FILES[1]="/etc/pam.d/password-auth" ++{{%- endif %}} + + for pamFile in "${AUTH_FILES[@]}" + do +diff --git a/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_systemauth/oval/shared.xml b/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_systemauth/oval/shared.xml +index d76b6f8..a754a84 100644 +--- a/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_systemauth/oval/shared.xml ++++ b/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_systemauth/oval/shared.xml +@@ -3,6 +3,9 @@ + {{{ oval_metadata("The password hashing algorithm should be set correctly in /etc/pam.d/system-auth.") }}} + + ++ {{%- if product == "rhel7" %}} ++ ++ {{%- endif %}} + + + +diff --git a/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_systemauth/rule.yml b/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_systemauth/rule.yml +index 24ab30d..58fcea9 100644 +--- a/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_systemauth/rule.yml ++++ b/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_systemauth/rule.yml +@@ -69,7 +69,7 @@ references: + srg: SRG-OS-000073-GPOS-00041 + stigid@ol7: OL07-00-010200 + stigid@rhel7: RHEL-07-010200 +- stigid@rhel8: RHEL-08-010160 ++ stigid@rhel8: RHEL-08-010159 + stigid@sle12: SLES-12-010230 + stigid@sle15: SLES-15-020170 + vmmsrg: SRG-OS-000480-VMM-002000 +diff --git a/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_systemauth/tests/correct.pass.sh b/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_systemauth/tests/correct.pass.sh +index 7e48176..fb9feec 100644 +--- a/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_systemauth/tests/correct.pass.sh ++++ b/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_systemauth/tests/correct.pass.sh +@@ -1,7 +1,9 @@ + #!/bin/bash + + AUTH_FILES[0]="/etc/pam.d/system-auth" ++{{%- if product == "rhel7" %}} + AUTH_FILES[1]="/etc/pam.d/password-auth" ++{{%- endif %}} + + for pamFile in "${AUTH_FILES[@]}" + do +diff --git a/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_systemauth/tests/missing.fail.sh b/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_systemauth/tests/missing.fail.sh +index 09bb82d..2f35381 100644 +--- a/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_systemauth/tests/missing.fail.sh ++++ b/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_systemauth/tests/missing.fail.sh +@@ -1,7 +1,9 @@ + #!/bin/bash + + AUTH_FILES[0]="/etc/pam.d/system-auth" ++{{%- if product == "rhel7" %}} + AUTH_FILES[1]="/etc/pam.d/password-auth" ++{{%- endif %}} + + for pamFile in "${AUTH_FILES[@]}" + do +diff --git a/products/rhel8/profiles/rht-ccp.profile b/products/rhel8/profiles/rht-ccp.profile +index d76bb38..1045be3 100644 +--- a/products/rhel8/profiles/rht-ccp.profile ++++ b/products/rhel8/profiles/rht-ccp.profile +@@ -54,6 +54,7 @@ selections: + - accounts_password_pam_difok + - accounts_passwords_pam_faillock_deny + - set_password_hashing_algorithm_systemauth ++ - set_password_hashing_algorithm_passwordauth + - set_password_hashing_algorithm_logindefs + - set_password_hashing_algorithm_libuserconf + - require_singleuser_auth +diff --git a/products/rhel8/profiles/stig.profile b/products/rhel8/profiles/stig.profile +index d51e53a..705caa8 100644 +--- a/products/rhel8/profiles/stig.profile ++++ b/products/rhel8/profiles/stig.profile +@@ -147,6 +147,9 @@ selections: + # RHEL-08-010152 + - require_emergency_target_auth + ++ # RHEL-08-010159 ++ - set_password_hashing_algorithm_passwordauth ++ + # RHEL-08-010160 + - set_password_hashing_algorithm_systemauth + +diff --git a/products/rhv4/profiles/pci-dss.profile b/products/rhv4/profiles/pci-dss.profile +index 90e196e..f1fb1f8 100644 +--- a/products/rhv4/profiles/pci-dss.profile ++++ b/products/rhv4/profiles/pci-dss.profile +@@ -115,6 +115,7 @@ selections: + - service_pcscd_enabled + - sssd_enable_smartcards + - set_password_hashing_algorithm_systemauth ++ - set_password_hashing_algorithm_passwordauth + - set_password_hashing_algorithm_logindefs + - set_password_hashing_algorithm_libuserconf + - file_owner_etc_shadow +diff --git a/products/rhv4/profiles/rhvh-stig.profile b/products/rhv4/profiles/rhvh-stig.profile +index ef28fa1..d17833b 100644 +--- a/products/rhv4/profiles/rhvh-stig.profile ++++ b/products/rhv4/profiles/rhvh-stig.profile +@@ -355,6 +355,7 @@ selections: + - set_password_hashing_algorithm_libuserconf + - set_password_hashing_algorithm_logindefs + - set_password_hashing_algorithm_systemauth ++ - set_password_hashing_algorithm_passwordauth + - package_opensc_installed + - var_smartcard_drivers=cac + - configure_opensc_card_drivers +diff --git a/products/rhv4/profiles/rhvh-vpp.profile b/products/rhv4/profiles/rhvh-vpp.profile +index 9be3e34..3b5802d 100644 +--- a/products/rhv4/profiles/rhvh-vpp.profile ++++ b/products/rhv4/profiles/rhvh-vpp.profile +@@ -200,6 +200,7 @@ selections: + - accounts_password_pam_unix_remember + - set_password_hashing_algorithm_logindefs + - set_password_hashing_algorithm_systemauth ++ - set_password_hashing_algorithm_passwordauth + - set_password_hashing_algorithm_libuserconf + - no_empty_passwords + +diff --git a/shared/references/cce-redhat-avail.txt b/shared/references/cce-redhat-avail.txt +index fef5fd8..d8daeb3 100644 +--- a/shared/references/cce-redhat-avail.txt ++++ b/shared/references/cce-redhat-avail.txt +@@ -69,9 +69,6 @@ CCE-85939-7 + CCE-85940-5 + CCE-85941-3 + CCE-85942-1 +-CCE-85943-9 +-CCE-85945-4 +-CCE-85946-2 + CCE-85947-0 + CCE-85948-8 + CCE-85949-6 +diff --git a/tests/data/profile_stability/rhel8/pci-dss.profile b/tests/data/profile_stability/rhel8/pci-dss.profile +index f58bcf9..e235d49 100644 +--- a/tests/data/profile_stability/rhel8/pci-dss.profile ++++ b/tests/data/profile_stability/rhel8/pci-dss.profile +@@ -1,5 +1,9 @@ ++title: PCI-DSS v3.2.1 Control Baseline for Red Hat Enterprise Linux 8 + description: Ensures PCI-DSS v3.2.1 security configuration settings are applied. +-documentation_complete: true ++extends: null ++metadata: ++ SMEs: ++ - yuumasato + reference: https://www.pcisecuritystandards.org/documents/PCI_DSS_v3-2-1.pdf + selections: + - account_disable_post_pw_expiration +@@ -136,4 +141,8 @@ selections: + - var_multiple_time_servers=rhel + - var_sshd_set_keepalive=0 + - var_smartcard_drivers=cac +-title: PCI-DSS v3.2.1 Control Baseline for Red Hat Enterprise Linux 8 ++platforms: !!set {} ++cpe_names: !!set {} ++platform: null ++filter_rules: '' ++documentation_complete: true +diff --git a/tests/data/profile_stability/rhel8/stig.profile b/tests/data/profile_stability/rhel8/stig.profile +index 3b4b43a..1b4b955 100644 +--- a/tests/data/profile_stability/rhel8/stig.profile ++++ b/tests/data/profile_stability/rhel8/stig.profile +@@ -332,6 +332,7 @@ selections: + - service_systemd-coredump_disabled + - service_usbguard_enabled + - set_password_hashing_algorithm_logindefs ++- set_password_hashing_algorithm_passwordauth + - set_password_hashing_algorithm_systemauth + - sshd_disable_compression + - sshd_disable_empty_passwords +diff --git a/tests/data/profile_stability/rhel8/stig_gui.profile b/tests/data/profile_stability/rhel8/stig_gui.profile +index 2e0e161..3568e07 100644 +--- a/tests/data/profile_stability/rhel8/stig_gui.profile ++++ b/tests/data/profile_stability/rhel8/stig_gui.profile +@@ -343,6 +343,7 @@ selections: + - service_systemd-coredump_disabled + - service_usbguard_enabled + - set_password_hashing_algorithm_logindefs ++- set_password_hashing_algorithm_passwordauth + - set_password_hashing_algorithm_systemauth + - sshd_disable_compression + - sshd_disable_empty_passwords diff --git a/SOURCES/scap-security-guide-0.1.61-update_RHEL_08_010030-PR_8183.patch b/SOURCES/scap-security-guide-0.1.61-update_RHEL_08_010030-PR_8183.patch new file mode 100644 index 0000000..862bb8d --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.61-update_RHEL_08_010030-PR_8183.patch @@ -0,0 +1,24 @@ +From 92b0f4069bced7d9e1e459db0799d7d2fb9faa59 Mon Sep 17 00:00:00 2001 +From: Gabriel Becker +Date: Wed, 9 Feb 2022 14:47:52 +0100 +Subject: [PATCH] Update ocil_clause of encrypt_partitions to exclude boot + partition. + +Boot partitions are not part of required partitions to be encrypted. +--- + .../software/disk_partitioning/encrypt_partitions/rule.yml | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/linux_os/guide/system/software/disk_partitioning/encrypt_partitions/rule.yml b/linux_os/guide/system/software/disk_partitioning/encrypt_partitions/rule.yml +index e9d25a34fbd..13231dc2cc9 100644 +--- a/linux_os/guide/system/software/disk_partitioning/encrypt_partitions/rule.yml ++++ b/linux_os/guide/system/software/disk_partitioning/encrypt_partitions/rule.yml +@@ -90,6 +90,7 @@ ocil: |- + /dev/sda2: UUID=" bc98d7ef-6g54-321h-1d24-9870de2ge1a2 + " TYPE="crypto_LUKS" +

+- Pseudo-file systems, such as /proc, /sys, and tmpfs, are not required to use disk encryption and are not a finding. ++ The boot partition and pseudo-file systems, such as /proc, /sys, and tmpfs, ++ are not required to use disk encryption and are not a finding. + + platform: machine diff --git a/SOURCES/scap-security-guide-0.1.61-update_RHEL_08_010287-PR_8051.patch b/SOURCES/scap-security-guide-0.1.61-update_RHEL_08_010287-PR_8051.patch new file mode 100644 index 0000000..c380505 --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.61-update_RHEL_08_010287-PR_8051.patch @@ -0,0 +1,34 @@ +commit 35b2bc766287571aa1e826344730a41ae790c379 +Author: Gabriel Becker +Date: Fri Feb 25 13:29:19 2022 +0100 + + Manual edited patch scap-security-guide-0.1.61-update_RHEL_08_010287-PR_8051.patch. + +diff --git a/linux_os/guide/system/software/integrity/crypto/configure_ssh_crypto_policy/rule.yml b/linux_os/guide/system/software/integrity/crypto/configure_ssh_crypto_policy/rule.yml +index 729e478..caccb6c 100644 +--- a/linux_os/guide/system/software/integrity/crypto/configure_ssh_crypto_policy/rule.yml ++++ b/linux_os/guide/system/software/integrity/crypto/configure_ssh_crypto_policy/rule.yml +@@ -28,7 +28,7 @@ references: + nerc-cip: CIP-003-3 R4.2,CIP-007-3 R5.1,CIP-007-3 R7.1 + nist: AC-17(a),AC-17(2),CM-6(a),MA-4(6),SC-13 + srg: SRG-OS-000250-GPOS-00093 +- stigid@rhel8: RHEL-08-010020 ++ stigid@rhel8: RHEL-08-010287 + + ocil_clause: 'the CRYPTO_POLICY variable is not set or is commented in the /etc/sysconfig/sshd' + +diff --git a/products/rhel8/profiles/stig.profile b/products/rhel8/profiles/stig.profile +index 6b9d799..5d03125 100644 +--- a/products/rhel8/profiles/stig.profile ++++ b/products/rhel8/profiles/stig.profile +@@ -189,9 +189,7 @@ selections: + # RHEL-08-010260 + - file_groupowner_var_log + +- # *** SHARED *** # +- # RHEL-08-010290 && RHEL-08-010291 +- # *** SHARED *** # ++ # RHEL-08-010287 + - configure_ssh_crypto_policy + + # RHEL-08-010290 diff --git a/SOURCES/scap-security-guide-0.1.61-update_RHEL_08_010383-PR_8138.patch b/SOURCES/scap-security-guide-0.1.61-update_RHEL_08_010383-PR_8138.patch new file mode 100644 index 0000000..90fd05e --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.61-update_RHEL_08_010383-PR_8138.patch @@ -0,0 +1,189 @@ +From 133d331a04e1ba27324291006c65c2bfa467e49d Mon Sep 17 00:00:00 2001 +From: Gabriel Becker +Date: Tue, 1 Feb 2022 16:54:16 +0100 +Subject: [PATCH 1/2] Update RHEL-08-010383 to require only one occurrence of a + config. + +The V1R5 release of RHEL8 STIG requires that the configuration should be +present only in one configuration file to prevent any ordering problem +when the modules loads the configuration using drop-in files that use +the lexicographically order of file names. +--- + .../sudo/sudoers_validate_passwd/ansible/shared.yml | 6 +++--- + .../sudo/sudoers_validate_passwd/oval/shared.xml | 12 ++++++------ + .../software/sudo/sudoers_validate_passwd/rule.yml | 3 ++- + .../tests/sudoers_validate_passwd_duplicates.fail.sh | 7 +++++++ + 4 files changed, 18 insertions(+), 10 deletions(-) + create mode 100644 linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_passwd_duplicates.fail.sh + +diff --git a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/ansible/shared.yml b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/ansible/shared.yml +index 08ffd76aed6..19673634fb3 100644 +--- a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/ansible/shared.yml ++++ b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/ansible/shared.yml +@@ -4,6 +4,6 @@ + # complexity = low + # disruption = low + +-{{{ ansible_lineinfile(msg='Ensure that Defaults !targetpw is defined in sudoers', path='/etc/sudoers', new_line='Defaults !targetpw', create='yes', state='present') }}} +-{{{ ansible_lineinfile(msg='Ensure that Defaults !rootpw is defined in sudoers', path='/etc/sudoers', new_line='Defaults !rootpw', create='yes', state='present') }}} +-{{{ ansible_lineinfile(msg='Ensure that Defaults !runaspw is defined in sudoers', path='/etc/sudoers', new_line='Defaults !runaspw', create='yes', state='present') }}} ++{{{ ansible_only_lineinfile(msg='Ensure that Defaults !targetpw is defined in sudoers', line_regex='^Defaults !targetpw$', path='/etc/sudoers', new_line='Defaults !targetpw') }}} ++{{{ ansible_only_lineinfile(msg='Ensure that Defaults !rootpw is defined in sudoers', line_regex='^Defaults !rootpw$', path='/etc/sudoers', new_line='Defaults !rootpw') }}} ++{{{ ansible_only_lineinfile(msg='Ensure that Defaults !runaspw is defined in sudoers', line_regex='^Defaults !runaspw$', path='/etc/sudoers', new_line='Defaults !runaspw') }}} +diff --git a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/oval/shared.xml b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/oval/shared.xml +index 646e6bfb7c0..b3fadd53bee 100644 +--- a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/oval/shared.xml ++++ b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/oval/shared.xml +@@ -8,17 +8,17 @@ +
+ + +- + + + +- + + + +- + + +@@ -26,19 +26,19 @@ + + ^/etc/sudoers(\.d/.*)?$ + ^Defaults !targetpw$\r?\n +- 1 ++ 1 + + + + ^/etc/sudoers(\.d/.*)?$ + ^Defaults !rootpw$\r?\n +- 1 ++ 1 + + + + ^/etc/sudoers(\.d/.*)?$ + ^Defaults !runaspw$\r?\n +- 1 ++ 1 + + + +diff --git a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/rule.yml b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/rule.yml +index ccc29b77d15..698021d8fd0 100644 +--- a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/rule.yml ++++ b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/rule.yml +@@ -42,7 +42,8 @@ ocil_clause: 'invoke user passwd when using sudo' + ocil: |- + Run the following command to Verify that the sudoers security policy is configured to use the invoking user's password for privilege escalation: +
 sudo egrep -i '(!rootpw|!targetpw|!runaspw)' /etc/sudoers /etc/sudoers.d/* | grep -v '#'
+- If no results are returned, this is a finding ++ If no results are returned, this is a finding. ++ If results are returned from more than one file location, this is a finding. + If "Defaults !targetpw" is not defined, this is a finding. + If "Defaults !rootpw" is not defined, this is a finding. + If "Defaults !runaspw" is not defined, this is a finding. +diff --git a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_passwd_duplicates.fail.sh b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_passwd_duplicates.fail.sh +new file mode 100644 +index 00000000000..6247b5230e4 +--- /dev/null ++++ b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_passwd_duplicates.fail.sh +@@ -0,0 +1,7 @@ ++# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,SUSE Linux Enterprise 15 ++# packages = sudo ++ ++echo 'Defaults !targetpw' >> /etc/sudoers ++echo 'Defaults !rootpw' >> /etc/sudoers ++echo 'Defaults !runaspw' >> /etc/sudoers ++echo 'Defaults !runaspw' >> /etc/sudoers + +From 315b248c77252fc3145cdf34fede98b1a32a7c04 Mon Sep 17 00:00:00 2001 +From: Gabriel Becker +Date: Wed, 9 Feb 2022 15:24:23 +0100 +Subject: [PATCH 2/2] Update remediations of sudoers_validate_passwd to remove + duplicates. + +--- + .../ansible/shared.yml | 20 +++++++++++++++++++ + .../sudoers_validate_passwd/bash/shared.sh | 12 +++++++++++ + .../tests/sudoers_d_duplicate.fail.sh | 9 +++++++++ + 3 files changed, 41 insertions(+) + create mode 100644 linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_d_duplicate.fail.sh + +diff --git a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/ansible/shared.yml b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/ansible/shared.yml +index 19673634fb3..399ca1ea3ce 100644 +--- a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/ansible/shared.yml ++++ b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/ansible/shared.yml +@@ -4,6 +4,26 @@ + # complexity = low + # disruption = low + ++{{%- macro delete_line_in_sudoers_d(line) %}} ++- name: "Find out if /etc/sudoers.d/* files contain {{{ line }}} to be deduplicated" ++ find: ++ path: "/etc/sudoers.d" ++ patterns: "*" ++ contains: '^{{{ line }}}$' ++ register: sudoers_d_defaults ++ ++- name: "Remove found occurrences of {{{ line }}} from /etc/sudoers.d/* files" ++ lineinfile: ++ path: "{{ item.path }}" ++ regexp: "^{{{ line }}}$" ++ state: absent ++ with_items: "{{ sudoers_d_defaults.files }}" ++{{%- endmacro %}} ++ ++{{{- delete_line_in_sudoers_d("Defaults !targetpw") }}} ++{{{- delete_line_in_sudoers_d("Defaults !rootpw") }}} ++{{{- delete_line_in_sudoers_d("Defaults !runaspw") }}} ++ + {{{ ansible_only_lineinfile(msg='Ensure that Defaults !targetpw is defined in sudoers', line_regex='^Defaults !targetpw$', path='/etc/sudoers', new_line='Defaults !targetpw') }}} + {{{ ansible_only_lineinfile(msg='Ensure that Defaults !rootpw is defined in sudoers', line_regex='^Defaults !rootpw$', path='/etc/sudoers', new_line='Defaults !rootpw') }}} + {{{ ansible_only_lineinfile(msg='Ensure that Defaults !runaspw is defined in sudoers', line_regex='^Defaults !runaspw$', path='/etc/sudoers', new_line='Defaults !runaspw') }}} +diff --git a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/bash/shared.sh b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/bash/shared.sh +index ea0ac67fa1c..3b327f3fc88 100644 +--- a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/bash/shared.sh ++++ b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/bash/shared.sh +@@ -1,5 +1,17 @@ + # platform = multi_platform_all + ++{{%- macro delete_line_in_sudoers_d(line) %}} ++if grep -x '^{{{line}}}$' /etc/sudoers.d/*; then ++ find /etc/sudoers.d/ -type f -exec sed -i "/{{{line}}}/d" {} \; ++fi ++{{%- endmacro %}} ++ ++{{{- delete_line_in_sudoers_d("Defaults !targetpw") }}} ++{{{- delete_line_in_sudoers_d("Defaults !rootpw") }}} ++{{{- delete_line_in_sudoers_d("Defaults !runaspw") }}} ++ + {{{ set_config_file(path="/etc/sudoers", parameter="Defaults !targetpw", value="", create=true, insensitive=false, separator="", separator_regex="", prefix_regex="") }}} + {{{ set_config_file(path="/etc/sudoers", parameter="Defaults !rootpw", value="", create=true, insensitive=false, separator="", separator_regex="", prefix_regex="") }}} + {{{ set_config_file(path="/etc/sudoers", parameter="Defaults !runaspw", value="", create=true, insensitive=false, separator="", separator_regex="", prefix_regex="") }}} ++ ++ +diff --git a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_d_duplicate.fail.sh b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_d_duplicate.fail.sh +new file mode 100644 +index 00000000000..a258d108a00 +--- /dev/null ++++ b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_d_duplicate.fail.sh +@@ -0,0 +1,9 @@ ++# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,SUSE Linux Enterprise 15 ++# packages = sudo ++ ++echo 'Defaults !targetpw' >> /etc/sudoers ++echo 'Defaults !rootpw' >> /etc/sudoers ++echo 'Defaults !runaspw' >> /etc/sudoers ++echo 'Defaults !targetpw' >> /etc/sudoers.d/00-complianceascode.conf ++echo 'Defaults !rootpw' >> /etc/sudoers.d/00-complianceascode.conf ++echo 'Defaults !runaspw' >> /etc/sudoers.d/00-complianceascode.conf diff --git a/SOURCES/scap-security-guide-0.1.61-update_RHEL_08_010385-PR_8220.patch b/SOURCES/scap-security-guide-0.1.61-update_RHEL_08_010385-PR_8220.patch new file mode 100644 index 0000000..634920e --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.61-update_RHEL_08_010385-PR_8220.patch @@ -0,0 +1,164 @@ +From 17320d95043eb6acec223c6b1fe40f04d58d184d Mon Sep 17 00:00:00 2001 +From: Gabriel Becker +Date: Mon, 21 Mar 2022 14:55:11 +0100 +Subject: [PATCH] 8220. + +--- + .../ansible/shared.yml | 36 +++++++++++++++++ + .../bash/shared.sh | 39 +++++++++++++++++++ + .../oval/shared.xml | 4 +- + .../sudo_require_reauthentication/rule.yml | 14 +------ + .../tests/multiple_correct_value.fail.sh | 10 +++++ + 5 files changed, 88 insertions(+), 15 deletions(-) + create mode 100644 linux_os/guide/system/software/sudo/sudo_require_reauthentication/ansible/shared.yml + create mode 100644 linux_os/guide/system/software/sudo/sudo_require_reauthentication/bash/shared.sh + create mode 100644 linux_os/guide/system/software/sudo/sudo_require_reauthentication/tests/multiple_correct_value.fail.sh + +diff --git a/linux_os/guide/system/software/sudo/sudo_require_reauthentication/ansible/shared.yml b/linux_os/guide/system/software/sudo/sudo_require_reauthentication/ansible/shared.yml +new file mode 100644 +index 0000000..b0c67a6 +--- /dev/null ++++ b/linux_os/guide/system/software/sudo/sudo_require_reauthentication/ansible/shared.yml +@@ -0,0 +1,36 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++{{{ ansible_instantiate_variables("var_sudo_timestamp_timeout") }}} ++- name: "Find out if /etc/sudoers.d/* files contain 'Defaults timestamp_timeout' to be deduplicated" ++ find: ++ path: "/etc/sudoers.d" ++ patterns: "*" ++ contains: '^[\s]*Defaults\s.*\btimestamp_timeout=.*' ++ register: sudoers_d_defaults_timestamp_timeout ++ ++- name: "Remove found occurrences of 'Defaults timestamp_timeout' from /etc/sudoers.d/* files" ++ lineinfile: ++ path: "{{ item.path }}" ++ regexp: '^[\s]*Defaults\s.*\btimestamp_timeout=.*' ++ state: absent ++ with_items: "{{ sudoers_d_defaults_timestamp_timeout.files }}" ++ ++- name: Ensure timestamp_timeout is enabled with the appropriate value in /etc/sudoers ++ lineinfile: ++ path: /etc/sudoers ++ regexp: '^[\s]*Defaults\s(.*)\btimestamp_timeout=[-]?\w+\b(.*)$' ++ line: 'Defaults \1timestamp_timeout={{ var_sudo_timestamp_timeout }}\2' ++ validate: /usr/sbin/visudo -cf %s ++ backrefs: yes ++ register: edit_sudoers_timestamp_timeout_option ++ ++- name: Enable timestamp_timeout option with appropriate value in /etc/sudoers ++ lineinfile: # noqa 503 ++ path: /etc/sudoers ++ line: 'Defaults timestamp_timeout={{ var_sudo_timestamp_timeout }}' ++ validate: /usr/sbin/visudo -cf %s ++ when: edit_sudoers_timestamp_timeout_option is defined and not edit_sudoers_timestamp_timeout_option.changed +diff --git a/linux_os/guide/system/software/sudo/sudo_require_reauthentication/bash/shared.sh b/linux_os/guide/system/software/sudo/sudo_require_reauthentication/bash/shared.sh +new file mode 100644 +index 0000000..f291f53 +--- /dev/null ++++ b/linux_os/guide/system/software/sudo/sudo_require_reauthentication/bash/shared.sh +@@ -0,0 +1,39 @@ ++# platform = multi_platform_all ++# reboot = false ++# strategy = restrict ++# complexity = low ++# disruption = low ++ ++. /usr/share/scap-security-guide/remediation_functions ++ ++{{{ bash_instantiate_variables("var_sudo_timestamp_timeout") }}} ++ ++if grep -x '^[\s]*Defaults.*\btimestamp_timeout=.*' /etc/sudoers.d/*; then ++ find /etc/sudoers.d/ -type f -exec sed -i "/^[\s]*Defaults.*\btimestamp_timeout=.*/d" {} \; ++fi ++ ++if /usr/sbin/visudo -qcf /etc/sudoers; then ++ cp /etc/sudoers /etc/sudoers.bak ++ if ! grep -P '^[\s]*Defaults.*\btimestamp_timeout=[-]?\w+\b\b.*$' /etc/sudoers; then ++ # sudoers file doesn't define Option timestamp_timeout ++ echo "Defaults timestamp_timeout=${var_sudo_timestamp_timeout}" >> /etc/sudoers ++ else ++ # sudoers file defines Option timestamp_timeout, remediate if appropriate value is not set ++ if ! grep -P "^[\s]*Defaults.*\btimestamp_timeout=${var_sudo_timestamp_timeout}\b.*$" /etc/sudoers; then ++ ++ sed -Ei "s/(^[\s]*Defaults.*\btimestamp_timeout=)[-]?\w+(\b.*$)/\1${var_sudo_timestamp_timeout}\2/" /etc/sudoers ++ fi ++ fi ++ ++ # Check validity of sudoers and cleanup bak ++ if /usr/sbin/visudo -qcf /etc/sudoers; then ++ rm -f /etc/sudoers.bak ++ else ++ echo "Fail to validate remediated /etc/sudoers, reverting to original file." ++ mv /etc/sudoers.bak /etc/sudoers ++ false ++ fi ++else ++ echo "Skipping remediation, /etc/sudoers failed to validate" ++ false ++fi +diff --git a/linux_os/guide/system/software/sudo/sudo_require_reauthentication/oval/shared.xml b/linux_os/guide/system/software/sudo/sudo_require_reauthentication/oval/shared.xml +index 8f404ca..dfc319b 100644 +--- a/linux_os/guide/system/software/sudo/sudo_require_reauthentication/oval/shared.xml ++++ b/linux_os/guide/system/software/sudo/sudo_require_reauthentication/oval/shared.xml +@@ -6,13 +6,13 @@ +
+ + +- ++ + + + + + +- /etc/sudoers ++ ^/etc/sudoers(\.d/.*)?$ + ^[\s]*Defaults[\s]+timestamp_timeout=([-]?[\d]+)$ + 1 + +diff --git a/linux_os/guide/system/software/sudo/sudo_require_reauthentication/rule.yml b/linux_os/guide/system/software/sudo/sudo_require_reauthentication/rule.yml +index 8622d6a..f7a14a8 100644 +--- a/linux_os/guide/system/software/sudo/sudo_require_reauthentication/rule.yml ++++ b/linux_os/guide/system/software/sudo/sudo_require_reauthentication/rule.yml +@@ -45,16 +45,4 @@ ocil: |- +
sudo grep -ri '^Defaults.*timestamp_timeout' /etc/sudoers /etc/sudoers.d
+ The output should be: +
/etc/sudoers:Defaults timestamp_timeout=0
or "timestamp_timeout" is set to a positive number. +- +-template: +- name: sudo_defaults_option +- vars: +- option: timestamp_timeout +- variable_name: "var_sudo_timestamp_timeout" +- # optional minus char added so remediation can detect properly if item is already configured +- option_regex_suffix: '=[-]?\w+\b' +- backends: +- # Template is not able to accomodate this particular check. +- # It needs to check for an integer greater than or equal to zero +- oval: "off" +- ++ If results are returned from more than one file location, this is a finding. +diff --git a/linux_os/guide/system/software/sudo/sudo_require_reauthentication/tests/multiple_correct_value.fail.sh b/linux_os/guide/system/software/sudo/sudo_require_reauthentication/tests/multiple_correct_value.fail.sh +new file mode 100644 +index 0000000..a258d66 +--- /dev/null ++++ b/linux_os/guide/system/software/sudo/sudo_require_reauthentication/tests/multiple_correct_value.fail.sh +@@ -0,0 +1,10 @@ ++#!/bin/bash ++ ++ ++if grep -q 'timestamp_timeout' /etc/sudoers; then ++ sed -i 's/.*timestamp_timeout.*/Defaults timestamp_timeout=3/' /etc/sudoers ++else ++ echo "Defaults timestamp_timeout=3" >> /etc/sudoers ++fi ++ ++echo "Defaults timestamp_timeout=3" > /etc/sudoers.d/00-complianceascode-test.conf +-- +2.34.1 + diff --git a/SOURCES/scap-security-guide-0.1.61-update_RHEL_08_020041-PR_8146.patch b/SOURCES/scap-security-guide-0.1.61-update_RHEL_08_020041-PR_8146.patch new file mode 100644 index 0000000..4283a6d --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.61-update_RHEL_08_020041-PR_8146.patch @@ -0,0 +1,303 @@ +commit 36b22c1b5f2cf6bdbe346cbca9c185f75e5dc8e6 +Author: Watson Sato +Date: Mon Feb 28 11:28:39 2022 +0100 + + Manual edited patch scap-security-guide-0.1.61-update_RHEL_08_020041-PR_8146.patch. + +diff --git a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/bash/shared.sh b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/bash/shared.sh +index 0c544bf..4519460 100644 +--- a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/bash/shared.sh ++++ b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/bash/shared.sh +@@ -1,7 +1,11 @@ + # platform = multi_platform_fedora,Red Hat Enterprise Linux 8,Oracle Linux 8 ++# reboot = true ++# strategy = enable ++# complexity = low ++# disruption = low + + if ! grep -x ' case "$name" in sshd|login) exec tmux ;; esac' /etc/bashrc; then +- cat >> /etc/bashrc <<'EOF' ++ cat >> /etc/profile.d/tmux.sh <<'EOF' + if [ "$PS1" ]; then + parent=$(ps -o ppid= -p $$) + name=$(ps -o comm= -p $parent) +diff --git a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/oval/shared.xml b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/oval/shared.xml +index 00ac349..4cb2f9e 100644 +--- a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/oval/shared.xml ++++ b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/oval/shared.xml +@@ -4,21 +4,27 @@ + + ++ + + +- + +- + + + +- /etc/bashrc +- ^(.*)$ +- 1 ++ ^/etc/bashrc$|^/etc/profile\.d/.*$ ++ if \[ "\$PS1" \]; then\n\s+parent=\$\(ps -o ppid= -p \$\$\)\n\s+name=\$\(ps -o comm= -p \$parent\)\n\s+case "\$name" in sshd\|login\) exec tmux ;; esac\nfi ++ 1 + +- +- if \[ "\$PS1" \]; then\n\s+parent=\$\(ps -o ppid= -p \$\$\)\n\s+name=\$\(ps -o comm= -p \$parent\)\n\s+case "\$name" in sshd\|login\) exec tmux ;; esac\nfi +- ++ ++ ++ ++ ++ ++ ++ ^tmux(?:|[\s]+.*)$ ++ 0 ++ + +diff --git a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/rule.yml b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/rule.yml +index c43b8cb..6be090b 100644 +--- a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/rule.yml ++++ b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/rule.yml +@@ -7,12 +7,20 @@ title: 'Support session locking with tmux' + description: |- + The tmux terminal multiplexer is used to implement + automatic session locking. It should be started from +- /etc/bashrc. ++ /etc/bashrc or drop-in files within /etc/profile.d/. ++ Additionally it must be ensured that the tmux process is running ++ and it can be verified with the following command: ++
ps all | grep tmux | grep -v grep
+ + rationale: |- + Unlike bash itself, the tmux terminal multiplexer + provides a mechanism to lock sessions after period of inactivity. + ++warnings: ++ - general: |- ++ The remediation does not start the tmux process, so it must be ++ manually started or have the system rebooted after applying the fix. ++ + severity: medium + + identifiers: +@@ -25,17 +33,21 @@ references: + srg: SRG-OS-000031-GPOS-00012,SRG-OS-000028-GPOS-00009 + stigid@rhel8: RHEL-08-020041 + +-ocil_clause: 'exec tmux is not present at the end of bashrc' ++ocil_clause: 'exec tmux is not present at the end of bashrc or tmux process is not running' + + ocil: |- + To verify that tmux is configured to execute, + run the following command: +-
$ grep -A1 -B3 "case ..name. in sshd|login) exec tmux ;; esac" /etc/bashrc
++
$ grep -A1 -B3 "case ..name. in sshd|login) exec tmux ;; esac" /etc/bashrc /etc/profile.d/*
+ The output should return the following: +
if [ "$PS1" ]; then
+       parent=$(ps -o ppid= -p $$)
+       name=$(ps -o comm= -p $parent)
+       case "$name" in sshd|login) exec tmux ;; esac
+     fi
++ To verify that the tmux process is running, ++ run the following command: ++
ps all | grep tmux | grep -v grep
++ If the command does not produce output, this is a finding. + + platform: machine +diff --git a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/correct_value.pass.sh b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/correct_value.pass.sh +new file mode 100644 +index 0000000..221c186 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/correct_value.pass.sh +@@ -0,0 +1,12 @@ ++#!/bin/bash ++# packages = tmux ++ ++cat >> /etc/bashrc <<'EOF' ++if [ "$PS1" ]; then ++ parent=$(ps -o ppid= -p $$) ++ name=$(ps -o comm= -p $parent) ++ case "$name" in sshd|login) exec tmux ;; esac ++fi ++EOF ++ ++tmux new-session -s root -d +diff --git a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/correct_value_d_directory.pass.sh b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/correct_value_d_directory.pass.sh +new file mode 100644 +index 0000000..1702bb1 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/correct_value_d_directory.pass.sh +@@ -0,0 +1,13 @@ ++#!/bin/bash ++# packages = tmux ++ ++ ++cat >> /etc/profile.d/00-complianceascode.conf <<'EOF' ++if [ "$PS1" ]; then ++ parent=$(ps -o ppid= -p $$) ++ name=$(ps -o comm= -p $parent) ++ case "$name" in sshd|login) exec tmux ;; esac ++fi ++EOF ++ ++tmux new-session -s root -d +diff --git a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/duplicate_value_multiple_files.fail.sh b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/duplicate_value_multiple_files.fail.sh +new file mode 100644 +index 0000000..1dc38b8 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/duplicate_value_multiple_files.fail.sh +@@ -0,0 +1,17 @@ ++#!/bin/bash ++ ++cat >> /etc/profile.d/00-complianceascode.conf <<'EOF' ++if [ "$PS1" ]; then ++ parent=$(ps -o ppid= -p $$) ++ name=$(ps -o comm= -p $parent) ++ case "$name" in sshd|login) exec tmux ;; esac ++fi ++EOF ++ ++cat >> /etc/bashrc <<'EOF' ++if [ "$PS1" ]; then ++ parent=$(ps -o ppid= -p $$) ++ name=$(ps -o comm= -p $parent) ++ case "$name" in sshd|login) exec tmux ;; esac ++fi ++EOF +diff --git a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/tmux_not_running.fail.sh b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/tmux_not_running.fail.sh +new file mode 100644 +index 0000000..6cb9d83 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/tmux_not_running.fail.sh +@@ -0,0 +1,13 @@ ++#!/bin/bash ++# packages = tmux ++# remediation = none ++ ++cat >> /etc/bashrc <<'EOF' ++if [ "$PS1" ]; then ++ parent=$(ps -o ppid= -p $$) ++ name=$(ps -o comm= -p $parent) ++ case "$name" in sshd|login) exec tmux ;; esac ++fi ++EOF ++ ++killall tmux || true +diff --git a/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/wrong_value.fail.sh b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/wrong_value.fail.sh +new file mode 100644 +index 0000000..f13a8b0 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-physical/screen_locking/console_screen_locking/configure_bashrc_exec_tmux/tests/wrong_value.fail.sh +@@ -0,0 +1,105 @@ ++#!/bin/bash ++# packages = tmux ++ ++cat > /etc/bashrc <<'EOF' ++# /etc/bashrc ++ ++# System wide functions and aliases ++# Environment stuff goes in /etc/profile ++ ++# It's NOT a good idea to change this file unless you know what you ++# are doing. It's much better to create a custom.sh shell script in ++# /etc/profile.d/ to make custom changes to your environment, as this ++# will prevent the need for merging in future updates. ++ ++# Prevent doublesourcing ++if [ -z "$BASHRCSOURCED" ]; then ++ BASHRCSOURCED="Y" ++ ++ # are we an interactive shell? ++ if [ "$PS1" ]; then ++ if [ -z "$PROMPT_COMMAND" ]; then ++ case $TERM in ++ xterm*|vte*) ++ if [ -e /etc/sysconfig/bash-prompt-xterm ]; then ++ PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm ++ elif [ "${VTE_VERSION:-0}" -ge 3405 ]; then ++ PROMPT_COMMAND="__vte_prompt_command" ++ else ++ PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"' ++ fi ++ ;; ++ screen*) ++ if [ -e /etc/sysconfig/bash-prompt-screen ]; then ++ PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen ++ else ++ PROMPT_COMMAND='printf "\033k%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"' ++ fi ++ ;; ++ *) ++ [ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default ++ ;; ++ esac ++ fi ++ # Turn on parallel history ++ shopt -s histappend ++ history -a ++ # Turn on checkwinsize ++ shopt -s checkwinsize ++ [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ " ++ # You might want to have e.g. tty in prompt (e.g. more virtual machines) ++ # and console windows ++ # If you want to do so, just add e.g. ++ # if [ "$PS1" ]; then ++ # PS1="[\u@\h:\l \W]\\$ " ++ # fi ++ # to your custom modification shell script in /etc/profile.d/ directory ++ fi ++ ++ if ! shopt -q login_shell ; then # We're not a login shell ++ # Need to redefine pathmunge, it gets undefined at the end of /etc/profile ++ pathmunge () { ++ case ":${PATH}:" in ++ *:"$1":*) ++ ;; ++ *) ++ if [ "$2" = "after" ] ; then ++ PATH=$PATH:$1 ++ else ++ PATH=$1:$PATH ++ fi ++ esac ++ } ++ ++ # By default, we want umask to get set. This sets it for non-login shell. ++ # Current threshold for system reserved uid/gids is 200 ++ # You could check uidgid reservation validity in ++ # /usr/share/doc/setup-*/uidgid file ++ if [ $UID -gt 199 ] && [ "`/usr/bin/id -gn`" = "`/usr/bin/id -un`" ]; then ++ umask 002 ++ else ++ umask 022 ++ fi ++ ++ SHELL=/bin/bash ++ # Only display echos from profile.d scripts if we are no login shell ++ # and interactive - otherwise just process them to set envvars ++ for i in /etc/profile.d/*.sh; do ++ if [ -r "$i" ]; then ++ if [ "$PS1" ]; then ++ . "$i" ++ else ++ . "$i" >/dev/null ++ fi ++ fi ++ done ++ ++ unset i ++ unset -f pathmunge ++ fi ++ ++fi ++# vim:ts=4:sw=4 ++EOF ++ ++tmux new-session -s root -d diff --git a/SOURCES/scap-security-guide-0.1.61-update_RHEL_08_040320-PR_8170.patch b/SOURCES/scap-security-guide-0.1.61-update_RHEL_08_040320-PR_8170.patch new file mode 100644 index 0000000..0633c61 --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.61-update_RHEL_08_040320-PR_8170.patch @@ -0,0 +1,199 @@ +commit 8fe724cfa0f4cea726ddd7adb44cfbba0931b865 +Author: Watson Sato +Date: Mon Feb 28 10:38:13 2022 +0100 + + Manual edited patch scap-security-guide-0.1.61-update_RHEL_08_040320-PR_8170.patch. + +diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/ansible/shared.yml b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/ansible/shared.yml +index 5b3afb3..67d6836 100644 +--- a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/ansible/shared.yml ++++ b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/ansible/shared.yml +@@ -14,12 +14,3 @@ + - xorg-x11-server-Xwayland + {{% endif %}} + state: absent +- +- +-- name: Switch to multi-user runlevel +- file: +- src: /usr/lib/systemd/system/multi-user.target +- dest: /etc/systemd/system/default.target +- state: link +- force: yes +- +diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/bash/shared.sh b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/bash/shared.sh +index dbabe57..496dc74 100644 +--- a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/bash/shared.sh ++++ b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/bash/shared.sh +@@ -12,6 +12,3 @@ + {{% if product not in ["rhel7", "ol7"] %}} + {{{ bash_package_remove("xorg-x11-server-Xwayland") }}} + {{% endif %}} +- +-# configure run level +-systemctl set-default multi-user.target +\ No newline at end of file +diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/oval/shared.xml b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/oval/shared.xml +index 0710efe..0868ec6 100644 +--- a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/oval/shared.xml ++++ b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/oval/shared.xml +@@ -2,10 +2,6 @@ + + {{{ oval_metadata("Ensure that the default runlevel target is set to multi-user.target.") }}} + +- {{%- if init_system == "systemd" and target_oval_version != [5, 10] %}} +- +- {{%- endif %}} + + xwindows_runlevel_target can be used to configure the system to boot into the multi-user.target. ++ If a GUI is an operational requirement, a tailored profile that removes this rule should used before + continuing installation. +diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/correct_target.pass.sh b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/correct_target.pass.sh +deleted file mode 100644 +index 9bf62a4..0000000 +--- a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/correct_target.pass.sh ++++ /dev/null +@@ -1,5 +0,0 @@ +-#!/bin/bash +- +-yum -y remove xorg-x11-server-Xorg xorg-x11-server-common xorg-x11-server-utils xorg-x11-server-Xwayland +- +-systemctl set-default multi-user.target +diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/correct_target_under_lib.pass.sh b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/correct_target_under_lib.pass.sh +deleted file mode 100644 +index 4eeb697..0000000 +--- a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/correct_target_under_lib.pass.sh ++++ /dev/null +@@ -1,5 +0,0 @@ +-#!/bin/bash +- +-yum -y remove xorg-x11-server-Xorg xorg-x11-server-common xorg-x11-server-utils xorg-x11-server-Xwayland +- +-ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target +diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/packages_installed.fail.sh b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/packages_installed.fail.sh +new file mode 100644 +index 0000000..b3908cf +--- /dev/null ++++ b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/packages_installed.fail.sh +@@ -0,0 +1,8 @@ ++#!/bin/bash ++ ++{{{ bash_package_install("xorg-x11-server-Xorg") }}} ++{{{ bash_package_install("xorg-x11-server-utils") }}} ++{{{ bash_package_install("xorg-x11-server-common") }}} ++{{% if product not in ["rhel7", "ol7"] %}} ++{{{ bash_package_install("xorg-x11-server-Xwayland") }}} ++{{% endif %}} +diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/packages_installed_removed.pass.sh b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/packages_installed_removed.pass.sh +new file mode 100644 +index 0000000..abafdbd +--- /dev/null ++++ b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/packages_installed_removed.pass.sh +@@ -0,0 +1,16 @@ ++#!/bin/bash ++# based on shared/templates/package_removed/tests/package-installed-removed.pass.sh ++ ++{{{ bash_package_install("xorg-x11-server-Xorg") }}} ++{{{ bash_package_install("xorg-x11-server-utils") }}} ++{{{ bash_package_install("xorg-x11-server-common") }}} ++{{% if product not in ["rhel7", "ol7"] %}} ++{{{ bash_package_install("xorg-x11-server-Xwayland") }}} ++{{% endif %}} ++ ++{{{ bash_package_remove("xorg-x11-server-Xorg") }}} ++{{{ bash_package_remove("xorg-x11-server-utils") }}} ++{{{ bash_package_remove("xorg-x11-server-common") }}} ++{{% if product not in ["rhel7", "ol7"] %}} ++{{{ bash_package_remove("xorg-x11-server-Xwayland") }}} ++{{% endif %}} +diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/packages_removed.pass.sh b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/packages_removed.pass.sh +new file mode 100644 +index 0000000..a403e10 +--- /dev/null ++++ b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/packages_removed.pass.sh +@@ -0,0 +1,8 @@ ++#!/bin/bash ++ ++{{{ bash_package_remove("xorg-x11-server-Xorg") }}} ++{{{ bash_package_remove("xorg-x11-server-utils") }}} ++{{{ bash_package_remove("xorg-x11-server-common") }}} ++{{% if product not in ["rhel7", "ol7"] %}} ++{{{ bash_package_remove("xorg-x11-server-Xwayland") }}} ++{{% endif %}} +diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/rhel7_packages_installed_correct_target.fail.sh b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/rhel7_packages_installed_correct_target.fail.sh +deleted file mode 100644 +index ff7d0ef..0000000 +--- a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/rhel7_packages_installed_correct_target.fail.sh ++++ /dev/null +@@ -1,4 +0,0 @@ +-#!/bin/bash +-# platform = Red Hat Enterprise Linux 7 +-# packages = xorg-x11-server-Xorg,xorg-x11-server-common,xorg-x11-server-utils +- +diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/rhel7_packages_installed_wrong_target.fail.sh b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/rhel7_packages_installed_wrong_target.fail.sh +deleted file mode 100644 +index d8ecd8c..0000000 +--- a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/rhel7_packages_installed_wrong_target.fail.sh ++++ /dev/null +@@ -1,5 +0,0 @@ +-#!/bin/bash +-# platform = Red Hat Enterprise Linux 7 +-# packages = xorg-x11-server-Xorg,xorg-x11-server-common,xorg-x11-server-utils +- +-systemctl set-default graphical.target +diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/rhel8_packages_installed_correct_target.fail.sh b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/rhel8_packages_installed_correct_target.fail.sh +deleted file mode 100644 +index 14f1a97..0000000 +--- a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/rhel8_packages_installed_correct_target.fail.sh ++++ /dev/null +@@ -1,4 +0,0 @@ +-#!/bin/bash +-# platform = Red Hat Enterprise Linux 8 +-# packages = xorg-x11-server-Xorg,xorg-x11-server-common,xorg-x11-server-utils,xorg-x11-server-Xwayland +- +diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/rhel8_packages_installed_wrong_target.fail.sh b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/rhel8_packages_installed_wrong_target.fail.sh +deleted file mode 100644 +index c678ef7..0000000 +--- a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/rhel8_packages_installed_wrong_target.fail.sh ++++ /dev/null +@@ -1,5 +0,0 @@ +-#!/bin/bash +-# platform = Red Hat Enterprise Linux 8 +-# packages = xorg-x11-server-Xorg,xorg-x11-server-common,xorg-x11-server-utils,xorg-x11-server-Xwayland +- +-systemctl set-default graphical.target +diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/wrong_target.fail.sh b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/wrong_target.fail.sh +deleted file mode 100644 +index bf8a615..0000000 +--- a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/wrong_target.fail.sh ++++ /dev/null +@@ -1,5 +0,0 @@ +-#!/bin/bash +- +-yum -y remove xorg-x11-server-Xorg xorg-x11-server-common xorg-x11-server-utils xorg-x11-server-Xwayland +- +-systemctl set-default graphical.target +diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/wrong_target_under_lib.fail.sh b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/wrong_target_under_lib.fail.sh +deleted file mode 100644 +index 652088b..0000000 +--- a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/wrong_target_under_lib.fail.sh ++++ /dev/null +@@ -1,5 +0,0 @@ +-#!/bin/bash +- +-yum -y remove xorg-x11-server-Xorg xorg-x11-server-common xorg-x11-server-utils xorg-x11-server-Xwayland +- +-ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target diff --git a/SOURCES/scap-security-guide-0.1.61-update_RHEL_08_STIG-PR_8139.patch b/SOURCES/scap-security-guide-0.1.61-update_RHEL_08_STIG-PR_8139.patch new file mode 100644 index 0000000..5e164f8 --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.61-update_RHEL_08_STIG-PR_8139.patch @@ -0,0 +1,1774 @@ +commit ed9b2df569f3cbc7fcfaf475a0f18d6108b9a244 +Author: Watson Sato +Date: Fri Feb 25 18:12:54 2022 +0100 + + Manual edited patch scap-security-guide-0.1.61-update_RHEL_08_STIG-PR_8139.patch. + +diff --git a/products/rhel8/profiles/stig.profile b/products/rhel8/profiles/stig.profile +index 5b2cc0f..a641eee 100644 +--- a/products/rhel8/profiles/stig.profile ++++ b/products/rhel8/profiles/stig.profile +@@ -11,7 +11,7 @@ title: 'DISA STIG for Red Hat Enterprise Linux 8' + + description: |- + This profile contains configuration checks that align to the +- DISA STIG for Red Hat Enterprise Linux 8 V1R4. ++ DISA STIG for Red Hat Enterprise Linux 8 V1R5. + + In addition to being applicable to Red Hat Enterprise Linux 8, DISA recognizes this + configuration baseline as applicable to the operating system tier of +diff --git a/products/rhel8/profiles/stig_gui.profile b/products/rhel8/profiles/stig_gui.profile +index e1f0f71..07ff3cb 100644 +--- a/products/rhel8/profiles/stig_gui.profile ++++ b/products/rhel8/profiles/stig_gui.profile +@@ -11,7 +11,7 @@ title: 'DISA STIG with GUI for Red Hat Enterprise Linux 8' + + description: |- + This profile contains configuration checks that align to the +- DISA STIG with GUI for Red Hat Enterprise Linux 8 V1R4. ++ DISA STIG with GUI for Red Hat Enterprise Linux 8 V1R5. + + In addition to being applicable to Red Hat Enterprise Linux 8, DISA recognizes this + configuration baseline as applicable to the operating system tier of +diff --git a/shared/references/disa-stig-rhel8-v1r4-xccdf-manual.xml b/shared/references/disa-stig-rhel8-v1r5-xccdf-manual.xml +similarity index 81% +rename from shared/references/disa-stig-rhel8-v1r4-xccdf-manual.xml +rename to shared/references/disa-stig-rhel8-v1r5-xccdf-manual.xml +index 46c5fa1..216e91f 100644 +--- a/shared/references/disa-stig-rhel8-v1r4-xccdf-manual.xml ++++ b/shared/references/disa-stig-rhel8-v1r5-xccdf-manual.xml +@@ -1,4 +1,4 @@ +-acceptedRed Hat Enterprise Linux 8 Security Technical Implementation GuideThis Security Technical Implementation Guide is published as a tool to improve the security of Department of Defense (DoD) information systems. The requirements are derived from the National Institute of Standards and Technology (NIST) 800-53 and related documents. Comments or proposed revisions to this document should be sent via email to the following address: disa.stig_spt@mail.mil.DISASTIG.DOD.MILRelease: 4 Benchmark Date: 27 Oct 20213.2.2.360791.10.01I - Mission Critical Classified<ProfileDescription></ProfileDescription>I - Mission Critical Sensitive<ProfileDescription></ProfileDescription>II - Mission Support Public<ProfileDescription></ProfileDescription>III - Administrative Classified<ProfileDescription></ProfileDescription>III - Administrative Sensitive<ProfileDescription></ProfileDescription>I - Mission Critical Public<ProfileDescription></ProfileDescription>II - Mission Support Classified<ProfileDescription></ProfileDescription>II - Mission Support Sensitive<ProfileDescription></ProfileDescription>III - Administrative Public<ProfileDescription></ProfileDescription>SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-010000RHEL 8 must be a vendor-supported release.<VulnDiscussion>An operating system release is considered "supported" if the vendor continues to provide security patches for the product. With an unsupported release, it will not be possible to resolve security issues discovered in the system software. + + Red Hat offers the Extended Update Support (EUS) ad-on to a Red Hat Enterprise Linux subscription, for a fee, for those customers who wish to standardize on a specific minor release for an extended period. The RHEL 8 minor releases eligible for EUS are 8.1, 8.2, 8.4, 8.6, and 8.8. Each RHEL 8 EUS stream is available for 24 months from the availability of the minor release. RHEL 8.10 will be the final minor release overall. For more details on the Red Hat Enterprise Linux Life Cycle visit https://access.redhat.com/support/policy/updates/errata.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Upgrade to a supported version of RHEL 8.Verify the version of the operating system is vendor supported. + +@@ -80,13 +80,13 @@ $ sudo cat /proc/sys/crypto/fips_enabled + + 1 + +-If FIPS mode is not "on", the kernel boot parameter is not configured for FIPS mode, or the system does not have a value of "1" for "fips_enabled" in "/proc/sys/crypto", this is a finding.SRG-OS-000185-GPOS-00079<GroupDescription></GroupDescription>RHEL-08-010030All RHEL 8 local disk partitions must implement cryptographic mechanisms to prevent unauthorized disclosure or modification of all information that requires at rest protection.<VulnDiscussion>RHEL 8 systems handling data requiring "data at rest" protections must employ cryptographic mechanisms to prevent unauthorized disclosure and modification of the information at rest. ++If FIPS mode is not "on", the kernel boot parameter is not configured for FIPS mode, or the system does not have a value of "1" for "fips_enabled" in "/proc/sys/crypto", this is a finding.SRG-OS-000185-GPOS-00079<GroupDescription></GroupDescription>RHEL-08-010030All RHEL 8 local disk partitions must implement cryptographic mechanisms to prevent unauthorized disclosure or modification of all information that requires at rest protection.<VulnDiscussion>RHEL 8 systems handling data requiring "data at rest" protections must employ cryptographic mechanisms to prevent unauthorized disclosure and modification of the information at rest. + + Selection of a cryptographic mechanism is based on the need to protect the integrity of organizational information. The strength of the mechanism is commensurate with the security category and/or classification of the information. Organizations have the flexibility to either encrypt all information on storage devices (i.e., full disk encryption) or encrypt specific data structures (e.g., files, records, or fields). + + Satisfies: SRG-OS-000185-GPOS-00079, SRG-OS-000404-GPOS-00183, SRG-OS-000405-GPOS-00184</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001199Configure RHEL 8 to prevent unauthorized modification of all information at rest by using disk encryption. + +-Encrypting a partition in an already installed system is more difficult, because existing partitions will need to be resized and changed. To encrypt an entire partition, dedicate a partition for encryption in the partition layout.Verify RHEL 8 prevents unauthorized disclosure or modification of all information requiring at-rest protection by using disk encryption. ++Encrypting a partition in an already installed system is more difficult, because existing partitions will need to be resized and changed. To encrypt an entire partition, dedicate a partition for encryption in the partition layout.Verify RHEL 8 prevents unauthorized disclosure or modification of all information requiring at-rest protection by using disk encryption. + + If there is a documented and approved reason for not having data-at-rest encryption, this requirement is Not Applicable. + +@@ -96,7 +96,7 @@ $ sudo blkid + + /dev/mapper/rhel-root: UUID="67b7d7fe-de60-6fd0-befb-e6748cf97743" TYPE="crypto_LUKS" + +-Every persistent disk partition present must be of type "crypto_LUKS". If any partitions other than pseudo file systems (such as /proc or /sys) are not type "crypto_LUKS", ask the administrator to indicate how the partitions are encrypted. If there is no evidence that all local disk partitions are encrypted, this is a finding.SRG-OS-000023-GPOS-00006<GroupDescription></GroupDescription>RHEL-08-010040RHEL 8 must display the Standard Mandatory DoD Notice and Consent Banner before granting local or remote access to the system via a ssh logon.<VulnDiscussion>Display of a standardized and approved use notification before granting access to the operating system ensures privacy and security notification verbiage used is consistent with applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance. ++Every persistent disk partition present must be of type "crypto_LUKS". If any partitions other than the boot partition or pseudo file systems (such as /proc or /sys) are not type "crypto_LUKS", ask the administrator to indicate how the partitions are encrypted. If there is no evidence that these partitions are encrypted, this is a finding.SRG-OS-000023-GPOS-00006<GroupDescription></GroupDescription>RHEL-08-010040RHEL 8 must display the Standard Mandatory DoD Notice and Consent Banner before granting local or remote access to the system via a ssh logon.<VulnDiscussion>Display of a standardized and approved use notification before granting access to the operating system ensures privacy and security notification verbiage used is consistent with applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance. + + System use notifications are required only for access via logon interfaces with human users and are not required when such human interfaces do not exist. + +@@ -293,7 +293,7 @@ $ sudo grep -E '(auth.*|authpriv.*|daemon.*)' /etc/rsyslog.conf + + auth.*;authpriv.*;daemon.* /var/log/secure + +-If "auth.*", "authpriv.*" or "daemon.*" are not configured to be logged, this is a finding.SRG-OS-000066-GPOS-00034<GroupDescription></GroupDescription>RHEL-08-010090RHEL 8, for PKI-based authentication, must validate certificates by constructing a certification path (which includes status information) to an accepted trust anchor.<VulnDiscussion>Without path validation, an informed trust decision by the relying party cannot be made when presented with any certificate not already explicitly trusted. ++If "auth.*", "authpriv.*" or "daemon.*" are not configured to be logged, this is a finding.SRG-OS-000066-GPOS-00034<GroupDescription></GroupDescription>RHEL-08-010090RHEL 8, for PKI-based authentication, must validate certificates by constructing a certification path (which includes status information) to an accepted trust anchor.<VulnDiscussion>Without path validation, an informed trust decision by the relying party cannot be made when presented with any certificate not already explicitly trusted. + + A trust anchor is an authoritative entity represented via a public key and associated data. It is used in the context of public key infrastructures, X.509 digital certificates, and DNSSEC. + +@@ -301,11 +301,11 @@ When there is a chain of trust, usually the top entity to be trusted becomes the + + This requirement verifies that a certification path to an accepted trust anchor is used for certificate validation and that the path includes status information. Path validation is necessary for a relying party to make an informed trust decision when presented with any certificate not already explicitly trusted. Status information for certification paths includes certificate revocation lists or online certificate status protocol responses. Validation of the certificate status information is out of scope for this requirement. + +-Satisfies: SRG-OS-000066-GPOS-00034, SRG-OS-000384-GPOS-00167</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000185Configure RHEL 8, for PKI-based authentication, to validate certificates by constructing a certification path (which includes status information) to an accepted trust anchor. ++Satisfies: SRG-OS-000066-GPOS-00034, SRG-OS-000384-GPOS-00167</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000185Configure RHEL 8, for PKI-based authentication, to validate certificates by constructing a certification path (which includes status information) to an accepted trust anchor. + +-Obtain a valid copy of the DoD root CA file from the PKI CA certificate bundle from cyber.mil and copy the DoD_PKE_CA_chain.pem into the following file: ++Obtain a valid copy of the DoD root CA file from the PKI CA certificate bundle at cyber.mil and copy into the following file: + +-/etc/sssd/pki/sssd_auth_ca_db.pemVerify RHEL 8 for PKI-based authentication has valid certificates by constructing a certification path (which includes status information) to an accepted trust anchor. ++/etc/sssd/pki/sssd_auth_ca_db.pemVerify RHEL 8 for PKI-based authentication has valid certificates by constructing a certification path (which includes status information) to an accepted trust anchor. + + Check that the system has a valid DoD root CA installed with the following command: + +@@ -356,19 +356,19 @@ $ sudo cut -d: -f2 /etc/shadow + + $6$kcOnRq/5$NUEYPuyL.wghQwWssXRcLRFiiru7f5JPV6GaJhNC2aK5F3PZpE/BCCtwrxRc/AInKMNX3CdMw11m9STiql12f/ + +-Password hashes "!" or "*" indicate inactive accounts not available for logon and are not evaluated. If any interactive user password hash does not begin with "$6$", this is a finding.SRG-OS-000073-GPOS-00041<GroupDescription></GroupDescription>RHEL-08-010130The RHEL 8 password-auth file must be configured to use a sufficient number of hashing rounds.<VulnDiscussion>The system must use a strong hashing algorithm to store the password. The system must use a sufficient number of hashing rounds to ensure the required level of entropy. ++Password hashes "!" or "*" indicate inactive accounts not available for logon and are not evaluated. If any interactive user password hash does not begin with "$6$", this is a finding.SRG-OS-000073-GPOS-00041<GroupDescription></GroupDescription>RHEL-08-010130The RHEL 8 shadow password suite must be configured to use a sufficient number of hashing rounds.<VulnDiscussion>The system must use a strong hashing algorithm to store the password. The system must use a sufficient number of hashing rounds to ensure the required level of entropy. + +-Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000196Configure RHEL 8 to encrypt all stored passwords with a strong cryptographic hash. ++Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000196Configure RHEL 8 to encrypt all stored passwords with a strong cryptographic hash. + +-Edit/modify the following line in the "/etc/pam.d/password-auth" file and set "rounds" to a value no lower than "5000": ++Edit/modify the following line in the "/etc/login.defs" file and set "SHA_CRYPT_MIN_ROUNDS" to a value no lower than "5000": + +-password sufficient pam_unix.so sha512 rounds=5000Check that a minimum number of hash rounds is configured by running the following command: ++SHA_CRYPT_MIN_ROUNDS 5000Check that a minimum number of hash rounds is configured by running the following command: + +-$ sudo grep rounds /etc/pam.d/password-auth ++$ sudo egrep "^SHA_CRYPT_" /etc/login.defs + +-password sufficient pam_unix.so sha512 rounds=5000 ++If only one of "SHA_CRYPT_MIN_ROUNDS" or "SHA_CRYPT_MAX_ROUNDS" is set, and this value is below "5000", this is a finding. + +-If "rounds" has a value below "5000", or is commented out, this is a finding.SRG-OS-000080-GPOS-00048<GroupDescription></GroupDescription>RHEL-08-010140RHEL 8 operating systems booted with United Extensible Firmware Interface (UEFI) must require authentication upon booting into single-user mode and maintenance.<VulnDiscussion>If the system does not require valid authentication before it boots into single-user or maintenance mode, anyone who invokes single-user or maintenance mode is granted privileged access to all files on the system. GRUB 2 is the default boot loader for RHEL 8 and is designed to require a password to boot into single-user mode or make modifications to the boot menu.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000213Configure the system to require a grub bootloader password for the grub superusers account with the grub2-setpassword command, which creates/overwrites the /boot/efi/EFI/redhat/user.cfg file. ++If both "SHA_CRYPT_MIN_ROUNDS" and "SHA_CRYPT_MAX_ROUNDS" are set, and the highest value for either is below "5000", this is a finding.SRG-OS-000080-GPOS-00048<GroupDescription></GroupDescription>RHEL-08-010140RHEL 8 operating systems booted with United Extensible Firmware Interface (UEFI) must require authentication upon booting into single-user mode and maintenance.<VulnDiscussion>If the system does not require valid authentication before it boots into single-user or maintenance mode, anyone who invokes single-user or maintenance mode is granted privileged access to all files on the system. GRUB 2 is the default boot loader for RHEL 8 and is designed to require a password to boot into single-user mode or make modifications to the boot menu.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000213Configure the system to require a grub bootloader password for the grub superusers account with the grub2-setpassword command, which creates/overwrites the /boot/efi/EFI/redhat/user.cfg file. + + Generate an encrypted grub2 password for the grub superusers account with the following command: + +@@ -404,21 +404,21 @@ $ sudo grep sulogin-shell /usr/lib/systemd/system/rescue.service + + ExecStart=-/usr/lib/systemd/systemd-sulogin-shell rescue + +-If the "ExecStart" line is configured for anything other than "/usr/lib/systemd/systemd-sulogin-shell rescue", commented out, or missing, this is a finding.SRG-OS-000120-GPOS-00061<GroupDescription></GroupDescription>RHEL-08-010160The RHEL 8 pam_unix.so module must be configured in the password-auth file to use a FIPS 140-2 approved cryptographic hashing algorithm for system authentication.<VulnDiscussion>Unapproved mechanisms that are used for authentication to the cryptographic module are not verified and therefore cannot be relied upon to provide confidentiality or integrity, and DoD data may be compromised. ++If the "ExecStart" line is configured for anything other than "/usr/lib/systemd/systemd-sulogin-shell rescue", commented out, or missing, this is a finding.SRG-OS-000120-GPOS-00061<GroupDescription></GroupDescription>RHEL-08-010160The RHEL 8 pam_unix.so module must be configured in the password-auth file to use a FIPS 140-2 approved cryptographic hashing algorithm for system authentication.<VulnDiscussion>Unapproved mechanisms that are used for authentication to the cryptographic module are not verified and therefore cannot be relied upon to provide confidentiality or integrity, and DoD data may be compromised. + + RHEL 8 systems utilizing encryption are required to use FIPS-compliant mechanisms for authenticating to cryptographic modules. + +-FIPS 140-2 is the current standard for validating that mechanisms used to access cryptographic modules utilize authentication that meets DoD requirements. This allows for Security Levels 1, 2, 3, or 4 for use on a general-purpose computing system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000803Configure RHEL 8 to use a FIPS 140-2 approved cryptographic hashing algorithm for system authentication. ++FIPS 140-2 is the current standard for validating that mechanisms used to access cryptographic modules utilize authentication that meets DoD requirements. This allows for Security Levels 1, 2, 3, or 4 for use on a general-purpose computing system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000803Configure RHEL 8 to use a FIPS 140-2 approved cryptographic hashing algorithm for system authentication. + + Edit/modify the following line in the "/etc/pam.d/password-auth" file to include the sha512 option for pam_unix.so: + +-password sufficient pam_unix.so sha512 rounds=5000Verify that the pam_unix.so module is configured to use sha512. ++password sufficient pam_unix.so sha512Verify that the pam_unix.so module is configured to use sha512. + + Check that the pam_unix.so module is configured to use sha512 in /etc/pam.d/password-auth with the following command: + + $ sudo grep password /etc/pam.d/password-auth | grep pam_unix + +-password sufficient pam_unix.so sha512 rounds=5000 ++password sufficient pam_unix.so sha512 + + If "sha512" is missing, or is commented out, this is a finding.SRG-OS-000120-GPOS-00061<GroupDescription></GroupDescription>RHEL-08-010161RHEL 8 must prevent system daemons from using Kerberos for authentication.<VulnDiscussion>Unapproved mechanisms that are used for authentication to the cryptographic module are not verified and therefore cannot be relied upon to provide confidentiality or integrity, and DoD data may be compromised. + +@@ -661,25 +661,40 @@ $ sudo update-crypto-policies --show + + FIPS + +-If the system-wide crypto policy is set to anything other than "FIPS", this is a finding.SRG-OS-000250-GPOS-00093<GroupDescription></GroupDescription>RHEL-08-010294The RHEL 8 operating system must implement DoD-approved TLS encryption in the OpenSSL package.<VulnDiscussion>Without cryptographic integrity protections, information can be altered by unauthorized users without detection. +- +-Remote access (e.g., RDP) is access to DoD nonpublic information systems by an authorized user (or an information system) communicating through an external, non-organization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless. +- +-Cryptographic mechanisms used for protecting the integrity of information include, for example, signed hash functions using asymmetric cryptography enabling distribution of the public key to verify the hash information while maintaining the confidentiality of the secret key used to generate the hash. +- +-RHEL 8 incorporates system-wide crypto policies by default. The employed algorithms can be viewed in the /etc/crypto-policies/back-ends/openssl.config file. +- +-Satisfies: SRG-OS-000250-GPOS-00093, SRG-OS-000393-GPOS-00173, SRG-OS-000394-GPOS-00174, SRG-OS-000125-GPOS-00065</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001453Configure the RHEL 8 OpenSSL library to use only DoD-approved TLS encryption by editing the following line in the "/etc/crypto-policies/back-ends/opensslcnf.config" file: +- +-MinProtocol = TLSv1.2 +- +-A reboot is required for the changes to take effect.Verify the OpenSSL library is configured to use only DoD-approved TLS encryption: +- +-$ sudo grep -i MinProtocol /etc/crypto-policies/back-ends/opensslcnf.config +- +-MinProtocol = TLSv1.2 +- +-If the "MinProtocol" is set to anything older than "TLSv1.2", this is a finding.SRG-OS-000250-GPOS-00093<GroupDescription></GroupDescription>RHEL-08-010295The RHEL 8 operating system must implement DoD-approved TLS encryption in the GnuTLS package.<VulnDiscussion>Without cryptographic integrity protections, information can be altered by unauthorized users without detection. ++If the system-wide crypto policy is set to anything other than "FIPS", this is a finding.SRG-OS-000250-GPOS-00093<GroupDescription></GroupDescription>RHEL-08-010294The RHEL 8 operating system must implement DoD-approved TLS encryption in the OpenSSL package.<VulnDiscussion>Without cryptographic integrity protections, information can be altered by unauthorized users without detection. ++ ++Remote access (e.g., RDP) is access to DoD nonpublic information systems by an authorized user (or an information system) communicating through an external, non-organization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless. ++ ++Cryptographic mechanisms used for protecting the integrity of information include, for example, signed hash functions using asymmetric cryptography enabling distribution of the public key to verify the hash information while maintaining the confidentiality of the secret key used to generate the hash. ++ ++RHEL 8 incorporates system-wide crypto policies by default. The employed algorithms can be viewed in the /etc/crypto-policies/back-ends/openssl.config file. ++ ++Satisfies: SRG-OS-000250-GPOS-00093, SRG-OS-000393-GPOS-00173, SRG-OS-000394-GPOS-00174, SRG-OS-000125-GPOS-00065</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001453Configure the RHEL 8 OpenSSL library to use only DoD-approved TLS encryption by editing the following line in the "/etc/crypto-policies/back-ends/opensslcnf.config" file: ++ ++For versions prior to crypto-policies-20210617-1.gitc776d3e.el8.noarch: ++MinProtocol = TLSv1.2 ++ ++For version crypto-policies-20210617-1.gitc776d3e.el8.noarch and newer: ++TLS.MinProtocol = TLSv1.2 ++DTLS.MinProtocol = DTLSv1.2 ++A reboot is required for the changes to take effect.Verify the OpenSSL library is configured to use only DoD-approved TLS encryption: ++ ++For versions prior to crypto-policies-20210617-1.gitc776d3e.el8.noarch: ++ ++$ sudo grep -i MinProtocol /etc/crypto-policies/back-ends/opensslcnf.config ++ ++MinProtocol = TLSv1.2 ++ ++If the "MinProtocol" is set to anything older than "TLSv1.2", this is a finding. ++ ++For version crypto-policies-20210617-1.gitc776d3e.el8.noarch and newer: ++ ++$ sudo grep -i MinProtocol /etc/crypto-policies/back-ends/opensslcnf.config ++ ++TLS.MinProtocol = TLSv1.2 ++DTLS.MinProtocol = DTLSv1.2 ++ ++If the "TLS.MinProtocol" is set to anything older than "TLSv1.2" or the "DTLS.MinProtocol" is set to anything older than DTLSv1.2, this is a finding.SRG-OS-000250-GPOS-00093<GroupDescription></GroupDescription>RHEL-08-010295The RHEL 8 operating system must implement DoD-approved TLS encryption in the GnuTLS package.<VulnDiscussion>Without cryptographic integrity protections, information can be altered by unauthorized users without detection. + + Transport Layer Security (TLS) encryption is a required security setting as a number of known vulnerabilities have been reported against Secure Sockets Layer (SSL) and earlier versions of TLS. Encryption of private information is essential to ensuring data confidentiality. If private information is not encrypted, it can be intercepted and easily read by an unauthorized party. SQL Server must use a minimum of FIPS 140-2-approved TLS version 1.2, and all non-FIPS-approved SSL and TLS versions must be disabled. NIST SP 800-52 specifies the preferred configurations for government systems. + +@@ -1077,23 +1092,23 @@ $ sudo yum list installed openssl-pkcs11 + + openssl-pkcs11.x86_64 0.4.8-2.el8 @anaconda + +-If the "openssl-pkcs11" package is not installed, ask the administrator to indicate what type of multifactor authentication is being utilized and what packages are installed to support it. If there is no evidence of multifactor authentication being used, this is a finding.SRG-OS-000375-GPOS-00160<GroupDescription></GroupDescription>RHEL-08-010400RHEL 8 must implement certificate status checking for multifactor authentication.<VulnDiscussion>Using an authentication device, such as a DoD Common Access Card (CAC) or token that is separate from the information system, ensures that even if the information system is compromised, credentials stored on the authentication device will not be affected. ++If the "openssl-pkcs11" package is not installed, ask the administrator to indicate what type of multifactor authentication is being utilized and what packages are installed to support it. If there is no evidence of multifactor authentication being used, this is a finding.SRG-OS-000375-GPOS-00160<GroupDescription></GroupDescription>RHEL-08-010400RHEL 8 must implement certificate status checking for multifactor authentication.<VulnDiscussion>Using an authentication device, such as a DoD Common Access Card (CAC) or token that is separate from the information system, ensures that even if the information system is compromised, credentials stored on the authentication device will not be affected. + + Multifactor solutions that require devices separate from information systems gaining access include, for example, hardware tokens providing time-based or challenge-response authenticators and smart cards such as the U.S. Government Personal Identity Verification (PIV) card and the DoD CAC. + + RHEL 8 includes multiple options for configuring certificate status checking, but for this requirement focuses on the System Security Services Daemon (SSSD). By default, sssd performs Online Certificate Status Protocol (OCSP) checking and certificate verification using a sha256 digest function. + +-Satisfies: SRG-OS-000375-GPOS-00160, SRG-OS-000377-GPOS-00162</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001948Configure the operating system to implement certificate status checking for multifactor authentication. ++Satisfies: SRG-OS-000375-GPOS-00160, SRG-OS-000377-GPOS-00162</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001948Configure the operating system to implement certificate status checking for multifactor authentication. + + Review the "/etc/sssd/sssd.conf" file to determine if the system is configured to prevent OCSP or certificate verification. + +-Add the following line to the "/etc/sssd/sssd.conf" file: ++Add the following line to the [sssd] section of the "/etc/sssd/sssd.conf" file: + + certificate_verification = ocsp_dgst=sha1 + + The "sssd" service must be restarted for the changes to take effect. To restart the "sssd" service, run the following command: + +-$ sudo systemctl restart sssd.serviceVerify the operating system implements certificate status checking for multifactor authentication. ++$ sudo systemctl restart sssd.serviceVerify the operating system implements certificate status checking for multifactor authentication. + + Check to see if Online Certificate Status Protocol (OCSP) is enabled and using the proper digest value on the system with the following command: + +@@ -1455,23 +1470,7 @@ $ sudo grep -i PermitRootLogin /etc/ssh/sshd_config + + PermitRootLogin no + +-If the "PermitRootLogin" keyword is set to "yes", is missing, or is commented out, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-010560The auditd service must be running in RHEL 8.<VulnDiscussion>Configuring RHEL 8 to implement organization-wide security implementation guides and security checklists ensures compliance with federal standards and establishes a common security baseline across the DoD that reflects the most restrictive security posture consistent with operational requirements. +- +-Configuration settings are the set of parameters that can be changed in hardware, software, or firmware components of the system that affect the security posture and/or functionality of the system. Security-related parameters are those parameters impacting the security state of the system, including the parameters required to satisfy other security control requirements. Security-related parameters include, for example: registry settings; account, file, directory permission settings; and settings for functions, ports, protocols, services, and remote connections.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Start the auditd service, and enable the auditd service with the following commands: +- +-$ sudo systemctl start auditd.service +- +-$ sudo systemctl enable auditd.serviceVerify the audit service is enabled and active with the following commands: +- +-$ sudo systemctl is-enabled auditd +- +-enabled +- +-$ sudo systemctl is-active auditd +- +-active +- +-If the service is not "enabled" and "active" this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-010561The rsyslog service must be running in RHEL 8.<VulnDiscussion>Configuring RHEL 8 to implement organization-wide security implementation guides and security checklists ensures compliance with federal standards and establishes a common security baseline across the DoD that reflects the most restrictive security posture consistent with operational requirements. ++If the "PermitRootLogin" keyword is set to "yes", is missing, or is commented out, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-010561The rsyslog service must be running in RHEL 8.<VulnDiscussion>Configuring RHEL 8 to implement organization-wide security implementation guides and security checklists ensures compliance with federal standards and establishes a common security baseline across the DoD that reflects the most restrictive security posture consistent with operational requirements. + + Configuration settings are the set of parameters that can be changed in hardware, software, or firmware components of the system that affect the security posture and/or functionality of the system. Security-related parameters are those parameters impacting the security state of the system, including the parameters required to satisfy other security control requirements. Security-related parameters include, for example: registry settings; account, file, directory permission settings; and settings for functions, ports, protocols, services, and remote connections.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Start the auditd service, and enable the rsyslog service with the following commands: + +@@ -2361,23 +2360,41 @@ $ sudo grep -i lock-command /etc/tmux.conf + + set -g lock-command vlock + +-If the "lock-command" is not set in the global settings to call "vlock", this is a finding.SRG-OS-000028-GPOS-00009<GroupDescription></GroupDescription>RHEL-08-020041RHEL 8 must ensure session control is automatically started at shell initialization.<VulnDiscussion>A session lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not want to log out because of the temporary nature of the absence. +- +-The session lock is implemented at the point where session activity can be determined. Rather than be forced to wait for a period of time to expire before the user session can be locked, RHEL 8 needs to provide users with the ability to manually invoke a session lock so users can secure their session if it is necessary to temporarily vacate the immediate physical vicinity. +- +-Tmux is a terminal multiplexer that enables a number of terminals to be created, accessed, and controlled from a single screen. Red Hat endorses tmux as the recommended session controlling package. +- +-Satisfies: SRG-OS-000028-GPOS-00009, SRG-OS-000030-GPOS-00011</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000056Configure the operating system to initialize the tmux terminal multiplexer as each shell is called by adding the following line to the end of the "/etc/bashrc" configuration file: +- +-[ -n "$PS1" -a -z "$TMUX" ] && exec tmux +- +-This setting will take effect at next logon.Verify the operating system shell initialization file is configured to start each shell with the tmux terminal multiplexer with the following command: +- +-$ sudo grep -i tmux /etc/bashrc ++If the "lock-command" is not set in the global settings to call "vlock", this is a finding.SRG-OS-000028-GPOS-00009<GroupDescription></GroupDescription>RHEL-08-020041RHEL 8 must ensure session control is automatically started at shell initialization.<VulnDiscussion>A session lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not want to log out because of the temporary nature of the absence. ++ ++The session lock is implemented at the point where session activity can be determined. Rather than be forced to wait for a period of time to expire before the user session can be locked, RHEL 8 needs to provide users with the ability to manually invoke a session lock so users can secure their session if it is necessary to temporarily vacate the immediate physical vicinity. ++ ++Tmux is a terminal multiplexer that enables a number of terminals to be created, accessed, and controlled from a single screen. Red Hat endorses tmux as the recommended session controlling package. ++ ++Satisfies: SRG-OS-000028-GPOS-00009, SRG-OS-000030-GPOS-00011</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000056Configure the operating system to initialize the tmux terminal multiplexer as each shell is called by adding the following lines to a custom.sh shell script in the /etc/profile.d/ directory: + +-[ -n "$PS1" -a -z "$TMUX" ] && exec tmux ++If [ "$PS1" ]; then ++parent=$(ps -o ppid= -p $$) ++name=$(ps -o comm= -p $parent) ++case "$name" in (sshd|login) exec tmux ;; esac ++fi + +-If "tmux" is not configured as the example above, is commented out, or missing from the "/etc/bashrc" initialization file, this is a finding.SRG-OS-000028-GPOS-00009<GroupDescription></GroupDescription>RHEL-08-020042RHEL 8 must prevent users from disabling session control mechanisms.<VulnDiscussion>A session lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not want to log out because of the temporary nature of the absence. ++This setting will take effect at next logon.Verify the operating system shell initialization file is configured to start each shell with the tmux terminal multiplexer with the following commands: ++ ++Determine if tmux is currently running: ++$ sudo ps all | grep tmux | grep -v grep ++ ++If the command does not produce output, this is a finding. ++ ++Determine the location of the tmux script: ++$ sudo grep tmux /etc/bashrc/etc/profile.d/* ++ ++/etc/profile.d/tmux.sh: case "$name" in (sshd|login) exec tmux ;; esac ++ ++Review the tmux script by using the following example: ++$ sudo cat /etc/profile.d/tmux.sh ++If [ "$PS1" ]; then ++parent=$(ps -o ppid= -p $$) ++name=$(ps -o comm= -p $parent) ++case "$name" in (sshd|login) exec tmux ;; esac ++fi ++ ++If "tmux" is not configured as the example above, is commented out, or is missing, this is a finding.SRG-OS-000028-GPOS-00009<GroupDescription></GroupDescription>RHEL-08-020042RHEL 8 must prevent users from disabling session control mechanisms.<VulnDiscussion>A session lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not want to log out because of the temporary nature of the absence. + + The session lock is implemented at the point where session activity can be determined. Rather than be forced to wait for a period of time to expire before the user session can be locked, RHEL 8 needs to provide users with the ability to manually invoke a session lock so users can secure their session if it is necessary to temporarily vacate the immediate physical vicinity. + +@@ -2520,31 +2537,23 @@ matchrule =<SAN>.*EDIPI@mil + maprule = (userCertificate;binary={cert!bin}) + domains = testing.test + +-If the certmap section does not exist, ask the System Administrator to indicate how certificates are mapped to accounts. If there is no evidence of certificate mapping, this is a finding.SRG-OS-000069-GPOS-00037<GroupDescription></GroupDescription>RHEL-08-020100RHEL 8 must ensure a password complexity module is enabled.<VulnDiscussion>Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. "pwquality" enforces complex password construction configuration and has the ability to limit brute-force attacks on the system. +- +-RHEL 8 utilizes "pwquality" as a mechanism to enforce password complexity. This is set in both: +-/etc/pam.d/password-auth +-/etc/pam.d/system-auth +- +-Note the value of "retry" set in these configuration files should be between "1" and "3". Manual changes to the listed files may be overwritten by the "authselect" program.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000192Configure the operating system to use "pwquality" to enforce password complexity rules. ++If the certmap section does not exist, ask the System Administrator to indicate how certificates are mapped to accounts. If there is no evidence of certificate mapping, this is a finding.SRG-OS-000069-GPOS-00037<GroupDescription></GroupDescription>RHEL-08-020100RHEL 8 must ensure the password complexity module is enabled in the password-auth file.<VulnDiscussion>Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. "pwquality" enforces complex password construction configuration and has the ability to limit brute-force attacks on the system. ++ ++RHEL 8 utilizes "pwquality" as a mechanism to enforce password complexity. This is set in both: ++/etc/pam.d/password-auth ++/etc/pam.d/system-auth</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure the operating system to use "pwquality" to enforce password complexity rules. + +-Add the following line to both "/etc/pam.d/password-auth" and "/etc/pam.d/system-auth" (or modify the line to have the required value): ++Add the following line to the "/etc/pam.d/password-auth" file (or modify the line to have the required value): + +-password required pam_pwquality.so retry=3Verify the operating system uses "pwquality" to enforce the password complexity rules. ++password required pam_pwquality.soVerify the operating system uses "pwquality" to enforce the password complexity rules. + +-Check for the use of "pwquality" with the following commands: ++Check for the use of "pwquality" in the password-auth file with the following command: + + $ sudo cat /etc/pam.d/password-auth | grep pam_pwquality + +-password required pam_pwquality.so retry=3 +- +-$ sudo cat /etc/pam.d/system-auth | grep pam_pwquality ++password required pam_pwquality.so + +-password required pam_pwquality.so retry=3 +- +-If both commands do not return a line containing the value "pam_pwquality.so", or the line is commented out, this is a finding. +- +-If the value of "retry" is set to "0" or greater than "3", this is a finding.SRG-OS-000069-GPOS-00037<GroupDescription></GroupDescription>RHEL-08-020110RHEL 8 must enforce password complexity by requiring that at least one uppercase character be used.<VulnDiscussion>Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. ++If the command does not return a line containing the value "pam_pwquality.so", or the line is commented out, this is a finding.SRG-OS-000069-GPOS-00037<GroupDescription></GroupDescription>RHEL-08-020110RHEL 8 must enforce password complexity by requiring that at least one uppercase character be used.<VulnDiscussion>Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. + + Password complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised. + +@@ -2586,7 +2595,7 @@ $ sudo grep dcredit /etc/security/pwquality.conf + + dcredit = -1 + +-If the value of "dcredit" is a positive number or is commented out, this is a finding.SRG-OS-000072-GPOS-00040<GroupDescription></GroupDescription>RHEL-08-020140RHEL 8 must require the maximum number of repeating characters of the same character class be limited to four when passwords are changed.<VulnDiscussion>Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. ++If the value of "dcredit" is a positive number or is commented out, this is a finding.SRG-OS-000072-GPOS-00040<GroupDescription></GroupDescription>RHEL-08-020140RHEL 8 must require the maximum number of repeating characters of the same character class be limited to four when passwords are changed.<VulnDiscussion>Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. + + Password complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised. + +@@ -2594,13 +2603,13 @@ RHEL 8 utilizes "pwquality" as a mechanism to enforce password complexity. The " + + Add the following line to "/etc/security/pwquality.conf" conf (or modify the line to have the required value): + +-maxclassrepeat = 4Check for the value of the "maxclassrepeat" option in "/etc/security/pwquality.conf" with the following command: ++maxclassrepeat = 4Check for the value of the "maxclassrepeat" option in "/etc/security/pwquality.conf" with the following command: + + $ sudo grep maxclassrepeat /etc/security/pwquality.conf + + maxclassrepeat = 4 + +-If the value of "maxclassrepeat" is set to more than "4" or is commented out, this is a finding.SRG-OS-000072-GPOS-00040<GroupDescription></GroupDescription>RHEL-08-020150RHEL 8 must require the maximum number of repeating characters be limited to three when passwords are changed.<VulnDiscussion>Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. ++If the value of "maxclassrepeat" is set to "0", more than "4" or is commented out, this is a finding.SRG-OS-000072-GPOS-00040<GroupDescription></GroupDescription>RHEL-08-020150RHEL 8 must require the maximum number of repeating characters be limited to three when passwords are changed.<VulnDiscussion>Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. + + Password complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised. + +@@ -2675,21 +2684,21 @@ $ sudo awk -F: '$5 > 60 {print $1 " " $5}' /etc/shadow + + $ sudo awk -F: '$5 <= 0 {print $1 " " $5}' /etc/shadow + +-If any results are returned that are not associated with a system account, this is a finding.SRG-OS-000077-GPOS-00045<GroupDescription></GroupDescription>RHEL-08-020220RHEL 8 passwords must be prohibited from reuse for a minimum of five generations.<VulnDiscussion>Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. If the information system or application allows the user to reuse their password consecutively when that password has exceeded its defined lifetime, the end result is a password that is not changed per policy requirements. +- +-RHEL 8 utilizes "pwquality" consecutively as a mechanism to enforce password complexity. This is set in both: +-/etc/pam.d/password-auth +-/etc/pam.d/system-auth. +- +-Note that manual changes to the listed files may be overwritten by the "authselect" program.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000200Configure the operating system to prohibit password reuse for a minimum of five generations. ++If any results are returned that are not associated with a system account, this is a finding.SRG-OS-000077-GPOS-00045<GroupDescription></GroupDescription>RHEL-08-020220RHEL 8 must be configured in the password-auth file to prohibit password reuse for a minimum of five generations.<VulnDiscussion>Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. If the information system or application allows the user to reuse their password consecutively when that password has exceeded its defined lifetime, the end result is a password that is not changed per policy requirements. ++ ++RHEL 8 uses "pwhistory" consecutively as a mechanism to prohibit password reuse. This is set in both: ++/etc/pam.d/password-auth ++/etc/pam.d/system-auth. ++ ++Note that manual changes to the listed files may be overwritten by the "authselect" program.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000200Configure the operating system in the password-auth file to prohibit password reuse for a minimum of five generations. + +-Add the following line in "/etc/pam.d/system-auth" and "/etc/pam.d/password-auth" (or modify the line to have the required value): ++Add the following line in "/etc/pam.d/password-auth" (or modify the line to have the required value): + +-password required pam_pwhistory.so use_authtok remember=5 retry=3Verify the operating system prohibits password reuse for a minimum of five generations. ++password required pam_pwhistory.so use_authtok remember=5 retry=3Verify the operating system is configured in the password-auth file to prohibit password reuse for a minimum of five generations. + +-Check for the value of the "remember" argument in "/etc/pam.d/system-auth" and "/etc/pam.d/password-auth" with the following command: ++Check for the value of the "remember" argument in "/etc/pam.d/password-auth" with the following command: + +-$ sudo grep -i remember /etc/pam.d/system-auth /etc/pam.d/password-auth ++$ sudo grep -i remember /etc/pam.d/password-auth + + password required pam_pwhistory.so use_authtok remember=5 retry=3 + +@@ -3065,23 +3074,7 @@ $ sudo grep disk_error_action /etc/audit/auditd.conf + + disk_error_action = HALT + +-If the value of the "disk_error_action" option is not "SYSLOG", "SINGLE", or "HALT", or the line is commented out, ask the system administrator to indicate how the system takes appropriate action when an audit process failure occurs. If there is no evidence of appropriate action, this is a finding.SRG-OS-000047-GPOS-00023<GroupDescription></GroupDescription>RHEL-08-030050The RHEL 8 System Administrator (SA) and Information System Security Officer (ISSO) (at a minimum) must be alerted when the audit storage volume is full.<VulnDiscussion>It is critical that when RHEL 8 is at risk of failing to process audit logs as required, it takes action to mitigate the failure. Audit processing failures include software/hardware errors; failures in the audit capturing mechanisms; and audit storage capacity being reached or exceeded. Responses to audit failure depend upon the nature of the failure mode. +- +-When availability is an overriding concern, other approved actions in response to an audit failure are as follows: +- +-1) If the failure was caused by the lack of audit record storage capacity, RHEL 8 must continue generating audit records if possible (automatically restarting the audit service if necessary) and overwriting the oldest audit records in a first-in-first-out manner. +- +-2) If audit records are sent to a centralized collection server and communication with this server is lost or the server fails, RHEL 8 must queue audit records locally until communication is restored or until the audit records are retrieved manually. Upon restoration of the connection to the centralized collection server, action should be taken to synchronize the local audit data with the collection server.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000140Configure RHEL 8 to notify the System Administrator (SA) and Information System Security Officer (ISSO) when the audit storage volume is full by configuring the "max_log_file_action" parameter in the "/etc/audit/auditd.conf" file with the a value of "syslog" or "keep_logs": +- +-max_log_file_action = syslogVerify that the SA and ISSO (at a minimum) are notified when the audit storage volume is full. +- +-Check which action RHEL 8 takes when the audit storage volume is full with the following command: +- +-$ sudo grep max_log_file_action /etc/audit/auditd.conf +- +-max_log_file_action=syslog +- +-If the value of the "max_log_file_action" option is set to "ignore", "rotate", or "suspend", or the line is commented out, ask the system administrator to indicate how the system takes appropriate action when an audit storage volume is full. If there is no evidence of appropriate action, this is a finding.SRG-OS-000047-GPOS-00023<GroupDescription></GroupDescription>RHEL-08-030060The RHEL 8 audit system must take appropriate action when the audit storage volume is full.<VulnDiscussion>It is critical that when RHEL 8 is at risk of failing to process audit logs as required, it takes action to mitigate the failure. Audit processing failures include software/hardware errors; failures in the audit capturing mechanisms; and audit storage capacity being reached or exceeded. Responses to audit failure depend upon the nature of the failure mode. ++If the value of the "disk_error_action" option is not "SYSLOG", "SINGLE", or "HALT", or the line is commented out, ask the system administrator to indicate how the system takes appropriate action when an audit process failure occurs. If there is no evidence of appropriate action, this is a finding.SRG-OS-000047-GPOS-00023<GroupDescription></GroupDescription>RHEL-08-030060The RHEL 8 audit system must take appropriate action when the audit storage volume is full.<VulnDiscussion>It is critical that when RHEL 8 is at risk of failing to process audit logs as required, it takes action to mitigate the failure. Audit processing failures include software/hardware errors; failures in the audit capturing mechanisms; and audit storage capacity being reached or exceeded. Responses to audit failure depend upon the nature of the failure mode. + + When availability is an overriding concern, other approved actions in response to an audit failure are as follows: + +@@ -3453,127 +3446,40 @@ $ sudo grep -w /usr/bin/su /etc/audit/audit.rules + + -a always,exit -F path=/usr/bin/su -F perm=x -F auid>=1000 -F auid!=unset -k privileged-priv_change + +-If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030200The RHEL 8 audit system must be configured to audit any usage of the lremovexattr system call.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). "Lremovexattr" is a system call that removes extended attributes. This is used for removal of extended attributes from symbolic links. +- +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. +- +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000458-GPOS-00203, SRG-OS-000462-GPOS-00206, SRG-OS-000463-GPOS-00207, SRG-OS-000468-GPOS-00212, SRG-OS-000471-GPOS-00215, SRG-OS-000474-GPOS-00219, SRG-OS-000466-GPOS-00210</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure RHEL 8 to audit the execution of the "lremovexattr" system call, by adding or updating the following lines to "/etc/audit/rules.d/audit.rules": +- +--a always,exit -F arch=b32 -S lremovexattr -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S lremovexattr -F auid>=1000 -F auid!=unset -k perm_mod +- +--a always,exit -F arch=b32 -S lremovexattr -F auid=0 -k perm_mod +--a always,exit -F arch=b64 -S lremovexattr -F auid=0 -k perm_mod +- +-The audit daemon must be restarted for the changes to take effect.Verify if RHEL 8 is configured to audit the execution of the "lremovexattr" system call, by running the following command: +- +-$ sudo grep -w lremovexattr /etc/audit/audit.rules +- +--a always,exit -F arch=b32 -S lremovexattr -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S lremovexattr -F auid>=1000 -F auid!=unset -k perm_mod +- +--a always,exit -F arch=b32 -S lremovexattr -F auid=0 -k perm_mod +--a always,exit -F arch=b64 -S lremovexattr -F auid=0 -k perm_mod +- +-If the command does not return all lines, or the lines are commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030210The RHEL 8 audit system must be configured to audit any usage of the removexattr system call.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). "Removexattr" is a system call that removes extended attributes. +- +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. +- +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000458-GPOS-00203, SRG-OS-000462-GPOS-00206, SRG-OS-000463-GPOS-00207, SRG-OS-000468-GPOS-00212, SRG-OS-000471-GPOS-00215, SRG-OS-000474-GPOS-00219, SRG-OS-000466-GPOS-00210</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure RHEL 8 to audit the execution of the "removexattr" system call, by adding or updating the following lines to "/etc/audit/rules.d/audit.rules": +- +--a always,exit -F arch=b32 -S removexattr -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S removexattr -F auid>=1000 -F auid!=unset -k perm_mod +- +--a always,exit -F arch=b32 -S removexattr -F auid=0 -k perm_mod +--a always,exit -F arch=b64 -S removexattr -F auid=0 -k perm_mod +- +-The audit daemon must be restarted for the changes to take effect.Verify if RHEL 8 is configured to audit the execution of the "removexattr" system call, by running the following command: +- +-$ sudo grep -w removexattr /etc/audit/audit.rules +- +--a always,exit -F arch=b32 -S removexattr -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S removexattr -F auid>=1000 -F auid!=unset -k perm_mod +- +--a always,exit -F arch=b32 -S removexattr -F auid=0 -k perm_mod +--a always,exit -F arch=b64 -S removexattr -F auid=0 -k perm_mod +- +-If the command does not return all lines, or the lines are commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030220The RHEL 8 audit system must be configured to audit any usage of the lsetxattr system call.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). "Lsetxattr" is a system call used to set an extended attribute value. This is used to set extended attributes on a symbolic link. +- +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. +- +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000458-GPOS-00203, SRG-OS-000462-GPOS-00206, SRG-OS-000463-GPOS-00207, SRG-OS-000468-GPOS-00212, SRG-OS-000471-GPOS-00215, SRG-OS-000474-GPOS-00219</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure RHEL 8 to audit the execution of the "lsetxattr" system call, by adding or updating the following lines to "/etc/audit/rules.d/audit.rules": +- +--a always,exit -F arch=b32 -S lsetxattr -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S lsetxattr -F auid>=1000 -F auid!=unset -k perm_mod +- +--a always,exit -F arch=b32 -S lsetxattr -F auid=0 -k perm_mod +--a always,exit -F arch=b64 -S lsetxattr -F auid=0 -k perm_mod +- +-The audit daemon must be restarted for the changes to take effect.Verify if RHEL 8 is configured to audit the execution of the "lsetxattr" system call, by running the following command: +- +-$ sudo grep -w lsetxattr /etc/audit/audit.rules +- +--a always,exit -F arch=b32 -S lsetxattr -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S lsetxattr -F auid>=1000 -F auid!=unset -k perm_mod +- +--a always,exit -F arch=b32 -S lsetxattr -F auid=0 -k perm_mod +--a always,exit -F arch=b64 -S lsetxattr -F auid=0 -k perm_mod +- +-If the command does not return all lines, or the lines are commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030230The RHEL 8 audit system must be configured to audit any usage of the fsetxattr system call.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). "Fsetxattr" is a system call used to set an extended attribute value. This is used to set extended attributes on a file. +- +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The auid representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. +- +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000458-GPOS-00203, SRG-OS-000462-GPOS-00206, SRG-OS-000463-GPOS-00207, SRG-OS-000468-GPOS-00212, SRG-OS-000471-GPOS-00215, SRG-OS-000474-GPOS-00219</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure RHEL 8 to audit the execution of the "fsetxattr" system call, by adding or updating the following lines to "/etc/audit/rules.d/audit.rules": +- +--a always,exit -F arch=b32 -S fsetxattr -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S fsetxattr -F auid>=1000 -F auid!=unset -k perm_mod +- +--a always,exit -F arch=b32 -S fsetxattr -F auid=0 -k perm_mod +--a always,exit -F arch=b64 -S fsetxattr -F auid=0 -k perm_mod +- +-The audit daemon must be restarted for the changes to take effect.Verify if RHEL 8 is configured to audit the execution of the "fsetxattr" system call, by running the following command: +- +-$ sudo grep -w fsetxattr /etc/audit/audit.rules +- +--a always,exit -F arch=b32 -S fsetxattr -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S fsetxattr -F auid>=1000 -F auid!=unset -k perm_mod +- +--a always,exit -F arch=b32 -S fsetxattr -F auid=0 -k perm_mod +--a always,exit -F arch=b64 -S fsetxattr -F auid=0 -k perm_mod +- +-If the command does not return all lines, or the lines are commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030240The RHEL 8 audit system must be configured to audit any usage of the fremovexattr system call.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). "Fremovexattr" is a system call that removes extended attributes. This is used for removal of extended attributes from a file. +- +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. +- +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000458-GPOS-00203, SRG-OS-000462-GPOS-00206, SRG-OS-000463-GPOS-00207, SRG-OS-000471-GPOS-00215, SRG-OS-000474-GPOS-00219, SRG-OS-000466-GPOS-00210</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure RHEL 8 to audit the execution of the "fremovexattr" system call by adding or updating the following lines to "/etc/audit/rules.d/audit.rules": ++If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030200The RHEL 8 audit system must be configured to audit any usage of the setxattr, fsetxattr, lsetxattr, removexattr, fremovexattr, and lremovexattr system calls.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. ++ ++Audit records can be generated from various components within the information system (e.g., module or policy filter). ++ ++"Setxattr" is a system call used to set an extended attribute value. ++"Fsetxattr" is a system call used to set an extended attribute value. This is used to set extended attributes on a file. ++"Lsetxattr" is a system call used to set an extended attribute value. This is used to set extended attributes on a symbolic link. ++"Removexattr" is a system call that removes extended attributes. ++"Fremovexattr" is a system call that removes extended attributes. This is used for removal of extended attributes from a file. ++"Lremovexattr" is a system call that removes extended attributes. This is used for removal of extended attributes from symbolic links. ++ ++When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. ++ ++The system call rules are loaded into a matching engine that intercepts each syscall made by all programs on the system. Therefore, it is very important to use syscall rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining syscalls into one rule whenever possible. ++ ++Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000392-GPOS-00172, SRG-OS-000458-GPOS-00203, SRG-OS-000462-GPOS-00206, SRG-OS-000463-GPOS-00207, SRG-OS-000468-GPOS-00212, SRG-OS-000471-GPOS-00215, SRG-OS-000474-GPOS-00219, SRG-OS-000466-GPOS-00210</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure RHEL 8 to audit the execution of the "setxattr", "fsetxattr", "lsetxattr", "removexattr", "fremovexattr", and "lremovexattr" system calls by adding or updating the following lines to "/etc/audit/rules.d/audit.rules": + +--a always,exit -F arch=b32 -S fremovexattr -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S fremovexattr -F auid>=1000 -F auid!=unset -k perm_mod ++-a always,exit -F arch=b32 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!=unset -k perm_mod ++-a always,exit -F arch=b64 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!=unset -k perm_mod + +--a always,exit -F arch=b32 -S fremovexattr -F auid=0 -k perm_mod +--a always,exit -F arch=b64 -S fremovexattr -F auid=0 -k perm_mod ++-a always,exit -F arch=b32 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod ++-a always,exit -F arch=b64 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod + +-The audit daemon must be restarted for the changes to take effect.Verify if RHEL 8 is configured to audit the execution of the "fremovexattr" system call, by running the following command: ++The audit daemon must be restarted for the changes to take effect.Verify if RHEL 8 is configured to audit the execution of the "setxattr", "fsetxattr", "lsetxattr", "removexattr", "fremovexattr", and "lremovexattr" system calls by running the following command: + +-$ sudo grep -w fremovexattr /etc/audit/audit.rules ++$ sudo grep xattr /etc/audit/audit.rules + +--a always,exit -F arch=b32 -S fremovexattr -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S fremovexattr -F auid>=1000 -F auid!=unset -k perm_mod ++-a always,exit -F arch=b32 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!=unset -k perm_mod ++-a always,exit -F arch=b64 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!=unset -k perm_mod + +--a always,exit -F arch=b32 -S fremovexattr -F auid=0 -k perm_mod +--a always,exit -F arch=b64 -S fremovexattr -F auid=0 -k perm_mod ++-a always,exit -F arch=b32 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod ++-a always,exit -F arch=b64 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod + +-If the command does not return all lines, or the lines are commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030250Successful/unsuccessful uses of the chage command in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. ++If the command does not return an audit rule for "setxattr", "fsetxattr", "lsetxattr", "removexattr", "fremovexattr", and "lremovexattr" or any of the lines returned are commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030250Successful/unsuccessful uses of the chage command in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. + + Audit records can be generated from various components within the information system (e.g., module or policy filter). The "chage" command is used to change or view user password expiry information. + +@@ -3605,31 +3511,7 @@ $ sudo grep -w chcon /etc/audit/audit.rules + + -a always,exit -F path=/usr/bin/chcon -F perm=x -F auid>=1000 -F auid!=unset -k perm_mod + +-If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030270The RHEL 8 audit system must be configured to audit any usage of the setxattr system call.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). "Setxattr" is a system call used to set an extended attribute value. +- +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. +- +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure RHEL 8 to audit the execution of the "setxattr" system call, by adding or updating the following lines to "/etc/audit/rules.d/audit.rules": +- +--a always,exit -F arch=b32 -S setxattr -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S setxattr -F auid>=1000 -F auid!=unset -k perm_mod +- +--a always,exit -F arch=b32 -S setxattr -F auid=0 -k perm_mod +--a always,exit -F arch=b64 -S setxattr -F auid=0 -k perm_mod +- +-The audit daemon must be restarted for the changes to take effect.Verify if RHEL 8 is configured to audit the execution of the "setxattr" system call, by running the following command: +- +-$ sudo grep -w setxattr /etc/audit/audit.rules +- +--a always,exit -F arch=b32 -S setxattr -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S setxattr -F auid>=1000 -F auid!=unset -k perm_mod +- +--a always,exit -F arch=b32 -S setxattr -F auid=0 -k perm_mod +--a always,exit -F arch=b64 -S setxattr -F auid=0 -k perm_mod +- +-If the command does not return all lines, or the lines are commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030280Successful/unsuccessful uses of the ssh-agent in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. ++If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030280Successful/unsuccessful uses of the ssh-agent in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. + + Audit records can be generated from various components within the information system (e.g., module or policy filter). The "ssh-agent" is a program to hold private keys used for public key authentication. + +@@ -3903,115 +3785,52 @@ $ sudo grep -w newgrp /etc/audit/audit.rules + + -a always,exit -F path=/usr/bin/newgrp -F perm=x -F auid>=1000 -F auid!=unset -k priv_cmd + +-If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030360Successful/unsuccessful uses of the init_module command in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). The "init_module" command is used to load a kernel module. +- +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. +- +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure the audit system to generate an audit event for any successful/unsuccessful use of the "init_module" command by adding or updating the following rules in the "/etc/audit/rules.d/audit.rules" file: +- +--a always,exit -F arch=b32 -S init_module -F auid>=1000 -F auid!=unset -k module_chng +--a always,exit -F arch=b64 -S init_module -F auid>=1000 -F auid!=unset -k module_chng +- +-The audit daemon must be restarted for the changes to take effect.Verify RHEL 8 generates an audit record when successful/unsuccessful attempts to use the "init_module" command by performing the following command to check the file system rules in "/etc/audit/audit.rules": +- +-$ sudo grep -w "init_module" /etc/audit/audit.rules +- +--a always,exit -F arch=b32 -S init_module -F auid>=1000 -F auid!=unset -k module_chng +--a always,exit -F arch=b64 -S init_module -F auid>=1000 -F auid!=unset -k module_chng +- +-If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030361Successful/unsuccessful uses of the rename command in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). The "rename" command will rename the specified files by replacing the first occurrence of expression in their name by replacement. +- +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. +- +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure the audit system to generate an audit event for any successful/unsuccessful use of the "rename" command by adding or updating the following rules in the "/etc/audit/rules.d/audit.rules" file: +- +--a always,exit -F arch=b32 -S rename -F auid>=1000 -F auid!=unset -k delete +--a always,exit -F arch=b64 -S rename -F auid>=1000 -F auid!=unset -k delete +- +-The audit daemon must be restarted for the changes to take effect.Verify RHEL 8 generates an audit record when successful/unsuccessful attempts to use the "rename" command by performing the following command to check the file system rules in "/etc/audit/audit.rules": +- +-$ sudo grep -w "rename" /etc/audit/audit.rules +- +--a always,exit -F arch=b32 -S rename -F auid>=1000 -F auid!=unset -k delete +--a always,exit -F arch=b64 -S rename -F auid>=1000 -F auid!=unset -k delete +- +-If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030362Successful/unsuccessful uses of the renameat command in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). The "renameat" command renames a file, moving it between directories if required. +- +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. +- +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure the audit system to generate an audit event for any successful/unsuccessful use of the "renameat" command by adding or updating the following rules in the "/etc/audit/rules.d/audit.rules" file: +- +--a always,exit -F arch=b32 -S renameat -F auid>=1000 -F auid!=unset -k delete +--a always,exit -F arch=b64 -S renameat -F auid>=1000 -F auid!=unset -k delete +- +-The audit daemon must be restarted for the changes to take effect.Verify RHEL 8 generates an audit record when successful/unsuccessful attempts to use the "renameat" command by performing the following command to check the file system rules in "/etc/audit/audit.rules": +- +-$ sudo grep -w "renameat" /etc/audit/audit.rules +- +--a always,exit -F arch=b32 -S renameat -F auid>=1000 -F auid!=unset -k delete +--a always,exit -F arch=b64 -S renameat -F auid>=1000 -F auid!=unset -k delete +- +-If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030363Successful/unsuccessful uses of the rmdir command in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). The "rmdir" command removes empty directories. +- +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. +- +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure the audit system to generate an audit event for any successful/unsuccessful use of the "rmdir" command by adding or updating the following rules in the "/etc/audit/rules.d/audit.rules" file: +- +--a always,exit -F arch=b32 -S rmdir -F auid>=1000 -F auid!=unset -k delete +--a always,exit -F arch=b64 -S rmdir -F auid>=1000 -F auid!=unset -k delete +- +-The audit daemon must be restarted for the changes to take effect.Verify RHEL 8 generates an audit record when successful/unsuccessful attempts to use the "rmdir" command by performing the following command to check the file system rules in "/etc/audit/audit.rules": +- +-$ sudo grep -w "rmdir" /etc/audit/audit.rules +- +--a always,exit -F arch=b32 -S rmdir -F auid>=1000 -F auid!=unset -k delete +--a always,exit -F arch=b64 -S rmdir -F auid>=1000 -F auid!=unset -k delete +- +-If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030364Successful/unsuccessful uses of the unlink command in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). The "unlink" command deletes a name from the filesystem. If that name was the last link to a file and no processes have the file open, the file is deleted and the space it was using is made available for reuse. +- +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. +- +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure the audit system to generate an audit event for any successful/unsuccessful use of the "unlink" command by adding or updating the following rules in the "/etc/audit/rules.d/audit.rules" file: +- +--a always,exit -F arch=b32 -S unlink -F auid>=1000 -F auid!=unset -k delete +--a always,exit -F arch=b64 -S unlink -F auid>=1000 -F auid!=unset -k delete +- +-The audit daemon must be restarted for the changes to take effect.Verify RHEL 8 generates an audit record when successful/unsuccessful attempts to use the "unlink" command by performing the following command to check the file system rules in "/etc/audit/audit.rules": +- +-$ sudo grep -w "unlink" /etc/audit/audit.rules +- +--a always,exit -F arch=b32 -S unlink -F auid>=1000 -F auid!=unset -k delete +--a always,exit -F arch=b64 -S unlink -F auid>=1000 -F auid!=unset -k delete +- +-If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030365Successful/unsuccessful uses of the unlinkat command in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). The "unlinkat" system call operates in exactly the same way as either "unlink" or "rmdir" except for the differences described in the manual page. +- +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. +- +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure the audit system to generate an audit event for any successful/unsuccessful use of the "unlinkat" command by adding or updating the following rules in the "/etc/audit/rules.d/audit.rules" file: +- +--a always,exit -F arch=b32 -S unlinkat -F auid>=1000 -F auid!=unset -k delete +--a always,exit -F arch=b64 -S unlinkat -F auid>=1000 -F auid!=unset -k delete +- +-The audit daemon must be restarted for the changes to take effect.Verify RHEL 8 generates an audit record when successful/unsuccessful attempts to use the "unlinkat" command by performing the following command to check the file system rules in "/etc/audit/audit.rules": +- +-$ sudo grep -w "unlinkat" /etc/audit/audit.rules ++If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030360Successful/unsuccessful uses of the init_module and finit_module system calls in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. ++ ++Audit records can be generated from various components within the information system (e.g., module or policy filter). The "init_module" and "finit_module" system calls are used to load a kernel module. ++ ++When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. ++ ++The system call rules are loaded into a matching engine that intercepts each syscall made by all programs on the system. Therefore, it is very important to use syscall rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining syscalls into one rule whenever possible. ++ ++Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure the audit system to generate an audit event for any successful/unsuccessful use of the "init_module" and "finit_module" system calls by adding or updating the following rules in the "/etc/audit/rules.d/audit.rules" file: ++ ++-a always,exit -F arch=b32 -S init_module,finit_module -F auid>=1000 -F auid!=unset -k module_chng ++-a always,exit -F arch=b64 -S init_module,finit_module -F auid>=1000 -F auid!=unset -k module_chng ++ ++The audit daemon must be restarted for the changes to take effect.Verify RHEL 8 generates an audit record upon successful/unsuccessful attempts to use the "init_module" and "finit_module" system calls by using the following command to check the file system rules in "/etc/audit/audit.rules": ++ ++$ sudo grep init_module /etc/audit/audit.rules ++ ++-a always,exit -F arch=b32 -S init_module,finit_module -F auid>=1000 -F auid!=unset -k module_chng ++-a always,exit -F arch=b64 -S init_module,finit_module -F auid>=1000 -F auid!=unset -k module_chng ++ ++If the command does not return an audit rule for "init_module" and "finit_module" or any of the lines returned are commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030361Successful/unsuccessful uses of the rename, unlink, rmdir, renameat, and unlinkat system calls in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. ++ ++Audit records can be generated from various components within the information system (e.g., module or policy filter). The "rename" system call will rename the specified files by replacing the first occurrence of expression in their name by replacement. ++ ++The "unlink" system call deletes a name from the filesystem. If that name was the last link to a file and no processes have the file open, the file is deleted and the space it was using is made available for reuse. ++The "rmdir" system call removes empty directories. ++The "renameat" system call renames a file, moving it between directories if required. ++The "unlinkat" system call operates in exactly the same way as either "unlink" or "rmdir" except for the differences described in the manual page. ++ ++When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. ++ ++The system call rules are loaded into a matching engine that intercepts each syscall made by all programs on the system. Therefore, it is very important to use syscall rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. Performance can be helped, however, by combining syscalls into one rule whenever possible. ++ ++Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure the audit system to generate an audit event for any successful/unsuccessful use of the "rename", "unlink", "rmdir", "renameat", and "unlinkat" system calls by adding or updating the following rules in the "/etc/audit/rules.d/audit.rules" file: + +--a always,exit -F arch=b32 -S unlinkat -F auid>=1000 -F auid!=unset -k delete +--a always,exit -F arch=b64 -S unlinkat -F auid>=1000 -F auid!=unset -k delete ++-a always,exit -F arch=b32 -S rename,unlink,rmdir,renameat,unlinkat -F auid>=1000 -F auid!=unset -k delete ++-a always,exit -F arch=b64 -S rename,unlink,rmdir,renameat,unlinkat -F auid>=1000 -F auid!=unset -k delete + +-If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030370Successful/unsuccessful uses of the gpasswd command in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. ++The audit daemon must be restarted for the changes to take effect.Verify RHEL 8 generates an audit record upon successful/unsuccessful attempts to use the "rename", "unlink", "rmdir", "renameat", and "unlinkat" system calls by using the following command to check the file system rules in "/etc/audit/audit.rules": ++ ++$ sudo grep 'rename\|unlink\|rmdir' /etc/audit/audit.rules ++ ++-a always,exit -F arch=b32 -S rename,unlink,rmdir,renameat,unlinkat -F auid>=1000 -F auid!=unset -k delete ++-a always,exit -F arch=b64 -S rename,unlink,rmdir,renameat,unlinkat -F auid>=1000 -F auid!=unset -k delete ++ ++If the command does not return an audit rule for "rename", "unlink", "rmdir", "renameat", and "unlinkat" or any of the lines returned are commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030370Successful/unsuccessful uses of the gpasswd command in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. + + Audit records can be generated from various components within the information system (e.g., module or policy filter). The "gpasswd" command is used to administer /etc/group and /etc/gshadow. Every group can have administrators, members and a password. + +@@ -4027,24 +3846,6 @@ $ sudo grep -w gpasswd /etc/audit/audit.rules + + -a always,exit -F path=/usr/bin/gpasswd -F perm=x -F auid>=1000 -F auid!=unset -k privileged-gpasswd + +-If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030380Successful/unsuccessful uses of the finit_module command in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). The "finit_module" command is used to load a kernel module. +- +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. +- +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure the audit system to generate an audit event for any successful/unsuccessful use of the "finit_module" command by adding or updating the following rules in the "/etc/audit/rules.d/audit.rules" file: +- +--a always,exit -F arch=b32 -S finit_module -F auid>=1000 -F auid!=unset -k module_chng +--a always,exit -F arch=b64 -S finit_module -F auid>=1000 -F auid!=unset -k module_chng +- +-The audit daemon must be restarted for the changes to take effect.Verify RHEL 8 generates an audit record when successful/unsuccessful attempts to use the "finit_module" command by performing the following command to check the file system rules in "/etc/audit/audit.rules": +- +-$ sudo grep -w "finit_module" /etc/audit/audit.rules +- +--a always,exit -F arch=b32 -S finit_module -F auid>=1000 -F auid!=unset -k module_chng +--a always,exit -F arch=b64 -S finit_module -F auid>=1000 -F auid!=unset -k module_chng +- + If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030390Successful/unsuccessful uses of the delete_module command in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. + + Audit records can be generated from various components within the information system (e.g., module or policy filter). The "delete_module" command is used to unload a kernel module. +@@ -4095,277 +3896,87 @@ $ sudo grep -w chsh /etc/audit/audit.rules + + -a always,exit -F path=/usr/bin/chsh -F perm=x -F auid>=1000 -F auid!=unset -k priv_cmd + +-If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030420Successful/unsuccessful uses of the truncate command in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). The "truncate" and "ftruncate" functions are used to truncate a file to a specified length. +- +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. +- +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000064-GPOS-00033</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure the audit system to generate an audit event for any successful/unsuccessful use of the "truncate" command by adding or updating the following rules in the "/etc/audit/rules.d/audit.rules" file: +- +--a always,exit -F arch=b32 -S truncate -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access +--a always,exit -F arch=b64 -S truncate -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access +- +--a always,exit -F arch=b32 -S truncate -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access +--a always,exit -F arch=b64 -S truncate -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access +- +-The audit daemon must be restarted for the changes to take effect.Verify RHEL 8 generates an audit record when successful/unsuccessful attempts to use the "truncate" command by performing the following command to check the file system rules in "/etc/audit/audit.rules": +- +-$ sudo grep -iw truncate /etc/audit/audit.rules +- +--a always,exit -F arch=b32 -S truncate -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access +--a always,exit -F arch=b64 -S truncate -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access +- +--a always,exit -F arch=b32 -S truncate -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access +--a always,exit -F arch=b64 -S truncate -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access +- +-If the command does not return all lines, or the lines are commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030430Successful/unsuccessful uses of the openat system call in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). The "openat" system call opens a file specified by a relative pathname. +- +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. +- +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000064-GPOS-00033</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure the audit system to generate an audit event for any successful/unsuccessful use of the "openat" command by adding or updating the following rules in the "/etc/audit/rules.d/audit.rules" file: +- +--a always,exit -F arch=b32 -S openat -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access +--a always,exit -F arch=b64 -S openat -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access +- +--a always,exit -F arch=b32 -S openat -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access +--a always,exit -F arch=b64 -S openat -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access +- +-The audit daemon must be restarted for the changes to take effect.Verify RHEL 8 generates an audit record when successful/unsuccessful attempts to use the "openat" command by performing the following command to check the file system rules in "/etc/audit/audit.rules": +- +-$ sudo grep -iw openat /etc/audit/audit.rules +- +--a always,exit -F arch=b32 -S openat -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access +--a always,exit -F arch=b64 -S openat -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access +- +--a always,exit -F arch=b32 -S openat -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access +--a always,exit -F arch=b64 -S openat -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access +- +-If the command does not return all lines, or the lines are commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030440Successful/unsuccessful uses of the open system call in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). The "open system" call opens a file specified by a pathname. If the specified file does not exist, it may optionally be created by "open". +- +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. +- +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000064-GPOS-00033</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure the audit system to generate an audit event for any successful/unsuccessful use of the "open" system call by adding or updating the following rules in the "/etc/audit/rules.d/audit.rules" file: +- +--a always,exit -F arch=b32 -S open -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access +--a always,exit -F arch=b64 -S open -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access +- +--a always,exit -F arch=b32 -S open -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access +--a always,exit -F arch=b64 -S open -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access +- +-The audit daemon must be restarted for the changes to take effect.Verify RHEL 8 generates an audit record when successful/unsuccessful attempts to use the "open" system call by performing the following command to check the file system rules in "/etc/audit/audit.rules": +- +-$ sudo grep -iw open /etc/audit/audit.rules +- +--a always,exit -F arch=b32 -S open -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access +--a always,exit -F arch=b64 -S open -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access +- +--a always,exit -F arch=b32 -S open -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access +--a always,exit -F arch=b64 -S open -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access +- +-If the command does not return all lines, or the lines are commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030450Successful/unsuccessful uses of the open_by_handle_at system call in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). The "name_to_handle_at" and "open_by_handle_at" system calls split the functionality of openat into two parts: "name_to_handle_at" returns an opaque handle that corresponds to a specified file; "open_by_handle_at" opens the file corresponding to a handle returned by a previous call to "name_to_handle_at" and returns an open file descriptor. +- +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. +- +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000064-GPOS-00033</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure the audit system to generate an audit event for any successful/unsuccessful use of the "open_by_handle_at" system call by adding or updating the following rules in the "/etc/audit/rules.d/audit.rules" file: +- +--a always,exit -F arch=b32 -S open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access +--a always,exit -F arch=b64 -S open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access +- +--a always,exit -F arch=b32 -S open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access +--a always,exit -F arch=b64 -S open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access +- +-The audit daemon must be restarted for the changes to take effect.Verify RHEL 8 generates an audit record when successful/unsuccessful attempts to use the "open_by_handle_at" system call by performing the following command to check the file system rules in "/etc/audit/audit.rules": +- +-$ sudo grep -iw open_by_handle_at /etc/audit/audit.rules +- +--a always,exit -F arch=b32 -S open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access +--a always,exit -F arch=b64 -S open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access +- +--a always,exit -F arch=b32 -S open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access +--a always,exit -F arch=b64 -S open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access +- +-If the command does not return all lines, or the lines are commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030460Successful/unsuccessful uses of the ftruncate command in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). The "truncate" and "ftruncate" functions are used to truncate a file to a specified length. +- +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. +- +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000064-GPOS-00033</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure the audit system to generate an audit event for any successful/unsuccessful use of the "ftruncate" command by adding or updating the following rules in the "/etc/audit/rules.d/audit.rules" file: +- +--a always,exit -F arch=b32 -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access +--a always,exit -F arch=b64 -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access +- +--a always,exit -F arch=b32 -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access +--a always,exit -F arch=b64 -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access +- +-The audit daemon must be restarted for the changes to take effect.Verify RHEL 8 generates an audit record when successful/unsuccessful attempts to use the "ftruncate" command by performing the following command to check the file system rules in "/etc/audit/audit.rules": +- +-$ sudo grep -iw ftruncate /etc/audit/audit.rules +- +--a always,exit -F arch=b32 -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access +--a always,exit -F arch=b64 -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access +- +--a always,exit -F arch=b32 -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access +--a always,exit -F arch=b64 -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access +- +-If the command does not return all lines, or the lines are commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030470Successful/unsuccessful uses of the creat system call in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). The "creat" system call is used to open and possibly create a file or device. +- +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. +- +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000064-GPOS-00033</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure the audit system to generate an audit event for any successful/unsuccessful use of the "creat" system call by adding or updating the following rules in the "/etc/audit/rules.d/audit.rules" file: +- +--a always,exit -F arch=b32 -S creat -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access +--a always,exit -F arch=b64 -S creat -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access +- +--a always,exit -F arch=b32 -S creat -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access +--a always,exit -F arch=b64 -S creat -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access +- +-The audit daemon must be restarted for the changes to take effect.Verify RHEL 8 generates an audit record when successful/unsuccessful attempts to use the "creat" system call by performing the following command to check the file system rules in "/etc/audit/audit.rules": +- +-$ sudo grep -iw creat /etc/audit/audit.rules +- +--a always,exit -F arch=b32 -S creat -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access +--a always,exit -F arch=b64 -S creat -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access +- +--a always,exit -F arch=b32 -S creat -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access +--a always,exit -F arch=b64 -S creat -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access +- +-If the command does not return all lines, or the lines are commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030480Successful/unsuccessful uses of the chown command in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). The "chown" command is used to change file owner and group. +- +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. +- +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000064-GPOS-00033, SRG-OS-000466-GPOS-00210</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure the audit system to generate an audit event for any successful/unsuccessful use of the "chown" command by adding or updating the following line to "/etc/audit/rules.d/audit.rules": +- +--a always,exit -F arch=b32 -S chown -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S chown -F auid>=1000 -F auid!=unset -k perm_mod +- +-The audit daemon must be restarted for the changes to take effect.Verify RHEL 8 generates an audit record when successful/unsuccessful attempts to use the "chown" command by performing the following command to check the file system rules in "/etc/audit/audit.rules": +- +-$ sudo grep -w chown /etc/audit/audit.rules +- +--a always,exit -F arch=b32 -S chown -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S chown -F auid>=1000 -F auid!=unset -k perm_mod +- +-If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030490Successful/unsuccessful uses of the chmod command in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). The "chmod" command changes the file mode bits of each given file according to mode, which can be either a symbolic representation of changes to make, or an octal number representing the bit pattern for the new mode bits. +- +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. +- +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000064-GPOS-00033, SRG-OS-000466-GPOS-00210</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure the audit system to generate an audit event for any successful/unsuccessful use of the "chmod" command by adding or updating the following line to "/etc/audit/rules.d/audit.rules": +- +--a always,exit -F arch=b32 -S chmod -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S chmod -F auid>=1000 -F auid!=unset -k perm_mod +- +-The audit daemon must be restarted for the changes to take effect.Verify RHEL 8 generates an audit record when successful/unsuccessful attempts to use the "chmod" command by performing the following command to check the file system rules in "/etc/audit/audit.rules": +- +-$ sudo grep -w chmod /etc/audit/audit.rules +- +--a always,exit -F arch=b32 -S chmod -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S chmod -F auid>=1000 -F auid!=unset -k perm_mod +- +-If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030500Successful/unsuccessful uses of the lchown system call in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). The "lchown" system call is used to change the ownership of the file specified by a path, which does not dereference symbolic links. +- +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. +- +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000064-GPOS-00033, SRG-OS-000466-GPOS-00210</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure the audit system to generate an audit event for any successful/unsuccessful use of the "lchown" system call by adding or updating the following lines to "/etc/audit/rules.d/audit.rules": +- +--a always,exit -F arch=b32 -S lchown -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S lchown -F auid>=1000 -F auid!=unset -k perm_mod +- +-The audit daemon must be restarted for the changes to take effect.Verify RHEL 8 generates an audit record when successful/unsuccessful attempts to use the "lchown" system call by performing the following command to check the file system rules in "/etc/audit/audit.rules": +- +-$ sudo grep -w lchown /etc/audit/audit.rules +- +--a always,exit -F arch=b32 -S lchown -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S lchown -F auid>=1000 -F auid!=unset -k perm_mod +- +-If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030510Successful/unsuccessful uses of the fchownat system call in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). The "fchownat" system call is used to change ownership of a file relative to a directory file descriptor. +- +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. +- +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000064-GPOS-00033, SRG-OS-000466-GPOS-00210</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure the audit system to generate an audit event for any successful/unsuccessful use of the "fchownat" system call by adding or updating the following lines to "/etc/audit/rules.d/audit.rules": +- +--a always,exit -F arch=b32 -S fchownat -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S fchownat -F auid>=1000 -F auid!=unset -k perm_mod +- +-The audit daemon must be restarted for the changes to take effect.Verify RHEL 8 generates an audit record when successful/unsuccessful attempts to use the "fchownat" system call by performing the following command to check the file system rules in "/etc/audit/audit.rules": +- +-$ sudo grep -w fchownat /etc/audit/audit.rules +- +--a always,exit -F arch=b32 -S fchownat -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S fchownat -F auid>=1000 -F auid!=unset -k perm_mod +- +-If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030520Successful/unsuccessful uses of the fchown system call in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). The "fchown" system call is used to change the ownership of a file referred to by the open file descriptor. +- +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. +- +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000064-GPOS-00033, SRG-OS-000466-GPOS-00210</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure the audit system to generate an audit event for any successful/unsuccessful use of the "fchown" system call by adding or updating the following line to "/etc/audit/rules.d/audit.rules": +- +--a always,exit -F arch=b32 -S fchown -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S fchown -F auid>=1000 -F auid!=unset -k perm_mod +- +-The audit daemon must be restarted for the changes to take effect.Verify RHEL 8 generates an audit record when successful/unsuccessful attempts to use the "fchown" system call by performing the following command to check the file system rules in "/etc/audit/audit.rules": +- +-$ sudo grep -w fchown /etc/audit/audit.rules +- +--a always,exit -F arch=b32 -S fchown -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S fchown -F auid>=1000 -F auid!=unset -k perm_mod +- +-If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030530Successful/unsuccessful uses of the fchmodat system call in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). The "fchmodat" system call is used to change permissions of a file relative to a directory file descriptor. +- +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. +- +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000064-GPOS-00033, SRG-OS-000466-GPOS-00210</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure the audit system to generate an audit event for any successful/unsuccessful use of the "fchmodat" system call by adding or updating the following lines to "/etc/audit/rules.d/audit.rules": +- +--a always,exit -F arch=b32 -S fchmodat -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S fchmodat -F auid>=1000 -F auid!=unset -k perm_mod +- +-The audit daemon must be restarted for the changes to take effect.Verify RHEL 8 generates an audit record when successful/unsuccessful attempts to use the "fchmodat" system call by performing the following command to check the file system rules in "/etc/audit/audit.rules": +- +-$ sudo grep -w fchmodat /etc/audit/audit.rules +- +--a always,exit -F arch=b32 -S fchmodat -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S fchmodat -F auid>=1000 -F auid!=unset -k perm_mod +- +-If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030540Successful/unsuccessful uses of the fchmod system call in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. +- +-Audit records can be generated from various components within the information system (e.g., module or policy filter). The "fchmod" system call is used to change permissions of a file. ++If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030420Successful/unsuccessful uses of the truncate, ftruncate, creat, open, openat, and open_by_handle_at system calls in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. ++ ++Audit records can be generated from various components within the information system (e.g., module or policy filter). The "truncate" and "ftruncate" functions are used to truncate a file to a specified length. ++ ++The "creat" system call is used to open and possibly create a file or device. ++The "open" system call opens a file specified by a pathname. If the specified file does not exist, it may optionally be created by "open". ++The "openat" system call opens a file specified by a relative pathname. ++The "name_to_handle_at" and "open_by_handle_at" system calls split the functionality of "openat" into two parts: "name_to_handle_at" returns an opaque handle that corresponds to a specified file; "open_by_handle_at" opens the file corresponding to a handle returned by a previous call to "name_to_handle_at" and returns an open file descriptor. ++ ++When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. ++ ++The system call rules are loaded into a matching engine that intercepts each syscall made by all programs on the system. Therefore, it is very important to use syscall rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining syscalls into one rule whenever possible. ++ ++Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000064-GPOS-00033</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure the audit system to generate an audit event for any successful/unsuccessful use of the "truncate", "ftruncate", "creat", "open", "openat", and "open_by_handle_at" system calls by adding or updating the following rules in the "/etc/audit/rules.d/audit.rules" file: + +-When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. ++-a always,exit -F arch=b32 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access ++-a always,exit -F arch=b64 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access + +-Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000064-GPOS-00033, SRG-OS-000466-GPOS-00210</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure the audit system to generate an audit event for any successful/unsuccessful use of the "fchmod" system call by adding or updating the following line to "/etc/audit/rules.d/audit.rules": ++-a always,exit -F arch=b32 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access ++-a always,exit -F arch=b64 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access + +--a always,exit -F arch=b32 -S fchmod -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S fchmod -F auid>=1000 -F auid!=unset -k perm_mod ++The audit daemon must be restarted for the changes to take effect.Verify RHEL 8 generates an audit record upon successful/unsuccessful attempts to use the "truncate", "ftruncate", "creat", "open", "openat", and "open_by_handle_at" system calls by using the following command to check the file system rules in "/etc/audit/audit.rules": ++ ++$ sudo grep 'open\|truncate\|creat' /etc/audit/audit.rules ++ ++-a always,exit -F arch=b32 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access ++-a always,exit -F arch=b64 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access ++ ++-a always,exit -F arch=b32 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access ++-a always,exit -F arch=b64 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access ++ ++If the output does not produce rules containing "-F exit=-EPERM", this is a finding. ++If the output does not produce rules containing "-F exit=-EACCES", this is a finding. ++If the command does not return an audit rule for "truncate", "ftruncate", "creat", "open", "openat", and "open_by_handle_at" or any of the lines returned are commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030480Successful/unsuccessful uses of the chown, fchown, fchownat, and lchown system calls in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. ++ ++Audit records can be generated from various components within the information system (e.g., module or policy filter). The "chown" command is used to change file owner and group. ++ ++The "fchown" system call is used to change the ownership of a file referred to by the open file descriptor. ++The "fchownat" system call is used to change ownership of a file relative to a directory file descriptor. ++The "lchown" system call is used to change the ownership of the file specified by a path, which does not dereference symbolic links. ++ ++When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. ++ ++The system call rules are loaded into a matching engine that intercepts each syscall made by all programs on the system. Therefore, it is very important to use syscall rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining syscalls into one rule whenever possible. ++ ++Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000064-GPOS-00033, SRG-OS-000466-GPOS-00210</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure the audit system to generate an audit event for any successful/unsuccessful use of the "chown", "fchown", "fchownat", and "lchown" system calls by adding or updating the following line to "/etc/audit/rules.d/audit.rules": + +-The audit daemon must be restarted for the changes to take effect.Verify RHEL 8 generates an audit record when successful/unsuccessful attempts to use the "fchmod" system call by performing the following command to check the file system rules in "/etc/audit/audit.rules": ++-a always,exit -F arch=b32 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=unset -k perm_mod ++-a always,exit -F arch=b64 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=unset -k perm_mod + +-$ sudo grep -w fchmod /etc/audit/audit.rules ++The audit daemon must be restarted for the changes to take effect.Verify RHEL 8 generates an audit record upon successful/unsuccessful attempts to use the "chown", "fchown", "fchownat" and "lchown" system calls by using the following command to check the file system rules in "/etc/audit/audit.rules": ++ ++$ sudo grep chown /etc/audit/audit.rules ++ ++-a always,exit -F arch=b32 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=unset -k perm_mod ++-a always,exit -F arch=b64 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=unset -k perm_mod ++ ++If audit rules are not defined for "chown", "fchown", "fchownat", and "lchown" or any of the lines returned are commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030490Successful/unsuccessful uses of the chmod, fchmod, and fchmodat system calls in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. ++ ++Audit records can be generated from various components within the information system (e.g., module or policy filter). The "chmod" system call changes the file mode bits of each given file according to mode, which can be either a symbolic representation of changes to make, or an octal number representing the bit pattern for the new mode bits. ++ ++The "fchmod" system call is used to change permissions of a file. ++The "fchmodat" system call is used to change permissions of a file relative to a directory file descriptor. ++ ++When a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to "-1". The AUID representation is an unsigned 32-bit integer, which equals "4294967295". The audit system interprets "-1", "4294967295", and "unset" in the same way. ++ ++The system call rules are loaded into a matching engine that intercepts each syscall made by all programs on the system. Therefore, it is very important to use syscall rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. Performance can be helped, however, by combining syscalls into one rule whenever possible. ++ ++Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000064-GPOS-00033, SRG-OS-000466-GPOS-00210</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000169Configure the audit system to generate an audit event for any successful/unsuccessful use of the "chmod", "fchmod", and "fchmodat" syscalls by adding or updating the following line to "/etc/audit/rules.d/audit.rules": + +--a always,exit -F arch=b32 -S fchmod -F auid>=1000 -F auid!=unset -k perm_mod +--a always,exit -F arch=b64 -S fchmod -F auid>=1000 -F auid!=unset -k perm_mod ++-a always,exit -F arch=b32 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=unset -k perm_mod ++-a always,exit -F arch=b64 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=unset -k perm_mod + +-If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030550Successful/unsuccessful uses of the sudo command in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. ++The audit daemon must be restarted for the changes to take effect.Verify RHEL 8 generates an audit record upon successful/unsuccessful attempts to use the "chmod", "fchmod", and "fchmodat" syscalls by using the following command to check the file system rules in "/etc/audit/audit.rules": ++ ++$ sudo grep chmod /etc/audit/audit.rules ++ ++-a always,exit -F arch=b32 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=unset -k perm_mod ++-a always,exit -F arch=b64 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=unset -k perm_mod ++ ++If the command does not return an audit rule for "chmod", "fchmod", and "fchmodat", or any of the lines returned are commented out, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-08-030550Successful/unsuccessful uses of the sudo command in RHEL 8 must generate an audit record.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. + + Audit records can be generated from various components within the information system (e.g., module or policy filter). The "sudo" command allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. + +@@ -4714,17 +4325,17 @@ $ sudo egrep '(\/usr\/sbin\/(audit|au))' /etc/aide.conf + /usr/sbin/rsyslogd p+i+n+u+g+s+b+acl+xattrs+sha512 + /usr/sbin/augenrules p+i+n+u+g+s+b+acl+xattrs+sha512 + +-If any of the audit tools listed above do not have an appropriate selection line, ask the system administrator to indicate what cryptographic mechanisms are being used to protect the integrity of the audit tools. If there is no evidence of integrity protection, this is a finding.SRG-OS-000341-GPOS-00132<GroupDescription></GroupDescription>RHEL-08-030660RHEL 8 must allocate audit record storage capacity to store at least one week of audit records, when audit records are not immediately sent to a central audit record storage facility.<VulnDiscussion>To ensure RHEL 8 systems have a sufficient storage capacity in which to write the audit logs, RHEL 8 needs to be able to allocate audit record storage capacity. ++If any of the audit tools listed above do not have an appropriate selection line, ask the system administrator to indicate what cryptographic mechanisms are being used to protect the integrity of the audit tools. If there is no evidence of integrity protection, this is a finding.SRG-OS-000341-GPOS-00132<GroupDescription></GroupDescription>RHEL-08-030660RHEL 8 must allocate audit record storage capacity to store at least one week of audit records, when audit records are not immediately sent to a central audit record storage facility.<VulnDiscussion>To ensure RHEL 8 systems have a sufficient storage capacity in which to write the audit logs, RHEL 8 needs to be able to allocate audit record storage capacity. + + The task of allocating audit record storage capacity is usually performed during initial installation of RHEL 8.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001849Allocate enough storage capacity for at least one week of audit records when audit records are not immediately sent to a central audit record storage facility. + + If audit records are stored on a partition made specifically for audit records, resize the partition with sufficient space to contain one week of audit records. + +-If audit records are not stored on a partition made specifically for audit records, a new partition with sufficient space will need be to be created.Verify RHEL 8 allocates audit record storage capacity to store at least one week of audit records when audit records are not immediately sent to a central audit record storage facility. ++If audit records are not stored on a partition made specifically for audit records, a new partition with sufficient space will need be to be created.Verify RHEL 8 allocates audit record storage capacity to store at least one week of audit records when audit records are not immediately sent to a central audit record storage facility. + + Determine to which partition the audit records are being written with the following command: + +-$ sudo grep log_file /etc/audit/auditd.conf ++$ sudo grep -iw log_file /etc/audit/auditd.conf + log_file = /var/log/audit/audit.log + + Check the size of the partition to which audit records are written (with the example being /var/log/audit/) with the following command: +@@ -5016,29 +4627,18 @@ $ sudo yum remove rsh-serverSRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-08-040020RHEL 8 must cover or disable the built-in or attached camera when not in use.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. ++If the rsh-server package is installed, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-08-040020RHEL 8 must cover or disable the built-in or attached camera when not in use.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. + + Failing to disconnect from collaborative computing devices (i.e., cameras) can result in subsequent compromises of organizational information. Providing easy methods to physically disconnect from such devices after a collaborative computing session helps to ensure participants actually carry out the disconnect activity without having to go through complex and tedious procedures. + +-Satisfies: SRG-OS-000095-GPOS-00049, SRG-OS-000370-GPOS-00155</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000381Configure the operating system to disable the built-in or attached camera when not in use. +- +-First determine the driver being used by the camera with the following command: ++Satisfies: SRG-OS-000095-GPOS-00049, SRG-OS-000370-GPOS-00155</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000381Configure the operating system to disable the built-in or attached camera when not in use. + +-$ sudo dmesg | grep -i video ++Build or modify the "/etc/modprobe.d/blacklist.conf" file by using the following example: + +-[ 44.630131] ACPI: Video Device [VGA] +-[ 46.655714] input: Video Bus as /devices/LNXSYSTM:00/LNXSYBUS:00/LNXVIDEO:00/input/input7 +-[ 46.670133] videodev: Linux video capture interface: v2.00 +-[ 47.226424] uvcvideo: Found UVC 1.00 device WebCam (0402:7675) +-[ 47.235752] usbcore: registered new interface driver uvcvideo +-[ 47.235756] USB Video Class driver (1.1.1) +- +-Next, build or modify the "/etc/modprobe.d/blacklist.conf" file by using the following example: +- +-##Disable WebCam ++install uvcvideo /bin/true + blacklist uvcvideo + +-Reboot the system for the settings to take effect.If the device or operating system does not have a camera installed, this requirement is not applicable. ++Reboot the system for the settings to take effect.If the device or operating system does not have a camera installed, this requirement is not applicable. + + This requirement is not applicable to mobile devices (smartphones and tablets), where the use of the camera is a local AO decision. + +@@ -5050,24 +4650,21 @@ For a built-in camera, the camera must be protected by a camera cover (e.g., lap + + If the camera is not disconnected, covered, or physically disabled, determine if it is being disabled via software with the following commands: + +-Determine if the camera is disabled via blacklist with the following command: ++Verify the operating system disables the ability to load the uvcvideo kernel module. + +-$ sudo grep blacklist /etc/modprobe.d/* ++$ sudo grep -r uvcvideo /etc/modprobe.d/* | grep "/bin/true" + +-/etc/modprobe.d/blacklist.conf:blacklist uvcvideo ++install uvcvideo /bin/true + +-Determine if a camera driver is in use with the following command: ++If the command does not return any output, or the line is commented out, and the collaborative computing device has not been authorized for use, this is a finding. + +-$ sudo dmesg | grep -i video ++Verify the camera is disabled via blacklist with the following command: + +-[ 44.630131] ACPI: Video Device [VGA] +-[ 46.655714] input: Video Bus as /devices/LNXSYSTM:00/LNXSYBUS:00/LNXVIDEO:00/input/input7 +-[ 46.670133] videodev: Linux video capture interface: v2.00 +-[ 47.226424] uvcvideo: Found UVC 1.00 device WebCam (0402:7675) +-[ 47.235752] usbcore: registered new interface driver uvcvideo +-[ 47.235756] USB Video Class driver (1.1.1) ++$ sudo grep -r uvcvideo /etc/modprobe.d/* | grep "blacklist" ++ ++blacklist uvcvideo + +-If the camera driver blacklist is missing, a camera driver is determined to be in use, and the collaborative computing device has not been authorized for use, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-08-040021RHEL 8 must disable the asynchronous transfer mode (ATM) protocol.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. ++If the command does not return any output or the output is not "blacklist uvcvideo", and the collaborative computing device has not been authorized for use, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-08-040021RHEL 8 must disable the asynchronous transfer mode (ATM) protocol.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. + + Failing to disconnect unused protocols can result in a system compromise. + +@@ -5270,25 +4867,16 @@ autofs.service - Automounts filesystems on demand + Loaded: loaded (/usr/lib/systemd/system/autofs.service; disabled) + Active: inactive (dead) + +-If the "autofs" status is set to "active" and is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000114-GPOS-00059<GroupDescription></GroupDescription>RHEL-08-040080RHEL 8 must be configured to disable USB mass storage.<VulnDiscussion>USB mass storage permits easy introduction of unknown devices, thereby facilitating malicious activity. ++If the "autofs" status is set to "active" and is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000114-GPOS-00059<GroupDescription></GroupDescription>RHEL-08-040080RHEL 8 must be configured to disable USB mass storage.<VulnDiscussion>USB mass storage permits easy introduction of unknown devices, thereby facilitating malicious activity. + +-Satisfies: SRG-OS-000114-GPOS-00059, SRG-OS-000378-GPOS-00163</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000778Configure the operating system to disable the ability to use the USB Storage kernel module. ++Satisfies: SRG-OS-000114-GPOS-00059, SRG-OS-000378-GPOS-00163</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000778Configure the operating system to disable the ability to use the USB Storage kernel module and the ability to use USB mass storage devices. + +-Create a file under "/etc/modprobe.d" with the following command: +- +-$ sudo touch /etc/modprobe.d/usb-storage.conf +- +-Add the following line to the created file: ++Add or update the following lines in the file "/etc/modprobe.d/blacklist.conf": + + install usb-storage /bin/true ++blacklist usb-storage + +-Configure the operating system to disable the ability to use USB mass storage devices. +- +-$ sudo vi /etc/modprobe.d/blacklist.conf +- +-Add or update the line: +- +-blacklist usb-storageVerify the operating system disables the ability to load the USB Storage kernel module. ++Reboot the system for the settings to take effect.Verify the operating system disables the ability to load the USB Storage kernel module. + + $ sudo grep -r usb-storage /etc/modprobe.d/* | grep -i "/bin/true" + +@@ -5304,19 +4892,28 @@ $ sudo grep usb-storage /etc/modprobe.d/* | grep -i "blacklist" + + blacklist usb-storage + +-If the command does not return any output or the output is not "blacklist usb-storage", and use of USB storage devices is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000297-GPOS-00115<GroupDescription></GroupDescription>RHEL-08-040090A RHEL 8 firewall must employ a deny-all, allow-by-exception policy for allowing connections to other systems.<VulnDiscussion>Failure to restrict network connectivity only to authorized systems permits inbound connections from malicious systems. It also permits outbound connections that may facilitate exfiltration of DoD data. ++If the command does not return any output or the output is not "blacklist usb-storage" and use of USB storage devices is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000297-GPOS-00115<GroupDescription></GroupDescription>RHEL-08-040090A RHEL 8 firewall must employ a deny-all, allow-by-exception policy for allowing connections to other systems.<VulnDiscussion>Failure to restrict network connectivity only to authorized systems permits inbound connections from malicious systems. It also permits outbound connections that may facilitate exfiltration of DoD data. + +-RHEL 8 incorporates the "firewalld" daemon, which allows for many different configurations. One of these configurations is zones. Zones can be utilized to a deny-all, allow-by-exception approach. The default "drop" zone will drop all incoming network packets unless it is explicitly allowed by the configuration file or is related to an outgoing network connection.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-002314Configure the "firewalld" daemon to employ a deny-all, allow-by-exception with the following commands: ++RHEL 8 incorporates the "firewalld" daemon, which allows for many different configurations. One of these configurations is zones. Zones can be utilized to a deny-all, allow-by-exception approach. The default "drop" zone will drop all incoming network packets unless it is explicitly allowed by the configuration file or is related to an outgoing network connection.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-002314Configure the "firewalld" daemon to employ a deny-all, allow-by-exception with the following commands: + + $ sudo firewall-cmd --permanent --new-zone=[custom] + + $ sudo cp /usr/lib/firewalld/zones/drop.xml /etc/firewalld/zones/[custom].xml + +-This will provide a clean configuration file to work with that employs a deny-all approach. Next, add the exceptions that are required for mission functionality. ++This will provide a clean configuration file to work with that employs a deny-all approach. Note: Add the exceptions that are required for mission functionality and update the short title in the xml file to match the [custom] zone name. + ++Reload the firewall rules to make the new [custom] zone available to load: ++$ sudo firewall-cmd --reload ++ ++Set the default zone to the new [custom] zone: + $ sudo firewall-cmd --set-default-zone=[custom] + +-Note: This is a runtime and permanent change.Verify "firewalld" is configured to employ a deny-all, allow-by-exception policy for allowing connections to other systems with the following commands: ++Note: This is a runtime and permanent change. ++Add any interfaces to the new [custom] zone: ++$ sudo firewall-cmd --permanent --zone=[custom] --change-interface=ens33 ++ ++Reload the firewall rules for changes to take effect: ++$ sudo firewall-cmd --reloadVerify "firewalld" is configured to employ a deny-all, allow-by-exception policy for allowing connections to other systems with the following commands: + + $ sudo firewall-cmd --state + +@@ -6467,22 +6064,13 @@ $ sudo egrep "[+]?acl" /etc/aide.conf + + VarFile = OwnerMode+n+l+X+acl + +-If the "acl" rule is not being used on all selection lines in the "/etc/aide.conf" file, is commented out, or ACLs are not being checked by another file integrity tool, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040320The graphical display manager must not be installed on RHEL 8 unless approved.<VulnDiscussion>Internet services that are not required for system or application processes must not be active to decrease the attack surface of the system. Graphical display managers have a long history of security vulnerabilities and must not be used, unless approved and documented.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Document the requirement for a graphical user interface with the ISSO or reinstall the operating system without the graphical user interface. If reinstallation is not feasible, then continue with the following procedure: ++If the "acl" rule is not being used on all selection lines in the "/etc/aide.conf" file, is commented out, or ACLs are not being checked by another file integrity tool, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040320The graphical display manager must not be installed on RHEL 8 unless approved.<VulnDiscussion>Internet services that are not required for system or application processes must not be active to decrease the attack surface of the system. Graphical display managers have a long history of security vulnerabilities and must not be used, unless approved and documented.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Document the requirement for a graphical user interface with the ISSO or reinstall the operating system without the graphical user interface. If reinstallation is not feasible, then continue with the following procedure: + + Open an SSH session and enter the following commands: + +-$ sudo systemctl set-default multi-user.target +- + $ sudo yum remove xorg-x11-server-Xorg xorg-x11-server-common xorg-x11-server-utils xorg-x11-server-Xwayland + +-A reboot is required for the changes to take effect.Verify that the system is configured to boot to the command line: +- +-$ systemctl get-default +-multi-user.target +- +-If the system default target is not set to "multi-user.target" and the Information System Security Officer (ISSO) lacks a documented requirement for a graphical user interface, this is a finding. +- +-Verify that a graphical user interface is not installed: ++A reboot is required for the changes to take effect.Verify that a graphical user interface is not installed: + + $ rpm -qa | grep xorg | grep server + +@@ -6610,11 +6198,11 @@ $ sudo grep -iw 'ALL' /etc/sudoers /etc/sudoers.d/* + + If the either of the following entries are returned, this is a finding: + ALL ALL=(ALL) ALL +-ALL ALL=(ALL:ALL) ALLSRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-010383RHEL 8 must use the invoking user's password for privilege escalation when using "sudo".<VulnDiscussion>The sudoers security policy requires that users authenticate themselves before they can use sudo. When sudoers requires authentication, it validates the invoking user's credentials. If the rootpw, targetpw, or runaspw flags are defined and not disabled, by default the operating system will prompt the invoking user for the "root" user password. ++ALL ALL=(ALL:ALL) ALLSRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-010383RHEL 8 must use the invoking user's password for privilege escalation when using "sudo".<VulnDiscussion>The sudoers security policy requires that users authenticate themselves before they can use sudo. When sudoers requires authentication, it validates the invoking user's credentials. If the rootpw, targetpw, or runaspw flags are defined and not disabled, by default the operating system will prompt the invoking user for the "root" user password. + For more information on each of the listed configurations, reference the sudoers(5) manual page.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-002227Define the following in the Defaults section of the /etc/sudoers file or a configuration file in the /etc/sudoers.d/ directory: + Defaults !targetpw + Defaults !rootpw +-Defaults !runaspwVerify that the sudoers security policy is configured to use the invoking user's password for privilege escalation. ++Defaults !runaspwVerify that the sudoers security policy is configured to use the invoking user's password for privilege escalation. + + $ sudo egrep -i '(!rootpw|!targetpw|!runaspw)' /etc/sudoers /etc/sudoers.d/* | grep -v '#' + +@@ -6622,10 +6210,11 @@ $ sudo egrep -i '(!rootpw|!targetpw|!runaspw)' /etc/sudoers /etc/sudoers.d/* | g + /etc/sudoers:Defaults !rootpw + /etc/sudoers:Defaults !runaspw + +-If no results are returned, this is a finding ++If no results are returned, this is a finding. ++If results are returned from more than one file location, this is a finding. + If "Defaults !targetpw" is not defined, this is a finding. + If "Defaults !rootpw" is not defined, this is a finding. +-If "Defaults !runaspw" is not defined, this is a finding.SRG-OS-000373-GPOS-00156<GroupDescription></GroupDescription>RHEL-08-010384RHEL 8 must require re-authentication when using the "sudo" command.<VulnDiscussion>Without re-authentication, users may access resources or perform tasks for which they do not have authorization. ++If "Defaults !runaspw" is not defined, this is a finding.SRG-OS-000373-GPOS-00156<GroupDescription></GroupDescription>RHEL-08-010384RHEL 8 must require re-authentication when using the "sudo" command.<VulnDiscussion>Without re-authentication, users may access resources or perform tasks for which they do not have authorization. + + When operating systems provide the capability to escalate a functional capability, it is critical the organization requires the user to re-authenticate when using the "sudo" command. + +@@ -6635,11 +6224,13 @@ $ sudo visudo + + Add or modify the following line: + Defaults timestamp_timeout=[value] +-Note: The "[value]" must be a number that is greater than or equal to "0".Verify the operating system requires re-authentication when using the "sudo" command to elevate privileges. ++Note: The "[value]" must be a number that is greater than or equal to "0".Verify the operating system requires re-authentication when using the "sudo" command to elevate privileges. + + $ sudo grep -i 'timestamp_timeout' /etc/sudoers /etc/sudoers.d/* + /etc/sudoers:Defaults timestamp_timeout=0 + ++If results are returned from more than one file location, this is a finding. ++ + If "timestamp_timeout" is set to a negative number, is commented out, or no results are returned, this is a finding.SRG-OS-000023-GPOS-00006<GroupDescription></GroupDescription>RHEL-08-010049RHEL 8 must display a banner before granting local or remote access to the system via a graphical user logon.<VulnDiscussion>Display of a standardized and approved use notification before granting access to the operating system ensures privacy and security notification verbiage used is consistent with applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance. + + System use notifications are required only for access via logon interfaces with human users and are not required when such human interfaces do not exist. +@@ -6670,19 +6261,7 @@ $ sudo grep banner-message-enable /etc/dconf/db/local.d/* + + banner-message-enable=true + +-If "banner-message-enable" is set to "false" or is missing, this is a finding.SRG-OS-000073-GPOS-00041<GroupDescription></GroupDescription>RHEL-08-010131The RHEL 8 system-auth file must be configured to use a sufficient number of hashing rounds.<VulnDiscussion>The system must use a strong hashing algorithm to store the password. The system must use a sufficient number of hashing rounds to ensure the required level of entropy. +- +-Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000196Configure RHEL 8 to encrypt all stored passwords with a strong cryptographic hash. +- +-Edit/modify the following line in the "etc/pam.d/system-auth" file and set "rounds" to a value no lower than "5000": +- +-password sufficient pam_unix.so sha512 rounds=5000Check that a minimum number of hash rounds is configured by running the following command: +- +-$ sudo grep rounds /etc/pam.d/system-auth +- +-password sufficient pam_unix.so sha512 rounds=5000 +- +-If "rounds" has a value below "5000", or is commented out, this is a finding.SRG-OS-000080-GPOS-00048<GroupDescription></GroupDescription>RHEL-08-010141RHEL 8 operating systems booted with United Extensible Firmware Interface (UEFI) must require a unique superusers name upon booting into single-user mode and maintenance.<VulnDiscussion>If the system does not require valid authentication before it boots into single-user or maintenance mode, anyone who invokes single-user or maintenance mode is granted privileged access to all files on the system. GRUB 2 is the default boot loader for RHEL 8 and is designed to require a password to boot into single-user mode or make modifications to the boot menu. ++If "banner-message-enable" is set to "false" or is missing, this is a finding.SRG-OS-000080-GPOS-00048<GroupDescription></GroupDescription>RHEL-08-010141RHEL 8 operating systems booted with United Extensible Firmware Interface (UEFI) must require a unique superusers name upon booting into single-user mode and maintenance.<VulnDiscussion>If the system does not require valid authentication before it boots into single-user or maintenance mode, anyone who invokes single-user or maintenance mode is granted privileged access to all files on the system. GRUB 2 is the default boot loader for RHEL 8 and is designed to require a password to boot into single-user mode or make modifications to the boot menu. + + The GRUB 2 superuser account is an account of last resort. Establishing a unique username for this account hardens the boot loader against brute force attacks. Due to the nature of the superuser account database being distinct from the OS account database, this allows the use of a username that is not among those within the OS account database. Examples of non-unique superusers names are root, superuser, unlock, etc.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000213Configure the system to have a unique name for the grub superusers account. + +@@ -6730,21 +6309,21 @@ $ sudo grep sulogin-shell /usr/lib/systemd/system/emergency.service + + ExecStart=-/usr/lib/systemd/systemd-sulogin-shell emergency + +-If the "ExecStart" line is configured for anything other than "/usr/lib/systemd/systemd-sulogin-shell emergency", commented out, or missing, this is a finding.SRG-OS-000120-GPOS-00061<GroupDescription></GroupDescription>RHEL-08-010159The RHEL 8 pam_unix.so module must be configured in the system-auth file to use a FIPS 140-2 approved cryptographic hashing algorithm for system authentication.<VulnDiscussion>Unapproved mechanisms that are used for authentication to the cryptographic module are not verified and therefore cannot be relied upon to provide confidentiality or integrity, and DoD data may be compromised. ++If the "ExecStart" line is configured for anything other than "/usr/lib/systemd/systemd-sulogin-shell emergency", commented out, or missing, this is a finding.SRG-OS-000120-GPOS-00061<GroupDescription></GroupDescription>RHEL-08-010159The RHEL 8 pam_unix.so module must be configured in the system-auth file to use a FIPS 140-2 approved cryptographic hashing algorithm for system authentication.<VulnDiscussion>Unapproved mechanisms that are used for authentication to the cryptographic module are not verified and therefore cannot be relied upon to provide confidentiality or integrity, and DoD data may be compromised. + + RHEL 8 systems utilizing encryption are required to use FIPS-compliant mechanisms for authenticating to cryptographic modules. + +-FIPS 140-2 is the current standard for validating that mechanisms used to access cryptographic modules utilize authentication that meets DoD requirements. This allows for Security Levels 1, 2, 3, or 4 for use on a general-purpose computing system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000803Configure RHEL 8 to use a FIPS 140-2 approved cryptographic hashing algorithm for system authentication. ++FIPS 140-2 is the current standard for validating that mechanisms used to access cryptographic modules utilize authentication that meets DoD requirements. This allows for Security Levels 1, 2, 3, or 4 for use on a general-purpose computing system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000803Configure RHEL 8 to use a FIPS 140-2 approved cryptographic hashing algorithm for system authentication. + + Edit/modify the following line in the "/etc/pam.d/system-auth" file to include the sha512 option for pam_unix.so: + +-password sufficient pam_unix.so sha512 rounds=5000Verify that pam_unix.so module is configured to use sha512. ++password sufficient pam_unix.so sha512Verify that pam_unix.so module is configured to use sha512. + + Check that pam_unix.so module is configured to use sha512 in /etc/pam.d/system-auth with the following command: + + $ sudo grep password /etc/pam.d/system-auth | grep pam_unix + +-password sufficient pam_unix.so sha512 rounds=5000 ++password sufficient pam_unix.so sha512 + + If "sha512" is missing, or is commented out, this is a finding.SRG-OS-000163-GPOS-00072<GroupDescription></GroupDescription>RHEL-08-010201The RHEL 8 SSH daemon must be configured with a timeout interval.<VulnDiscussion>Terminating an idle SSH session within a short time period reduces the window of opportunity for unauthorized personnel to take control of a management session enabled on the console or console port that has been left unattended. In addition, quickly terminating an idle SSH session will also free up resources committed by the managed network element. + +@@ -6769,7 +6348,7 @@ $ sudo grep -i clientalive /etc/ssh/sshd_config + ClientAliveInterval 600 + ClientAliveCountMax 0 + +-If "ClientAliveInterval" does not exist, does not have a value of "600" or less in "/etc/ssh/sshd_config", or is commented out, this is a finding.SRG-OS-000250-GPOS-00093<GroupDescription></GroupDescription>RHEL-08-010287The RHEL 8 SSH daemon must be configured to use system-wide crypto policies.<VulnDiscussion>Without cryptographic integrity protections, information can be altered by unauthorized users without detection. ++If "ClientAliveInterval" does not exist, does not have a value of "600" or less in "/etc/ssh/sshd_config", or is commented out, this is a finding.SRG-OS-000250-GPOS-00093<GroupDescription></GroupDescription>RHEL-08-010287The RHEL 8 SSH daemon must be configured to use system-wide crypto policies.<VulnDiscussion>Without cryptographic integrity protections, information can be altered by unauthorized users without detection. + + Remote access (e.g., RDP) is access to DoD nonpublic information systems by an authorized user (or an information system) communicating through an external, non-organization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless. + +@@ -6777,17 +6356,17 @@ Cryptographic mechanisms used for protecting the integrity of information includ + + RHEL 8 incorporates system-wide crypto policies by default. The SSH configuration file has no effect on the ciphers, MACs, or algorithms unless specifically defined in the /etc/sysconfig/sshd file. The employed algorithms can be viewed in the /etc/crypto-policies/back-ends/ directory. + +-Satisfies: SRG-OS-000250-GPOS-00093, SRG-OS-000393-GPOS-00173, SRG-OS-000394-GPOS-00174, SRG-OS-000125-GPOS-00065</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001453Configure the RHEL 8 SSH daemon to use system-wide crypto policies by adding the following line to /etc/sysconfig/sshd: ++Satisfies: SRG-OS-000250-GPOS-00093, SRG-OS-000393-GPOS-00173, SRG-OS-000394-GPOS-00174, SRG-OS-000125-GPOS-00065</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001453Configure the RHEL 8 SSH daemon to use system-wide crypto policies by adding the following line to /etc/sysconfig/sshd: + +-# crypto_policy= ++# CRYPTO_POLICY= + +-A reboot is required for the changes to take effect.Verify that system-wide crypto policies are in effect: ++A reboot is required for the changes to take effect.Verify that system-wide crypto policies are in effect: + +-$ sudo grep -i crypto_policy /etc/sysconfig/sshd ++$ sudo grep CRYPTO_POLICY /etc/sysconfig/sshd + +-# crypto_policy= ++# CRYPTO_POLICY= + +-If the "crypto_policy" is uncommented, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-010472RHEL 8 must have the packages required to use the hardware random number generator entropy gatherer service.<VulnDiscussion>The most important characteristic of a random number generator is its randomness, namely its ability to deliver random numbers that are impossible to predict. Entropy in computer security is associated with the unpredictability of a source of randomness. The random source with high entropy tends to achieve a uniform distribution of random values. Random number generators are one of the most important building blocks of cryptosystems. ++If the "CRYPTO_POLICY " is uncommented, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-010472RHEL 8 must have the packages required to use the hardware random number generator entropy gatherer service.<VulnDiscussion>The most important characteristic of a random number generator is its randomness, namely its ability to deliver random numbers that are impossible to predict. Entropy in computer security is associated with the unpredictability of a source of randomness. The random source with high entropy tends to achieve a uniform distribution of random values. Random number generators are one of the most important building blocks of cryptosystems. + + The rngd service feeds random data from hardware device to kernel random device. Quality (non-predictable) random number generation is important for several security functions (i.e., ciphers).</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Install the packages required to enabled the hardware random number generator entropy gatherer service with the following command: + +@@ -6819,13 +6398,13 @@ $ sudo grep /var/tmp /etc/fstab + + UUID=c274f65f /var/tmp xfs noatime,nobarrier 1 2 + +-If a separate entry for "/var/tmp" is not in use, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-010572RHEL 8 must prevent files with the setuid and setgid bit set from being executed on the /boot/efi directory.<VulnDiscussion>The "nosuid" mount option causes the system not to execute "setuid" and "setgid" files with owner privileges. This option must be used for mounting any file system not containing approved "setuid" and "setguid" files. Executing files from untrusted file systems increases the opportunity for unprivileged users to attain unauthorized administrative access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure the "/etc/fstab" to use the "nosuid" option on the /boot/efi directory.For systems that use BIOS, this is Not Applicable. ++If a separate entry for "/var/tmp" is not in use, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-010572RHEL 8 must prevent files with the setuid and setgid bit set from being executed on the /boot/efi directory.<VulnDiscussion>The "nosuid" mount option causes the system not to execute "setuid" and "setgid" files with owner privileges. This option must be used for mounting any file system not containing approved "setuid" and "setguid" files. Executing files from untrusted file systems increases the opportunity for unprivileged users to attain unauthorized administrative access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure the "/etc/fstab" to use the "nosuid" option on the /boot/efi directory.For systems that use BIOS, this is Not Applicable. + + Verify the /boot/efi directory is mounted with the "nosuid" option with the following command: + + $ sudo mount | grep '\s/boot/efi\s' + +-/dev/sda1 on /boot/efi type xfs (rw,nosuid,relatime,seclabe,attr2,inode64,noquota) ++/dev/sda1 on /boot/efi type vfat (rw,nosuid,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=winnt,errors=remount-ro) + + If the /boot/efi file system does not have the "nosuid" option set, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-010731All RHEL 8 local interactive user home directory files must have mode 0750 or less permissive.<VulnDiscussion>Excessive permissions on local interactive user home directories may allow unauthorized access to user files by other users.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Set the mode on files and directories in the local interactive user home directory with the following command: + +@@ -7114,7 +6693,7 @@ fapolicyd.service - File Access Policy Daemon + Loaded: loaded (/usr/lib/systemd/system/fapolicyd.service; enabled; vendor preset: disabled) + Active: active (running) + +-If fapolicyd is not enabled and running, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-08-040137The RHEL 8 fapolicy module must be configured to employ a deny-all, permit-by-exception policy to allow the execution of authorized software programs.<VulnDiscussion>The organization must identify authorized software programs and permit execution of authorized software. The process used to identify software programs that are authorized to execute on organizational information systems is commonly referred to as whitelisting. ++If fapolicyd is not enabled and running, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-08-040137The RHEL 8 fapolicy module must be configured to employ a deny-all, permit-by-exception policy to allow the execution of authorized software programs.<VulnDiscussion>The organization must identify authorized software programs and permit execution of authorized software. The process used to identify software programs that are authorized to execute on organizational information systems is commonly referred to as whitelisting. + + Utilizing a whitelist provides a configuration management method for allowing the execution of only authorized software. Using only authorized software decreases risk by limiting the number of potential vulnerabilities. Verification of whitelisted software occurs prior to execution or at system startup. + +@@ -7124,11 +6703,7 @@ RHEL 8 ships with many optional packages. One such package is a file access poli + + Proceed with caution with enforcing the use of this daemon. Improper configuration may render the system non-functional. The "fapolicyd" API is not namespace aware and can cause issues when launching or running containers. + +-Satisfies: SRG-OS-000368-GPOS-00154, SRG-OS-000370-GPOS-00155, SRG-OS-000480-GPOS-00232</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001764Configure RHEL 8 to employ a deny-all, permit-by-exception application whitelisting policy with "fapolicyd" using the following command: +- +-Note: Running this command requires a root shell +- +-# mount | egrep '^tmpfs| ext4| ext3| xfs' | awk '{ printf "%s\n", $3 }' >> /etc/fapolicyd/fapolicyd.mounts ++Satisfies: SRG-OS-000368-GPOS-00154, SRG-OS-000370-GPOS-00155, SRG-OS-000480-GPOS-00232</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001764Configure RHEL 8 to employ a deny-all, permit-by-exception application whitelisting policy with "fapolicyd". + + With the "fapolicyd" installed and enabled, configure the daemon to function in permissive mode until the whitelist is built correctly to avoid system lockout. Do this by editing the "/etc/fapolicyd/fapolicyd.conf" file with the following line: + +@@ -7138,7 +6713,7 @@ Build the whitelist in the "/etc/fapolicyd/fapolicyd.rules" file ensuring the la + + Once it is determined the whitelist is built correctly, set the fapolicyd to enforcing mode by editing the "permissive" line in the /etc/fapolicyd/fapolicyd.conf file. + +-permissive = 0Verify the RHEL 8 "fapolicyd" employs a deny-all, permit-by-exception policy. ++permissive = 0Verify the RHEL 8 "fapolicyd" employs a deny-all, permit-by-exception policy. + + Check that "fapolicyd" is in enforcement mode with the following command: + +@@ -7146,7 +6721,7 @@ $ sudo grep permissive /etc/fapolicyd/fapolicyd.conf + + permissive = 0 + +-Check that fapolicyd employs a deny-all policy on system mounts with the following commands: ++Check that fapolicyd employs a deny-all policy on system mounts with the following command: + + $ sudo tail /etc/fapolicyd/fapolicyd.rules + +@@ -7154,18 +6729,7 @@ allow exe=/usr/bin/python3.7 : ftype=text/x-python + deny_audit perm=any pattern=ld_so : all + deny perm=any all : all + +-$ sudo cat /etc/fapolicyd/fapolicyd.mounts +- +-/dev/shm +-/run +-/sys/fs/cgroup +-/ +-/home +-/boot +-/run/user/42 +-/run/user/1000 +- +-If fapolicyd is not running in enforcement mode on all system mounts with a deny-all, permit-by-exception policy, this is a finding.SRG-OS-000378-GPOS-00163<GroupDescription></GroupDescription>RHEL-08-040139RHEL 8 must have the USBGuard installed.<VulnDiscussion>Without authenticating devices, unidentified or unknown devices may be introduced, thereby facilitating malicious activity. ++If fapolicyd is not running in enforcement mode with a deny-all, permit-by-exception policy, this is a finding.SRG-OS-000378-GPOS-00163<GroupDescription></GroupDescription>RHEL-08-040139RHEL 8 must have the USBGuard installed.<VulnDiscussion>Without authenticating devices, unidentified or unknown devices may be introduced, thereby facilitating malicious activity. + Peripherals include, but are not limited to, such devices as flash drives, external storage, and printers. + A new feature that RHEL 8 provides is the USBGuard software framework. The USBguard-daemon is the main component of the USBGuard software framework. It runs as a service in the background and enforces the USB device authorization policy for all USB devices. The policy is defined by a set of rules using a rule language described in the usbguard-rules.conf file. The policy and the authorization state of USB devices can be modified during runtime using the usbguard tool. + +@@ -7511,4 +7075,201 @@ $ sudo grep -r net.ipv4.conf.all.forwarding /etc/sysctl.d/*.conf + + If "net.ipv4.conf.all.forwarding" is not set to "0", is missing or commented out, this is a finding. + +-If the configuration file does not begin with "99-", this is a finding. +\ No newline at end of file ++If the configuration file does not begin with "99-", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-010121The RHEL 8 operating system must not have accounts configured with blank or null passwords.<VulnDiscussion>If an account has an empty password, anyone could log on and run commands with the privileges of that account. Accounts with empty passwords should never be used in operational environments.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure all accounts on the system to have a password or lock the account with the following commands: ++ ++Perform a password reset: ++$ sudo passwd [username] ++Lock an account: ++$ sudo passwd -l [username]Check the "/etc/shadow" file for blank passwords with the following command: ++ ++$ sudo awk -F: '!$2 {print $1}' /etc/shadow ++ ++If the command returns any results, this is a finding.SRG-OS-000259-GPOS-00100<GroupDescription></GroupDescription>RHEL-08-010331RHEL 8 library directories must have mode 755 or less permissive.<VulnDiscussion>If RHEL 8 were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. ++ ++This requirement applies to RHEL 8 with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals will be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001499Configure the library directories to be protected from unauthorized access. Run the following command, replacing "[DIRECTORY]" with any library directory with a mode more permissive than 755. ++ ++$ sudo chmod 755 [DIRECTORY]Verify the system-wide shared library directories within "/lib", "/lib64", "/usr/lib" and "/usr/lib64" have mode "755" or less permissive with the following command: ++ ++$ sudo find /lib /lib64 /usr/lib /usr/lib64 -perm /022 -type d -exec stat -c "%n %a" '{}' \; ++ ++If any system-wide shared library directories are found to be group-writable or world-writable, this is a finding.SRG-OS-000259-GPOS-00100<GroupDescription></GroupDescription>RHEL-08-010341RHEL 8 library directories must be owned by root.<VulnDiscussion>If RHEL 8 were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. ++ ++This requirement applies to RHEL 8 with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals will be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001499Configure the system-wide shared library directories within (/lib, /lib64, /usr/lib and /usr/lib64) to be protected from unauthorized access. ++ ++Run the following command, replacing "[DIRECTORY]" with any library directory not owned by "root". ++ ++$ sudo chown root [DIRECTORY]Verify the system-wide shared library directories are owned by "root" with the following command: ++ ++$ sudo find /lib /lib64 /usr/lib /usr/lib64 ! -user root -type d -exec stat -c "%n %U" '{}' \; ++ ++If any system-wide shared library directory is returned, this is a finding.SRG-OS-000259-GPOS-00100<GroupDescription></GroupDescription>RHEL-08-010351RHEL 8 library directories must be group-owned by root or a system account.<VulnDiscussion>If RHEL 8 were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. ++ ++This requirement applies to RHEL 8 with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals will be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-001499Configure the system-wide shared library directories (/lib, /lib64, /usr/lib and /usr/lib64) to be protected from unauthorized access. ++ ++Run the following command, replacing "[DIRECTORY]" with any library directory not group-owned by "root". ++ ++$ sudo chgrp root [DIRECTORY]Verify the system-wide shared library directories are group-owned by "root" with the following command: ++ ++$ sudo find /lib /lib64 /usr/lib /usr/lib64 ! -group root -type d -exec stat -c "%n %G" '{}' \; ++ ++If any system-wide shared library directory is returned and is not group-owned by a required system account, this is a finding.SRG-OS-000445-GPOS-00199<GroupDescription></GroupDescription>RHEL-08-010359The RHEL 8 operating system must use a file integrity tool to verify correct operation of all security functions.<VulnDiscussion>Without verification of the security functions, security functions may not operate correctly, and the failure may go unnoticed. Security function is defined as the hardware, software, and/or firmware of the information system responsible for enforcing the system security policy and supporting the isolation of code and data on which the protection is based. Security functionality includes, but is not limited to, establishing system accounts, configuring access authorizations (i.e., permissions, privileges), setting events to be audited, and setting intrusion detection parameters. ++ ++This requirement applies to the RHEL 8 operating system performing security function verification/testing and/or systems and environments that require this functionality.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-002696Install the AIDE package by running the following command: ++ ++$ sudo yum install aideVerify that Advanced Intrusion Detection Environment (AIDE) is installed and verifies the correct operation of all security functions. ++ ++Check that the AIDE package is installed with the following command: ++ ++$ sudo rpm -q aide ++ ++aide-0.16-14.el8.x86_64 ++ ++If AIDE is not installed, ask the System Administrator how file integrity checks are performed on the system. ++ ++If there is no application installed to perform integrity checks, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-010379RHEL 8 must specify the default "include" directory for the /etc/sudoers file.<VulnDiscussion>The "sudo" command allows authorized users to run programs (including shells) as other users, system users, and root. The "/etc/sudoers" file is used to configure authorized "sudo" users as well as the programs they are allowed to run. Some configuration options in the "/etc/sudoers" file allow configured users to run programs without re-authenticating. Use of these configuration options makes it easier for one compromised account to be used to compromise other accounts. ++ ++It is possible to include other sudoers files from within the sudoers file currently being parsed using the #include and #includedir directives. When sudo reaches this line it will suspend processing of the current file (/etc/sudoers) and switch to the specified file/directory. Once the end of the included file(s) is reached, the rest of /etc/sudoers will be processed. Files that are included may themselves include other files. A hard limit of 128 nested include files is enforced to prevent include file loops.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure the /etc/sudoers file to only include the /etc/sudoers.d directory. ++ ++Edit the /etc/sudoers file with the following command: ++ ++$ sudo visudo ++ ++Add or modify the following line: ++#includedir /etc/sudoers.dVerify the operating system specifies only the default "include" directory for the /etc/sudoers file with the following command: ++ ++$ sudo grep include /etc/sudoers ++ ++#includedir /etc/sudoers.d ++ ++If the results are not "/etc/sudoers.d" or additional files or directories are specified, this is a finding. ++ ++Verify the operating system does not have nested "include" files or directories within the /etc/sudoers.d directory with the following command: ++ ++$ sudo grep include /etc/sudoers.d/* ++ ++If results are returned, this is a finding.SRG-OS-000373-GPOS-00156<GroupDescription></GroupDescription>RHEL-08-010385The RHEL 8 operating system must not be configured to bypass password requirements for privilege escalation.<VulnDiscussion>Without re-authentication, users may access resources or perform tasks for which they do not have authorization. ++ ++When operating systems provide the capability to escalate a functional capability, it is critical the user re-authenticate. ++ ++Satisfies: SRG-OS-000373-GPOS-00156, SRG-OS-000373-GPOS-00157, SRG-OS-000373-GPOS-00158</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-002038Configure the operating system to require users to supply a password for privilege escalation. ++ ++Check the configuration of the "/etc/ pam.d/sudo" file with the following command: ++$ sudo vi /etc/pam.d/sudo ++ ++Remove any occurrences of "pam_succeed_if" in the file.Verify the operating system is not be configured to bypass password requirements for privilege escalation. ++ ++Check the configuration of the "/etc/pam.d/sudo" file with the following command: ++ ++$ sudo grep pam_succeed_if /etc/pam.d/sudo ++ ++If any occurrences of "pam_succeed_if" is returned from the command, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-020101RHEL 8 must ensure the password complexity module is enabled in the system-auth file.<VulnDiscussion>Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. "pwquality" enforces complex password construction configuration and has the ability to limit brute-force attacks on the system. ++ ++RHEL 8 uses "pwquality" as a mechanism to enforce password complexity. This is set in both: ++/etc/pam.d/password-auth ++/etc/pam.d/system-auth</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure the operating system to use "pwquality" to enforce password complexity rules. ++ ++Add the following line to the "/etc/pam.d/system-auth" file(or modify the line to have the required value): ++ ++password required pam_pwquality.soVerify the operating system uses "pwquality" to enforce the password complexity rules. ++ ++Check for the use of "pwquality" in the system-auth file with the following command: ++ ++$ sudo cat /etc/pam.d/system-auth | grep pam_pwquality ++ ++password required pam_pwquality.so ++ ++If the command does not return a line containing the value "pam_pwquality.so", or the line is commented out, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-020102RHEL 8 systems below version 8.4 must ensure the password complexity module in the system-auth file is configured for three retries or less.<VulnDiscussion>Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. "pwquality" enforces complex password construction configuration and has the ability to limit brute-force attacks on the system. ++ ++RHEL 8 uses "pwquality" as a mechanism to enforce password complexity. This is set in both: ++/etc/pam.d/password-auth ++/etc/pam.d/system-auth ++ ++By limiting the number of attempts to meet the pwquality module complexity requirements before returning with an error, the system will audit abnormal attempts at password changes.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure the operating system to limit the "pwquality" retry option to 3. ++ ++Add the following line to the "/etc/pam.d/system-auth" file (or modify the line to have the required value): ++ ++password required pam_pwquality.so retry=3Note: This requirement applies to RHEL versions 8.0 through 8.3. If the system is RHEL version 8.4 or newer, this requirement is not applicable. ++ ++Verify the operating system is configured to limit the "pwquality" retry option to 3. ++ ++Check for the use of the "pwquality" retry option in the system-auth file with the following command: ++ ++$ sudo cat /etc/pam.d/system-auth | grep pam_pwquality ++ ++password required pam_pwquality.so retry=3 ++ ++If the value of "retry" is set to "0" or greater than "3", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-020103RHEL 8 systems below version 8.4 must ensure the password complexity module in the password-auth file is configured for three retries or less.<VulnDiscussion>Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. "pwquality" enforces complex password construction configuration and has the ability to limit brute-force attacks on the system. ++ ++RHEL 8 uses "pwquality" as a mechanism to enforce password complexity. This is set in both: ++/etc/pam.d/password-auth ++/etc/pam.d/system-auth ++ ++By limiting the number of attempts to meet the pwquality module complexity requirements before returning with an error, the system will audit abnormal attempts at password changes.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure the operating system to limit the "pwquality" retry option to 3. ++ ++Add the following line to the "/etc/pam.d/password-auth" file (or modify the line to have the required value): ++ ++password required pam_pwquality.so retry=3Note: This requirement applies to RHEL versions 8.0 through 8.3. If the system is RHEL version 8.4 or newer, this requirement is not applicable. ++ ++Verify the operating system is configured to limit the "pwquality" retry option to 3. ++ ++Check for the use of the "pwquality" retry option in the password-auth file with the following command: ++ ++$ sudo cat /etc/pam.d/password-auth | grep pam_pwquality ++ ++password required pam_pwquality.so retry=3 ++ ++If the value of "retry" is set to "0" or greater than "3", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-020104RHEL 8 systems, version 8.4 and above, must ensure the password complexity module is configured for three retries or less.<VulnDiscussion>Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. "pwquality" enforces complex password construction configuration and has the ability to limit brute-force attacks on the system. ++ ++RHEL 8 utilizes "pwquality" as a mechanism to enforce password complexity. This is set in both: ++/etc/pam.d/password-auth ++/etc/pam.d/system-auth ++By limiting the number of attempts to meet the pwquality module complexity requirements before returning with an error, the system will audit abnormal attempts at password changes.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Configure the operating system to limit the "pwquality" retry option to 3. ++ ++Add the following line to the "/etc/security/pwquality.conf" file(or modify the line to have the required value): ++ ++retry = 3Note: This requirement applies to RHEL versions 8.4 or newer. If the system is RHEL below version 8.4, this requirement is not applicable. ++ ++Verify the operating system is configured to limit the "pwquality" retry option to 3. ++ ++Check for the use of the "pwquality" retry option with the following command: ++ ++$ sudo grep retry /etc/security/pwquality.conf ++ ++retry = 3 ++ ++If the value of "retry" is set to "0" or greater than "3", is commented out or missing, this is a finding. ++ ++Check for the use of the "pwquality" retry option in the system-auth and password-auth files with the following command: ++ ++$ sudo grep retry /etc/pam.d/system-auth /etc/pam.d/password-auth ++ ++If the command returns any results, this is a finding.SRG-OS-000077-GPOS-00045<GroupDescription></GroupDescription>RHEL-08-020221RHEL 8 must be configured in the system-auth file to prohibit password reuse for a minimum of five generations.<VulnDiscussion>Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. If the information system or application allows the user to reuse their password consecutively when that password has exceeded its defined lifetime, the end result is a password that is not changed per policy requirements. ++ ++RHEL 8 uses "pwhistory" consecutively as a mechanism to prohibit password reuse. This is set in both: ++/etc/pam.d/password-auth ++/etc/pam.d/system-auth. ++ ++Note that manual changes to the listed files may be overwritten by the "authselect" program.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000200Configure the operating system in the system-auth file to prohibit password reuse for a minimum of five generations. ++ ++Add the following line in "/etc/pam.d/system-auth" (or modify the line to have the required value): ++ ++password required pam_pwhistory.so use_authtok remember=5 retry=3Verify the operating system is configured in the system-auth file to prohibit password reuse for a minimum of five generations. ++ ++Check for the value of the "remember" argument in "/etc/pam.d/password-auth" with the following command: ++ ++$ sudo grep -i remember /etc/pam.d/password-auth ++ ++password required pam_pwhistory.so use_authtok remember=5 retry=3 ++ ++If the line containing "pam_pwhistory.so" does not have the "remember" module argument set, is commented out, or the value of the "remember" module argument is set to less than "5", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-08-040321The graphical display manager must not be the default target on RHEL 8 unless approved.<VulnDiscussion>Internet services that are not required for system or application processes must not be active to decrease the attack surface of the system. Graphical display managers have a long history of security vulnerabilities and must not be used, unless approved and documented.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 8DISADPMS TargetRed Hat Enterprise Linux 82921CCI-000366Document the requirement for a graphical user interface with the ISSO or reinstall the operating system without the graphical user interface. If reinstallation is not feasible, then continue with the following procedure: ++ ++Open an SSH session and enter the following commands: ++ ++$ sudo systemctl set-default multi-user.target ++ ++A reboot is required for the changes to take effect.Verify that the system is configured to boot to the command line: ++ ++$ systemctl get-default ++multi-user.target ++ ++If the system default target is not set to "multi-user.target" and the Information System Security Officer (ISSO) lacks a documented requirement for a graphical user interface, this is a finding. +\ No newline at end of file +diff --git a/tests/data/profile_stability/rhel8/stig.profile b/tests/data/profile_stability/rhel8/stig.profile +index c2522c9..b9eeff5 100644 +--- a/tests/data/profile_stability/rhel8/stig.profile ++++ b/tests/data/profile_stability/rhel8/stig.profile +@@ -1,6 +1,6 @@ + description: 'This profile contains configuration checks that align to the + +- DISA STIG for Red Hat Enterprise Linux 8 V1R3. ++ DISA STIG for Red Hat Enterprise Linux 8 V1R5. + + + In addition to being applicable to Red Hat Enterprise Linux 8, DISA recognizes +diff --git a/tests/data/profile_stability/rhel8/stig_gui.profile b/tests/data/profile_stability/rhel8/stig_gui.profile +index 95d87fd..54bf46d 100644 +--- a/tests/data/profile_stability/rhel8/stig_gui.profile ++++ b/tests/data/profile_stability/rhel8/stig_gui.profile +@@ -1,6 +1,6 @@ + description: 'This profile contains configuration checks that align to the + +- DISA STIG with GUI for Red Hat Enterprise Linux 8 V1R3. ++ DISA STIG with GUI for Red Hat Enterprise Linux 8 V1R5. + + + In addition to being applicable to Red Hat Enterprise Linux 8, DISA recognizes diff --git a/SOURCES/scap-security-guide-0.1.61-update_RHEL_STIG-PR_8130.patch b/SOURCES/scap-security-guide-0.1.61-update_RHEL_STIG-PR_8130.patch new file mode 100644 index 0000000..2cc46e2 --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.61-update_RHEL_STIG-PR_8130.patch @@ -0,0 +1,673 @@ +commit 94a680f9601fc2119c08fc6514712611d7f0d935 +Author: Gabriel Becker +Date: Fri Feb 25 14:43:33 2022 +0100 + + Manual edited patch scap-security-guide-0.1.61-update_RHEL_STIG-PR_8130.patch. + +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/rule.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/rule.yml +index 10203c9..3c9e460 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/rule.yml ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/rule.yml +@@ -37,7 +37,7 @@ references: + disa: CCI-001499 + nist: CM-5(6),CM-5(6).1 + srg: SRG-OS-000259-GPOS-00100 +- stigid@rhel8: RHEL-08-010350 ++ stigid@rhel8: RHEL-08-010351 + stigid@sle12: SLES-12-010876 + stigid@sle15: SLES-15-010356 + stigid@ubuntu2004: UBTU-20-010431 +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/all_dirs_ok.pass.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/all_dirs_ok.pass.sh +index 50fdb17..6a05a2b 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/all_dirs_ok.pass.sh ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/all_dirs_ok.pass.sh +@@ -1,4 +1,4 @@ +-# platform = multi_platform_sle,Red Hat Enterprise Linux 8,multi_platform_fedora ++# platform = multi_platform_sle,multi_platform_rhel,multi_platform_fedora + + DIRS="/lib /lib64 /usr/lib /usr/lib64" + for dirPath in $DIRS; do +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/correct_groupowner.pass.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/correct_groupowner.pass.sh +new file mode 100644 +index 0000000..6a05a2b +--- /dev/null ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/correct_groupowner.pass.sh +@@ -0,0 +1,6 @@ ++# platform = multi_platform_sle,multi_platform_rhel,multi_platform_fedora ++ ++DIRS="/lib /lib64 /usr/lib /usr/lib64" ++for dirPath in $DIRS; do ++ find "$dirPath" -type d -exec chgrp root '{}' \; ++done +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/incorrect_groupowner.fail.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/incorrect_groupowner.fail.sh +new file mode 100644 +index 0000000..36461f5 +--- /dev/null ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/incorrect_groupowner.fail.sh +@@ -0,0 +1,6 @@ ++# platform = multi_platform_sle,multi_platform_rhel,multi_platform_fedora ++ ++DIRS="/lib /lib64 /usr/lib /usr/lib64" ++for dirPath in $DIRS; do ++ mkdir -p "$dirPath/testme" && chgrp nobody "$dirPath/testme" ++done +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/incorrect_groupowner_2.fail.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/incorrect_groupowner_2.fail.sh +new file mode 100644 +index 0000000..3f09e3d +--- /dev/null ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/incorrect_groupowner_2.fail.sh +@@ -0,0 +1,6 @@ ++# platform = multi_platform_sle,multi_platform_rhel,multi_platform_fedora ++ ++DIRS="/lib /lib64 /usr/lib /usr/lib64" ++for dirPath in $DIRS; do ++ mkdir -p "$dirPath/testme/test2" && chgrp nobody "$dirPath/testme/test2" ++done +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/nobody_group_owned_dir_on_lib.fail.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/nobody_group_owned_dir_on_lib.fail.sh +index 043ad6b..36461f5 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/nobody_group_owned_dir_on_lib.fail.sh ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/tests/nobody_group_owned_dir_on_lib.fail.sh +@@ -1,4 +1,4 @@ +-# platform = multi_platform_sle,Red Hat Enterprise Linux 8,multi_platform_fedora ++# platform = multi_platform_sle,multi_platform_rhel,multi_platform_fedora + + DIRS="/lib /lib64 /usr/lib /usr/lib64" + for dirPath in $DIRS; do +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_binary_dirs/rule.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_binary_dirs/rule.yml +index e236238..ba923d8 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_binary_dirs/rule.yml ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_binary_dirs/rule.yml +@@ -27,7 +27,7 @@ references: + srg: SRG-OS-000258-GPOS-00099 + stigid@ubuntu2004: UBTU-20-010424 + +-ocil_clause: 'any system exectables directories are found to not be owned by root' ++ocil_clause: 'any system executables directories are found to not be owned by root' + + ocil: |- + System executables are stored in the following directories by default: +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/oval/shared.xml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/oval/shared.xml +deleted file mode 100644 +index 28e193f..0000000 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/oval/shared.xml ++++ /dev/null +@@ -1,28 +0,0 @@ +- +- +- {{{ oval_metadata(" +- Checks that /lib, /lib64, /usr/lib, /usr/lib64, /lib/modules, and +- directories therein, are owned by root. +- ") }}} +- +- +- +- +- +- +- +- +- +- +- +- +- ^\/lib(|64)\/|^\/usr\/lib(|64)\/ +- +- state_owner_library_dirs_not_root +- +- +- +- 0 +- +- +- +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/rule.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/rule.yml +index d6a0bed..f0781b3 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/rule.yml ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/rule.yml +@@ -27,6 +27,8 @@ rationale: |- + severity: medium + + identifiers: ++ cce@rhel8: CCE-89021-0 ++ cce@rhel9: CCE-89022-8 + cce@sle12: CCE-83236-0 + cce@sle15: CCE-85735-9 + +@@ -34,6 +36,7 @@ references: + disa: CCI-001499 + nist: CM-5(6),CM-5(6).1 + srg: SRG-OS-000259-GPOS-00100 ++ stigid@rhel8: RHEL-08-010341 + stigid@sle12: SLES-12-010874 + stigid@sle15: SLES-15-010354 + stigid@ubuntu2004: UBTU-20-010429 +@@ -49,3 +52,14 @@ ocil: |- + For each of these directories, run the following command to find files not + owned by root: +
$ sudo find -L $DIR ! -user root -type d -exec chown root {} \;
++ ++template: ++ name: file_owner ++ vars: ++ filepath: ++ - /lib/ ++ - /lib64/ ++ - /usr/lib/ ++ - /usr/lib64/ ++ recursive: 'true' ++ fileuid: '0' +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/tests/all_dirs_ok.pass.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/tests/correct_owner.pass.sh +similarity index 69% +rename from linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/tests/all_dirs_ok.pass.sh +rename to linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/tests/correct_owner.pass.sh +index 0189166..a0d4990 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/tests/all_dirs_ok.pass.sh ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/tests/correct_owner.pass.sh +@@ -1,4 +1,4 @@ +-# platform = multi_platform_sle ++# platform = multi_platform_sle,multi_platform_rhel + DIRS="/lib /lib64 /usr/lib /usr/lib64" + for dirPath in $DIRS; do + find "$dirPath" -type d -exec chown root '{}' \; +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/tests/nobody_owned_dir_on_lib.fail.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/tests/incorrect_owner.fail.sh +similarity index 63% +rename from linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/tests/nobody_owned_dir_on_lib.fail.sh +rename to linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/tests/incorrect_owner.fail.sh +index 59b8a18..f366c2d 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/tests/nobody_owned_dir_on_lib.fail.sh ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_ownership_library_dirs/tests/incorrect_owner.fail.sh +@@ -1,4 +1,5 @@ +-# platform = multi_platform_sle ++# platform = multi_platform_sle,multi_platform_rhel ++groupadd nogroup + DIRS="/lib /lib64" + for dirPath in $DIRS; do + mkdir -p "$dirPath/testme" && chown nobody:nogroup "$dirPath/testme" +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/oval/shared.xml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/oval/shared.xml +index a0e4e24..add26b2 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/oval/shared.xml ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/oval/shared.xml +@@ -1,8 +1,8 @@ + + + {{{ oval_metadata(" +- Checks that /lib, /lib64, /usr/lib, /usr/lib64, /lib/modules, and +- objects therein, are not group-writable or world-writable. ++ Checks that the directories /lib, /lib64, /usr/lib and /usr/lib64 ++ are not group-writable or world-writable. + ") }}} + + +@@ -19,7 +19,7 @@ + ^\/lib(|64)|^\/usr\/lib(|64) + + dir_state_perms_nogroupwrite_noworldwrite +- dir_perms_state_symlink ++ dir_perms_state_nogroupwrite_noworldwrite_symlink + + + +@@ -27,7 +27,7 @@ + true + + +- ++ + symbolic link + + +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/rule.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/rule.yml +index 853f8ac..558eaa7 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/rule.yml ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/rule.yml +@@ -60,3 +60,14 @@ ocil: |- + To find shared libraries that are group-writable or world-writable, + run the following command for each directory DIR which contains shared libraries: +
$ sudo find -L DIR -perm /022 -type d
++ ++template: ++ name: file_permissions ++ vars: ++ filepath: ++ - /lib/ ++ - /lib64/ ++ - /usr/lib/ ++ - /usr/lib64/ ++ recursive: 'true' ++ filemode: '0755' +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_system_commands_dirs/ansible/shared.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_system_commands_dirs/ansible/shared.yml +index 7168288..eec7485 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_system_commands_dirs/ansible/shared.yml ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_system_commands_dirs/ansible/shared.yml +@@ -1,4 +1,4 @@ +-# platform = multi_platform_sle,Red Hat Enterprise Linux 8,multi_platform_fedora ++# platform = multi_platform_sle,Oracle Linux 8,multi_platform_rhel,multi_platform_fedora + # reboot = false + # strategy = restrict + # complexity = medium +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_system_commands_dirs/bash/shared.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_system_commands_dirs/bash/shared.sh +index a9e8c7d..e352dd3 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_system_commands_dirs/bash/shared.sh ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_groupownership_system_commands_dirs/bash/shared.sh +@@ -1,4 +1,4 @@ +-# platform = multi_platform_sle,Oracle Linux 8,Red Hat Enterprise Linux 8,multi_platform_fedora,multi_platform_ubuntu ++# platform = multi_platform_sle,Oracle Linux 8,multi_platform_rhel,multi_platform_fedora,multi_platform_ubuntu + + for SYSCMDFILES in /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin + do +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/ansible/shared.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/ansible/shared.yml +deleted file mode 100644 +index de81a37..0000000 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/ansible/shared.yml ++++ /dev/null +@@ -1,18 +0,0 @@ +-# platform = Red Hat Virtualization 4,multi_platform_fedora,multi_platform_rhel,multi_platform_ol,multi_platform_sle +-# reboot = false +-# strategy = restrict +-# complexity = medium +-# disruption = medium +-- name: "Read list libraries without root ownership" +- command: "find -L /usr/lib /usr/lib64 /lib /lib64 \\! -user root" +- register: libraries_not_owned_by_root +- changed_when: False +- failed_when: False +- check_mode: no +- +-- name: "Set ownership of system libraries to root" +- file: +- path: "{{ item }}" +- owner: "root" +- with_items: "{{ libraries_not_owned_by_root.stdout_lines }}" +- when: libraries_not_owned_by_root | length > 0 +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/bash/shared.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/bash/shared.sh +deleted file mode 100644 +index c75167d..0000000 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/bash/shared.sh ++++ /dev/null +@@ -1,8 +0,0 @@ +-# platform = Red Hat Virtualization 4,multi_platform_fedora,multi_platform_rhel,multi_platform_ol,multi_platform_sle +-for LIBDIR in /usr/lib /usr/lib64 /lib /lib64 +-do +- if [ -d $LIBDIR ] +- then +- find -L $LIBDIR \! -user root -exec chown root {} \; +- fi +-done +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/oval/shared.xml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/oval/shared.xml +deleted file mode 100644 +index 59ee3d8..0000000 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/oval/shared.xml ++++ /dev/null +@@ -1,39 +0,0 @@ +- +- +- {{{ oval_metadata(" +- Checks that /lib, /lib64, /usr/lib, /usr/lib64, /lib/modules, and +- objects therein, are owned by root. +- ") }}} +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- ^\/lib(|64)\/|^\/usr\/lib(|64)\/ +- +- state_owner_libraries_not_root +- +- +- +- +- ^\/lib(|64)\/|^\/usr\/lib(|64)\/ +- ^.*$ +- state_owner_libraries_not_root +- +- +- +- 0 +- +- +- +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/rule.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/rule.yml +index dfedd25..81089d3 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/rule.yml ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/rule.yml +@@ -59,3 +59,14 @@ ocil: |- + For each of these directories, run the following command to find files not + owned by root: +
$ sudo find -L $DIR ! -user root -exec chown root {} \;
++ ++template: ++ name: file_owner ++ vars: ++ filepath: ++ - /lib/ ++ - /lib64/ ++ - /usr/lib/ ++ - /usr/lib64/ ++ file_regex: ^.*$ ++ fileuid: '0' +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/tests/correct_owner.pass.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/tests/correct_owner.pass.sh +new file mode 100644 +index 0000000..92c6a08 +--- /dev/null ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/tests/correct_owner.pass.sh +@@ -0,0 +1,9 @@ ++# platform = multi_platform_sle,multi_platform_rhel,multi_platform_fedora,multi_platform_ubuntu ++ ++for SYSLIBDIRS in /lib /lib64 /usr/lib /usr/lib64 ++do ++ if [[ -d $SYSLIBDIRS ]] ++ then ++ find $SYSLIBDIRS ! -user root -type f -exec chown root '{}' \; ++ fi ++done +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/tests/incorrect_owner.fail.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/tests/incorrect_owner.fail.sh +new file mode 100644 +index 0000000..84da71f +--- /dev/null ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_ownership_library_dirs/tests/incorrect_owner.fail.sh +@@ -0,0 +1,11 @@ ++# platform = multi_platform_sle,multi_platform_rhel,multi_platform_fedora,multi_platform_ubuntu ++ ++useradd user_test ++for TESTFILE in /lib/test_me /lib64/test_me /usr/lib/test_me /usr/lib64/test_me ++do ++ if [[ ! -f $TESTFILE ]] ++ then ++ touch $TESTFILE ++ fi ++ chown user_test $TESTFILE ++done +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/ansible/shared.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/ansible/shared.yml +deleted file mode 100644 +index cf9eeba..0000000 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/ansible/shared.yml ++++ /dev/null +@@ -1,18 +0,0 @@ +-# platform = Red Hat Virtualization 4,multi_platform_fedora,multi_platform_rhel,multi_platform_ol,multi_platform_sle +-# reboot = false +-# strategy = restrict +-# complexity = high +-# disruption = medium +-- name: "Read list of world and group writable files in libraries directories" +- command: "find /lib /lib64 /usr/lib /usr/lib64 -perm /022 -type f" +- register: world_writable_library_files +- changed_when: False +- failed_when: False +- check_mode: no +- +-- name: "Disable world/group writability to library files" +- file: +- path: "{{ item }}" +- mode: "go-w" +- with_items: "{{ world_writable_library_files.stdout_lines }}" +- when: world_writable_library_files.stdout_lines | length > 0 +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/bash/shared.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/bash/shared.sh +deleted file mode 100644 +index af04ad6..0000000 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/bash/shared.sh ++++ /dev/null +@@ -1,5 +0,0 @@ +-# platform = multi_platform_all +-DIRS="/lib /lib64 /usr/lib /usr/lib64" +-for dirPath in $DIRS; do +- find "$dirPath" -perm /022 -type f -exec chmod go-w '{}' \; +-done +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/oval/shared.xml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/oval/shared.xml +deleted file mode 100644 +index f25c522..0000000 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/oval/shared.xml ++++ /dev/null +@@ -1,46 +0,0 @@ +- +- +- {{{ oval_metadata(" +- Checks that /lib, /lib64, /usr/lib, /usr/lib64, /lib/modules, and +- objects therein, are not group-writable or world-writable. +- ") }}} +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- ^\/lib(|64)|^\/usr\/lib(|64) +- +- state_perms_nogroupwrite_noworldwrite +- perms_state_symlink +- +- +- +- +- ^\/lib(|64)|^\/usr\/lib(|64) +- ^.*$ +- state_perms_nogroupwrite_noworldwrite +- perms_state_symlink +- +- +- +- true +- true +- +- +- +- symbolic link +- +- +- +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/rule.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/rule.yml +index 902d8b5..e9afb91 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/rule.yml ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/rule.yml +@@ -60,3 +60,14 @@ ocil: |- + To find shared libraries that are group-writable or world-writable, + run the following command for each directory DIR which contains shared libraries: +
$ sudo find -L DIR -perm /022 -type f
++ ++template: ++ name: file_permissions ++ vars: ++ filepath: ++ - /lib/ ++ - /lib64/ ++ - /usr/lib/ ++ - /usr/lib64/ ++ file_regex: ^.*$ ++ filemode: '0755' +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/tests/incorrect_permissions.fail.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/tests/lenient_permissions.fail.sh +similarity index 100% +rename from linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/tests/incorrect_permissions.fail.sh +rename to linux_os/guide/system/permissions/files/permissions_within_important_dirs/file_permissions_library_dirs/tests/lenient_permissions.fail.sh +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/rule.yml b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/rule.yml +index 3b983de..3a1e5ba 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/rule.yml ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/rule.yml +@@ -4,7 +4,7 @@ prodtype: fedora,ol8,rhel8,rhel9,sle12,sle15,ubuntu2004 + + title: |- + Verify the system-wide library files in directories +- "/lib", "/lib64", "/usr/lib/" and "/usr/lib64" are owned by root. ++ "/lib", "/lib64", "/usr/lib/" and "/usr/lib64" are group-owned by root. + + description: |- + System-wide library files are stored in the following directories +@@ -15,7 +15,7 @@ description: |- + /usr/lib64 + + All system-wide shared library files should be protected from unauthorised +- access. If any of these files is not owned by root, correct its owner with ++ access. If any of these files is not group-owned by root, correct its group-owner with + the following command: +
$ sudo chgrp root FILE
+ +@@ -46,7 +46,7 @@ references: + stigid@sle15: SLES-15-010355 + stigid@ubuntu2004: UBTU-20-01430 + +-ocil_clause: 'system wide library files are not group owned by root' ++ocil_clause: 'system wide library files are not group-owned by root' + + ocil: |- + System-wide library files are stored in the following directories: +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/correct_groupowner.pass.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/correct_groupowner.pass.sh +index a4ae285..5356d37 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/correct_groupowner.pass.sh ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/correct_groupowner.pass.sh +@@ -1,4 +1,4 @@ +-# platform = multi_platform_sle,Red Hat Enterprise Linux 8,multi_platform_fedora ++# platform = multi_platform_sle,multi_platform_rhel,multi_platform_fedora,multi_platform_ubuntu + + for SYSLIBDIRS in /lib /lib64 /usr/lib /usr/lib64 + do +diff --git a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/incorrect_groupowner.fail.sh b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/incorrect_groupowner.fail.sh +index c96f65b..9636acf 100644 +--- a/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/incorrect_groupowner.fail.sh ++++ b/linux_os/guide/system/permissions/files/permissions_within_important_dirs/root_permissions_syslibrary_files/tests/incorrect_groupowner.fail.sh +@@ -1,4 +1,4 @@ +-# platform = multi_platform_sle,Red Hat Enterprise Linux 8,multi_platform_fedora ++# platform = multi_platform_sle,multi_platform_rhel,multi_platform_fedora,multi_platform_ubuntu + + for TESTFILE in /lib/test_me /lib64/test_me /usr/lib/test_me /usr/lib64/test_me + do +diff --git a/products/rhel8/profiles/stig.profile b/products/rhel8/profiles/stig.profile +index d6f0793..5b2cc0f 100644 +--- a/products/rhel8/profiles/stig.profile ++++ b/products/rhel8/profiles/stig.profile +@@ -233,8 +233,13 @@ selections: + # RHEL-08-010340 + - file_ownership_library_dirs + ++ # RHEL-08-010341 ++ - dir_ownership_library_dirs ++ + # RHEL-08-010350 + - root_permissions_syslibrary_files ++ ++ # RHEL-08-010351 + - dir_group_ownership_library_dirs + + # RHEL-08-010359 +diff --git a/shared/references/cce-redhat-avail.txt b/shared/references/cce-redhat-avail.txt +index d8daeb3..0584677 100644 +--- a/shared/references/cce-redhat-avail.txt ++++ b/shared/references/cce-redhat-avail.txt +@@ -3074,8 +3074,6 @@ CCE-89017-8 + CCE-89018-6 + CCE-89019-4 + CCE-89020-2 +-CCE-89021-0 +-CCE-89022-8 + CCE-89023-6 + CCE-89024-4 + CCE-89025-1 +diff --git a/shared/templates/file_groupowner/ansible.template b/shared/templates/file_groupowner/ansible.template +index 68fc2e1..0b4ab59 100644 +--- a/shared/templates/file_groupowner/ansible.template ++++ b/shared/templates/file_groupowner/ansible.template +@@ -12,6 +12,7 @@ + paths: "{{{ path }}}" + patterns: {{{ FILE_REGEX[loop.index0] }}} + use_regex: yes ++ hidden: yes + register: files_found + + - name: Ensure group owner on {{{ path }}} file(s) matching {{{ FILE_REGEX[loop.index0] }}} +diff --git a/shared/templates/file_groupowner/oval.template b/shared/templates/file_groupowner/oval.template +index fd2e5db..64a4944 100644 +--- a/shared/templates/file_groupowner/oval.template ++++ b/shared/templates/file_groupowner/oval.template +@@ -45,6 +45,10 @@ + {{%- else %}} + {{{ filepath }}} + {{%- endif %}} ++ symlink_file_groupowner{{{ FILEID }}}_uid_{{{ FILEGID }}} + + {{% endfor %}} ++ ++ symbolic link ++ +
+diff --git a/shared/templates/file_owner/ansible.template b/shared/templates/file_owner/ansible.template +index 590c9fc..dba9e65 100644 +--- a/shared/templates/file_owner/ansible.template ++++ b/shared/templates/file_owner/ansible.template +@@ -12,6 +12,7 @@ + paths: "{{{ path }}}" + patterns: {{{ FILE_REGEX[loop.index0] }}} + use_regex: yes ++ hidden: yes + register: files_found + + - name: Ensure group owner on {{{ path }}} file(s) matching {{{ FILE_REGEX[loop.index0] }}} +diff --git a/shared/templates/file_owner/oval.template b/shared/templates/file_owner/oval.template +index 105e29c..777831d 100644 +--- a/shared/templates/file_owner/oval.template ++++ b/shared/templates/file_owner/oval.template +@@ -44,6 +44,10 @@ + {{%- else %}} + {{{ filepath }}} + {{%- endif %}} ++ symlink_file_owner{{{ FILEID }}}_uid_{{{ FILEUID }}} + + {{% endfor %}} ++ ++ symbolic link ++ + +diff --git a/shared/templates/file_permissions/ansible.template b/shared/templates/file_permissions/ansible.template +index fc211bd..6d4dedc 100644 +--- a/shared/templates/file_permissions/ansible.template ++++ b/shared/templates/file_permissions/ansible.template +@@ -12,6 +12,7 @@ + paths: "{{{ path }}}" + patterns: {{{ FILE_REGEX[loop.index0] }}} + use_regex: yes ++ hidden: yes + register: files_found + + - name: Set permissions for {{{ path }}} file(s) +diff --git a/tests/data/profile_stability/rhel8/stig.profile b/tests/data/profile_stability/rhel8/stig.profile +index 1b4b955..c2522c9 100644 +--- a/tests/data/profile_stability/rhel8/stig.profile ++++ b/tests/data/profile_stability/rhel8/stig.profile +@@ -175,6 +175,7 @@ selections: + - dconf_gnome_screensaver_idle_delay + - dconf_gnome_screensaver_lock_enabled + - dir_group_ownership_library_dirs ++- dir_ownership_library_dirs + - dir_permissions_library_dirs + - dir_perms_world_writable_root_owned + - dir_perms_world_writable_sticky_bits +diff --git a/tests/data/profile_stability/rhel8/stig_gui.profile b/tests/data/profile_stability/rhel8/stig_gui.profile +index 3568e07..95d87fd 100644 +--- a/tests/data/profile_stability/rhel8/stig_gui.profile ++++ b/tests/data/profile_stability/rhel8/stig_gui.profile +@@ -186,6 +186,7 @@ selections: + - dconf_gnome_screensaver_idle_delay + - dconf_gnome_screensaver_lock_enabled + - dir_group_ownership_library_dirs ++- dir_ownership_library_dirs + - dir_permissions_library_dirs + - dir_perms_world_writable_root_owned + - dir_perms_world_writable_sticky_bits diff --git a/SOURCES/scap-security-guide-0.1.61-update_accounts_password_template-PR_8164.patch b/SOURCES/scap-security-guide-0.1.61-update_accounts_password_template-PR_8164.patch new file mode 100644 index 0000000..d29385e --- /dev/null +++ b/SOURCES/scap-security-guide-0.1.61-update_accounts_password_template-PR_8164.patch @@ -0,0 +1,137 @@ +commit 11140ac5d67f256a7d3c8fdac9eca73c007dabb8 +Author: Watson Sato +Date: Mon Feb 28 11:04:30 2022 +0100 + + Manual edited patch scap-security-guide-0.1.61-update_accounts_password_template-PR_8164.patch. + +diff --git a/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_maxclassrepeat/rule.yml b/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_maxclassrepeat/rule.yml +index 1d53a71..2e47e16 100644 +--- a/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_maxclassrepeat/rule.yml ++++ b/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_maxclassrepeat/rule.yml +@@ -46,7 +46,7 @@ ocil_clause: 'that is not the case' + ocil: |- + To check the value for maximum consecutive repeating characters, run the following command: +
$ grep maxclassrepeat /etc/security/pwquality.conf
+- For DoD systems, the output should show maxclassrepeat=4. ++ For DoD systems, the output should show maxclassrepeat=4 or less but greater than zero. + + platform: pam + +@@ -55,3 +55,4 @@ template: + vars: + variable: maxclassrepeat + operation: less than or equal ++ zero_comparison_operation: greater than +diff --git a/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_maxclassrepeat/tests/correct_value.pass.sh b/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_maxclassrepeat/tests/correct_value.pass.sh +new file mode 100644 +index 0000000..5d91559 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_maxclassrepeat/tests/correct_value.pass.sh +@@ -0,0 +1,8 @@ ++#!/bin/bash ++ ++if grep -q 'maxclassrepeat' /etc/security/pwquality.conf; then ++ sed -i 's/.*maxclassrepeat.*/maxclassrepeat = 4/' /etc/security/pwquality.conf ++else ++ echo "maxclassrepeat = 4" >> /etc/security/pwquality.conf ++fi ++ +diff --git a/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_maxclassrepeat/tests/correct_value_less_than_variable.pass.sh b/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_maxclassrepeat/tests/correct_value_less_than_variable.pass.sh +new file mode 100644 +index 0000000..4bd8070 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_maxclassrepeat/tests/correct_value_less_than_variable.pass.sh +@@ -0,0 +1,8 @@ ++#!/bin/bash ++ ++if grep -q 'maxclassrepeat' /etc/security/pwquality.conf; then ++ sed -i 's/.*maxclassrepeat.*/maxclassrepeat = 2/' /etc/security/pwquality.conf ++else ++ echo "maxclassrepeat = 2" >> /etc/security/pwquality.conf ++fi ++ +diff --git a/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_maxclassrepeat/tests/negative_value.fail.sh b/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_maxclassrepeat/tests/negative_value.fail.sh +new file mode 100644 +index 0000000..61538a4 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_maxclassrepeat/tests/negative_value.fail.sh +@@ -0,0 +1,7 @@ ++#!/bin/bash ++ ++if grep -q 'maxclassrepeat' /etc/security/pwquality.conf; then ++ sed -i 's/.*maxclassrepeat.*/maxclassrepeat = -1/' /etc/security/pwquality.conf ++else ++ echo "maxclassrepeat = -1" >> /etc/security/pwquality.conf ++fi +diff --git a/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_maxclassrepeat/tests/wrong_value.fail.sh b/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_maxclassrepeat/tests/wrong_value.fail.sh +new file mode 100644 +index 0000000..2218250 +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_maxclassrepeat/tests/wrong_value.fail.sh +@@ -0,0 +1,8 @@ ++#!/bin/bash ++ ++if grep -q 'maxclassrepeat' /etc/security/pwquality.conf; then ++ sed -i 's/.*maxclassrepeat.*/maxclassrepeat = 5/' /etc/security/pwquality.conf ++else ++ echo "maxclassrepeat = 5" >> /etc/security/pwquality.conf ++fi ++ +diff --git a/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_maxclassrepeat/tests/wrong_value_0.fail.sh b/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_maxclassrepeat/tests/wrong_value_0.fail.sh +new file mode 100644 +index 0000000..780873c +--- /dev/null ++++ b/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_maxclassrepeat/tests/wrong_value_0.fail.sh +@@ -0,0 +1,8 @@ ++#!/bin/bash ++ ++if grep -q 'maxclassrepeat' /etc/security/pwquality.conf; then ++ sed -i 's/.*maxclassrepeat.*/maxclassrepeat = 0/' /etc/security/pwquality.conf ++else ++ echo "maxclassrepeat = 0" >> /etc/security/pwquality.conf ++fi ++ +diff --git a/shared/templates/accounts_password/oval.template b/shared/templates/accounts_password/oval.template +index 332a280..b995db1 100644 +--- a/shared/templates/accounts_password/oval.template ++++ b/shared/templates/accounts_password/oval.template +@@ -7,11 +7,14 @@ +
+
+ +- + + ++ {{%- if ZERO_COMPARISON_OPERATION %}} ++ ++ {{%- endif %}} + + + +@@ -24,5 +27,11 @@ + + + ++ {{%- if ZERO_COMPARISON_OPERATION %}} ++ ++ 0 ++ ++ {{%- endif %}} ++ + + +diff --git a/shared/templates/accounts_password/template.py b/shared/templates/accounts_password/template.py +index 65c25ec..ab849d1 100644 +--- a/shared/templates/accounts_password/template.py ++++ b/shared/templates/accounts_password/template.py +@@ -1,4 +1,7 @@ ++from ssg.utils import parse_template_boolean_value ++ + def preprocess(data, lang): + if lang == "oval": + data["sign"] = "-?" if data["variable"].endswith("credit") else "" ++ data["zero_comparison_operation"] = data.get("zero_comparison_operation", None) + return data diff --git a/SPECS/scap-security-guide.spec b/SPECS/scap-security-guide.spec index 3d79e8e..3c711ea 100644 --- a/SPECS/scap-security-guide.spec +++ b/SPECS/scap-security-guide.spec @@ -5,7 +5,7 @@ Name: scap-security-guide Version: 0.1.57 -Release: 5%{?dist} +Release: 9%{?dist} Summary: Security guidance and baselines in SCAP formats License: BSD-3-Clause Group: Applications/System @@ -74,6 +74,49 @@ Patch53: scap-security-guide-0.1.58-fix_rhel7_doc_link-PR_7443.patch Patch54: scap-security-guide-0.1.58-disable_ctrlaltdel_reboot_fix_test_scenario-PR_7444.patch Patch55: scap-security-guide-0.1.58-fix_cis_value_selector-PR_7452.patch Patch56: scap-security-guide-0.1.58-ism_usb_hid-PR_7493.patch +Patch57: scap-security-guide-0.1.58-RHEL_08_010400-PR_7411.patch +Patch58: scap-security-guide-0.1.58-BZ_1942281-PR_7471.patch +Patch59: scap-security-guide-0.1.59-add_missing_stig_ids-PR_7597.patch +Patch60: scap-security-guide-0.1.59-fix_6844-PR_7673.patch +Patch61: scap-security-guide-0.1.59-fix_7333-PR_7692.patch +Patch62: scap-security-guide-0.1.59-sshd_priv_keys_600-PR_7742.patch +Patch63: scap-security-guide-0.1.59-BZ1884687-PR_7770.patch +Patch64: scap-security-guide-0.1.59-BZ1884687D-PR_7837.patch +Patch65: scap-security-guide-0.1.59-BZ1884687C-PR_7824.patch +Patch66: scap-security-guide-0.1.59-BZ1884687B-PR_7790.patch +Patch67: scap-security-guide-0.1.60-rhel8_stig_v1r4-PR_7930.patch +Patch68: scap-security-guide-0.1.60-sysctl_d_directories-PR_7999.patch +Patch69: scap-security-guide-0.1.60-rhel9_stig_grub-PR_7931.patch +Patch70: scap-security-guide-0.1.59-multifile_templates-PR_7405.patch +Patch71: scap-security-guide-0.1.61-file_groupowner-PR_7791.patch +Patch72: scap-security-guide-0.1.61-file_owner-PR_7789.patch +Patch73: scap-security-guide-0.1.61-file_permissions-PR_7788.patch +Patch74: scap-security-guide-0.1.61-update_RHEL_08_010287-PR_8051.patch +Patch75: scap-security-guide-0.1.61-add_RHEL_08_010331-PR_8055.patch +Patch76: scap-security-guide-0.1.61-rhel8_stig_v1r5-PR_8050.patch +Patch77: scap-security-guide-0.1.61-add_RHEL_08_010359-PR_8131.patch +Patch78: scap-security-guide-0.1.61-update_RHEL_STIG-PR_8130.patch +Patch79: scap-security-guide-0.1.61-update_RHEL_08_STIG-PR_8139.patch +Patch80: scap-security-guide-0.1.61-add_RHEL_08_040321-PR_8169.patch +Patch81: scap-security-guide-0.1.61-add_RHEL_08_020221-PR_8173.patch +Patch82: scap-security-guide-0.1.61-update_RHEL_08_040320-PR_8170.patch +Patch83: scap-security-guide-0.1.61-rhel8_stig_audit_rules-PR_8174.patch +Patch84: scap-security-guide-0.1.61-update_RHEL_08_010030-PR_8183.patch +Patch85: scap-security-guide-0.1.61-update_accounts_password_template-PR_8164.patch +Patch86: scap-security-guide-0.1.61-update_RHEL_08_010383-PR_8138.patch +Patch87: scap-security-guide-0.1.61-remove_client_alive_max-PR_8197.patch +Patch88: scap-security-guide-0.1.61-update_RHEL_08_020041-PR_8146.patch +Patch89: scap-security-guide-0.1.61-no_time_servers_chrony-PR_8187.patch +Patch90: scap-security-guide-0.1.61-update_RHEL_08_010385-PR_8220.patch +Patch91: scap-security-guide-0.1.61-add_RHEL_08_0103789_include_sudoers-PR_8196.patch +Patch92: scap-security-guide-0.1.61-remove_tmux_process_running_check-PR_8246.patch +Patch93: scap-security-guide-0.1.58-templated_tests-PR_7211.patch +Patch94: reorder-reference-in-alphabetical-order.patch +Patch95: scap-security-guide-0.1.59-fix_accounts_umask_interactive_users-PR_7898.patch +Patch96: scap-security-guide-0.1.58-fix_rsyslog_streamdriver_remediation_typos-PR_7570.patch +Patch97: scap-security-guide-0.1.59-rsyslog_encrypt_offload_fix_7741-PR_7755.patch +Patch98: scap-security-guide-0.1.58-ansible_disable_ctrlaltdel_reboot-PR_7571.patch +Patch99: scap-security-guide-0.1.60-address_pool_directives_maxpoll_rule-PR_7910.patch BuildRequires: libxslt BuildRequires: expat @@ -177,6 +220,18 @@ cp -r %{_builddir}/%{_static_rhel6_content}/guides %{buildroot}%{_docdir}/%{name %endif %changelog +* Thu Mar 24 2022 Gabriel Becker - 0.1.57-9 +- Add missing updates to RHEL8 STIG profile version V1R5 (RHBZ#2059876) + +* Wed Mar 23 2022 Gabriel Becker - 0.1.57-8 +- Add missing updates to RHEL8 STIG profile version V1R5 (RHBZ#2059876) + +* Mon Mar 21 2022 Gabriel Becker - 0.1.57-7 +- Add missing updates to RHEL8 STIG profile version V1R5 (RHBZ#2059876) + +* Thu Feb 24 2022 Gabriel Becker - 0.1.57-6 +- Update RHEL8 STIG profile to V1R5 (RHBZ#2059876) + * Thu Sep 02 2021 Matej Tyc - 0.1.57-5 - Add USB HID rules to the ISM profile, so it is usable after the installation (RHBZ#1999423).