Guide to the Secure Configuration of Red Hat Enterprise Linux 7

with profile DISA STIG for Red Hat Enterprise Linux 7
This profile contains configuration checks that align to the DISA STIG for Red Hat Enterprise Linux V1R1. In addition to being applicable to RHEL7, DISA recognizes this configuration baseline as applicable to the operating system tier of Red Hat technologies that are based off RHEL7, such as RHEL Server, RHV-H, RHEL for HPC, RHEL Workstation, and Red Hat Storage deployments.

This guide presents a catalog of security-relevant configuration settings for Red Hat Enterprise Linux 7. It is a rendering of content structured in the eXtensible Configuration Checklist Description Format (XCCDF) in order to support security automation. The SCAP content is is available in the scap-security-guide package which is developed at https://www.open-scap.org/security-policies/scap-security-guide.

Providing system administrators with such guidance informs them how to securely configure systems under their control in a variety of network roles. Policy makers and baseline creators can use this catalog of settings, with its associated references to higher-level security control catalogs, in order to assist them in security baseline creation. This guide is a catalog, not a checklist, and satisfaction of every item is not likely to be possible or sensible in many operational scenarios. However, the XCCDF format enables granular selection and adjustment of settings, and their association with OVAL and OCIL content provides an automated checking capability. Transformations of this document, and its associated automated checking content, are capable of providing baselines that meet a diverse set of policy objectives. Some example XCCDF Profiles, which are selections of items that form checklists and can be used as baselines, are available with this guide. They can be processed, in an automated fashion, with tools that support the Security Content Automation Protocol (SCAP). The DISA STIG for Red Hat Enterprise Linux 7, which provides required settings for US Department of Defense systems, is one example of a baseline created from this guidance.

This benchmark is a direct port of a SCAP Security Guide benchmark developed for Red Hat Enterprise Linux. It has been modified through an automated process to remove specific dependencies on Red Hat Enterprise Linux and to function with CentOS. The result is a generally useful SCAP Security Guide benchmark with the following caveats:

  • CentOS is not an exact copy of Red Hat Enterprise Linux. There may be configuration differences that produce false positives and/or false negatives. If this occurs please file a bug report.
  • CentOS has its own build system, compiler options, patchsets, and is a community supported, non-commercial operating system. CentOS does not inherit certifications or evaluations from Red Hat Enterprise Linux. As such, some configuration rules (such as those requiring FIPS 140-2 encryption) will continue to fail on CentOS.

Members of the CentOS community are invited to participate in OpenSCAP and SCAP Security Guide development. Bug reports and patches can be sent to GitHub: https://github.com/OpenSCAP/scap-security-guide. The mailing list is at https://fedorahosted.org/mailman/listinfo/scap-security-guide.

Do not attempt to implement any of the settings in this guide without first testing them in a non-operational environment. The creators of this guidance assume no responsibility whatsoever for its use by other parties, and makes no guarantees, expressed or implied, about its quality, reliability, or any other characteristic.

Evaluation Characteristics

Target machinecentos
Benchmark URLrhel7-xccdf.xml
Benchmark IDxccdf_org.ssgproject.content_benchmark_RHEL-7
Profile IDxccdf_org.ssgproject.content_profile_stig-rhel7-disa
Started at2017-10-21T14:38:40
Finished at2017-10-21T14:39:59
Performed byroot

CPE Platforms

  • cpe:/o:centos:centos:7
  • cpe:/o:redhat:enterprise_linux:7
  • cpe:/o:redhat:enterprise_linux:7::client
  • cpe:/o:redhat:enterprise_linux:7::computenode

Addresses

  • IPv4  127.0.0.1
  • IPv4  172.42.208.132
  • IPv6  0:0:0:0:0:0:0:1
  • IPv6  fe80:0:0:0:20c:29ff:fe99:8ed0
  • MAC  00:00:00:00:00:00
  • MAC  00:0C:29:99:8E:D0

Compliance and Scoring

The target system did not satisfy the conditions of 97 rules! Please review rule results and consider applying remediation.

Rule results

99 passed
97 failed
3 other

Severity of failed rules

0 other
20 low
74 medium
3 high

Score

Scoring systemScoreMaximumPercent
urn:xccdf:scoring:default68.158012100.000000
68.16%

Rule Overview

Group rules by:
TitleSeverityResult
Guide to the Secure Configuration of Red Hat Enterprise Linux 7 97x fail 3x notchecked
Remediation functions used by the SCAP Security Guide Project
Introduction
General Principles
Encrypt Transmitted Data Whenever Possible
Minimize Software to Minimize Vulnerability
Run Different Network Services on Separate Systems
Configure Security Tools to Improve System Robustness
Least Privilege
How to Use This Guide
Read Sections Completely and in Order
Test in Non-Production Environment
Root Shell Environment Assumed
Formatting Conventions
Reboot Required
System Settings 90x fail 3x notchecked
Installing and Maintaining Software 12x fail 2x notchecked
Disk Partitioning 4x fail
Ensure /tmp Located On Separate Partitionlow
fail
Ensure /var Located On Separate Partitionlow
fail
Ensure /var/log Located On Separate Partitionlow
notselected
Ensure /var/log/audit Located On Separate Partitionlow
fail
Ensure /home Located On Separate Partitionlow
fail
Encrypt Partitionshigh
notselected
Updating Software 1x notchecked
Ensure Red Hat GPG Key Installedhigh
notselected
Ensure gpgcheck Enabled In Main Yum Configurationhigh
pass
Ensure gpgcheck Enabled For All Yum Package Repositorieshigh
notselected
Ensure Software Patches Installedhigh
notchecked
Ensure YUM Removes Previous Package Versionslow
pass
Ensure gpgcheck Enabled for Local Packageshigh
pass
System and Software Integrity 8x fail 1x notchecked
Software Integrity Checking 5x fail
Verify Integrity with AIDE 5x fail
Install AIDEmedium
notselected
Build and Test AIDE Databasemedium
notselected
Configure Periodic Execution of AIDEmedium
fail
Configure Notification of Post-AIDE Scan Detailsmedium
fail
Configure AIDE to Verify Access Control Lists (ACLs)medium
fail
Configure AIDE to Verify Extended Attributesmedium
fail
Configure AIDE to Use FIPS 140-2 for Validating Hashesmedium
fail
Verify Integrity with RPM
Verify and Correct File Permissions with RPMhigh
pass
Verify File Hashes with RPMhigh
pass
Endpoint Protection Software 1x fail 1x notchecked
McAfee Endpoint Security Software 1x fail 1x notchecked
McAfee Host-Based Intrusion Detection Software (HBSS)
Install the Host Intrusion Prevention System (HIPS) Modulemedium
notselected
Install the Asset Configuration Compliance Module (ACCM)medium
notselected
Install the Policy Auditor (PA) Modulemedium
notselected
Install the McAfee Runtime Libraries and Linux Agentmedium
notselected
Install McAfee Virus Scanning Softwarehigh
fail
Enable nails Servicemedium
notselected
Virus Scanning Software Definitions Are Updatedmedium
notchecked
Install Intrusion Detection Softwarehigh
notselected
Install Virus Scanning Softwarehigh
notselected
Federal Information Processing Standard (FIPS) 1x fail
Install the dracut-fips Packagemedium
notselected
Enable FIPS Mode in GRUB2medium
fail
Operating System Vendor Support and Certification 1x fail
The Installed Operating System Is Vendor Supported and Certifiedhigh
fail
GNOME Desktop Environment
Disable the GNOME3 Login User Listmedium
notselected
Disable the GNOME3 Login Restart and Shutdown Buttonshigh
notselected
Enable the GNOME3 Login Smartcard Authenticationmedium
notselected
Configure GNOME Screen Locking
Set GNOME3 Screensaver Inactivity Timeoutmedium
pass
Enable GNOME3 Screensaver Idle Activationmedium
pass
Enable GNOME3 Screensaver Lock After Idle Periodmedium
pass
Set GNOME3 Screensaver Lock Delay After Activation Periodmedium
pass
Implement Blank Screensaverlow
notselected
Ensure Users Cannot Change GNOME3 Session Settingslow
pass
GNOME System Settings
Disable Ctrl-Alt-Del Reboot Key Sequence in GNOME3high
notselected
Disable User Administration in GNOME3high
notselected
Disable Power Settings in GNOME3medium
notselected
Disable Geolocation in GNOME3medium
notselected
GNOME Network Settings
Disable WIFI Network Connection Creation in GNOME3medium
notselected
Disable WIFI Network Notification in GNOME3medium
notselected
GNOME Remote Access Settings
Require Credential Prompting for Remote Access in GNOME3medium
notselected
Require Encryption for Remote Access in GNOME3medium
notselected
GNOME Media Settings
Disable GNOME3 Automountinglow
notselected
Disable All GNOME3 Thumbnailerslow
notselected
Sudo
Ensure Users Re-Authenticate for Privilege Escalation - sudo NOPASSWDmedium
pass
Ensure Users Re-Authenticate for Privilege Escalation - sudo !authenticatemedium
pass
File Permissions and Masks 2x fail
Restrict Partition Mount Options 1x fail
Add nodev Option to Non-Root Local Partitionslow
notselected
Add nodev Option to Removable Media Partitionslow
notselected
Add noexec Option to Removable Media Partitionslow
notselected
Add nosuid Option to Removable Media Partitionslow
pass
Add nodev Option to /tmplow
notselected
Add noexec Option to /tmplow
notselected
Add nosuid Option to /tmplow
notselected
Add nosuid Option to /homelow
fail
Add nodev Option to /dev/shmlow
notselected
Add noexec Option to /dev/shmlow
notselected
Add nosuid Option to /dev/shmlow
notselected
Bind Mount /var/tmp To /tmplow
notselected
Restrict Dynamic Mounting and Unmounting of Filesystems 1x fail
Disable Modprobe Loading of USB Storage Drivermedium
fail
Disable Kernel Support for USB via Bootloader Configurationlow
notselected
Disable Booting from USB Devices in Boot Firmwarelow
notselected
Assign Password to Prevent Changes to Boot Firmware Configurationlow
notselected
Disable the Automountermedium
pass
Disable Mounting of cramfslow
notselected
Disable Mounting of freevxfslow
notselected
Disable Mounting of jffs2low
notselected
Disable Mounting of hfslow
notselected
Disable Mounting of hfspluslow
notselected
Disable Mounting of squashfslow
notselected
Disable Mounting of udflow
notselected
Verify Permissions on Important Files and Directories
Verify User Who Owns shadow Filemedium
notselected
Verify Group Who Owns shadow Filemedium
notselected
Verify Permissions on shadow Filemedium
notselected
Verify User Who Owns group Filemedium
notselected
Verify Group Who Owns group Filemedium
notselected
Verify Permissions on group Filemedium
notselected
Verify User Who Owns gshadow Filemedium
notselected
Verify Group Who Owns gshadow Filemedium
notselected
Verify Permissions on gshadow Filemedium
notselected
Verify User Who Owns passwd Filemedium
notselected
Verify Group Who Owns passwd Filemedium
notselected
Verify Permissions on passwd Filemedium
notselected
Verify File Permissions Within Some Important Directories
Verify that Shared Library Files Have Restrictive Permissionsmedium
notselected
Verify that Shared Library Files Have Root Ownershipmedium
notselected
Verify that System Executables Have Restrictive Permissionsmedium
notselected
Verify that System Executables Have Root Ownershipmedium
notselected
Verify that All World-Writable Directories Have Sticky Bits Setlow
notselected
Ensure No World-Writable Files Existmedium
notselected
Ensure All SGID Executables Are Authorizedlow
notselected
Ensure All SUID Executables Are Authorizedlow
notselected
Ensure All Files Are Owned by a Usermedium
pass
Ensure All Files Are Owned by a Groupmedium
pass
Ensure All World-Writable Directories Are Owned by a System Accountlow
pass
Restrict Programs from Dangerous Execution Patterns
Daemon Umask
Set Daemon Umasklow
notselected
Disable Core Dumps
Disable Core Dumps for All Userslow
notselected
Disable Core Dumps for SUID programslow
notselected
Enable ExecShield
Enable ExecShieldmedium
notselected
Enable Randomized Layout of Virtual Address Spacemedium
notselected
Enable Execute Disable (XD) or No Execute (NX) Support on x86 Systems
Install PAE Kernel on Supported 32-bit x86 Systemslow
notselected
Enable NX or XD Support in the BIOSlow
notselected
Restrict Access to Kernel Message Bufferlow
notselected
SELinux 1x fail
SELinux - Booleans
Disable the abrt_anon_write SELinux Booleanmedium
notselected
Disable the abrt_handle_event SELinux Booleanmedium
notselected
Disable the abrt_upload_watch_anon_write SELinux Booleanmedium
notselected
Enable the antivirus_can_scan_system SELinux Booleanmedium
notselected
Disable the antivirus_use_jit SELinux Booleanmedium
notselected
Enable the auditadm_exec_content SELinux Booleanmedium
notselected
Disable the authlogin_nsswitch_use_ldap SELinux Booleanmedium
notselected
Disable the authlogin_radius SELinux Booleanmedium
notselected
Disable the authlogin_yubikey SELinux Booleanmedium
notselected
Disable the awstats_purge_apache_log_files SELinux Booleanmedium
notselected
Disable the boinc_execmem SELinux Booleanmedium
notselected
Disable the cdrecord_read_content SELinux Booleanmedium
notselected
Disable the cluster_can_network_connect SELinux Booleanmedium
notselected
Disable the cluster_manage_all_files SELinux Booleanmedium
notselected
Disable the cluster_use_execmem SELinux Booleanmedium
notselected
Disable the cobbler_anon_write SELinux Booleanmedium
notselected
Disable the cobbler_can_network_connect SELinux Booleanmedium
notselected
Disable the cobbler_use_cifs SELinux Booleanmedium
notselected
Disable the cobbler_use_nfs SELinux Booleanmedium
notselected
Disable the collectd_tcp_network_connect SELinux Booleanmedium
notselected
Disable the condor_tcp_network_connect SELinux Booleanmedium
notselected
Disable the conman_can_network SELinux Booleanmedium
notselected
Disable the cron_can_relabel SELinux Booleanmedium
notselected
Disable the cron_system_cronjob_use_shares SELinux Booleanmedium
notselected
Enable the cron_userdomain_transition SELinux Booleanmedium
notselected
Disable the cups_execmem SELinux Booleanmedium
notselected
Disable the cvs_read_shadow SELinux Booleanmedium
notselected
Disable the daemons_dump_core SELinux Booleanmedium
notselected
Disable the daemons_enable_cluster_mode SELinux Booleanmedium
notselected
Disable the daemons_use_tcp_wrapper SELinux Booleanmedium
notselected
Disable the daemons_use_tty SELinux Booleanmedium
notselected
Enable the dbadm_exec_content SELinux Booleanmedium
notselected
Disable the dbadm_manage_user_files SELinux Booleanmedium
notselected
Disable the dbadm_read_user_files SELinux Booleanmedium
notselected
Disable the deny_execmem SELinux Booleanmedium
notselected
Disable the deny_ptrace SELinux Booleanmedium
notselected
Disable the dhcpc_exec_iptables SELinux Booleanmedium
notselected
Disable the dhcpd_use_ldap SELinux Booleanmedium
notselected
Disable the docker_connect_any SELinux Booleanmedium
notselected
Enable the docker_transition_unconfined SELinux Booleanmedium
notselected
Enable the domain_fd_use SELinux Booleanmedium
notselected
Disable the domain_kernel_load_modules SELinux Booleanmedium
notselected
Disable the entropyd_use_audio SELinux Booleanmedium
notselected
Disable the exim_can_connect_db SELinux Booleanmedium
notselected
Disable the exim_manage_user_files SELinux Booleanmedium
notselected
Disable the exim_read_user_files SELinux Booleanmedium
notselected
Disable the fcron_crond SELinux Booleanmedium
notselected
Disable the fenced_can_network_connect SELinux Booleanmedium
notselected
Disable the fenced_can_ssh SELinux Booleanmedium
notselected
Enable the fips_mode SELinux Booleanmedium
notselected
Disable the ftpd_anon_write SELinux Booleanmedium
notselected
Disable the ftpd_connect_all_unreserved SELinux Booleanmedium
notselected
Disable the ftpd_connect_db SELinux Booleanmedium
notselected
Disable the ftpd_full_access SELinux Booleanmedium
notselected
Disable the ftpd_use_cifs SELinux Booleanmedium
notselected
Disable the ftpd_use_fusefs SELinux Booleanmedium
notselected
Disable the ftpd_use_nfs SELinux Booleanmedium
notselected
Disable the ftpd_use_passive_mode SELinux Booleanmedium
notselected
Disable the ftp_home_dir SELinux Booleanmedium
notselected
Disable the git_cgi_enable_homedirs SELinux Booleanmedium
notselected
Disable the git_cgi_use_cifs SELinux Booleanmedium
notselected
Disable the git_cgi_use_nfs SELinux Booleanmedium
notselected
Disable the gitosis_can_sendmail SELinux Booleanmedium
notselected
Disable the git_session_bind_all_unreserved_ports SELinux Booleanmedium
notselected
Disable the git_session_users SELinux Booleanmedium
notselected
Disable the git_system_enable_homedirs SELinux Booleanmedium
notselected
Disable the git_system_use_cifs SELinux Booleanmedium
notselected
Disable the git_system_use_nfs SELinux Booleanmedium
notselected
Disable the glance_api_can_network SELinux Booleanmedium
notselected
Disable the glance_use_execmem SELinux Booleanmedium
notselected
Disable the glance_use_fusefs SELinux Booleanmedium
notselected
Disable the global_ssp SELinux Booleanmedium
notselected
Disable the gluster_anon_write SELinux Booleanmedium
notselected
Disable the gluster_export_all_ro SELinux Booleanmedium
notselected
Configure the gluster_export_all_rw SELinux Booleanmedium
notselected
Disable the gpg_web_anon_write SELinux Booleanmedium
notselected
Enable the gssd_read_tmp SELinux Booleanmedium
notselected
Disable the guest_exec_content SELinux Booleanmedium
notselected
Disable the haproxy_connect_any SELinux Booleanmedium
notselected
Disable the httpd_anon_write SELinux Booleanmedium
notselected
Configure the httpd_builtin_scripting SELinux Booleanmedium
notselected
Disable the httpd_can_check_spam SELinux Booleanmedium
notselected
Disable the httpd_can_connect_ftp SELinux Booleanmedium
notselected
Disable the httpd_can_connect_ldap SELinux Booleanmedium
notselected
Disable the httpd_can_connect_mythtv SELinux Booleanmedium
notselected
Disable the httpd_can_connect_zabbix SELinux Booleanmedium
notselected
Disable the httpd_can_network_connect_cobbler SELinux Booleanmedium
notselected
Disable the httpd_can_network_connect_db SELinux Booleanmedium
notselected
Disable the httpd_can_network_connect SELinux Booleanmedium
notselected
Disable the httpd_can_network_memcache SELinux Booleanmedium
notselected
Disable the httpd_can_network_relay SELinux Booleanmedium
notselected
Disable the httpd_can_sendmail SELinux Booleanmedium
notselected
Disable the httpd_dbus_avahi SELinux Booleanmedium
notselected
Disable the httpd_dbus_sssd SELinux Booleanmedium
notselected
Disable the httpd_dontaudit_search_dirs SELinux Booleanmedium
notselected
Configure the httpd_enable_cgi SELinux Booleanmedium
notselected
Disable the httpd_enable_ftp_server SELinux Booleanmedium
notselected
Disable the httpd_enable_homedirs SELinux Booleanmedium
notselected
Disable the httpd_execmem SELinux Booleanmedium
notselected
Enable the httpd_graceful_shutdown SELinux Booleanmedium
notselected
Disable the httpd_manage_ipa SELinux Booleanmedium
notselected
Disable the httpd_mod_auth_ntlm_winbind SELinux Booleanmedium
notselected
Disable the httpd_mod_auth_pam SELinux Booleanmedium
notselected
Disable the httpd_read_user_content SELinux Booleanmedium
notselected
Disable the httpd_run_ipa SELinux Booleanmedium
notselected
Disable the httpd_run_preupgrade SELinux Booleanmedium
notselected
Disable the httpd_run_stickshift SELinux Booleanmedium
notselected
Disable the httpd_serve_cobbler_files SELinux Booleanmedium
notselected
Disable the httpd_setrlimit SELinux Booleanmedium
notselected
Disable the httpd_ssi_exec SELinux Booleanmedium
notselected
Disable the httpd_sys_script_anon_write SELinux Booleanmedium
notselected
Disable the httpd_tmp_exec SELinux Booleanmedium
notselected
Disable the httpd_tty_comm SELinux Booleanmedium
notselected
Disable the httpd_unified SELinux Booleanmedium
notselected
Disable the httpd_use_cifs SELinux Booleanmedium
notselected
Disable the httpd_use_fusefs SELinux Booleanmedium
notselected
Disable the httpd_use_gpg SELinux Booleanmedium
notselected
Disable the httpd_use_nfs SELinux Booleanmedium
notselected
Disable the httpd_use_openstack SELinux Booleanmedium
notselected
Disable the httpd_use_sasl SELinux Booleanmedium
notselected
Disable the httpd_verify_dns SELinux Booleanmedium
notselected
Disable the icecast_use_any_tcp_ports SELinux Booleanmedium
notselected
Disable the irc_use_any_tcp_ports SELinux Booleanmedium
notselected
Disable the irssi_use_full_network SELinux Booleanmedium
notselected
Disable the kdumpgui_run_bootloader SELinux Booleanmedium
notselected
Enable the kerberos_enabled SELinux Booleanmedium
notselected
Disable the ksmtuned_use_cifs SELinux Booleanmedium
notselected
Disable the ksmtuned_use_nfs SELinux Booleanmedium
notselected
Enable the logadm_exec_content SELinux Booleanmedium
notselected
Disable the logging_syslogd_can_sendmail SELinux Booleanmedium
notselected
Disable the logging_syslogd_run_nagios_plugins SELinux Booleanmedium
notselected
Enable the logging_syslogd_use_tty SELinux Booleanmedium
notselected
Disable the logrotate_use_nfs SELinux Booleanmedium
notselected
Disable the logwatch_can_network_connect_mail SELinux Booleanmedium
notselected
Disable the lsmd_plugin_connect_any SELinux Booleanmedium
notselected
Disable the mailman_use_fusefs SELinux Booleanmedium
notselected
Disable the mcelog_client SELinux Booleanmedium
notselected
Enable the mcelog_exec_scripts SELinux Booleanmedium
notselected
Disable the mcelog_foreground SELinux Booleanmedium
notselected
Disable the mcelog_server SELinux Booleanmedium
notselected
Disable the minidlna_read_generic_user_content SELinux Booleanmedium
notselected
Disable the mmap_low_allowed SELinux Booleanmedium
notselected
Disable the mock_enable_homedirs SELinux Booleanmedium
notselected
Enable the mount_anyfile SELinux Booleanmedium
notselected
Disable the mozilla_plugin_bind_unreserved_ports SELinux Booleanmedium
notselected
Disable the mozilla_plugin_can_network_connect SELinux Booleanmedium
notselected
Disable the mozilla_plugin_use_bluejeans SELinux Booleanmedium
notselected
Disable the mozilla_plugin_use_gps SELinux Booleanmedium
notselected
Disable the mozilla_plugin_use_spice SELinux Booleanmedium
notselected
Disable the mozilla_read_content SELinux Booleanmedium
notselected
Disable the mpd_enable_homedirs SELinux Booleanmedium
notselected
Disable the mpd_use_cifs SELinux Booleanmedium
notselected
Disable the mpd_use_nfs SELinux Booleanmedium
notselected
Disable the mplayer_execstack SELinux Booleanmedium
notselected
Disable the mysql_connect_any SELinux Booleanmedium
notselected
Disable the nagios_run_pnp4nagios SELinux Booleanmedium
notselected
Disable the nagios_run_sudo SELinux Booleanmedium
notselected
Disable the named_tcp_bind_http_port SELinux Booleanmedium
notselected
Disable the named_write_master_zones SELinux Booleanmedium
notselected
Disable the neutron_can_network SELinux Booleanmedium
notselected
Disable the nfsd_anon_write SELinux Booleanmedium
notselected
Enable the nfs_export_all_ro SELinux Booleanmedium
notselected
Enable the nfs_export_all_rw SELinux Booleanmedium
notselected
Disable the nis_enabled SELinux Booleanmedium
notselected
Enable the nscd_use_shm SELinux Booleanmedium
notselected
Disable the openshift_use_nfs SELinux Booleanmedium
notselected
Disable the openvpn_can_network_connect SELinux Booleanmedium
notselected
Disable the openvpn_enable_homedirs SELinux Booleanmedium
notselected
Disable the openvpn_run_unconfined SELinux Booleanmedium
notselected
Disable the pcp_bind_all_unreserved_ports SELinux Booleanmedium
notselected
Disable the pcp_read_generic_logs SELinux Booleanmedium
notselected
Disable the piranha_lvs_can_network_connect SELinux Booleanmedium
notselected
Disable the polipo_connect_all_unreserved SELinux Booleanmedium
notselected
Disable the polipo_session_bind_all_unreserved_ports SELinux Booleanmedium
notselected
Disable the polipo_session_users SELinux Booleanmedium
notselected
Disable the polipo_use_cifs SELinux Booleanmedium
notselected
Disable the polipo_use_nfs SELinux Booleanmedium
notselected
Disable the polyinstantiation_enabled SELinux Booleanmedium
notselected
Enable the postfix_local_write_mail_spool SELinux Booleanmedium
notselected
Disable the postgresql_can_rsync SELinux Booleanmedium
notselected
Disable the postgresql_selinux_transmit_client_label SELinux Booleanmedium
notselected
Enable the postgresql_selinux_unconfined_dbadm SELinux Booleanmedium
notselected
Enable the postgresql_selinux_users_ddl SELinux Booleanmedium
notselected
Disable the pppd_can_insmod SELinux Booleanmedium
notselected
Disable the pppd_for_user SELinux Booleanmedium
notselected
Disable the privoxy_connect_any SELinux Booleanmedium
notselected
Disable the prosody_bind_http_port SELinux Booleanmedium
notselected
Disable the puppetagent_manage_all_files SELinux Booleanmedium
notselected
Disable the puppetmaster_use_db SELinux Booleanmedium
notselected
Disable the racoon_read_shadow SELinux Booleanmedium
notselected
Disable the rsync_anon_write SELinux Booleanmedium
notselected
Disable the rsync_client SELinux Booleanmedium
notselected
Disable the rsync_export_all_ro SELinux Booleanmedium
notselected
Disable the rsync_full_access SELinux Booleanmedium
notselected
Disable the samba_create_home_dirs SELinux Booleanmedium
notselected
Disable the samba_domain_controller SELinux Booleanmedium
notselected
Disable the samba_enable_home_dirs SELinux Booleanmedium
notselected
Disable the samba_export_all_ro SELinux Booleanmedium
notselected
Disable the samba_export_all_rw SELinux Booleanmedium
notselected
Disable the samba_load_libgfapi SELinux Booleanmedium
notselected
Disable the samba_portmapper SELinux Booleanmedium
notselected
Disable the samba_run_unconfined SELinux Booleanmedium
notselected
Disable the samba_share_fusefs SELinux Booleanmedium
notselected
Disable the samba_share_nfs SELinux Booleanmedium
notselected
Disable the sanlock_use_fusefs SELinux Booleanmedium
notselected
Disable the sanlock_use_nfs SELinux Booleanmedium
notselected
Disable the sanlock_use_samba SELinux Booleanmedium
notselected
Disable the saslauthd_read_shadow SELinux Booleanmedium
notselected
Enable the secadm_exec_content SELinux Booleanmedium
notselected
Disable the secure_mode_insmod SELinux Booleanmedium
notselected
Disable the secure_mode SELinux Booleanmedium
notselected
Disable the secure_mode_policyload SELinux Booleanmedium
notselected
Configure the selinuxuser_direct_dri_enabled SELinux Booleanmedium
notselected
Disable the selinuxuser_execheap SELinux Booleanmedium
notselected
Enable the selinuxuser_execmod SELinux Booleanmedium
notselected
disable the selinuxuser_execstack SELinux Booleanmedium
notselected
Disable the selinuxuser_mysql_connect_enabled SELinux Booleanmedium
notselected
Enable the selinuxuser_ping SELinux Booleanmedium
notselected
Disable the selinuxuser_postgresql_connect_enabled SELinux Booleanmedium
notselected
Disable the selinuxuser_rw_noexattrfile SELinux Booleanmedium
notselected
Disable the selinuxuser_share_music SELinux Booleanmedium
notselected
Disable the selinuxuser_tcp_server SELinux Booleanmedium
notselected
Disable the selinuxuser_udp_server SELinux Booleanmedium
notselected
Disable the selinuxuser_use_ssh_chroot SELinux Booleanmedium
notselected
Disable the sftpd_anon_write SELinux Booleanmedium
notselected
Disable the sftpd_enable_homedirs SELinux Booleanmedium
notselected
Disable the sftpd_full_access SELinux Booleanmedium
notselected
Disable the sftpd_write_ssh_home SELinux Booleanmedium
notselected
Disable the sge_domain_can_network_connect SELinux Booleanmedium
notselected
Disable the sge_use_nfs SELinux Booleanmedium
notselected
Disable the smartmon_3ware SELinux Booleanmedium
notselected
Disable the smbd_anon_write SELinux Booleanmedium
notselected
Disable the spamassassin_can_network SELinux Booleanmedium
notselected
Enable the spamd_enable_home_dirs SELinux Booleanmedium
notselected
Disable the squid_connect_any SELinux Booleanmedium
notselected
Disable the squid_use_tproxy SELinux Booleanmedium
notselected
Disable the ssh_chroot_rw_homedirs SELinux Booleanmedium
notselected
Disable the ssh_keysign SELinux Booleanmedium
notselected
Enable the staff_exec_content SELinux Booleanmedium
notselected
Disable the staff_use_svirt SELinux Booleanmedium
notselected
Disable the swift_can_network SELinux Booleanmedium
notselected
Enable the sysadm_exec_content SELinux Booleanmedium
notselected
Disable the telepathy_connect_all_ports SELinux Booleanmedium
notselected
Disable the telepathy_tcp_connect_generic_network_ports SELinux Booleanmedium
notselected
Disable the tftp_anon_write SELinux Booleanmedium
notselected
Disable the tftp_home_dir SELinux Booleanmedium
notselected
Disable the tmpreaper_use_nfs SELinux Booleanmedium
notselected
Disable the tmpreaper_use_samba SELinux Booleanmedium
notselected
Disable the tor_bind_all_unreserved_ports SELinux Booleanmedium
notselected
Disable the tor_can_network_relay SELinux Booleanmedium
notselected
Enable the unconfined_chrome_sandbox_transition SELinux Booleanmedium
notselected
Enable the unconfined_mozilla_plugin_transition SELinux Booleanmedium
notselected
Disable the unprivuser_use_svirt SELinux Booleanmedium
notselected
Disable the use_ecryptfs_home_dirs SELinux Booleanmedium
notselected
Disable the use_fusefs_home_dirs SELinux Booleanmedium
notselected
Disable the use_lpd_server SELinux Booleanmedium
notselected
Disable the use_nfs_home_dirs SELinux Booleanmedium
notselected
Enable the user_exec_content SELinux Booleanmedium
notselected
Disable the use_samba_home_dirs SELinux Booleanmedium
notselected
Disable the varnishd_connect_any SELinux Booleanmedium
notselected
Disable the virt_read_qemu_ga_data SELinux Booleanmedium
notselected
Disable the virt_rw_qemu_ga_data SELinux Booleanmedium
notselected
Disable the virt_sandbox_use_all_caps SELinux Booleanmedium
notselected
Enable the virt_sandbox_use_audit SELinux Booleanmedium
notselected
Disable the virt_sandbox_use_mknod SELinux Booleanmedium
notselected
Disable the virt_sandbox_use_nfs SELinux Booleanmedium
notselected
Disable the virt_sandbox_use_samba SELinux Booleanmedium
notselected
Disable the virt_sandbox_use_sys_admin SELinux Booleanmedium
notselected
Disable the virt_transition_userdomain SELinux Booleanmedium
notselected
Disable the virt_use_comm SELinux Booleanmedium
notselected
Disable the virt_use_execmem SELinux Booleanmedium
notselected
Disable the virt_use_fusefs SELinux Booleanmedium
notselected
Disable the virt_use_nfs SELinux Booleanmedium
notselected
Disable the virt_use_rawip SELinux Booleanmedium
notselected
Disable the virt_use_samba SELinux Booleanmedium
notselected
Disable the virt_use_sanlock SELinux Booleanmedium
notselected
Disable the virt_use_usb SELinux Booleanmedium
notselected
Disable the virt_use_xserver SELinux Booleanmedium
notselected
Disable the webadm_manage_user_files SELinux Booleanmedium
notselected
Disable the webadm_read_user_files SELinux Booleanmedium
notselected
Disable the wine_mmap_zero_ignore SELinux Booleanmedium
notselected
Disable the xdm_bind_vnc_tcp_port SELinux Booleanmedium
notselected
Disable the xdm_exec_bootloader SELinux Booleanmedium
notselected
Disable the xdm_write_home SELinux Booleanmedium
notselected
Enable the xend_run_blktap SELinux Booleanmedium
notselected
Enable the xend_run_qemu SELinux Booleanmedium
notselected
Disable the xen_use_nfs SELinux Booleanmedium
notselected
Disable the xguest_connect_network SELinux Booleanmedium
notselected
Disable the xguest_exec_content SELinux Booleanmedium
notselected
Disable the xguest_mount_media SELinux Booleanmedium
notselected
Disable the xguest_use_bluetooth SELinux Booleanmedium
notselected
Disable the xserver_clients_write_xshm SELinux Booleanmedium
notselected
Disable the xserver_execmem SELinux Booleanmedium
notselected
Disable the xserver_object_manager SELinux Booleanmedium
notselected
Disable the zabbix_can_network SELinux Booleanmedium
notselected
Disable the zarafa_setrlimit SELinux Booleanmedium
notselected
Disable the zebra_write_config SELinux Booleanmedium
notselected
Disable the zoneminder_anon_write SELinux Booleanmedium
notselected
Disable the zoneminder_run_sudo SELinux Booleanmedium
notselected
Ensure SELinux Not Disabled in /etc/default/grubmedium
notselected
Ensure SELinux State is Enforcinghigh
pass
Configure SELinux Policyhigh
pass
Uninstall setroubleshoot Packagelow
notselected
Uninstall mcstrans Packagelow
notselected
Ensure No Daemons are Unconfined by SELinuxmedium
notselected
Ensure No Device Files are Unlabeled by SELinuxmedium
fail
Ensure SELinux support is enabled in Dockerhigh
notselected
Account and Access Control 4x fail
Protect Accounts by Restricting Password-Based Login
Restrict Root Logins
Direct root Logins Not Allowedmedium
notselected
Restrict Serial Port Root Loginslow
notselected
Restrict Web Browser Use for Administrative Accountslow
notselected
Ensure that System Accounts Do Not Run a Shell Upon Loginmedium
notselected
Verify Only Root Has UID 0high
pass
Root Path Must Be Vendor Defaultlow
notselected
Verify Proper Storage and Existence of Password Hashes
Prevent Log In to Accounts With Empty Passwordhigh
pass
Verify All Account Password Hashes are Shadowedmedium
notselected
All GIDs referenced in /etc/passwd must be defined in /etc/grouplow
pass
Verify No netrc Files Existmedium
notselected
Set Password Expiration Parameters
Protect Accounts by Configuring PAM 2x fail
Set Password Quality Requirements 1x fail
Set Password Quality Requirements with pam_pwquality 1x fail
Set Password Retry Prompts Permitted Per-Sessionlow
fail
Set Password Maximum Consecutive Repeating Charactersmedium
pass
Set Password to Maximum of Consecutive Repeating Characters from Same Character Classmedium
pass
Set Password Strength Minimum Digit Charactersmedium
pass
Set Password Minimum Lengthmedium
pass
Set Password Strength Minimum Uppercase Charactersmedium
pass
Set Password Strength Minimum Special Charactersmedium
pass
Set Password Strength Minimum Lowercase Charactersmedium
pass
Set Password Strength Minimum Different Charactersmedium
pass
Set Password Strength Minimum Different Categoriesmedium
pass
Set Lockouts for Failed Password Attempts 1x fail
Set Deny For Failed Password Attemptsmedium
pass
Set Lockout Time For Failed Password Attemptsmedium
pass
Configure the root Account for Failed Password Attemptsmedium
fail
Set Interval For Counting Failed Password Attemptsmedium
pass
Limit Password Reusemedium
pass
Set Password Hashing Algorithm
Set PAM's Password Hashing Algorithmmedium
pass
Set Password Hashing Algorithm in /etc/login.defsmedium
pass
Set Password Hashing Algorithm in /etc/libuser.confmedium
pass
Secure Session Configuration Files for Login Accounts 1x fail
Ensure that No Dangerous Directories Exist in Root's Path
Ensure that Root's Path Does Not Include Relative Paths or Null Directorieslow
notselected
Ensure that Root's Path Does Not Include World or Group-Writable Directorieslow
notselected
Ensure that Users Have Sensible Umask Values
Ensure the Default Bash Umask is Set Correctlylow
notselected
Ensure the Default C Shell Umask is Set Correctlylow
notselected
Ensure the Default Umask is Set Correctly in /etc/profilelow
notselected
Ensure Home Directories are Created for New Usersmedium
fail
Set Interactive Session Timeoutmedium
pass
Ensure the Logon Failure Delay is Set Correctly in login.defslow
pass
Ensure that User Home Directories are not Group-Writable or World-Readablelow
notselected
Protect Physical Console Access 1x fail
Set Boot Loader Password 1x fail
Verify /boot/grub2/grub.cfg User Ownershipmedium
notselected
Verify /boot/grub2/grub.cfg Group Ownershipmedium
notselected
Verify /boot/grub2/grub.cfg Permissionsmedium
notselected
Set Boot Loader Passwordhigh
fail
Set the UEFI Boot Loader Passwordmedium
pass
Configure Screen Locking
Configure Console Screen Locking
Install the screen Packagemedium
pass
Enable Smart Card Loginmedium
pass
Require Authentication for Single User Modemedium
notselected
Disable debug-shell SystemD Servicemedium
notselected
Disable Ctrl-Alt-Del Reboot Activationhigh
pass
Verify that Interactive Boot is Disabledmedium
notselected
Warning Banners for System Accesses
Enable GNOME3 Login Warning Bannermedium
pass
Modify the System Login Bannermedium
pass
Network Configuration and Firewalls 8x fail 1x notchecked
Disable Unused Interfaces
Kernel Parameters Which Affect Networking 6x fail
Network Parameters for Hosts Only 3x fail
Disable Kernel Parameter for Sending ICMP Redirects by Defaultmedium
fail
Disable Kernel Parameter for Sending ICMP Redirects for All Interfacesmedium
fail
Disable Kernel Parameter for IP Forwardingmedium
fail
Network Related Kernel Runtime Parameters for Hosts and Routers 3x fail
Configure Kernel Parameter for Accepting Source-Routed Packets for All Interfacesmedium
pass
Configure Kernel Parameter for Accepting ICMP Redirects for All Interfacesmedium
fail
Configure Kernel Parameter for Accepting Secure Redirects for All Interfacesmedium
notselected
Configure Kernel Parameter to Log Martian Packetslow
notselected
Configure Kernel Parameter to Log Martian Packets By Defaultlow
notselected
Configure Kernel Parameter for Accepting Source-Routed Packets By Defaultmedium
pass
Configure Kernel Parameter for Accepting ICMP Redirects By Defaultmedium
fail
Configure Kernel Parameter for Accepting Secure Redirects By Defaultmedium
notselected
Configure Kernel Parameter to Ignore ICMP Broadcast Echo Requestsmedium
fail
Configure Kernel Parameter to Ignore Bogus ICMP Error Responseslow
notselected
Configure Kernel Parameter to Use TCP Syncookiesmedium
notselected
Configure Kernel Parameter to Use Reverse Path Filtering for All Interfacesmedium
notselected
Configure Kernel Parameter to Use Reverse Path Filtering by Defaultmedium
notselected
Wireless Networking
Disable Wireless Through Software Configuration
Disable WiFi or Bluetooth in BIOSlow
notselected
Deactivate Wireless Network Interfaceslow
notselected
Disable Bluetooth Servicemedium
notselected
Disable Bluetooth Kernel Modulesmedium
notselected
IPv6 1x fail
Disable Support for IPv6 Unless Needed
Disable IPv6 Networking Support Automatic Loadingmedium
notselected
Disable Interface Usage of IPv6low
notselected
Disable Support for RPC IPv6low
notselected
Configure IPv6 Settings if Necessary 1x fail
Disable Automatic Configuration 1x fail
Configure Kernel Parameter for Accepting Source-Routed Packets for All Interfacesmedium
fail
Configure Accepting IPv6 Router Advertisementslow
notselected
Configure Accepting IPv6 Router Advertisementslow
notselected
Configure Accepting IPv6 Redirects By Defaultmedium
notselected
Configure Accepting IPv6 Redirects By Defaultmedium
notselected
Configure Kernel Parameter for Accepting Source-Routed Packets for Interfaces By Defaultmedium
notselected
Disable Kernel Parameter for IPv6 Forwardingmedium
notselected
Limit Network-Transmitted Configuration if Using Static IPv6 Addresses
Manually Assign Global IPv6 Addresslow
notselected
Use Privacy Extensions for Addresslow
notselected
Manually Assign IPv6 Router Addresslow
notselected
firewalld
Inspect and Activate Default firewalld Rules
Verify firewalld Enabledmedium
pass
Strengthen the Default Ruleset
Set Default firewalld Zone for Incoming Packetsmedium
pass
Transport Layer Security Support
Uncommon Network Protocols
Disable DCCP Supportmedium
notselected
Disable SCTP Supportmedium
notselected
IPSec Support 1x notchecked
Install libreswan Packagemedium
notselected
Verify Any Configured IPSec Tunnel Connectionsmedium
notchecked
Disable Client Dynamic DNS Updatesmedium
notselected
Disable Zeroconf Networkinglow
notselected
Configure Multiple DNS Servers in /etc/resolv.conflow
fail
Ensure System is Not Acting as a Network Sniffermedium
pass
Configure Syslog 1x fail
Ensure Proper Configuration of Log Files
Ensure Log Files Are Owned By Appropriate Usermedium
notselected
Ensure Log Files Are Owned By Appropriate Groupmedium
notselected
Ensure System Log Files Have Correct Permissionsmedium
notselected
Ensure cron Is Logging To Rsyslogmedium
pass
Rsyslog Logs Sent To Remote Host 1x fail
Ensure Logs Sent To Remote Hostlow
fail
Configure rsyslogd to Accept Remote Messages If Acting as a Log Server
Ensure rsyslog Does Not Accept Remote Messages Unless Acting As Log Serverlow
pass
Enable rsyslog to Accept Messages via TCP, if Acting As Log Serverlow
notselected
Enable rsyslog to Accept Messages via UDP, if Acting As Log Serverlow
notselected
Ensure All Logs are Rotated by logrotate
Ensure Logrotate Runs Periodicallylow
notselected
Configure Logwatch on the Central Log Server
Configure Logwatch HostLimit Linelow
notselected
Configure Logwatch SplitHosts Linelow
notselected
Ensure rsyslog is Installedmedium
notselected
Enable rsyslog Servicemedium
notselected
Disable Logwatch on Clients if a Logserver Existslow
notselected
System Accounting with auditd 62x fail
Configure auditd Data Retention 1x fail
Configure auditd Number of Logs Retainedmedium
notselected
Configure auditd Max Log File Sizemedium
notselected
Configure auditd max_log_file_action Upon Reaching Maximum Log Sizemedium
notselected
Configure auditd space_left Action on Low Disk Spacemedium
fail
Configure auditd admin_space_left Action on Low Disk Spacemedium
notselected
Configure auditd mail_acct Action on Low Disk Spacemedium
pass
Configure auditd flush prioritylow
notselected
Configure auditd to use audispd's syslog pluginmedium
notselected
Configure auditd Rules for Comprehensive Auditing 61x fail
Records Events that Modify Date and Time Information
Record attempts to alter time through adjtimexlow
notselected
Record attempts to alter time through settimeofdaylow
notselected
Record Attempts to Alter Time Through stimelow
notselected
Record Attempts to Alter Time Through clock_settimelow
notselected
Record Attempts to Alter the localtime Filelow
notselected
Record Events that Modify the System's Discretionary Access Controls 13x fail
Record Events that Modify the System's Discretionary Access Controls - chmodlow
fail
Record Events that Modify the System's Discretionary Access Controls - chownlow
fail
Record Events that Modify the System's Discretionary Access Controls - fchmodlow
fail
Record Events that Modify the System's Discretionary Access Controls - fchmodatlow
fail
Record Events that Modify the System's Discretionary Access Controls - fchownlow
fail
Record Events that Modify the System's Discretionary Access Controls - fchownatlow
fail
Record Events that Modify the System's Discretionary Access Controls - fremovexattrmedium
fail
Record Events that Modify the System's Discretionary Access Controls - fsetxattrlow
fail
Record Events that Modify the System's Discretionary Access Controls - lchownlow
fail
Record Events that Modify the System's Discretionary Access Controls - lremovexattrmedium
fail
Record Events that Modify the System's Discretionary Access Controls - lsetxattrlow
fail
Record Events that Modify the System's Discretionary Access Controls - removexattrmedium
fail
Record Events that Modify the System's Discretionary Access Controls - setxattrlow
fail
Record Attempts to Alter Logon and Logout Events - tallylogmedium
fail
Record Attempts to Alter Logon and Logout Events - faillockmedium
fail
Record Attempts to Alter Logon and Logout Events - lastlogmedium
fail
Record Unauthorized Access Attempts Events to Files (unsuccessful) 6x fail
Ensure auditd Collects Unauthorized Access Attempts to Files (unsuccessful)medium
notselected
Record Unauthorized Access Attempts to Files (unsuccessful) - creatmedium
fail
Record Unauthorized Access Attempts to Files (unsuccessful) - openmedium
fail
Record Unauthorized Access Attempts to Files (unsuccessful) - openatmedium
fail
Record Unauthorized Access Attempts to Files (unsuccessful) - open_by_handle_atmedium
fail
Record Unauthorized Access Attempts to Files (unsuccessful) - truncatemedium
fail
Record Unauthorized Access Attempts to Files (unsuccessful) - ftruncatemedium
fail
Record Execution Attempts to Run SELinux Privileged Commands 4x fail
Record Any Attempts to Run semanagemedium
fail
Record Any Attempts to Run setseboolmedium
fail
Record Any Attempts to Run chconmedium
fail
Record Any Attempts to Run restoreconmedium
fail
Record Information on the Use of Privileged Commands 17x fail
Ensure auditd Collects Information on the Use of Privileged Commandsmedium
fail
Ensure auditd Collects Information on the Use of Privileged Commands - passwdmedium
fail
Ensure auditd Collects Information on the Use of Privileged Commands - unix_chkpwdmedium
fail
Ensure auditd Collects Information on the Use of Privileged Commands - gpasswdmedium
fail
Ensure auditd Collects Information on the Use of Privileged Commands - chagemedium
fail
Ensure auditd Collects Information on the Use of Privileged Commands - userhelpermedium
fail
Ensure auditd Collects Information on the Use of Privileged Commands - sumedium
fail
Ensure auditd Collects Information on the Use of Privileged Commands - sudomedium
fail
Ensure auditd Collects Information on the Use of Privileged Commands - sudoeditmedium
fail
Ensure auditd Collects Information on the Use of Privileged Commands - newgrpmedium
notselected
Ensure auditd Collects Information on the Use of Privileged Commands - chshmedium
fail
Ensure auditd Collects Information on the Use of Privileged Commands - umountmedium
fail
Ensure auditd Collects Information on the Use of Privileged Commands - postdropmedium
fail
Ensure auditd Collects Information on the Use of Privileged Commands - postqueuemedium
fail
Ensure auditd Collects Information on the Use of Privileged Commands - ssh-keysignmedium
fail
Ensure auditd Collects Information on the Use of Privileged Commands - pt_chownmedium
fail
Ensure auditd Collects Information on the Use of Privileged Commands - crontabmedium
fail
Ensure auditd Collects Information on the Use of Privileged Commands - pam_timestamp_checkmedium
fail
Record File Deletion Events by User 5x fail
Ensure auditd Collects File Deletion Events by Usermedium
notselected
Ensure auditd Collects File Deletion Events by User - rmdirmedium
fail
Ensure auditd Collects File Deletion Events by User - unlinkmedium
fail
Ensure auditd Collects File Deletion Events by User - unlinkatmedium
fail
Ensure auditd Collects File Deletion Events by User - renamemedium
fail
Ensure auditd Collects File Deletion Events by User - renameatmedium
fail
Record Information on Kernel Modules Loading and Unloading 5x fail
Ensure auditd Collects Information on Kernel Module Loading and Unloadingmedium
notselected
Ensure auditd Collects Information on Kernel Module Loading and Unloading - init_modulemedium
fail
Ensure auditd Collects Information on Kernel Module Loading and Unloading - delete_modulemedium
fail
Ensure auditd Collects Information on Kernel Module Loading and Unloading - insmodmedium
fail
Ensure auditd Collects Information on Kernel Module Loading and Unloading - rmmodmedium
fail
Ensure auditd Collects Information on Kernel Module Loading and Unloading - modprobemedium
fail
Shutdown System When Auditing Failures Occurmedium
fail
Record Events that Modify User/Group Informationlow
notselected
Record Events that Modify User/Group Information - /etc/groupmedium
fail
Record Events that Modify User/Group Information - /etc/gshadowmedium
fail
Record Events that Modify User/Group Information - /etc/shadowmedium
fail
Record Events that Modify User/Group Information - passwdmedium
fail
Record Events that Modify User/Group Information - opasswdmedium
fail
Record Events that Modify the System's Network Environmentlow
notselected
System Audit Logs Must Have Mode 0640 or Less Permissivemedium
notselected
System Audit Logs Must Be Owned By Rootmedium
notselected
Record Events that Modify the System's Mandatory Access Controlslow
notselected
Record Attempts to Alter Process and Session Initiation Informationlow
notselected
Ensure auditd Collects Information on Exporting to Media (successful)medium
fail
Ensure auditd Collects System Administrator Actionslow
fail
Make the auditd Configuration Immutablemedium
notselected
Enable auditd Servicehigh
pass
Enable Auditing for Processes Which Start Prior to the Audit Daemonmedium
notselected
Services 7x fail
Obsolete Services
Xinetd
Disable xinetd Servicemedium
notselected
Uninstall xinetd Packagelow
notselected
Install tcp_wrappers Packagemedium
notselected
Telnet
Disable telnet Servicehigh
notselected
Uninstall telnet-server Packagehigh
pass
Remove telnet Clientslow
notselected
Rlogin, Rsh, and Rexec
Uninstall rsh-server Packagehigh
pass
Disable rexec Servicehigh
notselected
Disable rsh Servicehigh
notselected
Uninstall rsh Packagelow
notselected
Disable rlogin Servicehigh
notselected
Remove Rsh Trust Fileshigh
notselected
NIS
Uninstall ypserv Packagehigh
pass
Disable ypbind Servicemedium
notselected
Remove NIS Clientlow
notselected
TFTP Server
Disable tftp Servicemedium
notselected
Uninstall tftp-server Packagehigh
pass
Remove tftp Daemonhigh
notselected
Ensure tftp Daemon Uses Secure Modemedium
pass
Chat/Messaging Services
Uninstall talk-server Packagemedium
notselected
Uninstall talk Packagelow
notselected
Base Services 1x fail
Disable Automatic Bug Reporting Tool (abrtd)low
notselected
Disable Advanced Configuration and Power Interface (acpid)low
notselected
Disable Certmonger Service (certmonger)low
notselected
Disable Control Group Config (cgconfig)low
notselected
Disable Control Group Rules Engine (cgred)low
notselected
Disable CPU Speed (cpupower)low
notselected
Enable IRQ Balance (irqbalance)low
notselected
Disable KDump Kernel Crash Analyzer (kdump)medium
fail
Disable Software RAID Monitor (mdmonitor)low
notselected
Disable D-Bus IPC Service (messagebus)low
notselected
Disable Network Console (netconsole)low
notselected
Disable ntpdate Service (ntpdate)low
notselected
Disable Odd Job Daemon (oddjobd)low
notselected
Disable Portreserve (portreserve)low
notselected
Enable Process Accounting (psacct)low
notselected
Disable Apache Qpid (qpidd)low
notselected
Disable Quota Netlink (quota_nld)low
notselected
Disable Network Router Discovery Daemon (rdisc)low
notselected
Disable Red Hat Network Service (rhnsd)low
notselected
Disable Red Hat Subscription Manager Daemon (rhsmcertd)low
notselected
Disable Cyrus SASL Authentication Daemon (saslauthd)low
notselected
Disable SMART Disk Monitoring Service (smartd)low
notselected
Disable System Statistics Reset Service (sysstat)low
notselected
Cron and At Daemons
Restrict at and cron to Authorized Users if Necessary
Verify User Who Owns /etc/cron.allow filemedium
pass
Verify Group Who Owns /etc/cron.allow filemedium
pass
Enable cron Servicemedium
notselected
Disable anacron Servicelow
notselected
Disable At Service (atd)low
notselected
Docker Service
Enable the Docker servicemedium
notselected
Use direct-lvm with the Device Mapper Storage Driverlow
notselected
SSH Server 4x fail
Configure OpenSSH Server if Necessary 4x fail
Strengthen Firewall Configuration if Possible
Enable SSH Server firewalld Firewall exceptionlow
notselected
Allow Only SSH Protocol 2high
pass
Limit Users' SSH Accesslow
notselected
Disable GSSAPI Authenticationmedium
pass
Disable Kerberos Authenticationmedium
pass
Enable Use of Strict Mode Checkingmedium
pass
Enable Use of Privilege Separationmedium
pass
Disable Compression Or Set Compression to delayedmedium
pass
Print Last Loglow
pass
Set LogLevel to INFOlow
notselected
Set SSH Idle Timeout Intervallow
pass
Set SSH Client Alive Countmedium
pass
Set SSH authentication attempt limitmedium
notselected
Disable SSH Support for .rhosts Filesmedium
pass
Disable SSH Support for User Known Hostsmedium
pass
Disable SSH Support for Rhosts RSA Authenticationmedium
pass
Disable Host-Based Authenticationmedium
pass
Enable Encrypted X11 Fordwardinghigh
pass
Disable SSH Root Loginmedium
fail
Disable SSH Access via Empty Passwordshigh
pass
Enable SSH Warning Bannermedium
pass
Do Not Allow SSH Environment Optionsmedium
fail
Use Only FIPS 140-2 Validated Ciphersmedium
fail
Use Only FIPS 140-2 Validated MACsmedium
fail
Use Only Strong Ciphersmedium
notselected
Use Only Strong MACsmedium
notselected
Install the OpenSSH Server Packagemedium
pass
Enable the OpenSSH Servicemedium
pass
Disable SSH Server If Possible (Unusual)low
notselected
Verify Permissions on SSH Server Public *.pub Key Filesmedium
pass
Verify Permissions on SSH Server Private *_key Key Filesmedium
pass
Remove SSH Server firewalld Firewall exception (Unusual)low
notselected
System Security Services Daemon 1x fail
Install the SSSD Packagemedium
notselected
Enable the SSSD Servicemedium
notselected
Configure SSSD's Memory Cache to Expiremedium
notselected
Configure SSSD to Expire Offline Credentialsmedium
notselected
Configure SSSD to Expire SSH Known Hostsmedium
notselected
Configure PAM in SSSD Servicesmedium
fail
X Window System
Disable X Windows
Disable X Windows Startup By Setting Default Targetmedium
notselected
Remove the X Windows Package Groupmedium
pass
Avahi Server
Disable Avahi Server if Possible
Disable Avahi Server Softwarelow
notselected
Configure Avahi if Necessary
Serve Avahi Only via Required Protocollow
notselected
Check Avahi Responses' TTL Fieldlow
notselected
Prevent Other Programs from Using Avahi's Portlow
notselected
Disable Avahi Publishinglow
notselected
Restrict Information Published by Avahilow
notselected
Print Support
Configure the CUPS Service if Necessary
Disable Printer Browsing Entirely if Possiblelow
notselected
Disable Print Server Capabilitieslow
notselected
Disable the CUPS Servicelow
notselected
DHCP
Disable DHCP Server
Disable DHCP Servicemedium
notselected
Uninstall DHCP Server Packagemedium
notselected
Disable DHCP Server
Minimize Served Information
Do Not Use Dynamic DNSlow
notselected
Deny Decline Messageslow
notselected
Deny BOOTP Querieslow
notselected
Configure Logginglow
notselected
Disable DHCP Client
Disable DHCP Clientlow
notselected
Configure DHCP Client if Necessary
Minimize the DHCP-Configured Options
Network Time Protocol 1x fail
Enable the NTP Daemonmedium
notselected
Specify a Remote NTP Servermedium
notselected
Specify Additional Remote NTP Serverslow
notselected
Configure NTP Maxpoll Intervallow
fail
Mail Server Software
Configure SMTP For Mail Clients
Disable Postfix Network Listeningmedium
notselected
Configure Operating System to Protect Mail Server
Configure SSL Certificates for Use with SMTP AUTH
Ensure Security of Postfix SSL Certificate
Configure Postfix if Necessary
Configure Postfix Resource Usage to Limit Denial of Service Attacks
Control Mail Relaying
Configure Trusted Networks and Hosts
Enact SMTP Relay Restrictions
Enact SMTP Recipient Restrictions
Require SMTP AUTH Before Relaying from Untrusted Clients
Use TLS for SMTP AUTH
Configure SMTP Greeting Bannermedium
notselected
Enable Postfix Servicelow
notselected
Uninstall Sendmail Packagemedium
notselected
LDAP
Configure OpenLDAP Clients
Configure LDAP Client to Use TLS For All Transactionsmedium
pass
Configure Certificate Directives for LDAP Use of TLSmedium
notselected
Configure OpenLDAP Server
Install and Protect LDAP Certificate Files
Uninstall openldap-servers Packagelow
notselected
NFS and RPC
Disable All NFS Services if Possible
Disable Services Used Only by NFS
Disable Network File System Lock Service (nfslock)low
notselected
Disable Secure RPC Client Service (rpcgssd)low
notselected
Disable rpcbind Servicelow
notselected
Disable RPC ID Mapping Service (rpcidmapd)low
notselected
Configure All Systems which Use NFS
Make Each System a Client or a Server, not Both
Configure NFS Services to Use Fixed Ports (NFSv3 and NFSv2)
Configure lockd to use static TCP portlow
notselected
Configure lockd to use static UDP portlow
notselected
Configure statd to use static portlow
notselected
Configure mountd to use static portlow
notselected
Configure NFS Clients
Disable NFS Server Daemons
Specify UID and GID for Anonymous NFS Connectionslow
notselected
Disable Network File System (nfs)low
notselected
Disable Secure RPC Server Service (rpcsvcgssd)low
notselected
Mount Remote Filesystems with Restrictive Options
Mount Remote Filesystems with nodevmedium
notselected
Mount Remote Filesystems with nosuidmedium
pass
Mount Remote Filesystems with noexecmedium
pass
Mount Remote Filesystems with Kerberos Securitymedium
pass
Configure NFS Servers
Configure the Exports File Restrictively
Use Access Lists to Enforce Authorization Restrictions
Export Filesystems Read-Only if Possible
Use Root-Squashing on All Exportslow
notselected
Restrict NFS Clients to Privileged Portslow
notselected
Ensure Insecure File Locking is Not Allowedmedium
notselected
Use Kerberos Security on All Exportsmedium
notselected
DNS Server
Disable DNS Server
Disable DNS Serverlow
notselected
Uninstall bind Packagelow
notselected
Isolate DNS from Other Services
Run DNS Software on Dedicated Servers
Run DNS Software in a chroot Jail
Protect DNS Data from Tampering or Attack
Run Separate DNS Servers for External and Internal Queries
Use Views to Partition External and Internal Information
Disable Zone Transfers from the Nameserverlow
notselected
Authenticate Zone Transferslow
notselected
Disable Dynamic Updateslow
notselected
FTP Server
Disable vsftpd if Possible
Disable vsftpd Servicelow
notselected
Uninstall vsftpd Packagehigh
pass
Use vsftpd to Provide FTP Service if Necessary
Install vsftpd Packagelow
notselected
Use vsftpd to Provide FTP Service if Necessary
Restrict the Set of Users Allowed to Access FTP
Limit Users Allowed FTP Access if Necessary
Restrict Access to Anonymous Users if Possiblelow
notselected
Configure Firewalls to Protect the FTP Server
Enable Logging of All FTP Transactionslow
notselected
Create Warning Banners for All FTP Usersmedium
notselected
Disable FTP Uploads if Possiblelow
notselected
Place the FTP Home Directory on its Own Partitionlow
notselected
Web Server
Disable Apache if Possible
Disable httpd Servicelow
notselected
Uninstall httpd Packagelow
notselected
Install Apache if Necessary
Confirm Minimal Built-in Modules Installed
Secure Apache Configuration
Restrict Web Server Information Leakage
Set httpd ServerTokens Directive to Prodlow
notselected
Set httpd ServerSignature Directive to Offlow
notselected
Minimize Web Server Loadable Modules
httpd Core Modules
Minimize Modules for HTTP Basic Authentication
Minimize Various Optional Components
Minimize Configuration Files Included
Disable HTTP Digest Authenticationlow
notselected
Disable HTTP mod_rewritelow
notselected
Disable LDAP Supportlow
notselected
Disable Server Side Includeslow
notselected
Disable MIME Magiclow
notselected
Disable WebDAV (Distributed Authoring and Versioning)low
notselected
Disable Server Activity Statuslow
notselected
Disable Web Server Configuration Displaylow
notselected
Disable URL Correction on Misspelled Entrieslow
notselected
Disable Proxy Supportlow
notselected
Disable Cache Supportlow
notselected
Disable CGI Supportlow
notselected
Directory Restrictions
Restrict Root Directorylow
notselected
Restrict Web Directorylow
notselected
Restrict Other Critical Directorieslow
notselected
Limit Available Methodslow
notselected
Use Appropriate Modules to Improve httpd's Security
Deploy mod_ssl
Install mod_ssllow
notselected
Deploy mod_security
Install mod_securitylow
notselected
Use Denial-of-Service Protection Modules
Configure PHP Securely
Configure Operating System to Protect Web Server
Restrict File and Directory Access
Set Permissions on the /var/log/httpd/ Directorylow
notselected
Set Permissions on the /etc/httpd/conf/ Directorylow
notselected
Set Permissions on All Configuration Files Inside /etc/httpd/conf/low
notselected
Set Permissions on All Configuration Files Inside /etc/httpd/conf.d/low
notselected
Set Permissions on All Configuration Files Inside /etc/httpd/conf.modules.d/low
notselected
Configure firewalld to Allow Access to the Web Server
Run httpd in a chroot Jail if Practical
IMAP and POP3 Server
Disable Dovecot
Disable Dovecot Servicelow
notselected
Uninstall dovecot Packagelow
notselected
Configure Dovecot if Necessary
Support Only the Necessary Protocols
Enable SSL Support
Enable the SSL flag in /etc/dovecot.conflow
notselected
Configure Dovecot to Use the SSL Certificate filelow
notselected
Configure Dovecot to Use the SSL Key filelow
notselected
Disable Plaintext Authenticationlow
notselected
Allow IMAP Clients to Access the Server
Network Routing
Disable Quagga if Possible
Disable Quagga Servicemedium
notselected
Uninstall quagga Packagemedium
notselected
Samba(SMB) Microsoft Windows File Sharing Server
Disable Samba if Possible
Disable Sambalow
notselected
Uninstall Samba Packagelow
notselected
Configure Samba if Necessary
Restrict SMB File Sharing to Configured Networks
Restrict Printer Sharing
Install the Samba Common Packagemedium
notselected
Disable Root Access to SMB Shareslow
notselected
Require Client SMB Packet Signing, if using smbclientlow
notselected
Require Client SMB Packet Signing, if using mount.cifslow
notselected
Proxy Server
Disable Squid if Possible
Disable Squidlow
notselected
Uninstall squid Packagelow
notselected
SNMP Server
Disable SNMP Server if Possible
Disable snmpd Servicelow
notselected
Uninstall net-snmp Packagelow
notselected
Configure SNMP Server if Necessary
Configure SNMP Service to Use Only SNMPv3 or Newer medium
notselected
Ensure Default SNMP Password Is Not Usedhigh
pass
Documentation to Support C2S/CIS Mapping
Procedural Requirementlow
notselected
Not Applicable to Operating Systemlow
notselected
Product Meets this Requirementlow
notselected
Requirement Applies to All Ruleslow
notselected
Rule Compliance through Removal of xinetdlow
notselected

Result Details

Ensure /tmp Located On Separate Partitionxccdf_org.ssgproject.content_rule_partition_for_tmp low

Ensure /tmp Located On Separate Partition

Rule IDxccdf_org.ssgproject.content_rule_partition_for_tmp
Result
fail
Time2017-10-21T14:38:42
Severitylow
Identifiers and References

References:  SC-32(1), 366, SRG-OS-000480-GPOS-00227, 1.1.1

Description

The /tmp directory is a world-writable directory used for temporary file storage. Ensure it has its own partition or logical volume at installation time, or migrate it using LVM.

Rationale

The /tmp partition is used as temporary storage by many programs. Placing /tmp in its own partition enables the setting of more restrictive mount options, which can help protect programs which use it.

OVAL details

Items not found violating /tmp on own partition:

Object oval:ssg-object_own_tmp_partition:obj:1 of type partition_object
Mount point
/tmp
Ensure /var Located On Separate Partitionxccdf_org.ssgproject.content_rule_partition_for_var low

Ensure /var Located On Separate Partition

Rule IDxccdf_org.ssgproject.content_rule_partition_for_var
Result
fail
Time2017-10-21T14:38:42
Severitylow
Identifiers and References

References:  SC-32(1), 1.1.5, 366, SRG-OS-000480-GPOS-00227

Description

The /var directory is used by daemons and other system services to store frequently-changing data. Ensure that /var has its own partition or logical volume at installation time, or migrate it using LVM.

Rationale

Ensuring that /var is mounted on its own partition enables the setting of more restrictive mount options. This helps protect system services such as daemons or other programs which use it. It is not uncommon for the /var directory to contain world-writable directories installed by other software packages.

OVAL details

Items not found violating /var on own partition:

Object oval:ssg-object_mount_var_own_partition:obj:1 of type partition_object
Mount point
/var
Ensure /var/log Located On Separate Partitionxccdf_org.ssgproject.content_rule_partition_for_var_log low

Ensure /var/log Located On Separate Partition

Rule IDxccdf_org.ssgproject.content_rule_partition_for_var_log
Result
notselected
Time2017-10-21T14:38:42
Severitylow
Identifiers and References

References:  AU-9, SC-32, http://iase.disa.mil/stigs/cci/Pages/index.aspx, 1.1.7

Description

System logs are stored in the /var/log directory. Ensure that it has its own partition or logical volume at installation time, or migrate it using LVM.

Rationale

Placing /var/log in its own partition enables better separation between log files and other files in /var/.

Ensure /var/log/audit Located On Separate Partitionxccdf_org.ssgproject.content_rule_partition_for_var_log_audit low

Ensure /var/log/audit Located On Separate Partition

Rule IDxccdf_org.ssgproject.content_rule_partition_for_var_log_audit
Result
fail
Time2017-10-21T14:38:42
Severitylow
Identifiers and References

References:  AU-4, AU-9, SC-32(1), 366, 1.1.8, SRG-OS-000480-GPOS-00227

Description

Audit logs are stored in the /var/log/audit directory. Ensure that it has its own partition or logical volume at installation time, or migrate it later using LVM. Make absolutely certain that it is large enough to store all audit logs that will be created by the auditing daemon.

Rationale

Placing /var/log/audit in its own partition enables better separation between audit files and other files, and helps ensure that auditing cannot be halted due to the partition running out of space.

OVAL details

Items not found violating check for /var/log/audit partition:

Object oval:ssg-object_mount_var_log_audit_own_partition:obj:1 of type partition_object
Mount point
/var/log/audit
Ensure /home Located On Separate Partitionxccdf_org.ssgproject.content_rule_partition_for_home low

Ensure /home Located On Separate Partition

Rule IDxccdf_org.ssgproject.content_rule_partition_for_home
Result
fail
Time2017-10-21T14:38:42
Severitylow
Identifiers and References

References:  SC-32(1), 366, 1208, 1.1.9, SRG-OS-000480-GPOS-00227

Description

If user home directories will be stored locally, create a separate partition for /home at installation time (or migrate it later using LVM). If /home will be mounted from another system such as an NFS server, then creating a separate partition is not necessary at installation time, and the mountpoint can instead be configured later.

Rationale

Ensuring that /home is mounted on its own partition enables the setting of more restrictive mount options, and also helps ensure that users cannot trivially fill partitions used for log or audit data storage.

OVAL details

Items not found violating /home on own partition:

Object oval:ssg-object_mount_home_own_partition:obj:1 of type partition_object
Mount point
/home
Encrypt Partitionsxccdf_org.ssgproject.content_rule_encrypt_partitions high

Encrypt Partitions

Rule IDxccdf_org.ssgproject.content_rule_encrypt_partitions
Result
notselected
Time2017-10-21T14:38:42
Severityhigh
Identifiers and References

References:  SC-13, SC-28(1), 1199, 2476, SRG-OS-000405-GPOS-00184, SRG-OS-000185-GPOS-00079, 3.13.16

Description

Red Hat Enterprise Linux 7 natively supports partition encryption through the Linux Unified Key Setup-on-disk-format (LUKS) technology. The easiest way to encrypt a partition is during installation time.

For manual installations, select the Encrypt checkbox during partition creation to encrypt the partition. When this option is selected the system will prompt for a passphrase to use in decrypting the partition. The passphrase will subsequently need to be entered manually every time the system boots.

For automated/unattended installations, it is possible to use Kickstart by adding the --encrypted and --passphrase= options to the definition of each partition to be encrypted. For example, the following line would encrypt the root partition:

part / --fstype=ext4 --size=100 --onpart=hda1 --encrypted --passphrase=PASSPHRASE
Any PASSPHRASE is stored in the Kickstart in plaintext, and the Kickstart must then be protected accordingly. Omitting the --passphrase= option from the partition definition will cause the installer to pause and interactively ask for the passphrase during installation.

Detailed information on encrypting partitions using LUKS can be found on the Red Hat Documentation web site:
https://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/7/html/Security_Guide/sec-Encryption.html

Rationale

The risk of a system's physical compromise, particularly mobile systems such as laptops, places its data at risk of compromise. Encrypting this data mitigates the risk of its loss if the system is lost.

Ensure Red Hat GPG Key Installedxccdf_org.ssgproject.content_rule_ensure_redhat_gpgkey_installed high

Ensure Red Hat GPG Key Installed

Rule IDxccdf_org.ssgproject.content_rule_ensure_redhat_gpgkey_installed
Result
notselected
Time2017-10-21T14:38:42
Severityhigh
Identifiers and References

References:  CM-5(3), SI-7, MA-1(b), 1749, 366, Req-6.2, 1.2.2, 5.10.4.1, 3.4.8

Description

To ensure the system can cryptographically verify base software packages come from Red Hat (and to connect to the Red Hat Network to receive them), the Red Hat GPG key must properly be installed. To install the Red Hat GPG key, run:

$ sudo rhn_register
If the system is not connected to the Internet or an RHN Satellite, then install the Red Hat GPG key from trusted media such as the Red Hat installation CD-ROM or DVD. Assuming the disc is mounted in /media/cdrom, use the following command as the root user to import it into the keyring:
$ sudo rpm --import /media/cdrom/RPM-GPG-KEY

Rationale

Changes to 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. The Red Hat GPG key is necessary to cryptographically verify packages are from Red Hat.

Ensure gpgcheck Enabled In Main Yum Configurationxccdf_org.ssgproject.content_rule_ensure_gpgcheck_globally_activated high

Ensure gpgcheck Enabled In Main Yum Configuration

Rule IDxccdf_org.ssgproject.content_rule_ensure_gpgcheck_globally_activated
Result
pass
Time2017-10-21T14:38:42
Severityhigh
Identifiers and References

References:  CM-5(3), SI-7, MA-1(b), 1749, SRG-OS-000366-GPOS-00153, Req-6.2, 1.2.3, 5.10.4.1, 3.4.8

Description

The gpgcheck option controls whether RPM packages' signatures are always checked prior to installation. To configure yum to check package signatures before installing them, ensure the following line appears in /etc/yum.conf in the [main] section:

gpgcheck=1

Rationale

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.
Accordingly, patches, service packs, device drivers, or operating system components must be signed with a certificate recognized and approved by the organization.
Verifying the authenticity of the software prior to installation validates the integrity of the patch or upgrade received from a vendor. This ensures the software has not been tampered with and that it has been provided by a trusted vendor. Self-signed certificates are disallowed by this requirement. Certificates used to verify the software must be from an approved Certificate Authority (CA).

OVAL details

Items not found satisfying check value of gpgcheck in /etc/dnf/dnf.conf:

Object oval:ssg-object_dnf_ensure_gpgcheck_globally_activated:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/dnf/dnf.conf^\s*gpgcheck\s*=\s*1\s*$1

Items found satisfying check value of gpgcheck in /etc/yum.conf:

PathContent
/etc/yum.confgpgcheck=1
Ensure gpgcheck Enabled For All Yum Package Repositoriesxccdf_org.ssgproject.content_rule_ensure_gpgcheck_never_disabled high

Ensure gpgcheck Enabled For All Yum Package Repositories

Rule IDxccdf_org.ssgproject.content_rule_ensure_gpgcheck_never_disabled
Result
notselected
Time2017-10-21T14:38:42
Severityhigh
Identifiers and References

References:  CM-5(3), SI-7, MA-1(b), 1749, 366, Req-6.2, 5.10.4.1, 3.4.8

Description

To ensure signature checking is not disabled for any repos, remove any lines from files in /etc/yum.repos.d of the form:

gpgcheck=0

Rationale

Verifying the authenticity of the software prior to installation validates the integrity of the patch or upgrade received from a vendor. This ensures the software has not been tampered with and that it has been provided by a trusted vendor. Self-signed certificates are disallowed by this requirement. Certificates used to verify the software must be from an approved Certificate Authority (CA).

Ensure Software Patches Installedxccdf_org.ssgproject.content_rule_security_patches_up_to_date high

Ensure Software Patches Installed

Rule IDxccdf_org.ssgproject.content_rule_security_patches_up_to_date
Result
notchecked
Time2017-10-21T14:38:42
Severityhigh
Identifiers and References

References:  SI-2, SI-2(c), MA-1(b), 366, Req-6.2, 1.7, SRG-OS-000480-GPOS-00227, 5.10.4.1

Description

If the system is joined to the Red Hat Network, a Red Hat Satellite Server, or a yum server, run the following command to install updates:

$ sudo yum update
If the system is not configured to use one of these sources, updates (in the form of RPM packages) can be manually downloaded from the Red Hat Network and installed using rpm.

NOTE: U.S. Defense systems are required to be patched within 30 days or sooner as local policy dictates.

Rationale

Installing software updates is a fundamental mitigation against the exploitation of publicly-known vulnerabilities. If the most recent security patches and updates are not installed, unauthorized users may take advantage of weaknesses in the unpatched software. The lack of prompt attention to patching could result in a system compromise.

Evaluation messages
info 
None of the check-content-ref elements was resolvable.
Ensure YUM Removes Previous Package Versionsxccdf_org.ssgproject.content_rule_clean_components_post_updating low

Ensure YUM Removes Previous Package Versions

Rule IDxccdf_org.ssgproject.content_rule_clean_components_post_updating
Result
pass
Time2017-10-21T14:38:42
Severitylow
Identifiers and References

References:  SI-2(6), 2617, SRG-OS-000437-GPOS-00194, 3.4.8

Description

Yum should be configured to remove previous software components after previous versions have been installed. To configure yum to remove the previous software components after updating, set the clean_requirements_on_remove to 1 in /etc/yum.conf.

Rationale

Previous versions of software components that are not removed from the information system after updates have been installed may be exploited by some adversaries.

OVAL details

Items found satisfying check value of clean_requirements_on_remove in /etc/yum.conf:

PathContent
/etc/yum.confclean_requirements_on_remove=1
Ensure gpgcheck Enabled for Local Packagesxccdf_org.ssgproject.content_rule_ensure_gpgcheck_local_packages high

Ensure gpgcheck Enabled for Local Packages

Rule IDxccdf_org.ssgproject.content_rule_ensure_gpgcheck_local_packages
Result
pass
Time2017-10-21T14:38:42
Severityhigh
Identifiers and References

References:  CM-5(3), 1749, SRG-OS-000366-GPOS-00153, 3.4.8

Description

Yum should be configured to verify the signature(s) of local packages prior to installation. To configure yum to verify signatures of local packages, set the localpkg_gpgcheck to 1 in /etc/yum.conf.

Rationale

Changes to any software components can have significant effects to the overall security of the operating system. This requirement ensures the software has not been tampered and has been provided by a trusted vendor.

Accordingly, patches, service packs, device drivers, or operating system components must be signed with a certificate recognized and approved by the organization.

OVAL details

Items found satisfying check value of localpkg_gpgcheck in /etc/yum.conf:

PathContent
/etc/yum.conflocalpkg_gpgcheck=1
Install AIDExccdf_org.ssgproject.content_rule_package_aide_installed medium

Install AIDE

Rule IDxccdf_org.ssgproject.content_rule_package_aide_installed
Result
notselected
Time2017-10-21T14:38:42
Severitymedium
Identifiers and References

References:  CM-3(d), CM-3(e), CM-6(d), CM-6(3), SC-28, SI-7, http://iase.disa.mil/stigs/cci/Pages/index.aspx, Req-11.5, 1.3.1, 5.10.1.3

Description

Install the AIDE package with the command:

$ sudo yum install aide

Rationale

The AIDE package must be installed if it is to be available for integrity checking.

Build and Test AIDE Databasexccdf_org.ssgproject.content_rule_aide_build_database medium

Build and Test AIDE Database

Rule IDxccdf_org.ssgproject.content_rule_aide_build_database
Result
notselected
Time2017-10-21T14:38:42
Severitymedium
Identifiers and References

References:  CM-3(d), CM-3(e), CM-6(d), CM-6(3), SC-28, SI-7, Req-11.5, 5.10.1.3

Description

Run the following command to generate a new database:

$ sudo /usr/sbin/aide --init
By default, the database will be written to the file /var/lib/aide/aide.db.new.gz. Storing the database, the configuration file /etc/aide.conf, and the binary /usr/sbin/aide (or hashes of these files), in a secure location (such as on read-only media) provides additional assurance about their integrity. The newly-generated database can be installed as follows:
$ sudo cp /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz
To initiate a manual check, run the following command:
$ sudo /usr/sbin/aide --check
If this check produces any unexpected output, investigate.

Rationale

For AIDE to be effective, an initial database of "known-good" information about files must be captured and it should be able to be verified against the installed files.

Configure Periodic Execution of AIDExccdf_org.ssgproject.content_rule_aide_periodic_cron_checking medium

Configure Periodic Execution of AIDE

Rule IDxccdf_org.ssgproject.content_rule_aide_periodic_cron_checking
Result
fail
Time2017-10-21T14:38:42
Severitymedium
Identifiers and References

References:  CM-3(d), CM-3(e), CM-3(5), CM-6(d), CM-6(3), SC-28, SI-7, 1744, Req-11.5, 1.3.1, SRG-OS-000363-GPOS-00150, 5.10.1.3

Description

At a minimum, AIDE should be configured to run a weekly scan. At most, AIDE should be run daily. To implement a daily execution of AIDE at 4:05am using cron, add the following line to /etc/crontab:

05 4 * * * root /usr/sbin/aide --check
To implement a weekly execution of AIDE at 4:05am using cron, add the following line to /etc/crontab:
05 4 * * 0 root /usr/sbin/aide --check
AIDE can be executed periodically through other means; this is merely one example.

Rationale

By default, AIDE does not install itself for periodic execution. Periodically running AIDE is necessary to reveal unexpected changes in installed files.

Unauthorized changes to the baseline configuration could make the system vulnerable to various attacks or allow unauthorized access to the operating system. Changes to operating system configurations can have unintended side effects, some of which may be relevant to security.

Detecting such changes and providing an automated response can help avoid unintended, negative consequences that could ultimately affect the security state of the operating system. The operating system's Information Management Officer (IMO)/Information System Security Officer (ISSO) and System Administrators (SAs) must be notified via email and/or monitoring system trap when there is an unauthorized modification of a configuration item.

OVAL details

Items found violating run aide daily with cron:

PathContent
/etc/crontab05 4 * * * root /usr/sbin/aide --check

Items not found violating run aide daily with cron:

Object oval:ssg-object_test_aide_crond_checking:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/etc/cron.d^.*$^[0-9]*[\s]*[0-9]*[\s]*\*[\s]*\*[\s]*\*[\s]*root[\s]*/usr/sbin/aide[\s]*\-\-check.*$1

Items not found violating run aide daily with cron:

Object oval:ssg-object_aide_var_cron_checking:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/var/spool/cron/root^[0-9]*[\s]*[0-9]*[\s]*\*[\s]*\*[\s]*\*[\s]*(root|)/usr/sbin/aide[\s]*\-\-check.*$1

Items not found violating run aide daily with cron.(daily|weekly|monthly):

Object oval:ssg-object_aide_crontabs_checking:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/etc/cron.(daily|weekly|monthly)^.*$^\s*/usr/sbin/aide[\s]*\-\-check.*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable
echo "05 4 * * * root /usr/sbin/aide --check" >> /etc/crontab
Configure Notification of Post-AIDE Scan Detailsxccdf_org.ssgproject.content_rule_aide_scan_notification medium

Configure Notification of Post-AIDE Scan Details

Rule IDxccdf_org.ssgproject.content_rule_aide_scan_notification
Result
fail
Time2017-10-21T14:38:42
Severitymedium
Identifiers and References

References:  CM-3(5), 1744, SRG-OS-000363-GPOS-00150

Description

AIDE should notify appropriate personnel of the details of a scan after the scan has been run. If AIDE has already been configured for periodic execution in /etc/crontab, append the following line to the existing AIDE line:

 | /bin/mail -s "$(hostname) - AIDE Integrity Check" root@localhost
Otherwise, add the following line to /etc/crontab:
05 4 * * * root /usr/sbin/aide --check | /bin/mail -s "$(hostname) - AIDE Integrity Check" root@localhost
AIDE can be executed periodically through other means; this is merely one example.

Rationale

Unauthorized changes to the baseline configuration could make the system vulnerable to various attacks or allow unauthorized access to the operating system. Changes to operating system configurations can have unintended side effects, some of which may be relevant to security.

Detecting such changes and providing an automated response can help avoid unintended, negative consequences that could ultimately affect the security state of the operating system. The operating system's Information Management Officer (IMO)/Information System Security Officer (ISSO) and System Administrators (SAs) must be notified via email and/or monitoring system trap when there is an unauthorized modification of a configuration item.

OVAL details

Items not found violating notify personnel when aide completes:

Object oval:ssg-object_test_aide_scan_notification:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/crontab^.*/usr/sbin/aide[\s]*\-\-check.*\|.*/bin/mail[\s]*-s[\s]*".*"[\s]*root@.*$1

Items not found violating notify personnel when aide completes:

Object oval:ssg-object_aide_var_cron_notification:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/var/spool/cron/root^.*/usr/sbin/aide[\s]*\-\-check.*\|.*/bin/mail[\s]*-s[\s]*".*"[\s]*root@.*$1

Items not found violating notify personnel when aide completes in cron.(daily|weekly|monthly):

Object oval:ssg-object_aide_crontabs_notification:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/etc/cron.(d|daily|weekly|monthly)^.*$^.*/usr/sbin/aide[\s]*\-\-check.*\|.*/bin/mail[\s]*-s[\s]*".*"[\s]*root@.*$1
Remediation Shell script:   (show)

Complexity:high
Disruption:medium
Strategy:restrict
CRONTAB=/etc/crontab
CRONDIRS='/etc/cron.d /etc/cron.daily /etc/cron.weekly /etc/cron.monthly'

if [ -f /var/spool/cron/root ]; then
	VARSPOOL=/var/spool/cron/root
fi

if ! grep -qR '^.*\/usr\/sbin\/aide\s*\-\-check.*\|.*\/bin\/mail\s*-s\s*".*"\s*root@.*$' $CRONTAB $VARSPOOL $CRONDIRS; then
	echo '0 5 * * * /usr/sbin/aide  --check | /bin/mail -s "$(hostname) - AIDE Integrity Check" root@localhost' >> $CRONTAB
fi

Configure AIDE to Verify Access Control Lists (ACLs)xccdf_org.ssgproject.content_rule_aide_verify_acls medium

Configure AIDE to Verify Access Control Lists (ACLs)

Rule IDxccdf_org.ssgproject.content_rule_aide_verify_acls
Result
fail
Time2017-10-21T14:38:42
Severitymedium
Identifiers and References

References:  SI-7.1, 366, SRG-OS-000480-GPOS-00227

Description

By default, the acl option is added to the FIPSR ruleset in AIDE. If using a custom ruleset or the acl option is missing, add acl to the appropriate ruleset. For example, add acl to the following line in /etc/aide.conf:

FIPSR = p+i+n+u+g+s+m+c+acl+selinux+xattrs+sha256
AIDE rules can be configured in multiple ways; this is merely one example that is already configured by default.

Rationale

ACLs can provide permissions beyond those permitted through the file mode and must be verified by the file integrity tools.

OVAL details

Items not found violating acl is set in /etc/aide.conf:

Object oval:ssg-object_aide_verify_acls:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/aide.conf^(?!ALLXTRAHASHES)[A-Z]*[\s]*=[\s]*([a-z0-9\+]*)$1
State oval:ssg-state_aide_verify_acls:ste:1 of type textfilecontent54_state
Subexpression
^.*acl.*$
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable

aide_conf="/etc/aide.conf"

groups=$(grep "^[A-Z]\+" $aide_conf | grep -v "^ALLXTRAHASHES" | cut -f1 -d '=' | tr -d ' ' | sort -u)

for group in $groups
do
	config=$(grep "^$group\s*=" $aide_conf | cut -f2 -d '=' | tr -d ' ')

	if ! [[ $config = *acl* ]]
	then
		if [[ -z $config ]]
		then
			config="acl"
		else
			config=$config"+acl"
		fi
	fi
	sed -i "s/^$group\s*=.*/$group = $config/g" $aide_conf
done
Configure AIDE to Verify Extended Attributesxccdf_org.ssgproject.content_rule_aide_verify_ext_attributes medium

Configure AIDE to Verify Extended Attributes

Rule IDxccdf_org.ssgproject.content_rule_aide_verify_ext_attributes
Result
fail
Time2017-10-21T14:38:42
Severitymedium
Identifiers and References

References:  SI-7.1, 366, SRG-OS-000480-GPOS-00227

Description

By default, the xattrs option is added to the FIPSR ruleset in AIDE. If using a custom ruleset or the xattrs option is missing, add xattrs to the appropriate ruleset. For example, add xattrs to the following line in /etc/aide.conf:

FIPSR = p+i+n+u+g+s+m+c+acl+selinux+xattrs+sha256
AIDE rules can be configured in multiple ways; this is merely one example that is already configured by default.

Rationale

Extended attributes in file systems are used to contain arbitrary data and file metadata with security implications.

OVAL details

Items not found violating xattrs is set in /etc/aide.conf:

Object oval:ssg-object_aide_verify_ext_attributes:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/aide.conf^(?!ALLXTRAHASHES)[A-Z]*[\s]*=[\s]*([a-z0-9\+]*)$1
State oval:ssg-state_aide_verify_ext_attributes:ste:1 of type textfilecontent54_state
Subexpression
^.*xattrs.*$
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable

aide_conf="/etc/aide.conf"

groups=$(grep "^[A-Z]\+" $aide_conf | grep -v "^ALLXTRAHASHES" | cut -f1 -d '=' | tr -d ' ' | sort -u)

for group in $groups
do
	config=$(grep "^$group\s*=" $aide_conf | cut -f2 -d '=' | tr -d ' ')

	if ! [[ $config = *xattrs* ]]
	then
		if [[ -z $config ]]
		then
			config="xattrs"
		else
			config=$config"+xattrs"
		fi
	fi
	sed -i "s/^$group\s*=.*/$group = $config/g" $aide_conf
done
Configure AIDE to Use FIPS 140-2 for Validating Hashesxccdf_org.ssgproject.content_rule_aide_use_fips_hashes medium

Configure AIDE to Use FIPS 140-2 for Validating Hashes

Rule IDxccdf_org.ssgproject.content_rule_aide_use_fips_hashes
Result
fail
Time2017-10-21T14:38:42
Severitymedium
Identifiers and References

References:  SI-7(1), 366, SRG-OS-000480-GPOS-00227, 3.13.11

Description

By default, the sha512 option is added to the NORMAL ruleset in AIDE. If using a custom ruleset or the sha512 option is missing, add sha512 to the appropriate ruleset. For example, add sha512 to the following line in /etc/aide.conf:

NORMAL = FIPSR+sha512
AIDE rules can be configured in multiple ways; this is merely one example that is already configured by default.

Rationale

File integrity tools use cryptographic hashes for verifying file contents and directories have not been altered. These hashes must be FIPS 140-2 approved cryptographic hashes.

OVAL details

Items not found violating Verify non-FIPS hashes are not configured in /etc/aide.conf:

Object oval:ssg-object_aide_non_fips_hashes:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/aide.conf^[A-Z]*[\s]*=[\s]*.*(sha1|rmd160|sha256|whirlpool|tiger|haval|gost|crc32).*$0

Items not found violating Verify FIPS hashes are configured in /etc/aide.conf:

Object oval:ssg-object_aide_use_fips_hashes:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/aide.conf^[A-Z]*[\s]*=[\s]*([a-z0-9\+]*)$1
State oval:ssg-state_aide_use_fips_hashes:ste:1 of type textfilecontent54_state
Subexpression
^.*sha512.*$
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable

aide_conf="/etc/aide.conf"
forbidden_hashes=(sha1 rmd160 sha256 whirlpool tiger haval gost crc32)

groups=$(grep "^[A-Z]\+" $aide_conf | cut -f1 -d ' ' | tr -d ' ' | sort -u)

for group in $groups
do
	config=$(grep "^$group\s*=" $aide_conf | cut -f2 -d '=' | tr -d ' ')

	if ! [[ $config = *sha512* ]]
	then
		config=$config"+sha512"
	fi

	for hash in ${forbidden_hashes[@]}
	do
		config=$(echo $config | sed "s/$hash//")
	done

	config=$(echo $config | sed "s/^\+*//")
	config=$(echo $config | sed "s/\+\++/+/")
	config=$(echo $config | sed "s/\+$//")

	sed -i "s/^$group\s*=.*/$group = $config/g" $aide_conf
done
Verify and Correct File Permissions with RPMxccdf_org.ssgproject.content_rule_rpm_verify_permissions high

Verify and Correct File Permissions with RPM

Rule IDxccdf_org.ssgproject.content_rule_rpm_verify_permissions
Result
pass
Time2017-10-21T14:38:54
Severityhigh
Identifiers and References

References:  AC-6, AU-9(1), AU-9(3), CM-6(d), CM-6(3), 1494, 1496, Req-11.5, 1.2.6, 6.1.3, 6.1.4, 6.1.5, 6.1.6, 6.1.7, 6.1.8, 6.1.9, 6.2.3, SRG-OS-000257-GPOS-00098, SRG-OS-000278-GPOS-00108, 5.10.4.1, 3.3.8, 3.4.1

Description

Discretionary access control is weakened if a user or group has access permissions to system files and directories greater than the default. The RPM package management system can check file access permissions of installed software packages, including many that are important to system security. Verify that the file permissions, ownership, and gruop membership of system files and commands match vendor values. Check the file permissions, ownership, and group membership with the following command:

$ sudo rpm -Va | grep '^.M'
Output indicates files that do not match vendor defaults. After locating a file with incorrect permissions, run the following command to determine which package owns it:
$ rpm -qf FILENAME

Next, run the following command to reset its permissions to the correct values:
$ sudo rpm --setperms PACKAGENAME

Rationale

Permissions on system binaries and configuration files that are too generous could allow an unauthorized user to gain privileges that they should not have. The permissions set by the vendor should be maintained. Any deviations from this baseline should be investigated.

Warnings
warning  Note: Due to a bug in the gdm package, the RPM verify command may continue to fail even after file permissions have been correctly set on /var/log/gdm. This is being tracked in Red Hat Bugzilla #1275532.
OVAL details

Items not found satisfying user ownership of all files matches local rpm database:

Object oval:ssg-object_files_fail_user_ownership:obj:1 of type rpmverifyfile_object
BehaviorsNameEpochVersionReleaseArchFilepathFilter
no value.*.*.*.*.*.*oval:ssg-state_files_fail_user_ownership:ste:1

Items not found satisfying group ownership of all files matches local rpm database:

Object oval:ssg-object_files_fail_group_ownership:obj:1 of type rpmverifyfile_object
BehaviorsNameEpochVersionReleaseArchFilepathFilter
no value.*.*.*.*.*.*oval:ssg-state_files_fail_group_ownership:ste:1

Items not found satisfying mode of all files matches local rpm database:

Object oval:ssg-object_files_fail_mode:obj:1 of type rpmverifyfile_object
BehaviorsNameEpochVersionReleaseArchFilepathFilter
no value.*.*.*.*.*.*oval:ssg-state_files_fail_mode:ste:1
Verify File Hashes with RPMxccdf_org.ssgproject.content_rule_rpm_verify_hashes high

Verify File Hashes with RPM

Rule IDxccdf_org.ssgproject.content_rule_rpm_verify_hashes
Result
pass
Time2017-10-21T14:39:27
Severityhigh
Identifiers and References

References:  CM-6(d), CM-6(3), SI-7(1), 663, Req-11.5, 1.2.6, SRG-OS-000480-GPOS-00227, 5.10.4.1, 3.3.8, 3.4.1

Description

Without cryptographic integrity protections, system executables and files can be altered by unauthorized users without detection. The RPM package management system can check the hashes of installed software packages, including many that are important to system security. To verify that the cryptographic hash of system files and commands match vendor values, run the following command to list which files on the system have hashes that differ from what is expected by the RPM database:

$ rpm -Va | grep '^..5'
A "c" in the second column indicates that a file is a configuration file, which may appropriately be expected to change. If the file was not expected to change, investigate the cause of the change using audit logs or other means. The package can then be reinstalled to restore the file. Run the following command to determine which package owns the file:
$ rpm -qf FILENAME
The package can be reinstalled from a yum repository using the command:
$ sudo yum reinstall PACKAGENAME
Alternatively, the package can be reinstalled from trusted media using the command:
$ sudo rpm -Uvh PACKAGENAME

Rationale

The hashes of important files like system executables should match the information given by the RPM database. Executables with erroneous hashes could be a sign of nefarious activity on the system.

OVAL details

Items not found satisfying verify file md5 hashes:

Object oval:ssg-object_files_fail_md5_hash:obj:1 of type rpmverifyfile_object
BehaviorsNameEpochVersionReleaseArchFilepathFilter
no value.*.*.*.*.*^/(bin|sbin|lib|lib64|usr)/.+$oval:ssg-state_files_fail_md5_hash:ste:1
Install the Host Intrusion Prevention System (HIPS) Modulexccdf_org.ssgproject.content_rule_install_mcafee_hbss_hips medium

Install the Host Intrusion Prevention System (HIPS) Module

Rule IDxccdf_org.ssgproject.content_rule_install_mcafee_hbss_hips
Result
notselected
Time2017-10-21T14:39:27
Severitymedium
Identifiers and References

References:  SC-7, SI-4(1).1, 366, 1263, Req-11.4, STG-OS-000480-GPOS-00227

Description

Install the McAfee Host Intrusion Prevention System (HIPS) Module if it is absolutely necessary. If SELinux is enabled, do not install or enable this module.

Rationale

Without a host-based intrusion detection tool, there is no system-level defense when an intruder gains access to a system or network. Additionally, a host-based intrusion prevention tool can provide methods to immediately lock out detected intrusion attempts.

Warnings
warning  Installing and enabling this module conflicts with SELinux. Per DoD/DISA guidance, SELinux takes precedence over this module.
warning  Due to McAfee HIPS being 3rd party software, automated remediation is not available for this configuration check.
Install the Asset Configuration Compliance Module (ACCM)xccdf_org.ssgproject.content_rule_install_mcafee_hbss_accm medium

Install the Asset Configuration Compliance Module (ACCM)

Rule IDxccdf_org.ssgproject.content_rule_install_mcafee_hbss_accm
Result
notselected
Time2017-10-21T14:39:27
Severitymedium
Identifiers and References

References:  SC-7, SI-4(1).1, 366, 1263, Req-11.4, STG-OS-000480-GPOS-00227

Description

Install the Asset Configuration Compliance Module (ACCM).

Rationale

Without a host-based intrusion detection tool, there is no system-level defense when an intruder gains access to a system or network. Additionally, a host-based intrusion prevention tool can provide methods to immediately lock out detected intrusion attempts.

Warnings
warning  Due to HBSS ACCM being 3rd party software, automated remediation is not available for this configuration check.
Install the Policy Auditor (PA) Modulexccdf_org.ssgproject.content_rule_install_mcafee_hbss_pa medium

Install the Policy Auditor (PA) Module

Rule IDxccdf_org.ssgproject.content_rule_install_mcafee_hbss_pa
Result
notselected
Time2017-10-21T14:39:27
Severitymedium
Identifiers and References

References:  SC-7, SI-4(1).1, 366, 1263, Req-11.4, STG-OS-000480-GPOS-00227

Description

Install the Policy Auditor (PA) Module.

Rationale

Without a host-based intrusion detection tool, there is no system-level defense when an intruder gains access to a system or network. Additionally, a host-based intrusion prevention tool can provide methods to immediately lock out detected intrusion attempts.

Warnings
warning  Due to McAfee being 3rd party software, automated remediation is not available for this configuration check.
Install the McAfee Runtime Libraries and Linux Agentxccdf_org.ssgproject.content_rule_install_mcafee_cma_rt medium

Install the McAfee Runtime Libraries and Linux Agent

Rule IDxccdf_org.ssgproject.content_rule_install_mcafee_cma_rt
Result
notselected
Time2017-10-21T14:39:27
Severitymedium
Identifiers and References
Description

Install the McAfee Runtime Libraries (MFErt) and Linux Agent (MFEcma).

Rationale

The McAfee Runtime Libraries (MFErt) and Linux Agent (MFEcma) are dependencies for VirusScan Enterprise for Linux (VSEL) and Host-based Security System (HBSS) to run.

Install McAfee Virus Scanning Softwarexccdf_org.ssgproject.content_rule_install_mcafee_antivirus high

Install McAfee Virus Scanning Software

Rule IDxccdf_org.ssgproject.content_rule_install_mcafee_antivirus
Result
fail
Time2017-10-21T14:39:27
Severityhigh
Identifiers and References

References:  SC-28, SI-3, SI-3(1)(ii), 366, 1239, 1668, SRG-OS-000480-GPOS-00227

Description

Install McAfee VirusScan Enterprise for Linux antivirus software which is provided for DoD systems and uses signatures to search for the presence of viruses on the filesystem.

Rationale

Virus scanning software can be used to detect if a system has been compromised by computer viruses, as well as to limit their spread to other systems.

Warnings
warning  Due to McAfee HIPS being 3rd party software, automated remediation is not available for this configuration check.
OVAL details

Items not found violating AntiVirus package is installed:

Object oval:ssg-obj_linuxshield_install_antivirus:obj:1 of type rpminfo_object
Name
McAfeeVSEForLinux
Enable nails Servicexccdf_org.ssgproject.content_rule_service_nails_enabled medium

Enable nails Service

Rule IDxccdf_org.ssgproject.content_rule_service_nails_enabled
Result
notselected
Time2017-10-21T14:39:27
Severitymedium
Identifiers and References

References:  SC-28, SI-3, SI-3(1)(ii), 366, 1239, 1668, SRG-OS-000480-GPOS-00227

Description

The nails service is used to run McAfee VirusScan Enterprise for Linux and McAfee Host-based Security System (HBSS) services. The nails service can be enabled with the following command:

$ sudo systemctl enable nails.service

Rationale

Virus scanning software can be used to detect if a system has been compromised by computer viruses, as well as to limit their spread to other systems.

Virus Scanning Software Definitions Are Updatedxccdf_org.ssgproject.content_rule_mcafee_antivirus_definitions_updated medium

Virus Scanning Software Definitions Are Updated

Rule IDxccdf_org.ssgproject.content_rule_mcafee_antivirus_definitions_updated
Result
notchecked
Time2017-10-21T14:39:27
Severitymedium
Identifiers and References

References:  SC-28, SI-3, SI-3(1)(ii), 366, 1239, 1668, SRG-OS-000480-GPOS-00227

Description

Ensure virus definition files are no older than 7 days or their last release.

Rationale

Virus scanning software can be used to detect if a system has been compromised by computer viruses, as well as to limit their spread to other systems.

Evaluation messages
info 
No candidate or applicable check found.
Install Intrusion Detection Softwarexccdf_org.ssgproject.content_rule_install_hids high

Install Intrusion Detection Software

Rule IDxccdf_org.ssgproject.content_rule_install_hids
Result
notselected
Time2017-10-21T14:39:27
Severityhigh
Identifiers and References

References:  SC-7, 1263, Req-11.4

Description

The base Red Hat platform already includes a sophisticated auditing system that can detect intruder activity, as well as SELinux, which provides host-based intrusion prevention capabilities by confining privileged programs and user sessions which may become compromised.

Rationale

Host-based intrusion detection tools provide a system-level defense when an intruder gains access to a system or network.

Warnings
warning  Note in DoD environments, supplemental intrusion detection tools, such as the McAfee Host-based Security System, are available to integrate with existing infrastructure. When these supplemental tools interfere with proper functioning of SELinux, SELinux takes precedence.
Install Virus Scanning Softwarexccdf_org.ssgproject.content_rule_install_antivirus high

Install Virus Scanning Software

Rule IDxccdf_org.ssgproject.content_rule_install_antivirus
Result
notselected
Time2017-10-21T14:39:27
Severityhigh
Identifiers and References

References:  SC-28, SI-3, 1239, 1668

Description

Install virus scanning software, which uses signatures to search for the presence of viruses on the filesystem. Ensure virus definition files are no older than 7 days, or their last release. Configure the virus scanning software to perform scans dynamically on all accessed files. If this is not possible, configure the system to scan all altered files on the system on a daily basis. If the system processes inbound SMTP mail, configure the virus scanner to scan all received mail.

Rationale

Virus scanning software can be used to detect if a system has been compromised by computer viruses, as well as to limit their spread to other systems.

Install the dracut-fips Packagexccdf_org.ssgproject.content_rule_package_dracut-fips_installed medium

Install the dracut-fips Package

Rule IDxccdf_org.ssgproject.content_rule_package_dracut-fips_installed
Result
notselected
Time2017-10-21T14:39:27
Severitymedium
Identifiers and References

References:  AC-17(2), 68, 2450, SRG-OS-000033-GPOS-00014, SRG-OS-000396-GPOS-00176, SRG-OS-000478-GPOS-00223, 5.10.1.2, 3.13.11, 3.13.8

Description

To enable FIPS, the system requires that the dracut-fips package be installed. The dracut-fips package can be installed with the following command:

$ sudo yum install dracut-fips

Rationale

Use of weak or untested encryption algorithms undermines the purposes of utilizing 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.

Enable FIPS Mode in GRUB2xccdf_org.ssgproject.content_rule_grub2_enable_fips_mode medium

Enable FIPS Mode in GRUB2

Rule IDxccdf_org.ssgproject.content_rule_grub2_enable_fips_mode
Result
fail
Time2017-10-21T14:39:27
Severitymedium
Identifiers and References

References:  AC-17(2), 68, 2450, SRG-OS-000033-GPOS-00014, SRG-OS-000396-GPOS-00176, SRG-OS-000478-GPOS-00223, 5.10.1.2, 3.13.8, 3.13.11

Description

To ensure FIPS mode is enabled, rebuild initramfs by running the following command:

dracut -f
After the dracut command has been run, add the argument fips=1 to the default GRUB 2 command line for the Linux operating system in /etc/default/grub, in the manner below:
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=VolGroup/LogVol06 rd.lvm.lv=VolGroup/lv_swap rhgb quiet rd.shell=0 fips=1"
Finally, rebuild the grub.cfg file by using the
grub2-mkconfig -o
command as follows:
  • On BIOS-based machines, issue the following command as root:
    ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
  • On UEFI-based machines, issue the following command as root:
    ~]# grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg

Rationale

Use of weak or untested encryption algorithms undermines the purposes of utilizing 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.

Warnings
warning  Running
dracut -f
will overwrite the existing initramfs file.
warning  The system needs to be rebooted for these changes to take effect.
warning  The ability to enable FIPS does not denote FIPS compliancy or certification. Red Hat, Inc. and Red Hat Enterprise Linux are respectively FIPS certified and compliant. Community projects such as CentOS, Scientific Linux, etc. do not necessarily meet FIPS certification and compliancy. Therefore, non-certified vendors and/or projects do not meet this requirement even if technically feasible.

See http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/1401vend.htm for a list of FIPS certified vendors.
OVAL details

Items found violating check for fips=1 in /etc/default/grub via GRUB_CMDLINE_LINUX:

PathContent
/etc/default/grubGRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap"

Items not found violating check for GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub:

Object oval:ssg-object_grub2_default_exists:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/default/grub^\s*GRUB_CMDLINE_LINUX_DEFAULT=.*$1

Items not found violating check for fips=1 in /etc/default/grub via GRUB_CMDLINE_LINUX_DEFAULT:

Object oval:ssg-object_grub2_enable_fips_mode_default:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/default/grub^\s*GRUB_CMDLINE_LINUX_DEFAULT="(.*)"$1
State oval:ssg-state_grub2_enable_fips_mode:ste:1 of type textfilecontent54_state
Subexpression
^.*fips=1.*$

Items found violating check for fips=1 in /etc/default/grub via GRUB_CMDLINE_LINUX:

PathContent
/etc/default/grubGRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap"
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


if grep --silent ^PRELINKING /etc/sysconfig/prelink ; then
        sed -i "s/^PRELINKING.*/PRELINKING=no/g" /etc/sysconfig/prelink
else
        echo -e "\n# Set PRELINKING to 'no' per security requirements" >> /etc/sysconfig/prelink
        echo "PRELINKING=no" >> /etc/sysconfig/prelink
fi

prelink -u -a

function package_command {

# Load function arguments into local variables
local package_operation=$1
local package=$2

# Check sanity of the input
if [ $# -ne "2" ]
then
  echo "Usage: package_command 'install/uninstall' 'rpm_package_name"
  echo "Aborting."
  exit 1
fi

# If dnf is installed, use dnf; otherwise, use yum
if [ -f "/usr/bin/dnf" ] ; then
  install_util="/usr/bin/dnf"
else
  install_util="/usr/bin/yum"
fi

if [ "$package_operation" != 'remove' ] ; then
  # If the rpm is not installed, install the rpm
  if ! /bin/rpm -q --quiet $package; then
    $install_util -y $package_operation $package
  fi
else
  # If the rpm is installed, uninstall the rpm
  if /bin/rpm -q --quiet $package; then
    $install_util -y $package_operation $package
  fi
fi

}

package_command install dracut-fips

dracut -f

if [ -e /sys/firmware/efi ]; then
	BOOT=`df /boot/efi | tail -1 | awk '{print $1 }'`
else
	BOOT=`df /boot | tail -1 | awk '{ print $1 }'`
fi

# Correct the form of default kernel command line in /etc/default/grub
if ! grep -q "^GRUB_CMDLINE_LINUX=\".*fips=1.*\"" /etc/default/grub;
then
  # Append 'fips=1' argument to /etc/default/grub (if not present yet)
  sed -i "s/\(GRUB_CMDLINE_LINUX=\)\"\(.*\)\"/\1\"\2 fips=1\"/" /etc/default/grub
fi

# Edit runtime setting
# Correct the form of kernel command line for each installed kernel in the bootloader
/sbin/grubby --update-kernel=ALL --args="boot=${BOOT} fips=1"
The Installed Operating System Is Vendor Supported and Certifiedxccdf_org.ssgproject.content_rule_installed_OS_is_certified high

The Installed Operating System Is Vendor Supported and Certified

Rule IDxccdf_org.ssgproject.content_rule_installed_OS_is_certified
Result
fail
Time2017-10-21T14:39:27
Severityhigh
Identifiers and References

References:  SI-2(c), 366, SRG-OS-000480-GPOS-00227

Description

The installed operating system must be maintained and certified by a vendor. Red Hat Enterprise Linux is supported by Red Hat, Inc. As the Red Hat Enterprise Linux vendor, Red Hat, Inc. is responsible for providing security patches as well as meeting and maintaining goverment certifications and standards.

Rationale

An operating system is considered "supported" if the vendor continues to provide security patches for the product as well as maintain government certification requirements. With an unsupported release, it will not be possible to resolve security issue discovered in the system software as well as meet government certifications.

Disable the GNOME3 Login User Listxccdf_org.ssgproject.content_rule_dconf_gnome_disable_user_list medium

Disable the GNOME3 Login User List

Rule IDxccdf_org.ssgproject.content_rule_dconf_gnome_disable_user_list
Result
notselected
Time2017-10-21T14:39:27
Severitymedium
Identifiers and References

References:  AC-23

Description

In the default graphical environment, users logging directly into the system are greeted with a login screen that displays all known users. This functionality should be disabled by setting disable-user-list to true.

To disable, add or edit disable-user-list to /etc/dconf/db/gdm.d/00-security-settings. For example:

[org/gnome/login-screen]
disable-user-list=true
Once the setting has been added, add a lock to /etc/dconf/db/gdm.d/locks/00-security-settings-lock to prevent user modification. For example:
/org/gnome/login-screen/disable-user-list
After the settings have been set, run dconf update.

Rationale

Leaving the user list enabled is a security risk since it allows anyone with physical access to the system to quickly enumerate known user accounts without logging in.

Disable the GNOME3 Login Restart and Shutdown Buttonsxccdf_org.ssgproject.content_rule_dconf_gnome_disable_restart_shutdown high

Disable the GNOME3 Login Restart and Shutdown Buttons

Rule IDxccdf_org.ssgproject.content_rule_dconf_gnome_disable_restart_shutdown
Result
notselected
Time2017-10-21T14:39:27
Severityhigh
Identifiers and References

References:  AC-6, 366, SRG-OS-000480-GPOS-00227, 3.1.2

Description

In the default graphical environment, users logging directly into the system are greeted with a login screen that allows any user, known or unknown, the ability the ability to shutdown or restart the system. This functionality should be disabled by setting disable-restart-buttons to true.

To disable, add or edit disable-restart-buttons to /etc/dconf/db/gdm.d/00-security-settings. For example:

[org/gnome/login-screen]
disable-restart-buttons=true
Once the setting has been added, add a lock to /etc/dconf/db/gdm.d/locks/00-security-settings-lock to prevent user modification. For example:
/org/gnome/login-screen/disable-restart-buttons
After the settings have been set, run dconf update.

Rationale

A user who is at the console can reboot the system at the login screen. If restart or shutdown buttons are pressed at the login screen, this can create the risk of short-term loss of availability of systems due to reboot.

Enable the GNOME3 Login Smartcard Authenticationxccdf_org.ssgproject.content_rule_dconf_gnome_enable_smartcard_auth medium

Enable the GNOME3 Login Smartcard Authentication

Rule IDxccdf_org.ssgproject.content_rule_dconf_gnome_enable_smartcard_auth
Result
notselected
Time2017-10-21T14:39:27
Severitymedium
Identifiers and References

References:  765, 766, 767, 768, 771, 772, 884, Req-8.3

Description

In the default graphical environment, smart card authentication can be enabled on the login screen by setting enable-smartcard-authentication to true.

To enable, add or edit enable-smartcard-authentication to /etc/dconf/db/gdm.d/00-security-settings. For example:

[org/gnome/login-screen]
enable-smartcard-authentication=true
Once the setting has been added, add a lock to /etc/dconf/db/gdm.d/locks/00-security-settings-lock to prevent user modification. For example:
/org/gnome/login-screen/enable-smartcard-authentication
After the settings have been set, run dconf update.

Rationale

Smart card login provides two-factor authentication stronger than that provided by a username and password combination. Smart cards leverage PKI (public key infrastructure) in order to provide and verify credentials.

Set GNOME3 Screensaver Inactivity Timeoutxccdf_org.ssgproject.content_rule_dconf_gnome_screensaver_idle_delay medium

Set GNOME3 Screensaver Inactivity Timeout

Rule IDxccdf_org.ssgproject.content_rule_dconf_gnome_screensaver_idle_delay
Result
pass
Time2017-10-21T14:39:27
Severitymedium
Identifiers and References

References:  AC-11(a), 57, Req-8.1.8, SRG-OS-000029-GPOS-00010, 5.5.5, 3.1.10

Description

The idle time-out value for inactivity in the GNOME3 desktop is configured via the idle-delay setting must be set under an appropriate configuration file(s) in the /etc/dconf/db/local.d directory and locked in /etc/dconf/db/local.d/locks directory to prevent user modification.

For example, to configure the system for a 15 minute delay, add the following to /etc/dconf/db/local.d/00-security-settings:

[org/gnome/desktop/session]
idle-delay='uint32 900'
Once the setting has been added, add a lock to /etc/dconf/db/local.d/locks/00-security-settings-lock to prevent user modification. For example:
/org/gnome/desktop/session/idle-delay
After the settings have been set, run dconf update.

Rationale

A session time-out 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 logout because of the temporary nature of the absence. Rather than relying on the user to manually lock their operating system session prior to vacating the vicinity, GNOME3 can be configured to identify when a user's session has idled and take action to initiate a session lock.

OVAL details

Items not found satisfying screensaver idle delay is configured:

Object oval:ssg-obj_screensaver_idle_delay:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/etc/dconf/db/local.d/^.*$^\[org/gnome/desktop/session]([^\n]*\n+)+?idle-delay=uint32[\s][0-9]*$1

Items not found satisfying user cannot change screensaver idle delay:

Object oval:ssg-obj_prevent_user_change_idle_delay:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/etc/dconf/db/local.d/locks/^.*$^/org/gnome/desktop/session/idle-delay$1

Items not found satisfying screensaver idle delay setting is correct:

Object oval:ssg-obj_screensaver_idle_delay_setting:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/etc/dconf/db/local.d/^.*$^idle-delay[\s=]*uint32[\s]([^=\s]*)1
State oval:ssg-state_screensaver_idle_delay_setting:ste:1 of type textfilecontent54_state
Subexpression
900
Enable GNOME3 Screensaver Idle Activationxccdf_org.ssgproject.content_rule_dconf_gnome_screensaver_idle_activation_enabled medium

Enable GNOME3 Screensaver Idle Activation

Rule IDxccdf_org.ssgproject.content_rule_dconf_gnome_screensaver_idle_activation_enabled
Result
pass
Time2017-10-21T14:39:27
Severitymedium
Identifiers and References

References:  AC-11(a), 57, SRG-OS-000029-GPOS-00010, Req-8.1.8, 5.5.5, 3.1.10

Description

To activate the screensaver in the GNOME3 desktop after a period of inactivity, add or set idle-activation-enabled to true in /etc/dconf/db/local.d/00-security-settings. For example:

[org/gnome/desktop/screensaver]
idle_activation_enabled=true
Once the setting has been added, add a lock to /etc/dconf/db/local.d/locks/00-security-settings-lock to prevent user modification. For example:
/org/gnome/desktop/screensaver/idle-activation-enabled
After the settings have been set, run dconf update.

Rationale

A session time-out 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 logout because of the temporary nature of the absence. Rather than relying on the user to manually lock their operating system session prior to vacating the vicinity, GNOME desktops can be configured to identify when a user's session has idled and take action to initiate the session lock.

Enabling idle activation of the screensaver ensures the screensaver will be activated after the idle delay. Applications requiring continuous, real-time screen display (such as network management products) require the login session does not have administrator rights and the display station is located in a controlled-access area.

OVAL details

Items not found satisfying idle delay is configured:

Object oval:ssg-obj_screensaver_idle_activation_enabled:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/etc/dconf/db/local.d/^.*$^\[org/gnome/desktop/screensaver]([^\n]*\n+)+?idle-activation-enabled=true$1

Items not found satisfying user cannot change idle_activation_enabled:

Object oval:ssg-obj_prevent_user_change_idle_activation_enabled:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/etc/dconf/db/local.d/locks/^.*$^/org/gnome/desktop/screensaver/idle-activation-enabled$1
Enable GNOME3 Screensaver Lock After Idle Periodxccdf_org.ssgproject.content_rule_dconf_gnome_screensaver_lock_enabled medium

Enable GNOME3 Screensaver Lock After Idle Period

Rule IDxccdf_org.ssgproject.content_rule_dconf_gnome_screensaver_lock_enabled
Result
pass
Time2017-10-21T14:39:27
Severitymedium
Identifiers and References

References:  AC-11(b), 56, Req-8.1.8, SRG-OS-000028-GPOS-00009, OS-SRG-000030-GPOS-00011, 5.5.5, 3.1.10

Description

To activate locking of the screensaver in the GNOME3 desktop when it is activated, add or set lock-enabled to true in /etc/dconf/db/local.d/00-security-settings. For example:

[org/gnome/desktop/screensaver]
lock-enabled=true
Once the settings have been added, add a lock to /etc/dconf/db/local.d/locks/00-security-settings-lock to prevent user modification. For example:
/org/gnome/desktop/screensaver/lock-enabled
After the settings have been set, run dconf update.

Rationale

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 logout because of the temporary nature of the absense.

OVAL details

Items not found satisfying screensaver lock is enabled:

Object oval:ssg-obj_screensaver_lock_enabled:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/etc/dconf/db/local.d/^.*$^\[org/gnome/desktop/screensaver]([^\n]*\n+)+?lock-enabled=true$1

Items not found satisfying screensaver lock cannot be changed by user:

Object oval:ssg-obj_prevent_user_screensaver_lock:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/etc/dconf/db/local.d/locks/^.*$^/org/gnome/desktop/screensaver/lock-enabled$1

Items not found satisfying screensaver lock is set correctly:

Object oval:ssg-obj_screensaver_enabled_lock_delay:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/etc/dconf/db/local.d/^.*$^\[org/gnome/desktop/screensaver]([^\n]*\n+)+?lock-delay=uint32[\s]0$1

Items not found satisfying screensaver lock delay cannot be changed by user:

Object oval:ssg-obj_prevent_user_lock_delay_locked:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/etc/dconf/db/local.d/locks/^.*$^/org/gnome/desktop/screensaver/lock-delay$1
Set GNOME3 Screensaver Lock Delay After Activation Periodxccdf_org.ssgproject.content_rule_dconf_gnome_screensaver_lock_delay medium

Set GNOME3 Screensaver Lock Delay After Activation Period

Rule IDxccdf_org.ssgproject.content_rule_dconf_gnome_screensaver_lock_delay
Result
pass
Time2017-10-21T14:39:27
Severitymedium
Identifiers and References

References:  AC-11(a), 56, Req-8.1.8, OS-SRG-000029-GPOS-00010, 3.1.10

Description

To activate the locking delay of the screensaver in the GNOME3 desktop when the screensaver is activated, add or set lock-delay to uint32 0 in /etc/dconf/db/local.d/00-security-settings. For example:

[org/gnome/desktop/screensaver]
lock-delay=uint32 0
Once the setting has been added, add a lock to /etc/dconf/db/local.d/locks/00-security-settings-lock to prevent user modification. For example:
/org/gnome/desktop/screensaver/lock-delay
After the settings have been set, run dconf update.

Rationale

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 logout because of the temporary nature of the absense.

OVAL details

Items not found satisfying screensaver lock is set correctly:

Object oval:ssg-obj_screensaver_lock_delay:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/etc/dconf/db/local.d/^.*$^\[org/gnome/desktop/screensaver]([^\n]*\n+)+?lock-delay=uint32[\s]0$1

Items not found satisfying screensaver lock delay cannot be changed by user:

Object oval:ssg-obj_prevent_user_lock_delay:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/etc/dconf/db/local.d/locks/^.*$^/org/gnome/desktop/screensaver/lock-delay$1
Implement Blank Screensaverxccdf_org.ssgproject.content_rule_dconf_gnome_screensaver_mode_blank low

Implement Blank Screensaver

Rule IDxccdf_org.ssgproject.content_rule_dconf_gnome_screensaver_mode_blank
Result
notselected
Time2017-10-21T14:39:27
Severitylow
Identifiers and References

References:  AC-11(b), 60, Req-8.1.8, 5.5.5, 3.1.10

Description

To set the screensaver mode in the GNOME3 desktop to a blank screen, add or set picture-uri to string '' in /etc/dconf/db/local.d/00-security-settings. For example:

[org/gnome/desktop/screensaver]
picture-uri=string ''
Once the settings have been added, add a lock to /etc/dconf/db/local.d/locks/00-security-settings-lock to prevent user modification. For example:
/org/gnome/desktop/screensaver/picture-uri
After the settings have been set, run dconf update.

Rationale

Setting the screensaver mode to blank-only conceals the contents of the display from passersby.

Ensure Users Cannot Change GNOME3 Session Settingsxccdf_org.ssgproject.content_rule_dconf_gnome_session_user_locks low

Ensure Users Cannot Change GNOME3 Session Settings

Rule IDxccdf_org.ssgproject.content_rule_dconf_gnome_session_user_locks
Result
pass
Time2017-10-21T14:39:27
Severitylow
Identifiers and References

References:  AC-11(a), 57, SRG-OS-00029-GPOS-0010, 3.1.10

Description

If not already configured, ensure that users cannot change GNOME3 session idle and lock settings by adding /org/gnome/desktop/screensaver/lock-delay and /org/gnome/desktop/session/idle-delay to /etc/dconf/db/local.d/locks/00-security-settings-lock to prevent user modification. For example:

/org/gnome/desktop/screensaver/lock-delay
/org/gnome/desktop/session/idle-delay
After the settings have been set, run dconf update.

Rationale

A session time-out 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 logout because of the temporary nature of the absence. Rather than relying on the user to manually lock their operating system session prior to vacating the vicinity, GNOME desktops can be configured to identify when a user's session has idled and take action to initiate the session lock. As such, users should not be allowed to change session settings.

OVAL details

Items not found satisfying user cannot change screensaver idle delay:

Object oval:ssg-obj_user_change_idle_delay_lock:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/etc/dconf/db/local.d/locks/^.*$^/org/gnome/desktop/session/idle-delay$1

Items not found satisfying screensaver lock delay cannot be changed by user:

Object oval:ssg-obj_user_change_lock_delay_lock:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/etc/dconf/db/local.d/locks/^.*$^/org/gnome/desktop/screensaver/lock-delay$1
Disable Ctrl-Alt-Del Reboot Key Sequence in GNOME3xccdf_org.ssgproject.content_rule_dconf_gnome_disable_ctrlaltdel_reboot high

Disable Ctrl-Alt-Del Reboot Key Sequence in GNOME3

Rule IDxccdf_org.ssgproject.content_rule_dconf_gnome_disable_ctrlaltdel_reboot
Result
notselected
Time2017-10-21T14:39:27
Severityhigh
Identifiers and References

References:  AC-6, 366, SRG-OS-000480-GPOS-00227, 3.1.2

Description

By default, GNOME will reboot the system if the Ctrl-Alt-Del key sequence is pressed.

To configure the system to ignore the Ctrl-Alt-Del key sequence from the Graphical User Interface (GUI) instead of rebooting the system, add or set logout to string '' in /etc/dconf/db/local.d/00-security-settings. For example:

[org/gnome/settings-daemon/plugins/media-keys]
logout=string ''
Once the settings have been added, add a lock to /etc/dconf/db/local.d/locks/00-security-settings-lock to prevent user modification. For example:
/org/gnome/settings-daemon/plugins/media-keys/logout
After the settings have been set, run dconf update.

Rationale

A locally logged-in user who presses Ctrl-Alt-Del, when at the console, can reboot the system. If accidentally pressed, as could happen in the case of mixed OS environment, this can create the risk of short-term loss of availability of systems due to unintentional reboot.

Disable User Administration in GNOME3xccdf_org.ssgproject.content_rule_dconf_gnome_disable_user_admin high

Disable User Administration in GNOME3

Rule IDxccdf_org.ssgproject.content_rule_dconf_gnome_disable_user_admin
Result
notselected
Time2017-10-21T14:39:27
Severityhigh
Identifiers and References

References:  3.1.5

Description

By default, GNOME will allow all users to have some administratrion capability. This should be disabled so that non-administrative users are not making configuration changes. To configure the system to disable user administration capability in the Graphical User Interface (GUI), add or set user-administration-disabled to true in /etc/dconf/db/local.d/00-security-settings. For example:

[org/gnome/desktop/lockdown]
user-administration-disabled=true
Once the settings have been added, add a lock to /etc/dconf/db/local.d/locks/00-security-settings-lock to prevent user modification. For example:
/org/gnome/desktop/lockdown/user-administration-disabled
After the settings have been set, run dconf update.

Rationale

Allowing all users to have some administratrive capabilities to the system through the Graphical User Interface (GUI) when they would not have them otherwise could allow unintended configuration changes as well as a nefarious user the capability to make system changes such as adding new accounts, etc.

Disable Power Settings in GNOME3xccdf_org.ssgproject.content_rule_dconf_gnome_disable_power_settings medium

Disable Power Settings in GNOME3

Rule IDxccdf_org.ssgproject.content_rule_dconf_gnome_disable_power_settings
Result
notselected
Time2017-10-21T14:39:27
Severitymedium
Identifiers and References
Description

By default, GNOME enables a power profile designed for mobile devices with battery usage. While useful for mobile devices, this setting should be disabled for all other systems. To configure the system to disable the power setting, add or set active to false in /etc/dconf/db/local.d/00-security-settings. For example:

[org/gnome/settings-daemon/plugins/power]
active=false
Once the settings have been added, add a lock to /etc/dconf/db/local.d/locks/00-security-settings-lock to prevent user modification. For example:
/org/gnome/settings-daemon/plugins/power
After the settings have been set, run dconf update.

Rationale

Power settings should not be enabled on systems that are not mobile devices. Enabling power settings on non-mobile devices could have unintended processing consequences on standard systems.

Disable Geolocation in GNOME3xccdf_org.ssgproject.content_rule_dconf_gnome_disable_geolocation medium

Disable Geolocation in GNOME3

Rule IDxccdf_org.ssgproject.content_rule_dconf_gnome_disable_geolocation
Result
notselected
Time2017-10-21T14:39:27
Severitymedium
Identifiers and References
Description

GNOME allows the clock and applications to track and access location information. This setting should be disabled as applications should not track system location. To configure the system to disable location tracking, add or set enabled to false in /etc/dconf/db/local.d/00-security-settings. For example:

[org/gnome/system/location]
enabled=false
To configure the clock to disable location tracking, add or set geolocation to false in /etc/dconf/db/local.d/00-security-settings. For example:
[org/gnome/clocks]
geolocation=false
Once the settings have been added, add a lock to /etc/dconf/db/local.d/locks/00-security-settings-lock to prevent user modification. For example:
/org/gnome/system/location/enabled
/org/gnome/clocks/geolocation
After the settings have been set, run dconf update.

Rationale

Power settings should not be enabled on systems that are not mobile devices. Enabling power settings on non-mobile devices could have unintended processing consequences on standard systems.

Disable WIFI Network Connection Creation in GNOME3xccdf_org.ssgproject.content_rule_dconf_gnome_disable_wifi_create medium

Disable WIFI Network Connection Creation in GNOME3

Rule IDxccdf_org.ssgproject.content_rule_dconf_gnome_disable_wifi_create
Result
notselected
Time2017-10-21T14:39:27
Severitymedium
Identifiers and References

References:  3.1.16

Description

GNOME allows users to create ad-hoc wireless connections through the NetworkManager applet. Wireless connections should be disabled by adding or setting disable-wifi-create to true in /etc/dconf/db/local.d/00-security-settings. For example:

[org/gnome/nm-applet]
disable-wifi-create=true
Once the settings have been added, add a lock to /etc/dconf/db/local.d/locks/00-security-settings-lock to prevent user modification. For example:
/org/gnome/nm-applet/disable-wifi-create
After the settings have been set, run dconf update.

Rationale

Wireless network connections should not be allowed to be configured by general users on a given system as it could open the system to backdoor attacks.

Disable WIFI Network Notification in GNOME3xccdf_org.ssgproject.content_rule_dconf_gnome_disable_wifi_notification medium

Disable WIFI Network Notification in GNOME3

Rule IDxccdf_org.ssgproject.content_rule_dconf_gnome_disable_wifi_notification
Result
notselected
Time2017-10-21T14:39:27
Severitymedium
Identifiers and References

References:  3.1.16

Description

By default, GNOME disables WIFI notification. This should be permanently set so that users do not connect to a wireless network when the system finds one. While useful for mobile devices, this setting should be disabled for all other systems. To configure the system to disable the WIFI notication, add or set suppress-wireless-networks-available to true in /etc/dconf/db/local.d/00-security-settings. For example:

[org/gnome/nm-applet]
suppress-wireless-networks-available=true
Once the settings have been added, add a lock to /etc/dconf/db/local.d/locks/00-security-settings-lock to prevent user modification. For example:
/org/gnome/nm-applet/suppress-wireless-networks-available
After the settings have been set, run dconf update.

Rationale

Wireless network connections should not be allowed to be configured by general users on a given system as it could open the system to backdoor attacks.

Require Credential Prompting for Remote Access in GNOME3xccdf_org.ssgproject.content_rule_dconf_gnome_remote_access_credential_prompt medium

Require Credential Prompting for Remote Access in GNOME3

Rule IDxccdf_org.ssgproject.content_rule_dconf_gnome_remote_access_credential_prompt
Result
notselected
Time2017-10-21T14:39:27
Severitymedium
Identifiers and References

References:  3.1.12

Description

By default, GNOME does not require credentials when using Vino for remote access. To configure the system to require remote credentials, add or set authentication-methods to ['vnc'] in /etc/dconf/db/local.d/00-security-settings. For example:

[org/gnome/Vino]
authentication-methods=['vnc']
Once the settings have been added, add a lock to /etc/dconf/db/local.d/locks/00-security-settings-lock to prevent user modification. For example:
/org/gnome/Vino/authentication-methods
After the settings have been set, run dconf update.

Rationale

Username and password prompting is required for remote access. Otherwise, non-authorized and nefarious users can access the system freely.

Require Encryption for Remote Access in GNOME3xccdf_org.ssgproject.content_rule_dconf_gnome_remote_access_encryption medium

Require Encryption for Remote Access in GNOME3

Rule IDxccdf_org.ssgproject.content_rule_dconf_gnome_remote_access_encryption
Result
notselected
Time2017-10-21T14:39:27
Severitymedium
Identifiers and References

References:  CM-2(1)(b), 366, SRG-OS-000480-GPOS-00227, 3.1.13

Description

By default, GNOME requires encryption when using Vino for remote access. To prevent remote access encryption from being disabled, add or set require-encryption to true in /etc/dconf/db/local.d/00-security-settings. For example:

[org/gnome/Vino]
require-encryption=true
Once the settings have been added, add a lock to /etc/dconf/db/local.d/locks/00-security-settings-lock to prevent user modification. For example:
/org/gnome/Vino/require-encryption
After the settings have been set, run dconf update.

Rationale

Open X displays allow an attacker to capture keystrokes and to execute commands remotely.

Disable GNOME3 Automountingxccdf_org.ssgproject.content_rule_dconf_gnome_disable_automount low

Disable GNOME3 Automounting

Rule IDxccdf_org.ssgproject.content_rule_dconf_gnome_disable_automount
Result
notselected
Time2017-10-21T14:39:27
Severitylow
Identifiers and References

References:  AC-19(a), AC-19(d), AC-19(e), 3.1.7

Description

The system's default desktop environment, GNOME3, will mount devices and removable media (such as DVDs, CDs and USB flash drives) whenever they are inserted into the system. To disable automount and autorun within GNOME3, add or set automount to false, automount-open to false, and autorun-never to true in /etc/dconf/db/local.d/00-security-settings. For example:

[org/gnome/desktop/media-handling]
automount=false
automount-open=false
autorun-never=true
Once the settings have been added, add a lock to /etc/dconf/db/local.d/locks/00-security-settings-lock to prevent user modification. For example:
/org/gnome/desktop/media-handling/automount
/org/gnome/desktop/media-handling/auto-open
/org/gnome/desktop/media-handling/autorun-never
After the settings have been set, run dconf update.

Rationale

Disabling automatic mounting in GNOME3 can prevent the introduction of malware via removable media. It will, however, also prevent desktop users from legitimate use of removable media.

Disable All GNOME3 Thumbnailersxccdf_org.ssgproject.content_rule_dconf_gnome_disable_thumbnailers low

Disable All GNOME3 Thumbnailers

Rule IDxccdf_org.ssgproject.content_rule_dconf_gnome_disable_thumbnailers
Result
notselected
Time2017-10-21T14:39:27
Severitylow
Identifiers and References

References:  CM-7

Description

The system's default desktop environment, GNOME3, uses a number of different thumbnailer programs to generate thumbnails for any new or modified content in an opened folder. To disable the execution of these thumbnail applications, add or set disable-all to true in /etc/dconf/db/local.d/00-security-settings. For example:

[org/gnome/desktop/thumbnailers]
disable-all=true
Once the settings have been added, add a lock to /etc/dconf/db/local.d/locks/00-security-settings-lock to prevent user modification. For example:
/org/gnome/desktop/thumbnailers/disable-all
After the settings have been set, run dconf update. This effectively prevents an attacker from gaining access to a system through a flaw in GNOME3's Nautilus thumbnail creators.

Rationale

An attacker with knowledge of a flaw in a GNOME3 thumbnailer application could craft a malicious file to exploit this flaw. Assuming the attacker could place the malicious file on the local filesystem (via a web upload for example) and assuming a user browses the same location using Nautilus, the malicious file would exploit the thumbnailer with the potential for malicious code execution. It is best to disable these thumbnailer applications unless they are explicitly required.

Ensure Users Re-Authenticate for Privilege Escalation - sudo NOPASSWDxccdf_org.ssgproject.content_rule_sudo_remove_nopasswd medium

Ensure Users Re-Authenticate for Privilege Escalation - sudo NOPASSWD

Rule IDxccdf_org.ssgproject.content_rule_sudo_remove_nopasswd
Result
pass
Time2017-10-21T14:39:28
Severitymedium
Identifiers and References

References:  IA-11, 2038, SRG-OS-000373-GPOS-00156, SRG-OS-000373-GPOS-00157, SRG-OS-000373-GPOS-00158

Description

The sudo NOPASSWD tag, when specified, allows a user to execute commands using sudo without having to authenticate. This should be disabled by making sure that the NOPASSWD tag does not exist in /etc/sudoers configuration file or any sudo configuration snippets in /etc/sudoers.d/.

Rationale

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 that the user re-authenticate.

OVAL details

Items not found satisfying NOPASSWD does not exist /etc/sudoers:

Object oval:ssg-object_nopasswd_etc_sudoers:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/sudoers^(?!#).*[\s]+NOPASSWD[\s]*\:.*$1

Items not found satisfying NOPASSWD does not exist in /etc/sudoers.d:

Object oval:ssg-object_nopasswd_etc_sudoers_d:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/etc/sudoers.d^.*$^(?!#).*[\s]+NOPASSWD[\s]*\:.*$1
Ensure Users Re-Authenticate for Privilege Escalation - sudo !authenticatexccdf_org.ssgproject.content_rule_sudo_remove_no_authenticate medium

Ensure Users Re-Authenticate for Privilege Escalation - sudo !authenticate

Rule IDxccdf_org.ssgproject.content_rule_sudo_remove_no_authenticate
Result
pass
Time2017-10-21T14:39:28
Severitymedium
Identifiers and References

References:  IA-11, 2038, SRG-OS-000373-GPOS-00156, SRG-OS-000373-GPOS-00157, SRG-OS-000373-GPOS-00158

Description

The sudo !authenticate option, when specified, allows a user to execute commands using sudo without having to authenticate. This should be disabled by making sure that the !authenticate option does not exist in /etc/sudoers configuration file or any sudo configuration snippets in /etc/sudoers.d/.

Rationale

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 that the user re-authenticate.

OVAL details

Items not found satisfying !authenticate does not exist in /etc/sudoers:

Object oval:ssg-object_no_authenticate_etc_sudoers:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/sudoers^(?!#).*[\s]+\!authenticate.*$1

Items not found satisfying !authenticate does not exist in /etc/sudoers.d:

Object oval:ssg-object_no_authenticate_etc_sudoers_d:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/etc/sudoers.d^.*$^(?!#).*[\s]+\!authenticate.*$1
Add nodev Option to Non-Root Local Partitionsxccdf_org.ssgproject.content_rule_mount_option_nodev_nonroot_local_partitions low

Add nodev Option to Non-Root Local Partitions

Rule IDxccdf_org.ssgproject.content_rule_mount_option_nodev_nonroot_local_partitions
Result
notselected
Time2017-10-21T14:39:28
Severitylow
Identifiers and References

References:  CM-7, 1.1.11

Description

The nodev mount option prevents files from being interpreted as character or block devices. Legitimate character and block devices should exist only in the /dev directory on the root partition or within chroot jails built for system services. Add the nodev option to the fourth column of /etc/fstab for the line which controls mounting of any non-root local partitions.

Rationale

The nodev mount option prevents files from being interpreted as character or block devices. The only legitimate location for device files is the /dev directory located on the root partition. The only exception to this is chroot jails, for which it is not advised to set nodev on these filesystems.

Add nodev Option to Removable Media Partitionsxccdf_org.ssgproject.content_rule_mount_option_nodev_removable_partitions low

Add nodev Option to Removable Media Partitions

Rule IDxccdf_org.ssgproject.content_rule_mount_option_nodev_removable_partitions
Result
notselected
Time2017-10-21T14:39:28
Severitylow
Identifiers and References

References:  AC-19(a), AC-19(d), AC-19(e), CM-7, MP-2

Description

The nodev mount option prevents files from being interpreted as character or block devices. Legitimate character and block devices should exist only in the /dev directory on the root partition or within chroot jails built for system services. Add the nodev option to the fourth column of /etc/fstab for the line which controls mounting of any removable media partitions.

Rationale

The only legitimate location for device files is the /dev directory located on the root partition. An exception to this is chroot jails, and it is not advised to set nodev on partitions which contain their root filesystems.

Add noexec Option to Removable Media Partitionsxccdf_org.ssgproject.content_rule_mount_option_noexec_removable_partitions low

Add noexec Option to Removable Media Partitions

Rule IDxccdf_org.ssgproject.content_rule_mount_option_noexec_removable_partitions
Result
notselected
Time2017-10-21T14:39:28
Severitylow
Identifiers and References

References:  AC-19(a), AC-19(d), AC-19(e), CM-7, MP-2, 87, 1.1.12

Description

The noexec mount option prevents the direct execution of binaries on the mounted filesystem. Preventing the direct execution of binaries from removable media (such as a USB key) provides a defense against malicious software that may be present on such untrusted media. Add the noexec option to the fourth column of /etc/fstab for the line which controls mounting of any removable media partitions.

Rationale

Allowing users to execute binaries from removable media such as USB keys exposes the system to potential compromise.

Add nosuid Option to Removable Media Partitionsxccdf_org.ssgproject.content_rule_mount_option_nosuid_removable_partitions low

Add nosuid Option to Removable Media Partitions

Rule IDxccdf_org.ssgproject.content_rule_mount_option_nosuid_removable_partitions
Result
pass
Time2017-10-21T14:39:28
Severitylow
Identifiers and References

References:  AC-6, AC-19(a), AC-19(d), AC-19(e), CM-7, MP-2, 1.1.13, 366, SRG-OS-000480-GPOS-00227

Description

The nosuid mount option prevents set-user-identifier (SUID) and set-group-identifier (SGID) permissions from taking effect. These permissions allow users to execute binaries with the same permissions as the owner and group of the file respectively. Users should not be allowed to introduce SUID and SGID files into the system via partitions mounted from removeable media. Add the nosuid option to the fourth column of /etc/fstab for the line which controls mounting of any removable media partitions.

Rationale

The presence of SUID and SGID executables should be tightly controlled. Allowing users to introduce SUID or SGID binaries from partitions mounted off of removable media would allow them to introduce their own highly-privileged programs.

OVAL details

Items not found satisfying 'nosuid' mount option used for at least one CD / DVD drive alternative names in /etc/fstab:

Object oval:ssg-object_nosuid_etc_fstab_cd_dvd_drive:obj:1 of type textfilecontent54_object
FilepathPatternInstance
^[\s]*/dev/cdrom[\s]+[/\w]+[\s]+[\w]+[\s]+([^\s]+)(?:[\s]+[\d]+){2}$
^[\s]*/dev/dvd[\s]+[/\w]+[\s]+[\w]+[\s]+([^\s]+)(?:[\s]+[\d]+){2}$
^[\s]*/dev/scd0[\s]+[/\w]+[\s]+[\w]+[\s]+([^\s]+)(?:[\s]+[\d]+){2}$
^[\s]*/dev/sr0[\s]+[/\w]+[\s]+[\w]+[\s]+([^\s]+)(?:[\s]+[\d]+){2}$
/dev/cdrom
/dev/dvd
/dev/scd0
/dev/sr0
/etc/fstab1
State oval:ssg-state_nosuid_etc_fstab_cd_dvd_drive:ste:1 of type textfilecontent54_state
Subexpression
^.*,?nosuid,?.*$

Items not found satisfying 'nosuid' mount option used for at least one CD / DVD drive alternative names in runtime configuration:

Object oval:ssg-object_nosuid_runtime_cd_dvd_drive:obj:1 of type partition_object
Mount pointFilter
^.*$oval:ssg-state_nosuid_runtime_cd_dvd_drive:ste:1

Items not found satisfying Check if removable partition is configured with 'nosuid' mount option in /etc/fstab:

Object oval:ssg-object_nosuid_etc_fstab_not_cd_dvd_drive:obj:1 of type textfilecontent54_object
FilepathPatternInstance
^[\s]*/dev/cdrom[\s]+[/\w]+[\s]+[\w]+[\s]+([^\s]+)(?:[\s]+[\d]+){2}$
/dev/cdrom
/etc/fstab1
State oval:ssg-state_nosuid_etc_fstab_not_cd_dvd_drive:ste:1 of type textfilecontent54_state
Subexpression
^.*,?nosuid,?.*

Items not found satisfying 'nosuid' mount option used for removable partition in runtime configuration:

Object oval:ssg-object_nosuid_runtime_not_cd_dvd_drive:obj:1 of type partition_object
Mount pointFilter
^.*$oval:ssg-state_nosuid_runtime_not_cd_dvd_drive:ste:1
Add nodev Option to /tmpxccdf_org.ssgproject.content_rule_mount_option_tmp_nodev low

Add nodev Option to /tmp

Rule IDxccdf_org.ssgproject.content_rule_mount_option_tmp_nodev
Result
notselected
Time2017-10-21T14:39:28
Severitylow
Identifiers and References

References:  CM-7, MP-2, 1.1.2

Description

The nodev mount option can be used to prevent device files from being created in /tmp. Legitimate character and block devices should not exist within temporary directories like /tmp. Add the nodev option to the fourth column of /etc/fstab for the line which controls mounting of /tmp.

Rationale

The only legitimate location for device files is the /dev directory located on the root partition. The only exception to this is chroot jails.

Add noexec Option to /tmpxccdf_org.ssgproject.content_rule_mount_option_tmp_noexec low

Add noexec Option to /tmp

Rule IDxccdf_org.ssgproject.content_rule_mount_option_tmp_noexec
Result
notselected
Time2017-10-21T14:39:28
Severitylow
Identifiers and References

References:  CM-7, MP-2, 1.1.4

Description

The noexec mount option can be used to prevent binaries from being executed out of /tmp. Add the noexec option to the fourth column of /etc/fstab for the line which controls mounting of /tmp.

Rationale

Allowing users to execute binaries from world-writable directories such as /tmp should never be necessary in normal operation and can expose the system to potential compromise.

Add nosuid Option to /tmpxccdf_org.ssgproject.content_rule_mount_option_tmp_nosuid low

Add nosuid Option to /tmp

Rule IDxccdf_org.ssgproject.content_rule_mount_option_tmp_nosuid
Result
notselected
Time2017-10-21T14:39:28
Severitylow
Identifiers and References

References:  CM-7, MP-2, 1.1.3

Description

The nosuid mount option can be used to prevent execution of setuid programs in /tmp. The SUID and SGID permissions should not be required in these world-writable directories. Add the nosuid option to the fourth column of /etc/fstab for the line which controls mounting of /tmp.

Rationale

The presence of SUID and SGID executables should be tightly controlled. Users should not be able to execute SUID or SGID binaries from temporary storage partitions.

Add nosuid Option to /homexccdf_org.ssgproject.content_rule_mount_option_home_nosuid low

Add nosuid Option to /home

Rule IDxccdf_org.ssgproject.content_rule_mount_option_home_nosuid
Result
fail
Time2017-10-21T14:39:28
Severitylow
Identifiers and References

References:  CM-7, MP-2, 1.1.3

Description

The nosuid mount option can be used to prevent execution of setuid programs in /home. The SUID and SGID permissions should not be required in these user data directories. Add the nosuid option to the fourth column of /etc/fstab for the line which controls mounting of /tmp.

Rationale

The presence of SUID and SGID executables should be tightly controlled. Users should not be able to execute SUID or SGID binaries from user home directory partitions.

OVAL details

Items not found violating nosuid on /home:

Object oval:ssg-object_home_nosuid_partition:obj:1 of type partition_object
Mount point
/home
State oval:ssg-state_home_nosuid:ste:1 of type partition_state
Mount options
nosuid
Add nodev Option to /dev/shmxccdf_org.ssgproject.content_rule_mount_option_dev_shm_nodev low

Add nodev Option to /dev/shm

Rule IDxccdf_org.ssgproject.content_rule_mount_option_dev_shm_nodev
Result
notselected
Time2017-10-21T14:39:28
Severitylow
Identifiers and References

References:  CM-7, MP-2, 1.1.14

Description

The nodev mount option can be used to prevent creation of device files in /dev/shm. Legitimate character and block devices should not exist within temporary directories like /dev/shm. Add the nodev option to the fourth column of /etc/fstab for the line which controls mounting of /dev/shm.

Rationale

The only legitimate location for device files is the /dev directory located on the root partition. The only exception to this is chroot jails.

Add noexec Option to /dev/shmxccdf_org.ssgproject.content_rule_mount_option_dev_shm_noexec low

Add noexec Option to /dev/shm

Rule IDxccdf_org.ssgproject.content_rule_mount_option_dev_shm_noexec
Result
notselected
Time2017-10-21T14:39:28
Severitylow
Identifiers and References

References:  CM-7, MP-2, 1.1.16

Description

The noexec mount option can be used to prevent binaries from being executed out of /dev/shm. It can be dangerous to allow the execution of binaries from world-writable temporary storage directories such as /dev/shm. Add the noexec option to the fourth column of /etc/fstab for the line which controls mounting of /dev/shm.

Rationale

Allowing users to execute binaries from world-writable directories such as /dev/shm can expose the system to potential compromise.

Add nosuid Option to /dev/shmxccdf_org.ssgproject.content_rule_mount_option_dev_shm_nosuid low

Add nosuid Option to /dev/shm

Rule IDxccdf_org.ssgproject.content_rule_mount_option_dev_shm_nosuid
Result
notselected
Time2017-10-21T14:39:28
Severitylow
Identifiers and References

References:  CM-7, MP-2, 1.1.14

Description

The nosuid mount option can be used to prevent execution of setuid programs in /dev/shm. The SUID and SGID permissions should not be required in these world-writable directories. Add the nosuid option to the fourth column of /etc/fstab for the line which controls mounting of /dev/shm.

Rationale

The presence of SUID and SGID executables should be tightly controlled. Users should not be able to execute SUID or SGID binaries from temporary storage partitions.

Bind Mount /var/tmp To /tmpxccdf_org.ssgproject.content_rule_mount_option_var_tmp_bind low

Bind Mount /var/tmp To /tmp

Rule IDxccdf_org.ssgproject.content_rule_mount_option_var_tmp_bind
Result
notselected
Time2017-10-21T14:39:28
Severitylow
Identifiers and References

References:  CM-7, 1.1.6

Description

The /var/tmp directory is a world-writable directory. Bind-mount it to /tmp in order to consolidate temporary storage into one location protected by the same techniques as /tmp. To do so, edit /etc/fstab and add the following line:

/tmp     /var/tmp     none     rw,nodev,noexec,nosuid,bind     0 0
See the mount(8) man page for further explanation of bind mounting.

Rationale

Having multiple locations for temporary storage is not required. Unless absolutely necessary to meet requirements, the storage location /var/tmp should be bind mounted to /tmp and thus share the same protections.

Disable Modprobe Loading of USB Storage Driverxccdf_org.ssgproject.content_rule_kernel_module_usb-storage_disabled medium

Disable Modprobe Loading of USB Storage Driver

Rule IDxccdf_org.ssgproject.content_rule_kernel_module_usb-storage_disabled
Result
fail
Time2017-10-21T14:39:28
Severitymedium
Identifiers and References

References:  AC-19(a), AC-19(d), AC-19(e), IA-3, 366, 778, 1958, SRG-OS-000114-GPOS-00059, SRG-OS-000378-GPOS-0016, SRG-OS-000480-GPOS-00227, 3.1.21

Description

To prevent USB storage devices from being used, configure the kernel module loading system to prevent automatic loading of the USB storage driver. To configure the system to prevent the usb-storage kernel module from being loaded, add the following line to a file in the directory /etc/modprobe.d:

install usb-storage /bin/true
This will prevent the modprobe program from loading the usb-storage module, but will not prevent an administrator (or another program) from using the insmod program to load the module manually.

Rationale

USB storage devices such as thumb drives can be used to introduce malicious software.

OVAL details

Items not found violating kernel module usb-storage disabled:

Object oval:ssg-obj_kernmod_usb-storage_disabled:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/etc/modprobe.d^.*\.conf$^\s*install\s+usb-storage\s+(/bin/false|/bin/true)$1

Items not found violating kernel module usb-storage disabled in /etc/modprobe.conf:

Object oval:ssg-obj_kernmod_usb-storage_modprobeconf:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/modprobe.conf^\s*install\s+usb-storage\s+(/bin/false|/bin/true)$1

Items not found violating kernel module usb-storage disabled in /etc/modules-load.d:

Object oval:ssg-obj_kernmod_usb-storage_etcmodules-load:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/etc/modules-load.d^.*\.conf$^\s*install\s+usb-storage\s+(/bin/false|/bin/true)$1

Items not found violating kernel module usb-storage disabled in /run/modules-load.d:

Object oval:ssg-obj_kernmod_usb-storage_runmodules-load:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/run/modules-load.d^.*\.conf$^\s*install\s+usb-storage\s+(/bin/false|/bin/true)$1

Items not found violating kernel module usb-storage disabled in /usr/lib/modules-load.d:

Object oval:ssg-obj_kernmod_usb-storage_libmodules-load:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/usr/lib/modules-load.d^.*\.conf$^\s*install\s+usb-storage\s+(/bin/false|/bin/true)$1
Remediation Shell script:   (show)

Complexity:low
Disruption:medium
Reboot:true
Strategy:disable
if grep --silent "^install usb-storage" /etc/modprobe.d/usb-storage.conf ; then
        sed -i 's/^install usb-storage.*/install usb-storage /bin/true/g' /etc/modprobe.d/usb-storage.conf
else
        echo -e "\n# Disable per security requirements" >> /etc/modprobe.d/usb-storage.conf
        echo "install usb-storage /bin/true" >> /etc/modprobe.d/usb-storage.conf
fi
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:medium
Reboot:true
Strategy:disable
- name: Ensure kernel module 'usb-storage' is disabled
  lineinfile:
    create=yes
    dest="/etc/modprobe.d/{{item}}.conf"
    regexp="{{item}}"
    line="install {{item}} /bin/true"
  with_items:
    - usb-storage
Disable Kernel Support for USB via Bootloader Configurationxccdf_org.ssgproject.content_rule_bootloader_nousb_argument low

Disable Kernel Support for USB via Bootloader Configuration

Rule IDxccdf_org.ssgproject.content_rule_bootloader_nousb_argument
Result
notselected
Time2017-10-21T14:39:28
Severitylow
Identifiers and References

References:  AC-19(a), AC-19(d), AC-19(e), 1250

Description

All USB support can be disabled by adding the nousb argument to the kernel's boot loader configuration. To do so, append "nousb" to the kernel line in /etc/default/grub as shown:

kernel /vmlinuz-VERSION ro vga=ext root=/dev/VolGroup00/LogVol00 rhgb quiet nousb
WARNING: Disabling all kernel support for USB will cause problems for systems with USB-based keyboards, mice, or printers. This configuration is infeasible for systems which require USB devices, which is common.

Rationale

Disabling the USB subsystem within the Linux kernel at system boot will protect against potentially malicious USB devices, although it is only practical in specialized systems.

Disable Booting from USB Devices in Boot Firmwarexccdf_org.ssgproject.content_rule_bios_disable_usb_boot low

Disable Booting from USB Devices in Boot Firmware

Rule IDxccdf_org.ssgproject.content_rule_bios_disable_usb_boot
Result
notselected
Time2017-10-21T14:39:28
Severitylow
Identifiers and References

References:  AC-19(a), AC-19(d), AC-19(e), 1250

Description

Configure the system boot firmware (historically called BIOS on PC systems) to disallow booting from USB drives.

Rationale

Booting a system from a USB device would allow an attacker to circumvent any security measures provided by the operating system. Attackers could mount partitions and modify the configuration of the OS.

Assign Password to Prevent Changes to Boot Firmware Configurationxccdf_org.ssgproject.content_rule_bios_assign_password low

Assign Password to Prevent Changes to Boot Firmware Configuration

Rule IDxccdf_org.ssgproject.content_rule_bios_assign_password
Result
notselected
Time2017-10-21T14:39:28
Severitylow
Identifiers and References
Description

Assign a password to the system boot firmware (historically called BIOS on PC systems) to require a password for any configuration changes.

Rationale

Assigning a password to the system boot firmware prevents anyone with physical access from configuring the system to boot from local media and circumvent the operating system's access controls. For systems in physically secure locations, such as a data center or Sensitive Compartmented Information Facility (SCIF), this risk must be weighed against the risk of administrative personnel being unable to conduct recovery operations in a timely fashion.

Disable the Automounterxccdf_org.ssgproject.content_rule_service_autofs_disabled medium

Disable the Automounter

Rule IDxccdf_org.ssgproject.content_rule_service_autofs_disabled
Result
pass
Time2017-10-21T14:39:28
Severitymedium
Identifiers and References

References:  AC-19(a), AC-19(d), AC-19(e), IA-3, 366, 778, 1958, SRG-OS-000114-GPOS-00059, SRG-OS-000378-GPOS-00163, SRG-OS-000480-GPOS-00227, 3.4.6

Description

The autofs daemon mounts and unmounts filesystems, such as user home directories shared via NFS, on demand. In addition, autofs can be used to handle removable media, and the default configuration provides the cdrom device as /misc/cd. However, this method of providing access to removable media is not common, so autofs can almost always be disabled if NFS is not in use. Even if NFS is required, it may be possible to configure filesystem mounts statically by editing /etc/fstab rather than relying on the automounter.

The autofs service can be disabled with the following command:

$ sudo systemctl disable autofs.service

Rationale

Disabling the automounter permits the administrator to statically control filesystem mounting through /etc/fstab.

Additionally, automatically mounting filesystems permits easy introduction of unknown devices, thereby facilitating malicious activity.

OVAL details

Items found satisfying systemd test:

UnitDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependency
multi-user.targetbasic.targetsysinit.targetsystemd-journal-catalog-update.servicesystemd-update-utmp.servicelocal-fs.target-.mountboot.mountrhel-readonly.servicesystemd-remount-fs.servicerhel-import-state.servicesystemd-journald.servicesystemd-update-done.serviceplymouth-start.servicelvm2-lvmetad.socketsys-kernel-debug.mountsystemd-random-seed.servicesystemd-firstboot.servicesystemd-ask-password-console.pathcryptsetup.targetsystemd-tmpfiles-setup.serviceplymouth-read-write.servicesystemd-machine-id-commit.servicelvm2-monitor.servicedev-hugepages.mountswap.targetdev-mapper-centos\x2dswap.swapsystemd-tmpfiles-setup-dev.servicesys-fs-fuse-connections.mountsystemd-journal-flush.servicesystemd-udevd.servicesystemd-udev-trigger.serviceproc-sys-fs-binfmt_misc.automountsystemd-binfmt.servicesystemd-hwdb-update.servicelvm2-lvmpolld.socketsys-kernel-config.mountkmod-static-nodes.servicedev-mqueue.mountsystemd-vconsole-setup.servicesystemd-sysctl.servicesystemd-modules-load.serviceslices.targetsystem.slice-.slicesockets.targetsystemd-shutdownd.socketdm-event.socketsystemd-journald.socketsystemd-udevd-control.socketdbus.socketsystemd-initctl.socketpcscd.socketsystemd-udevd-kernel.socketmicrocode.servicerhel-dmesg.servicepaths.targetrhel-autorelabel.servicerhel-autorelabel-mark.serviceselinux-policy-migrate-local-changes@targeted.servicetimers.targetsystemd-tmpfiles-clean.timerrhel-configure.servicerhel-loadmodules.servicedbus.serviceremote-fs.targetpostfix.serviceauditd.servicesystemd-ask-password-wall.pathcrond.servicetuned.servicegetty.targetgetty@tty1.servicesystemd-readahead-replay.servicebrandbot.pathsshd.servicesystemd-update-utmp-runlevel.serviceplymouth-quit-wait.servicersyslog.servicefirewalld.serviceirqbalance.servicekdump.servicechronyd.servicesystemd-logind.serviceplymouth-quit.serviceNetworkManager.servicenetwork.servicesystemd-readahead-collect.servicesystemd-user-sessions.service
Disable Mounting of cramfsxccdf_org.ssgproject.content_rule_kernel_module_cramfs_disabled low

Disable Mounting of cramfs

Rule IDxccdf_org.ssgproject.content_rule_kernel_module_cramfs_disabled
Result
notselected
Time2017-10-21T14:39:28
Severitylow
Identifiers and References

References:  CM-7, 1.1.18, 3.4.6

Description

To configure the system to prevent the cramfs kernel module from being loaded, add the following line to a file in the directory /etc/modprobe.d:

install cramfs /bin/true
This effectively prevents usage of this uncommon filesystem.

Rationale

Linux kernel modules which implement filesystems that are not needed by the local system should be disabled.

Disable Mounting of freevxfsxccdf_org.ssgproject.content_rule_kernel_module_freevxfs_disabled low

Disable Mounting of freevxfs

Rule IDxccdf_org.ssgproject.content_rule_kernel_module_freevxfs_disabled
Result
notselected
Time2017-10-21T14:39:28
Severitylow
Identifiers and References

References:  CM-7, 1.1.19, 3.4.6

Description

To configure the system to prevent the freevxfs kernel module from being loaded, add the following line to a file in the directory /etc/modprobe.d:

install freevxfs /bin/true
This effectively prevents usage of this uncommon filesystem.

Rationale

Linux kernel modules which implement filesystems that are not needed by the local system should be disabled.

Disable Mounting of jffs2xccdf_org.ssgproject.content_rule_kernel_module_jffs2_disabled low

Disable Mounting of jffs2

Rule IDxccdf_org.ssgproject.content_rule_kernel_module_jffs2_disabled
Result
notselected
Time2017-10-21T14:39:28
Severitylow
Identifiers and References

References:  CM-7, 1.1.20, 3.4.6

Description

To configure the system to prevent the jffs2 kernel module from being loaded, add the following line to a file in the directory /etc/modprobe.d:

install jffs2 /bin/true
This effectively prevents usage of this uncommon filesystem.

Rationale

Linux kernel modules which implement filesystems that are not needed by the local system should be disabled.

Disable Mounting of hfsxccdf_org.ssgproject.content_rule_kernel_module_hfs_disabled low

Disable Mounting of hfs

Rule IDxccdf_org.ssgproject.content_rule_kernel_module_hfs_disabled
Result
notselected
Time2017-10-21T14:39:28
Severitylow
Identifiers and References

References:  CM-7, 1.1.21, 3.4.6

Description

To configure the system to prevent the hfs kernel module from being loaded, add the following line to a file in the directory /etc/modprobe.d:

install hfs /bin/true
This effectively prevents usage of this uncommon filesystem.

Rationale

Linux kernel modules which implement filesystems that are not needed by the local system should be disabled.

Disable Mounting of hfsplusxccdf_org.ssgproject.content_rule_kernel_module_hfsplus_disabled low

Disable Mounting of hfsplus

Rule IDxccdf_org.ssgproject.content_rule_kernel_module_hfsplus_disabled
Result
notselected
Time2017-10-21T14:39:28
Severitylow
Identifiers and References

References:  CM-7, 1.1.22, 3.4.6

Description

To configure the system to prevent the hfsplus kernel module from being loaded, add the following line to a file in the directory /etc/modprobe.d:

install hfsplus /bin/true
This effectively prevents usage of this uncommon filesystem.

Rationale

Linux kernel modules which implement filesystems that are not needed by the local system should be disabled.

Disable Mounting of squashfsxccdf_org.ssgproject.content_rule_kernel_module_squashfs_disabled low

Disable Mounting of squashfs

Rule IDxccdf_org.ssgproject.content_rule_kernel_module_squashfs_disabled
Result
notselected
Time2017-10-21T14:39:28
Severitylow
Identifiers and References

References:  CM-7, 1.1.23, 3.4.6

Description

To configure the system to prevent the squashfs kernel module from being loaded, add the following line to a file in the directory /etc/modprobe.d:

install squashfs /bin/true
This effectively prevents usage of this uncommon filesystem.

Rationale

Linux kernel modules which implement filesystems that are not needed by the local system should be disabled.

Disable Mounting of udfxccdf_org.ssgproject.content_rule_kernel_module_udf_disabled low

Disable Mounting of udf

Rule IDxccdf_org.ssgproject.content_rule_kernel_module_udf_disabled
Result
notselected
Time2017-10-21T14:39:28
Severitylow
Identifiers and References

References:  CM-7, 1.1.24, 3.4.6

Description

To configure the system to prevent the udf kernel module from being loaded, add the following line to a file in the directory /etc/modprobe.d:

install udf /bin/true
This effectively prevents usage of this uncommon filesystem.

Rationale

Linux kernel modules which implement filesystems that are not needed by the local system should be disabled.

Verify User Who Owns shadow Filexccdf_org.ssgproject.content_rule_userowner_shadow_file medium

Verify User Who Owns shadow File

Rule IDxccdf_org.ssgproject.content_rule_userowner_shadow_file
Result
notselected
Time2017-10-21T14:39:28
Severitymedium
Identifiers and References

References:  AC-6, http://iase.disa.mil/stigs/cci/Pages/index.aspx, Req-8.7.c, 5.5.2.2

Description

To properly set the owner of /etc/shadow, run the command:

$ sudo chown root /etc/shadow

Rationale

The /etc/shadow file contains the list of local system accounts and stores password hashes. Protection of this file is critical for system security. Failure to give ownership of this file to root provides the designated owner with access to sensitive information which could weaken the system security posture.

Verify Group Who Owns shadow Filexccdf_org.ssgproject.content_rule_groupowner_shadow_file medium

Verify Group Who Owns shadow File

Rule IDxccdf_org.ssgproject.content_rule_groupowner_shadow_file
Result
notselected
Time2017-10-21T14:39:28
Severitymedium
Identifiers and References

References:  AC-6, http://iase.disa.mil/stigs/cci/Pages/index.aspx, Req-8.7.c, 5.5.2.2

Description

To properly set the group owner of /etc/shadow, run the command:

$ sudo chgrp root /etc/shadow

Rationale

The /etc/shadow file stores password hashes. Protection of this file is critical for system security.

Verify Permissions on shadow Filexccdf_org.ssgproject.content_rule_file_permissions_etc_shadow medium

Verify Permissions on shadow File

Rule IDxccdf_org.ssgproject.content_rule_file_permissions_etc_shadow
Result
notselected
Time2017-10-21T14:39:28
Severitymedium
Identifiers and References

References:  AC-6, http://iase.disa.mil/stigs/cci/Pages/index.aspx, Req-8.7.c, 5.5.2.2

Description

To properly set the permissions of /etc/shadow, run the command:

$ sudo chmod 0000 /etc/shadow

Rationale

The /etc/shadow file contains the list of local system accounts and stores password hashes. Protection of this file is critical for system security. Failure to give ownership of this file to root provides the designated owner with access to sensitive information which could weaken the system security posture.

Verify User Who Owns group Filexccdf_org.ssgproject.content_rule_file_owner_etc_group medium

Verify User Who Owns group File

Rule IDxccdf_org.ssgproject.content_rule_file_owner_etc_group
Result
notselected
Time2017-10-21T14:39:28
Severitymedium
Identifiers and References

References:  AC-6, Req-8.7.c, 5.5.2.2

Description

To properly set the owner of /etc/group, run the command:

$ sudo chown root /etc/group

Rationale

The /etc/group file contains information regarding groups that are configured on the system. Protection of this file is important for system security.

Verify Group Who Owns group Filexccdf_org.ssgproject.content_rule_file_groupowner_etc_group medium

Verify Group Who Owns group File

Rule IDxccdf_org.ssgproject.content_rule_file_groupowner_etc_group
Result
notselected
Time2017-10-21T14:39:28
Severitymedium
Identifiers and References

References:  AC-6, http://iase.disa.mil/stigs/cci/Pages/index.aspx, Req-8.7.c, 5.5.2.2

Description

To properly set the group owner of /etc/group, run the command:

$ sudo chgrp root /etc/group

Rationale

The /etc/group file contains information regarding groups that are configured on the system. Protection of this file is important for system security.

Verify Permissions on group Filexccdf_org.ssgproject.content_rule_file_permissions_etc_group medium

Verify Permissions on group File

Rule IDxccdf_org.ssgproject.content_rule_file_permissions_etc_group
Result
notselected
Time2017-10-21T14:39:28
Severitymedium
Identifiers and References

References:  AC-6, http://iase.disa.mil/stigs/cci/Pages/index.aspx, Req-8.7.c, 5.5.2.2

Description

To properly set the permissions of /etc/group, run the command:

$ sudo chmod 644 /etc/group

Rationale

The /etc/group file contains information regarding groups that are configured on the system. Protection of this file is important for system security.

Verify User Who Owns gshadow Filexccdf_org.ssgproject.content_rule_file_owner_etc_gshadow medium

Verify User Who Owns gshadow File

Rule IDxccdf_org.ssgproject.content_rule_file_owner_etc_gshadow
Result
notselected
Time2017-10-21T14:39:28
Severitymedium
Identifiers and References

References:  AC-6, http://iase.disa.mil/stigs/cci/Pages/index.aspx

Description

To properly set the owner of /etc/gshadow, run the command:

$ sudo chown root /etc/gshadow

Rationale

The /etc/gshadow file contains group password hashes. Protection of this file is critical for system security.

Verify Group Who Owns gshadow Filexccdf_org.ssgproject.content_rule_file_groupowner_etc_gshadow medium

Verify Group Who Owns gshadow File

Rule IDxccdf_org.ssgproject.content_rule_file_groupowner_etc_gshadow
Result
notselected
Time2017-10-21T14:39:28
Severitymedium
Identifiers and References

References:  AC-6, http://iase.disa.mil/stigs/cci/Pages/index.aspx

Description

To properly set the group owner of /etc/gshadow, run the command:

$ sudo chgrp root /etc/gshadow

Rationale

The /etc/gshadow file contains group password hashes. Protection of this file is critical for system security.

Verify Permissions on gshadow Filexccdf_org.ssgproject.content_rule_file_permissions_etc_gshadow medium

Verify Permissions on gshadow File

Rule IDxccdf_org.ssgproject.content_rule_file_permissions_etc_gshadow
Result
notselected
Time2017-10-21T14:39:28
Severitymedium
Identifiers and References

References:  AC-6, http://iase.disa.mil/stigs/cci/Pages/index.aspx

Description

To properly set the permissions of /etc/gshadow, run the command:

$ sudo chmod 0000 /etc/gshadow

Rationale

The /etc/gshadow file contains group password hashes. Protection of this file is critical for system security.

Verify User Who Owns passwd Filexccdf_org.ssgproject.content_rule_file_owner_etc_passwd medium

Verify User Who Owns passwd File

Rule IDxccdf_org.ssgproject.content_rule_file_owner_etc_passwd
Result
notselected
Time2017-10-21T14:39:28
Severitymedium
Identifiers and References

References:  AC-6, http://iase.disa.mil/stigs/cci/Pages/index.aspx, Req-8.7.c, 5.5.2.2

Description

To properly set the owner of /etc/passwd, run the command:

$ sudo chown root /etc/passwd

Rationale

The /etc/passwd file contains information about the users that are configured on the system. Protection of this file is critical for system security.

Verify Group Who Owns passwd Filexccdf_org.ssgproject.content_rule_file_groupowner_etc_passwd medium

Verify Group Who Owns passwd File

Rule IDxccdf_org.ssgproject.content_rule_file_groupowner_etc_passwd
Result
notselected
Time2017-10-21T14:39:28
Severitymedium
Identifiers and References

References:  AC-6, http://iase.disa.mil/stigs/cci/Pages/index.aspx, Req-8.7.c, 5.5.2.2

Description

To properly set the group owner of /etc/passwd, run the command:

$ sudo chgrp root /etc/passwd

Rationale

The /etc/passwd file contains information about the users that are configured on the system. Protection of this file is critical for system security.

Verify Permissions on passwd Filexccdf_org.ssgproject.content_rule_file_permissions_etc_passwd medium

Verify Permissions on passwd File

Rule IDxccdf_org.ssgproject.content_rule_file_permissions_etc_passwd
Result
notselected
Time2017-10-21T14:39:28
Severitymedium
Identifiers and References

References:  AC-6, http://iase.disa.mil/stigs/cci/Pages/index.aspx, Req-8.7.c, 5.5.2.2

Description

To properly set the permissions of /etc/passwd, run the command:

$ sudo chmod 0644 /etc/passwd

Rationale

If the /etc/passwd file is writable by a group-owner or the world the risk of its compromise is increased. The file contains the list of accounts on the system and associated information, and protection of this file is critical for system security.

Verify that Shared Library Files Have Restrictive Permissionsxccdf_org.ssgproject.content_rule_file_permissions_library_dirs medium

Verify that Shared Library Files Have Restrictive Permissions

Rule IDxccdf_org.ssgproject.content_rule_file_permissions_library_dirs
Result
notselected
Time2017-10-21T14:39:28
Severitymedium
Identifiers and References

References:  AC-6, http://iase.disa.mil/stigs/cci/Pages/index.aspx

Description

System-wide shared library files, which are linked to executables during process load time or run time, are stored in the following directories by default:

/lib
/lib64
/usr/lib
/usr/lib64
Kernel modules, which can be added to the kernel during runtime, are stored in /lib/modules. All files in these directories should not be group-writable or world-writable. If any file in these directories is found to be group-writable or world-writable, correct its permission with the following command:
$ sudo chmod go-w FILE

Rationale

Files from shared library directories are loaded into the address space of processes (including privileged ones) or of the kernel itself at runtime. Restrictive permissions are necessary to protect the integrity of the system.

Verify that Shared Library Files Have Root Ownershipxccdf_org.ssgproject.content_rule_file_ownership_library_dirs medium

Verify that Shared Library Files Have Root Ownership

Rule IDxccdf_org.ssgproject.content_rule_file_ownership_library_dirs
Result
notselected
Time2017-10-21T14:39:28
Severitymedium
Identifiers and References

References:  AC-6, http://iase.disa.mil/stigs/cci/Pages/index.aspx

Description

System-wide shared library files, which are linked to executables during process load time or run time, are stored in the following directories by default:

/lib
/lib64
/usr/lib
/usr/lib64
Kernel modules, which can be added to the kernel during runtime, are also stored in /lib/modules. All files in these directories should be owned by the root user. If the directory, or any file in these directories, is found to be owned by a user other than root correct its ownership with the following command:
$ sudo chown root FILE

Rationale

Files from shared library directories are loaded into the address space of processes (including privileged ones) or of the kernel itself at runtime. Proper ownership is necessary to protect the integrity of the system.

Verify that System Executables Have Restrictive Permissionsxccdf_org.ssgproject.content_rule_file_permissions_binary_dirs medium

Verify that System Executables Have Restrictive Permissions

Rule IDxccdf_org.ssgproject.content_rule_file_permissions_binary_dirs
Result
notselected
Time2017-10-21T14:39:28
Severitymedium
Identifiers and References

References:  AC-6, http://iase.disa.mil/stigs/cci/Pages/index.aspx

Description

System executables are stored in the following directories by default:

/bin
/sbin
/usr/bin
/usr/libexec
/usr/local/bin
/usr/local/sbin
/usr/sbin
All files in these directories should not be group-writable or world-writable. If any file FILE in these directories is found to be group-writable or world-writable, correct its permission with the following command:
$ sudo chmod go-w FILE

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.

Verify that System Executables Have Root Ownershipxccdf_org.ssgproject.content_rule_file_ownership_binary_dirs medium

Verify that System Executables Have Root Ownership

Rule IDxccdf_org.ssgproject.content_rule_file_ownership_binary_dirs
Result
notselected
Time2017-10-21T14:39:28
Severitymedium
Identifiers and References

References:  AC-6, http://iase.disa.mil/stigs/cci/Pages/index.aspx

Description

System executables are stored in the following directories by default:

/bin
/sbin
/usr/bin
/usr/libexec
/usr/local/bin
/usr/local/sbin
/usr/sbin
All files in these directories should be owned by the root user. If any file FILE in these directories is found to be owned by a user other than root, correct its ownership with the following command:
$ sudo chown root FILE

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.

Verify that All World-Writable Directories Have Sticky Bits Setxccdf_org.ssgproject.content_rule_dir_perms_world_writable_sticky_bits low

Verify that All World-Writable Directories Have Sticky Bits Set

Rule IDxccdf_org.ssgproject.content_rule_dir_perms_world_writable_sticky_bits
Result
notselected
Time2017-10-21T14:39:28
Severitylow
Identifiers and References

References:  AC-6, 1.1.17

Description

When the so-called 'sticky bit' is set on a directory, only the owner of a given file may remove that file from the directory. Without the sticky bit, any user with write access to a directory may remove any file in the directory. Setting the sticky bit prevents users from removing each other's files. In cases where there is no reason for a directory to be world-writable, a better solution is to remove that permission rather than to set the sticky bit. However, if a directory is used by a particular application, consult that application's documentation instead of blindly changing modes.
To set the sticky bit on a world-writable directory DIR, run the following command:

$ sudo chmod +t DIR

Rationale

Failing to set the sticky bit on public directories allows unauthorized users to delete files in the directory structure.

The only authorized public directories are those temporary directories supplied with the system, or those designed to be temporary file repositories. The setting is normally reserved for directories used by the system, by users for temporary file storage (such as /tmp), and for directories requiring global read/write access.

Ensure No World-Writable Files Existxccdf_org.ssgproject.content_rule_file_permissions_unauthorized_world_writable medium

Ensure No World-Writable Files Exist

Rule IDxccdf_org.ssgproject.content_rule_file_permissions_unauthorized_world_writable
Result
notselected
Time2017-10-21T14:39:28
Severitymedium
Identifiers and References

References:  AC-6

Description

It is generally a good idea to remove global (other) write access to a file when it is discovered. However, check with documentation for specific applications before making changes. Also, monitor for recurring world-writable files, as these may be symptoms of a misconfigured application or user account.

Rationale

Data in world-writable files can be modified by any user on the system. In almost all circumstances, files can be configured using a combination of user and group permissions to support whatever legitimate access is needed without the risk caused by world-writable files.

Ensure All SGID Executables Are Authorizedxccdf_org.ssgproject.content_rule_file_permissions_unauthorized_sgid low

Ensure All SGID Executables Are Authorized

Rule IDxccdf_org.ssgproject.content_rule_file_permissions_unauthorized_sgid
Result
notselected
Time2017-10-21T14:39:28
Severitylow
Identifiers and References

References:  AC-6(1)

Description

The SGID (set group id) bit should be set only on files that were installed via authorized means. A straightforward means of identifying unauthorized SGID files is determine if any were not installed as part of an RPM package, which is cryptographically verified. Investigate the origin of any unpackaged SGID files.

Rationale

Executable files with the SGID permission run with the privileges of the owner of the file. SGID files of uncertain provenance could allow for unprivileged users to elevate privileges. The presence of these files should be strictly controlled on the system.

Ensure All SUID Executables Are Authorizedxccdf_org.ssgproject.content_rule_file_permissions_unauthorized_suid low

Ensure All SUID Executables Are Authorized

Rule IDxccdf_org.ssgproject.content_rule_file_permissions_unauthorized_suid
Result
notselected
Time2017-10-21T14:39:28
Severitylow
Identifiers and References

References:  AC-6(1)

Description

The SUID (set user id) bit should be set only on files that were installed via authorized means. A straightforward means of identifying unauthorized SGID files is determine if any were not installed as part of an RPM package, which is cryptographically verified. Investigate the origin of any unpackaged SUID files.

Rationale

Executable files with the SUID permission run with the privileges of the owner of the file. SUID files of uncertain provenance could allow for unprivileged users to elevate privileges. The presence of these files should be strictly controlled on the system.

Ensure All Files Are Owned by a Userxccdf_org.ssgproject.content_rule_no_files_unowned_by_user medium

Ensure All Files Are Owned by a User

Rule IDxccdf_org.ssgproject.content_rule_no_files_unowned_by_user
Result
pass
Time2017-10-21T14:39:38
Severitymedium
Identifiers and References

References:  AC-3(4), AC-6, CM-6(b), 002165, SRG-OS-000480-GPOS-00227

Description

If any files are not owned by a user, then the cause of their lack of ownership should be investigated. Following this, the files should be deleted or assigned to an appropriate user.

Rationale

Unowned files do not directly imply a security problem, but they are generally a sign that something is amiss. They may be caused by an intruder, by incorrect software installation or draft software removal, or by failure to remove all files belonging to a deleted account. The files should be repaired so they will not cause problems when accounts are created in the future, and the cause should be discovered and addressed.

OVAL details

Items not found satisfying Check user ids on all files on the system:

Object oval:ssg-file_permissions_unowned_object:obj:1 of type file_object
BehaviorsPathFilenameFilter
no value/.*oval:ssg-file_permissions_unowned_userid_list_match:ste:1
Ensure All Files Are Owned by a Groupxccdf_org.ssgproject.content_rule_file_permissions_ungroupowned medium

Ensure All Files Are Owned by a Group

Rule IDxccdf_org.ssgproject.content_rule_file_permissions_ungroupowned
Result
pass
Time2017-10-21T14:39:47
Severitymedium
Identifiers and References

References:  AC-3(4), AC-6, IA-2, 02165, SRG-OS-000480-GPOS-00227

Description

If any files are not owned by a group, then the cause of their lack of group-ownership should be investigated. Following this, the files should be deleted or assigned to an appropriate group.

Rationale

Unowned files do not directly imply a security problem, but they are generally a sign that something is amiss. They may be caused by an intruder, by incorrect software installation or draft software removal, or by failure to remove all files belonging to a deleted account. The files should be repaired so they will not cause problems when accounts are created in the future, and the cause should be discovered and addressed.

OVAL details

Items not found satisfying files with no group owner:

Object oval:ssg-object_file_permissions_ungroupowned:obj:1 of type file_object
BehaviorsPathFilenameFilter
no value/.*oval:ssg-state_file_permissions_ungroupowned:ste:1
Ensure All World-Writable Directories Are Owned by a System Accountxccdf_org.ssgproject.content_rule_dir_perms_world_writable_system_owned low

Ensure All World-Writable Directories Are Owned by a System Account

Rule IDxccdf_org.ssgproject.content_rule_dir_perms_world_writable_system_owned
Result
pass
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  AC-6, 366, SRG-OS-000480-GPOS-00227

Description

All directories in local partitions which are world-writable should be owned by root or another system account. If any world-writable directories are not owned by a system account, this should be investigated. Following this, the files should be deleted or assigned to an appropriate group.

Rationale

Allowing a user account to own a world-writable directory is undesirable because it allows the owner of that directory to remove or replace any files that may be placed in the directory by other users.

OVAL details

Items not found satisfying check for local directories that are world writable and have uid greater than or equal to 1000:

Object oval:ssg-all_local_directories:obj:1 of type file_object
BehaviorsPathFilenameFilter
no value/no valueoval:ssg-state_gid_is_user_and_world_writable:ste:1
State oval:ssg-state_gid_is_user_and_world_writable:ste:1 of type file_state
User idOwrite
1000true
Set Daemon Umaskxccdf_org.ssgproject.content_rule_umask_for_daemons low

Set Daemon Umask

Rule IDxccdf_org.ssgproject.content_rule_umask_for_daemons
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  AC-6, 3.1

Description

The file /etc/init.d/functions includes initialization parameters for most or all daemons started at boot time. The default umask of 022 prevents creation of group- or world-writable files. To set the default umask for daemons, edit the following line, inserting 022 or 027 for UMASK appropriately:

umask 022
Setting the umask to too restrictive a setting can cause serious errors at runtime. Many daemons on the system already individually restrict themselves to a umask of 077 in their own init scripts.

Rationale

The umask influences the permissions assigned to files created by a process at run time. An unnecessarily permissive umask could result in files being created with insecure permissions.

Disable Core Dumps for All Usersxccdf_org.ssgproject.content_rule_disable_users_coredumps low

Disable Core Dumps for All Users

Rule IDxccdf_org.ssgproject.content_rule_disable_users_coredumps
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  SC-5, 1.6.1

Description

To disable core dumps for all users, add the following line to /etc/security/limits.conf:

*     hard   core    0

Rationale

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.

Disable Core Dumps for SUID programsxccdf_org.ssgproject.content_rule_sysctl_fs_suid_dumpable low

Disable Core Dumps for SUID programs

Rule IDxccdf_org.ssgproject.content_rule_sysctl_fs_suid_dumpable
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  SI-11, 1.6.1

Description

To set the runtime status of the fs.suid_dumpable kernel parameter, run the following command:

$ sudo sysctl -w fs.suid_dumpable=0
If this is not the system's default value, add the following line to /etc/sysctl.conf:
fs.suid_dumpable = 0

Rationale

The core dump of a setuid program is more likely to contain sensitive data, as the program itself runs with greater privileges than the user who initiated execution of the program. Disabling the ability for any setuid program to write a core file decreases the risk of unauthorized access of such data.

Enable ExecShieldxccdf_org.ssgproject.content_rule_sysctl_kernel_exec_shield medium

Enable ExecShield

Rule IDxccdf_org.ssgproject.content_rule_sysctl_kernel_exec_shield
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  SC-39, 2530, 3.1.7

Description

By default on Red Hat Enterprise Linux 7 64-bit systems, ExecShield is enabled and can only be disabled if the hardware does not support ExecShield or is disabled in /etc/default/grub. For Red Hat Enterprise Linux 7 32-bit systems, sysctl can be used to enable ExecShield.

Rationale

ExecShield uses the segmentation feature on all x86 systems to prevent execution in memory higher than a certain address. It writes an address as a limit in the code segment descriptor, to control where code can be executed, on a per-process basis. When the kernel places a process's memory regions such as the stack and heap higher than this address, the hardware prevents execution in that address range. This is enabled by default on the latest Red Hat and Fedora systems if supported by the hardware.

Enable Randomized Layout of Virtual Address Spacexccdf_org.ssgproject.content_rule_sysctl_kernel_randomize_va_space medium

Enable Randomized Layout of Virtual Address Space

Rule IDxccdf_org.ssgproject.content_rule_sysctl_kernel_randomize_va_space
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  SC-30(2), 1.6.1, 3.1.7

Description

To set the runtime status of the kernel.randomize_va_space kernel parameter, run the following command:

$ sudo sysctl -w kernel.randomize_va_space=2
If this is not the system's default value, add the following line to /etc/sysctl.conf:
kernel.randomize_va_space = 2

Rationale

Address space layout randomization (ASLR) makes it more difficult for an attacker to predict the location of attack code they have introduced into a process's address space during an attempt at exploitation. Additionally, ASLR makes it more difficult for an attacker to know the location of existing code in order to re-purpose it using return oriented programming (ROP) techniques.

Install PAE Kernel on Supported 32-bit x86 Systemsxccdf_org.ssgproject.content_rule_install_PAE_kernel_on_x86-32 low

Install PAE Kernel on Supported 32-bit x86 Systems

Rule IDxccdf_org.ssgproject.content_rule_install_PAE_kernel_on_x86-32
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  CM-6(b), 3.1.7

Description

Systems that are using the 64-bit x86 kernel package do not need to install the kernel-PAE package because the 64-bit x86 kernel already includes this support. However, if the system is 32-bit and also supports the PAE and NX features as determined in the previous section, the kernel-PAE package should be installed to enable XD or NX support:

$ sudo yum install kernel-PAE
The installation process should also have configured the bootloader to load the new kernel at boot. Verify this at reboot and modify /etc/default/grub if necessary.

Rationale

On 32-bit systems that support the XD or NX bit, the vendor-supplied PAE kernel is required to enable either Execute Disable (XD) or No Execute (NX) support.

Warnings
warning  The kernel-PAE package should not be installed on older systems that do not support the XD or NX bit, as this may prevent them from booting.
Enable NX or XD Support in the BIOSxccdf_org.ssgproject.content_rule_bios_enable_execution_restrictions low

Enable NX or XD Support in the BIOS

Rule IDxccdf_org.ssgproject.content_rule_bios_enable_execution_restrictions
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  CM-6(b), 3.1.7

Description

Reboot the system and enter the BIOS or Setup configuration menu. Navigate the BIOS configuration menu and make sure that the option is enabled. The setting may be located under a Security section. Look for Execute Disable (XD) on Intel-based systems and No Execute (NX) on AMD-based systems.

Rationale

Computers with the ability to prevent this type of code execution frequently put an option in the BIOS that will allow users to turn the feature on or off at will.

Restrict Access to Kernel Message Bufferxccdf_org.ssgproject.content_rule_sysctl_kernel_dmesg_restrict low

Restrict Access to Kernel Message Buffer

Rule IDxccdf_org.ssgproject.content_rule_sysctl_kernel_dmesg_restrict
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  SI-11, 1314, 3.1.5

Description

To set the runtime status of the kernel.dmesg_restrict kernel parameter, run the following command:

$ sudo sysctl -w kernel.dmesg_restrict=1
If this is not the system's default value, add the following line to /etc/sysctl.conf:
kernel.dmesg_restrict = 1

Rationale

Unprivileged access to the kernel syslog can expose sensitive kernel address information.

Disable the abrt_anon_write SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_abrt_anon_write medium

Disable the abrt_anon_write SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_abrt_anon_write
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD, 3.7.2

Description

By default, the SELinux boolean abrt_anon_write is disabled. If this setting is enabled, it should be disabled. To disable the abrt_anon_write SELinux boolean, run the following command:

$ sudo setsebool -P abrt_anon_write off

Rationale

Disable the abrt_handle_event SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_abrt_handle_event medium

Disable the abrt_handle_event SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_abrt_handle_event
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD, 3.7.2

Description

By default, the SELinux boolean abrt_handle_event is disabled. If this setting is enabled, it should be disabled. To disable the abrt_handle_event SELinux boolean, run the following command:

$ sudo setsebool -P abrt_handle_event off

Rationale

Disable the abrt_upload_watch_anon_write SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_abrt_upload_watch_anon_write medium

Disable the abrt_upload_watch_anon_write SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_abrt_upload_watch_anon_write
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD, 3.7.2

Description

By default, the SELinux boolean abrt_upload_watch_anon_write is enabled. This setting should be disabled as it allows the Automatic Bug Report Tool (ABRT) to modify public files used for public file transfer services. To disable the abrt_upload_watch_anon_write SELinux boolean, run the following command:

$ sudo setsebool -P abrt_upload_watch_anon_write off

Rationale

Enable the antivirus_can_scan_system SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_antivirus_can_scan_system medium

Enable the antivirus_can_scan_system SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_antivirus_can_scan_system
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD, 3.7.2

Description

By default, the SELinux boolean antivirus_can_scan_system is disabled. This setting should be enabled as it allows antivirus programs to read non-security files on a system. To enable the antivirus_can_scan_system SELinux boolean, run the following command:

$ sudo setsebool -P antivirus_can_scan_system on

Rationale

Disable the antivirus_use_jit SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_antivirus_use_jit medium

Disable the antivirus_use_jit SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_antivirus_use_jit
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD, 3.7.2

Description

By default, the SELinux boolean antivirus_use_jit is disabled. If this setting is enabled, it should be disabled. To disable the antivirus_use_jit SELinux boolean, run the following command:

$ sudo setsebool -P antivirus_use_jit off

Rationale

Enable the auditadm_exec_content SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_auditadm_exec_content medium

Enable the auditadm_exec_content SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_auditadm_exec_content
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD, 80424-5

Description

By default, the SELinux boolean auditadm_exec_content is enabled. If this setting is disabled, it should be enabled. To enable the auditadm_exec_content SELinux boolean, run the following command:

$ sudo setsebool -P auditadm_exec_content on

Rationale

Disable the authlogin_nsswitch_use_ldap SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_authlogin_nsswitch_use_ldap medium

Disable the authlogin_nsswitch_use_ldap SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_authlogin_nsswitch_use_ldap
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD, 3.7.2

Description

By default, the SELinux boolean authlogin_nsswitch_use_ldap is disabled. If this setting is enabled, it should be disabled. To disable the authlogin_nsswitch_use_ldap SELinux boolean, run the following command:

$ sudo setsebool -P authlogin_nsswitch_use_ldap off

Rationale

Disable the authlogin_radius SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_authlogin_radius medium

Disable the authlogin_radius SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_authlogin_radius
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD, 3.7.2

Description

By default, the SELinux boolean authlogin_radius is disabled. If this setting is enabled, it should be disabled. To disable the authlogin_radius SELinux boolean, run the following command:

$ sudo setsebool -P authlogin_radius off

Rationale

Disable the authlogin_yubikey SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_authlogin_yubikey medium

Disable the authlogin_yubikey SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_authlogin_yubikey
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD, 3.7.2

Description

By default, the SELinux boolean authlogin_yubikey is disabled. If this setting is enabled, it should be disabled. To disable the authlogin_yubikey SELinux boolean, run the following command:

$ sudo setsebool -P authlogin_yubikey off

Rationale

Disable the awstats_purge_apache_log_files SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_awstats_purge_apache_log_files medium

Disable the awstats_purge_apache_log_files SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_awstats_purge_apache_log_files
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD, 3.7.2

Description

By default, the SELinux boolean awstats_purge_apache_log_files is disabled. If this setting is enabled, it should be disabled. To disable the awstats_purge_apache_log_files SELinux boolean, run the following command:

$ sudo setsebool -P awstats_purge_apache_log_files off

Rationale

Disable the boinc_execmem SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_boinc_execmem medium

Disable the boinc_execmem SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_boinc_execmem
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD, 3.7.2

Description

By default, the SELinux boolean boinc_execmem is enabled. This setting should be disabled. To disable the boinc_execmem SELinux boolean, run the following command:

$ sudo setsebool -P boinc_execmem off

Rationale

Disable the cdrecord_read_content SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_cdrecord_read_content medium

Disable the cdrecord_read_content SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_cdrecord_read_content
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean cdrecord_read_content is disabled. If this setting is enabled, it should be disabled. To disable the cdrecord_read_content SELinux boolean, run the following command:

$ sudo setsebool -P cdrecord_read_content off

Rationale

Disable the cluster_can_network_connect SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_cluster_can_network_connect medium

Disable the cluster_can_network_connect SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_cluster_can_network_connect
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean cluster_can_network_connect is disabled. If this setting is enabled, it should be disabled. To disable the cluster_can_network_connect SELinux boolean, run the following command:

$ sudo setsebool -P cluster_can_network_connect off

Rationale

Disable the cluster_manage_all_files SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_cluster_manage_all_files medium

Disable the cluster_manage_all_files SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_cluster_manage_all_files
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean cluster_manage_all_files is disabled. If this setting is enabled, it should be disabled. To disable the cluster_manage_all_files SELinux boolean, run the following command:

$ sudo setsebool -P cluster_manage_all_files off

Rationale

Disable the cluster_use_execmem SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_cluster_use_execmem medium

Disable the cluster_use_execmem SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_cluster_use_execmem
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean cluster_use_execmem is disabled. If this setting is enabled, it should be disabled. To disable the cluster_use_execmem SELinux boolean, run the following command:

$ sudo setsebool -P cluster_use_execmem off

Rationale

Disable the cobbler_anon_write SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_cobbler_anon_write medium

Disable the cobbler_anon_write SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_cobbler_anon_write
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean cobbler_anon_write is disabled. If this setting is enabled, it should be disabled. To disable the cobbler_anon_write SELinux boolean, run the following command:

$ sudo setsebool -P cobbler_anon_write off

Rationale

Disable the cobbler_can_network_connect SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_cobbler_can_network_connect medium

Disable the cobbler_can_network_connect SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_cobbler_can_network_connect
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean cobbler_can_network_connect is disabled. If this setting is enabled, it should be disabled. To disable the cobbler_can_network_connect SELinux boolean, run the following command:

$ sudo setsebool -P cobbler_can_network_connect off

Rationale

Disable the cobbler_use_cifs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_cobbler_use_cifs medium

Disable the cobbler_use_cifs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_cobbler_use_cifs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean cobbler_use_cifs is disabled. If this setting is enabled, it should be disabled. To disable the cobbler_use_cifs SELinux boolean, run the following command:

$ sudo setsebool -P cobbler_use_cifs off

Rationale

Disable the cobbler_use_nfs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_cobbler_use_nfs medium

Disable the cobbler_use_nfs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_cobbler_use_nfs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean cobbler_use_nfs is disabled. If this setting is enabled, it should be disabled. To disable the cobbler_use_nfs SELinux boolean, run the following command:

$ sudo setsebool -P cobbler_use_nfs off

Rationale

Disable the collectd_tcp_network_connect SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_collectd_tcp_network_connect medium

Disable the collectd_tcp_network_connect SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_collectd_tcp_network_connect
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean collectd_tcp_network_connect is disabled. If this setting is enabled, it should be disabled. To disable the collectd_tcp_network_connect SELinux boolean, run the following command:

$ sudo setsebool -P collectd_tcp_network_connect off

Rationale

Disable the condor_tcp_network_connect SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_condor_tcp_network_connect medium

Disable the condor_tcp_network_connect SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_condor_tcp_network_connect
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean condor_tcp_network_connect is disabled. If this setting is enabled, it should be disabled. To disable the condor_tcp_network_connect SELinux boolean, run the following command:

$ sudo setsebool -P condor_tcp_network_connect off

Rationale

Disable the conman_can_network SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_conman_can_network medium

Disable the conman_can_network SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_conman_can_network
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean conman_can_network is disabled. If this setting is enabled, it should be disabled. To disable the conman_can_network SELinux boolean, run the following command:

$ sudo setsebool -P conman_can_network off

Rationale

Disable the cron_can_relabel SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_cron_can_relabel medium

Disable the cron_can_relabel SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_cron_can_relabel
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean cron_can_relabel is disabled. If this setting is enabled, it should be disabled. To disable the cron_can_relabel SELinux boolean, run the following command:

$ sudo setsebool -P cron_can_relabel off

Rationale

Disable the cron_system_cronjob_use_shares SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_cron_system_cronjob_use_shares medium

Disable the cron_system_cronjob_use_shares SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_cron_system_cronjob_use_shares
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean cron_system_cronjob_use_shares is disabled. If this setting is enabled, it should be disabled. To disable the cron_system_cronjob_use_shares SELinux boolean, run the following command:

$ sudo setsebool -P cron_system_cronjob_use_shares off

Rationale

Enable the cron_userdomain_transition SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_cron_userdomain_transition medium

Enable the cron_userdomain_transition SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_cron_userdomain_transition
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean cron_userdomain_transition is enabled. This setting should be enabled as end user cron jobs run in their default associated user domain(s) instead of the general cronjob domain. To enable the cron_userdomain_transition SELinux boolean, run the following command:

$ sudo setsebool -P cron_userdomain_transition on

Rationale

Disable the cups_execmem SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_cups_execmem medium

Disable the cups_execmem SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_cups_execmem
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean cups_execmem is disabled. If this setting is enabled, it should be disabled. To disable the cups_execmem SELinux boolean, run the following command:

$ sudo setsebool -P cups_execmem off

Rationale

Disable the cvs_read_shadow SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_cvs_read_shadow medium

Disable the cvs_read_shadow SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_cvs_read_shadow
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean cvs_read_shadow is disabled. If this setting is enabled, it should be disabled. To disable the cvs_read_shadow SELinux boolean, run the following command:

$ sudo setsebool -P cvs_read_shadow off

Rationale

Disable the daemons_dump_core SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_daemons_dump_core medium

Disable the daemons_dump_core SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_daemons_dump_core
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean daemons_dump_core is disabled. If this setting is enabled, it should be disabled. To disable the daemons_dump_core SELinux boolean, run the following command:

$ sudo setsebool -P daemons_dump_core off

Rationale

Disable the daemons_enable_cluster_mode SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_daemons_enable_cluster_mode medium

Disable the daemons_enable_cluster_mode SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_daemons_enable_cluster_mode
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean daemons_enable_cluster_mode is disabled. If this setting is enabled, it should be disabled. To disable the daemons_enable_cluster_mode SELinux boolean, run the following command:

$ sudo setsebool -P daemons_enable_cluster_mode off

Rationale

Disable the daemons_use_tcp_wrapper SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_daemons_use_tcp_wrapper medium

Disable the daemons_use_tcp_wrapper SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_daemons_use_tcp_wrapper
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean daemons_use_tcp_wrapper is disabled. If this setting is enabled, it should be disabled. To disable the daemons_use_tcp_wrapper SELinux boolean, run the following command:

$ sudo setsebool -P daemons_use_tcp_wrapper off

Rationale

Disable the daemons_use_tty SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_daemons_use_tty medium

Disable the daemons_use_tty SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_daemons_use_tty
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean daemons_use_tty is disabled. If this setting is enabled, it should be disabled. To disable the daemons_use_tty SELinux boolean, run the following command:

$ sudo setsebool -P daemons_use_tty off

Rationale

Enable the dbadm_exec_content SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_dbadm_exec_content medium

Enable the dbadm_exec_content SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_dbadm_exec_content
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean dbadm_exec_content is enabled. If this setting is disabled, it should be enabled. To enable the dbadm_exec_content SELinux boolean, run the following command:

$ sudo setsebool -P dbadm_exec_content on

Rationale

Disable the dbadm_manage_user_files SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_dbadm_manage_user_files medium

Disable the dbadm_manage_user_files SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_dbadm_manage_user_files
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean dbadm_manage_user_files is disabled. If this setting is enabled, it should be disabled. To disable the dbadm_manage_user_files SELinux boolean, run the following command:

$ sudo setsebool -P dbadm_manage_user_files off

Rationale

Disable the dbadm_read_user_files SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_dbadm_read_user_files medium

Disable the dbadm_read_user_files SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_dbadm_read_user_files
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean dbadm_read_user_files is disabled. If this setting is enabled, it should be disabled. To disable the dbadm_read_user_files SELinux boolean, run the following command:

$ sudo setsebool -P dbadm_read_user_files off

Rationale

Disable the deny_execmem SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_deny_execmem medium

Disable the deny_execmem SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_deny_execmem
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean deny_execmem is disabled. If this setting is enabled, it should be disabled. To disable the deny_execmem SELinux boolean, run the following command:

$ sudo setsebool -P deny_execmem off

Rationale

Disable the deny_ptrace SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_deny_ptrace medium

Disable the deny_ptrace SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_deny_ptrace
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean deny_ptrace is disabled. If this setting is enabled, it should be disabled. To disable the deny_ptrace SELinux boolean, run the following command:

$ sudo setsebool -P deny_ptrace off

Rationale

Disable the dhcpc_exec_iptables SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_dhcpc_exec_iptables medium

Disable the dhcpc_exec_iptables SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_dhcpc_exec_iptables
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean dhcpc_exec_iptables is disabled. If this setting is enabled, it should be disabled. To disable the dhcpc_exec_iptables SELinux boolean, run the following command:

$ sudo setsebool -P dhcpc_exec_iptables off

Rationale

Disable the dhcpd_use_ldap SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_dhcpd_use_ldap medium

Disable the dhcpd_use_ldap SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_dhcpd_use_ldap
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean dhcpd_use_ldap is disabled. If this setting is enabled, it should be disabled. To disable the dhcpd_use_ldap SELinux boolean, run the following command:

$ sudo setsebool -P dhcpd_use_ldap off

Rationale

Disable the docker_connect_any SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_docker_connect_any medium

Disable the docker_connect_any SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_docker_connect_any
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean docker_connect_any is disabled. If this setting is enabled, it should be disabled. To disable the docker_connect_any SELinux boolean, run the following command:

$ sudo setsebool -P docker_connect_any off

Rationale

Enable the docker_transition_unconfined SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_docker_transition_unconfined medium

Enable the docker_transition_unconfined SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_docker_transition_unconfined
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean docker_transition_unconfined is enabled. If this setting is disabled, it should be enabled. To enable the docker_transition_unconfined SELinux boolean, run the following command:

$ sudo setsebool -P docker_transition_unconfined on

Rationale

Enable the domain_fd_use SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_domain_fd_use medium

Enable the domain_fd_use SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_domain_fd_use
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean domain_fd_use is enabled. If this setting is disabled, it should be enabled. To enable the domain_fd_use SELinux boolean, run the following command:

$ sudo setsebool -P domain_fd_use on

Rationale

Disable the domain_kernel_load_modules SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_domain_kernel_load_modules medium

Disable the domain_kernel_load_modules SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_domain_kernel_load_modules
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean domain_kernel_load_modules is disabled. If this setting is enabled, it should be disabled. To disable the domain_kernel_load_modules SELinux boolean, run the following command:

$ sudo setsebool -P domain_kernel_load_modules off

Rationale

Disable the entropyd_use_audio SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_entropyd_use_audio medium

Disable the entropyd_use_audio SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_entropyd_use_audio
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean entropyd_use_audio is enabled. This setting should be disabled as it uses audit input to generate entropy. To disable the entropyd_use_audio SELinux boolean, run the following command:

$ sudo setsebool -P entropyd_use_audio off

Rationale

Disable the exim_can_connect_db SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_exim_can_connect_db medium

Disable the exim_can_connect_db SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_exim_can_connect_db
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean exim_can_connect_db is disabled. If this setting is enabled, it should be disabled. To disable the exim_can_connect_db SELinux boolean, run the following command:

$ sudo setsebool -P exim_can_connect_db off

Rationale

Disable the exim_manage_user_files SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_exim_manage_user_files medium

Disable the exim_manage_user_files SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_exim_manage_user_files
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean exim_manage_user_files is disabled. If this setting is enabled, it should be disabled. To disable the exim_manage_user_files SELinux boolean, run the following command:

$ sudo setsebool -P exim_manage_user_files off

Rationale

Disable the exim_read_user_files SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_exim_read_user_files medium

Disable the exim_read_user_files SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_exim_read_user_files
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean exim_read_user_files is disabled. If this setting is enabled, it should be disabled. To disable the exim_read_user_files SELinux boolean, run the following command:

$ sudo setsebool -P exim_read_user_files off

Rationale

Disable the fcron_crond SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_fcron_crond medium

Disable the fcron_crond SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_fcron_crond
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean fcron_crond is disabled. If this setting is enabled, it should be disabled. To disable the fcron_crond SELinux boolean, run the following command:

$ sudo setsebool -P fcron_crond off

Rationale

Disable the fenced_can_network_connect SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_fenced_can_network_connect medium

Disable the fenced_can_network_connect SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_fenced_can_network_connect
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean fenced_can_network_connect is disabled. If this setting is enabled, it should be disabled. To disable the fenced_can_network_connect SELinux boolean, run the following command:

$ sudo setsebool -P fenced_can_network_connect off

Rationale

Disable the fenced_can_ssh SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_fenced_can_ssh medium

Disable the fenced_can_ssh SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_fenced_can_ssh
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean fenced_can_ssh is disabled. If this setting is enabled, it should be disabled. To disable the fenced_can_ssh SELinux boolean, run the following command:

$ sudo setsebool -P fenced_can_ssh off

Rationale

Enable the fips_mode SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_fips_mode medium

Enable the fips_mode SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_fips_mode
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  SC-13, TBD, TBD, 3.13.11

Description

By default, the SELinux boolean fips_mode is enabled. This allows all SELinux domains to execute in fips_mode. If this setting is disabled, it should be enabled. To enable the fips_mode SELinux boolean, run the following command:

$ sudo setsebool -P fips_mode on

Rationale

Disable the ftpd_anon_write SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_ftpd_anon_write medium

Disable the ftpd_anon_write SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_ftpd_anon_write
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean ftpd_anon_write is disabled. If this setting is enabled, it should be disabled. To disable the ftpd_anon_write SELinux boolean, run the following command:

$ sudo setsebool -P ftpd_anon_write off

Rationale

Disable the ftpd_connect_all_unreserved SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_ftpd_connect_all_unreserved medium

Disable the ftpd_connect_all_unreserved SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_ftpd_connect_all_unreserved
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean ftpd_connect_all_unreserved is disabled. If this setting is enabled, it should be disabled. To disable the ftpd_connect_all_unreserved SELinux boolean, run the following command:

$ sudo setsebool -P ftpd_connect_all_unreserved off

Rationale

Disable the ftpd_connect_db SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_ftpd_connect_db medium

Disable the ftpd_connect_db SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_ftpd_connect_db
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean ftpd_connect_db is disabled. If this setting is enabled, it should be disabled. To disable the ftpd_connect_db SELinux boolean, run the following command:

$ sudo setsebool -P ftpd_connect_db off

Rationale

Disable the ftpd_full_access SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_ftpd_full_access medium

Disable the ftpd_full_access SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_ftpd_full_access
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean ftpd_full_access is disabled. If this setting is enabled, it should be disabled. To disable the ftpd_full_access SELinux boolean, run the following command:

$ sudo setsebool -P ftpd_full_access off

Rationale

Disable the ftpd_use_cifs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_ftpd_use_cifs medium

Disable the ftpd_use_cifs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_ftpd_use_cifs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean ftpd_use_cifs is disabled. If this setting is enabled, it should be disabled. To disable the ftpd_use_cifs SELinux boolean, run the following command:

$ sudo setsebool -P ftpd_use_cifs off

Rationale

Disable the ftpd_use_fusefs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_ftpd_use_fusefs medium

Disable the ftpd_use_fusefs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_ftpd_use_fusefs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean ftpd_use_fusefs is disabled. If this setting is enabled, it should be disabled. To disable the ftpd_use_fusefs SELinux boolean, run the following command:

$ sudo setsebool -P ftpd_use_fusefs off

Rationale

Disable the ftpd_use_nfs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_ftpd_use_nfs medium

Disable the ftpd_use_nfs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_ftpd_use_nfs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean ftpd_use_nfs is disabled. If this setting is enabled, it should be disabled. To disable the ftpd_use_nfs SELinux boolean, run the following command:

$ sudo setsebool -P ftpd_use_nfs off

Rationale

Disable the ftpd_use_passive_mode SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_ftpd_use_passive_mode medium

Disable the ftpd_use_passive_mode SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_ftpd_use_passive_mode
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean ftpd_use_passive_mode is disabled. If this setting is enabled, it should be disabled. To disable the ftpd_use_passive_mode SELinux boolean, run the following command:

$ sudo setsebool -P ftpd_use_passive_mode off

Rationale

Disable the ftp_home_dir SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_ftp_home_dir medium

Disable the ftp_home_dir SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_ftp_home_dir
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean ftp_home_dir is disabled. If this setting is enabled, it should be disabled. To disable the ftp_home_dir SELinux boolean, run the following command:

$ sudo setsebool -P ftp_home_dir off

Rationale

Disable the git_cgi_enable_homedirs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_git_cgi_enable_homedirs medium

Disable the git_cgi_enable_homedirs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_git_cgi_enable_homedirs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean git_cgi_enable_homedirs is disabled. If this setting is enabled, it should be disabled. To disable the git_cgi_enable_homedirs SELinux boolean, run the following command:

$ sudo setsebool -P git_cgi_enable_homedirs off

Rationale

Disable the git_cgi_use_cifs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_git_cgi_use_cifs medium

Disable the git_cgi_use_cifs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_git_cgi_use_cifs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean git_cgi_use_cifs is disabled. If this setting is enabled, it should be disabled. To disable the git_cgi_use_cifs SELinux boolean, run the following command:

$ sudo setsebool -P git_cgi_use_cifs off

Rationale

Disable the git_cgi_use_nfs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_git_cgi_use_nfs medium

Disable the git_cgi_use_nfs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_git_cgi_use_nfs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean git_cgi_use_nfs is disabled. If this setting is enabled, it should be disabled. To disable the git_cgi_use_nfs SELinux boolean, run the following command:

$ sudo setsebool -P git_cgi_use_nfs off

Rationale

Disable the gitosis_can_sendmail SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_gitosis_can_sendmail medium

Disable the gitosis_can_sendmail SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_gitosis_can_sendmail
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean gitosis_can_sendmail is disabled. If this setting is enabled, it should be disabled. To disable the gitosis_can_sendmail SELinux boolean, run the following command:

$ sudo setsebool -P gitosis_can_sendmail off

Rationale

Disable the git_session_bind_all_unreserved_ports SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_git_session_bind_all_unreserved_ports medium

Disable the git_session_bind_all_unreserved_ports SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_git_session_bind_all_unreserved_ports
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean git_session_bind_all_unreserved_ports is disabled. If this setting is enabled, it should be disabled. To disable the git_session_bind_all_unreserved_ports SELinux boolean, run the following command:

$ sudo setsebool -P git_session_bind_all_unreserved_ports off

Rationale

Disable the git_session_users SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_git_session_users medium

Disable the git_session_users SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_git_session_users
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean git_session_users is disabled. If this setting is enabled, it should be disabled. To disable the git_session_users SELinux boolean, run the following command:

$ sudo setsebool -P git_session_users off

Rationale

Disable the git_system_enable_homedirs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_git_system_enable_homedirs medium

Disable the git_system_enable_homedirs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_git_system_enable_homedirs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean git_system_enable_homedirs is disabled. If this setting is enabled, it should be disabled. To disable the git_system_enable_homedirs SELinux boolean, run the following command:

$ sudo setsebool -P git_system_enable_homedirs off

Rationale

Disable the git_system_use_cifs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_git_system_use_cifs medium

Disable the git_system_use_cifs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_git_system_use_cifs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean git_system_use_cifs is disabled. If this setting is enabled, it should be disabled. To disable the git_system_use_cifs SELinux boolean, run the following command:

$ sudo setsebool -P git_system_use_cifs off

Rationale

Disable the git_system_use_nfs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_git_system_use_nfs medium

Disable the git_system_use_nfs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_git_system_use_nfs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean git_system_use_nfs is disabled. If this setting is enabled, it should be disabled. To disable the git_system_use_nfs SELinux boolean, run the following command:

$ sudo setsebool -P git_system_use_nfs off

Rationale

Disable the glance_api_can_network SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_glance_api_can_network medium

Disable the glance_api_can_network SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_glance_api_can_network
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean glance_api_can_network is disabled. If this setting is enabled, it should be disabled. To disable the glance_api_can_network SELinux boolean, run the following command:

$ sudo setsebool -P glance_api_can_network off

Rationale

Disable the glance_use_execmem SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_glance_use_execmem medium

Disable the glance_use_execmem SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_glance_use_execmem
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean glance_use_execmem is disabled. If this setting is enabled, it should be disabled. To disable the glance_use_execmem SELinux boolean, run the following command:

$ sudo setsebool -P glance_use_execmem off

Rationale

Disable the glance_use_fusefs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_glance_use_fusefs medium

Disable the glance_use_fusefs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_glance_use_fusefs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean glance_use_fusefs is disabled. If this setting is enabled, it should be disabled. To disable the glance_use_fusefs SELinux boolean, run the following command:

$ sudo setsebool -P glance_use_fusefs off

Rationale

Disable the global_ssp SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_global_ssp medium

Disable the global_ssp SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_global_ssp
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean global_ssp is disabled. If this setting is enabled, it should be disabled. To disable the global_ssp SELinux boolean, run the following command:

$ sudo setsebool -P global_ssp off

Rationale

Disable the gluster_anon_write SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_gluster_anon_write medium

Disable the gluster_anon_write SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_gluster_anon_write
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean gluster_anon_write is disabled. If this setting is enabled, it should be disabled. To disable the gluster_anon_write SELinux boolean, run the following command:

$ sudo setsebool -P gluster_anon_write off

Rationale

Disable the gluster_export_all_ro SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_gluster_export_all_ro medium

Disable the gluster_export_all_ro SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_gluster_export_all_ro
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean gluster_export_all_ro is disabled. If this setting is enabled, it should be disabled. To disable the gluster_export_all_ro SELinux boolean, run the following command:

$ sudo setsebool -P gluster_export_all_ro off

Rationale

Configure the gluster_export_all_rw SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_gluster_export_all_rw medium

Configure the gluster_export_all_rw SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_gluster_export_all_rw
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean gluster_export_all_rw is enabled. If GlusterFS is in use, this setting should be enabled. Otherwise, disable it. To disable the gluster_export_all_rw SELinux boolean, run the following command:

$ sudo setsebool -P gluster_export_all_rw off

Rationale

Disable the gpg_web_anon_write SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_gpg_web_anon_write medium

Disable the gpg_web_anon_write SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_gpg_web_anon_write
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean gpg_web_anon_write is disabled. If this setting is enabled, it should be disabled. To disable the gpg_web_anon_write SELinux boolean, run the following command:

$ sudo setsebool -P gpg_web_anon_write off

Rationale

Enable the gssd_read_tmp SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_gssd_read_tmp medium

Enable the gssd_read_tmp SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_gssd_read_tmp
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean gssd_read_tmp is enabled. This setting allows gssd processes to access Kerberos to read TGTs in the temp directory. If this setting is disabled, it should be enabled. To enable the gssd_read_tmp SELinux boolean, run the following command:

$ sudo setsebool -P gssd_read_tmp on

Rationale

Disable the guest_exec_content SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_guest_exec_content medium

Disable the guest_exec_content SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_guest_exec_content
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean guest_exec_content is enabled. This setting should be disabled as no guest accounts should be used. To enable the guest_exec_content SELinux boolean, run the following command:

$ sudo setsebool -P guest_exec_content on

Rationale

Disable the haproxy_connect_any SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_haproxy_connect_any medium

Disable the haproxy_connect_any SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_haproxy_connect_any
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean haproxy_connect_any is disabled. If this setting is enabled, it should be disabled. To disable the haproxy_connect_any SELinux boolean, run the following command:

$ sudo setsebool -P haproxy_connect_any off

Rationale

Disable the httpd_anon_write SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_anon_write medium

Disable the httpd_anon_write SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_anon_write
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_anon_write is disabled. If this setting is enabled, it should be disabled. To disable the httpd_anon_write SELinux boolean, run the following command:

$ sudo setsebool -P httpd_anon_write off

Rationale

Configure the httpd_builtin_scripting SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_builtin_scripting medium

Configure the httpd_builtin_scripting SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_builtin_scripting
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_builtin_scripting is enabled. This setting should be disabled if httpd is not running php or some similary scripting language. To disable the httpd_builtin_scripting SELinux boolean, run the following command:

$ sudo setsebool -P httpd_builtin_scripting off

Rationale

Disable the httpd_can_check_spam SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_can_check_spam medium

Disable the httpd_can_check_spam SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_can_check_spam
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_can_check_spam is disabled. If this setting is enabled, it should be disabled. To disable the httpd_can_check_spam SELinux boolean, run the following command:

$ sudo setsebool -P httpd_can_check_spam off

Rationale

Disable the httpd_can_connect_ftp SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_can_connect_ftp medium

Disable the httpd_can_connect_ftp SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_can_connect_ftp
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_can_connect_ftp is disabled. If this setting is enabled, it should be disabled. To disable the httpd_can_connect_ftp SELinux boolean, run the following command:

$ sudo setsebool -P httpd_can_connect_ftp off

Rationale

Disable the httpd_can_connect_ldap SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_can_connect_ldap medium

Disable the httpd_can_connect_ldap SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_can_connect_ldap
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_can_connect_ldap is disabled. If this setting is enabled, it should be disabled. To disable the httpd_can_connect_ldap SELinux boolean, run the following command:

$ sudo setsebool -P httpd_can_connect_ldap off

Rationale

Disable the httpd_can_connect_mythtv SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_can_connect_mythtv medium

Disable the httpd_can_connect_mythtv SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_can_connect_mythtv
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_can_connect_mythtv is disabled. If this setting is enabled, it should be disabled. To disable the httpd_can_connect_mythtv SELinux boolean, run the following command:

$ sudo setsebool -P httpd_can_connect_mythtv off

Rationale

Disable the httpd_can_connect_zabbix SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_can_connect_zabbix medium

Disable the httpd_can_connect_zabbix SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_can_connect_zabbix
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_can_connect_zabbix is disabled. If this setting is enabled, it should be disabled. To disable the httpd_can_connect_zabbix SELinux boolean, run the following command:

$ sudo setsebool -P httpd_can_connect_zabbix off

Rationale

Disable the httpd_can_network_connect_cobbler SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_can_network_connect_cobbler medium

Disable the httpd_can_network_connect_cobbler SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_can_network_connect_cobbler
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_can_network_connect_cobbler is disabled. If this setting is enabled, it should be disabled. To disable the httpd_can_network_connect_cobbler SELinux boolean, run the following command:

$ sudo setsebool -P httpd_can_network_connect_cobbler off

Rationale

Disable the httpd_can_network_connect_db SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_can_network_connect_db medium

Disable the httpd_can_network_connect_db SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_can_network_connect_db
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_can_network_connect_db is disabled. If this setting is enabled, it should be disabled. To disable the httpd_can_network_connect_db SELinux boolean, run the following command:

$ sudo setsebool -P httpd_can_network_connect_db off

Rationale

Disable the httpd_can_network_connect SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_can_network_connect medium

Disable the httpd_can_network_connect SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_can_network_connect
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_can_network_connect is disabled. If this setting is enabled, it should be disabled. To disable the httpd_can_network_connect SELinux boolean, run the following command:

$ sudo setsebool -P httpd_can_network_connect off

Rationale

Disable the httpd_can_network_memcache SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_can_network_memcache medium

Disable the httpd_can_network_memcache SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_can_network_memcache
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_can_network_memcache is disabled. If this setting is enabled, it should be disabled. To disable the httpd_can_network_memcache SELinux boolean, run the following command:

$ sudo setsebool -P httpd_can_network_memcache off

Rationale

Disable the httpd_can_network_relay SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_can_network_relay medium

Disable the httpd_can_network_relay SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_can_network_relay
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_can_network_relay is disabled. If this setting is enabled, it should be disabled. To disable the httpd_can_network_relay SELinux boolean, run the following command:

$ sudo setsebool -P httpd_can_network_relay off

Rationale

Disable the httpd_can_sendmail SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_can_sendmail medium

Disable the httpd_can_sendmail SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_can_sendmail
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_can_sendmail is disabled. If this setting is enabled, it should be disabled. To disable the httpd_can_sendmail SELinux boolean, run the following command:

$ sudo setsebool -P httpd_can_sendmail off

Rationale

Disable the httpd_dbus_avahi SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_dbus_avahi medium

Disable the httpd_dbus_avahi SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_dbus_avahi
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_dbus_avahi is disabled. If this setting is enabled, it should be disabled. To disable the httpd_dbus_avahi SELinux boolean, run the following command:

$ sudo setsebool -P httpd_dbus_avahi off

Rationale

Disable the httpd_dbus_sssd SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_dbus_sssd medium

Disable the httpd_dbus_sssd SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_dbus_sssd
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_dbus_sssd is disabled. If this setting is enabled, it should be disabled. To disable the httpd_dbus_sssd SELinux boolean, run the following command:

$ sudo setsebool -P httpd_dbus_sssd off

Rationale

Disable the httpd_dontaudit_search_dirs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_dontaudit_search_dirs medium

Disable the httpd_dontaudit_search_dirs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_dontaudit_search_dirs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_dontaudit_search_dirs is disabled. If this setting is enabled, it should be disabled. To disable the httpd_dontaudit_search_dirs SELinux boolean, run the following command:

$ sudo setsebool -P httpd_dontaudit_search_dirs off

Rationale

Configure the httpd_enable_cgi SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_enable_cgi medium

Configure the httpd_enable_cgi SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_enable_cgi
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_enable_cgi is enabled. This setting should be disabled unless httpd is used with CGI scripting. To disable the httpd_enable_cgi SELinux boolean, run the following command:

$ sudo setsebool -P httpd_enable_cgi off

Rationale

Disable the httpd_enable_ftp_server SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_enable_ftp_server medium

Disable the httpd_enable_ftp_server SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_enable_ftp_server
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_enable_ftp_server is disabled. If this setting is enabled, it should be disabled. To disable the httpd_enable_ftp_server SELinux boolean, run the following command:

$ sudo setsebool -P httpd_enable_ftp_server off

Rationale

Disable the httpd_enable_homedirs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_enable_homedirs medium

Disable the httpd_enable_homedirs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_enable_homedirs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_enable_homedirs is disabled. If this setting is enabled, it should be disabled. To disable the httpd_enable_homedirs SELinux boolean, run the following command:

$ sudo setsebool -P httpd_enable_homedirs off

Rationale

Disable the httpd_execmem SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_execmem medium

Disable the httpd_execmem SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_execmem
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_execmem is disabled. If this setting is enabled, it should be disabled. To disable the httpd_execmem SELinux boolean, run the following command:

$ sudo setsebool -P httpd_execmem off

Rationale

Enable the httpd_graceful_shutdown SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_graceful_shutdown medium

Enable the httpd_graceful_shutdown SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_graceful_shutdown
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_graceful_shutdown is enabled. If this setting is disabled, it should be enabled. To enable the httpd_graceful_shutdown SELinux boolean, run the following command:

$ sudo setsebool -P httpd_graceful_shutdown on

Rationale

Disable the httpd_manage_ipa SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_manage_ipa medium

Disable the httpd_manage_ipa SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_manage_ipa
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_manage_ipa is disabled. If this setting is enabled, it should be disabled. To disable the httpd_manage_ipa SELinux boolean, run the following command:

$ sudo setsebool -P httpd_manage_ipa off

Rationale

Disable the httpd_mod_auth_ntlm_winbind SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_mod_auth_ntlm_winbind medium

Disable the httpd_mod_auth_ntlm_winbind SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_mod_auth_ntlm_winbind
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_mod_auth_ntlm_winbind is disabled. If this setting is enabled, it should be disabled. To disable the httpd_mod_auth_ntlm_winbind SELinux boolean, run the following command:

$ sudo setsebool -P httpd_mod_auth_ntlm_winbind off

Rationale

Disable the httpd_mod_auth_pam SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_mod_auth_pam medium

Disable the httpd_mod_auth_pam SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_mod_auth_pam
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_mod_auth_pam is disabled. If this setting is enabled, it should be disabled. To disable the httpd_mod_auth_pam SELinux boolean, run the following command:

$ sudo setsebool -P httpd_mod_auth_pam off

Rationale

Disable the httpd_read_user_content SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_read_user_content medium

Disable the httpd_read_user_content SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_read_user_content
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_read_user_content is disabled. If this setting is enabled, it should be disabled. To disable the httpd_read_user_content SELinux boolean, run the following command:

$ sudo setsebool -P httpd_read_user_content off

Rationale

Disable the httpd_run_ipa SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_run_ipa medium

Disable the httpd_run_ipa SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_run_ipa
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_run_ipa is disabled. If this setting is enabled, it should be disabled. To disable the httpd_run_ipa SELinux boolean, run the following command:

$ sudo setsebool -P httpd_run_ipa off

Rationale

Disable the httpd_run_preupgrade SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_run_preupgrade medium

Disable the httpd_run_preupgrade SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_run_preupgrade
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_run_preupgrade is disabled. If this setting is enabled, it should be disabled. To disable the httpd_run_preupgrade SELinux boolean, run the following command:

$ sudo setsebool -P httpd_run_preupgrade off

Rationale

Disable the httpd_run_stickshift SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_run_stickshift medium

Disable the httpd_run_stickshift SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_run_stickshift
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_run_stickshift is disabled. If this setting is enabled, it should be disabled. To disable the httpd_run_stickshift SELinux boolean, run the following command:

$ sudo setsebool -P httpd_run_stickshift off

Rationale

Disable the httpd_serve_cobbler_files SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_serve_cobbler_files medium

Disable the httpd_serve_cobbler_files SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_serve_cobbler_files
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_serve_cobbler_files is disabled. If this setting is enabled, it should be disabled. To disable the httpd_serve_cobbler_files SELinux boolean, run the following command:

$ sudo setsebool -P httpd_serve_cobbler_files off

Rationale

Disable the httpd_setrlimit SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_setrlimit medium

Disable the httpd_setrlimit SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_setrlimit
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_setrlimit is disabled. If this setting is enabled, it should be disabled. To disable the httpd_setrlimit SELinux boolean, run the following command:

$ sudo setsebool -P httpd_setrlimit off

Rationale

Disable the httpd_ssi_exec SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_ssi_exec medium

Disable the httpd_ssi_exec SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_ssi_exec
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_ssi_exec is disabled. If this setting is enabled, it should be disabled. To disable the httpd_ssi_exec SELinux boolean, run the following command:

$ sudo setsebool -P httpd_ssi_exec off

Rationale

Disable the httpd_sys_script_anon_write SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_sys_script_anon_write medium

Disable the httpd_sys_script_anon_write SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_sys_script_anon_write
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_sys_script_anon_write is disabled. If this setting is enabled, it should be disabled. To disable the httpd_sys_script_anon_write SELinux boolean, run the following command:

$ sudo setsebool -P httpd_sys_script_anon_write off

Rationale

Disable the httpd_tmp_exec SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_tmp_exec medium

Disable the httpd_tmp_exec SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_tmp_exec
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_tmp_exec is disabled. If this setting is enabled, it should be disabled. To disable the httpd_tmp_exec SELinux boolean, run the following command:

$ sudo setsebool -P httpd_tmp_exec off

Rationale

Disable the httpd_tty_comm SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_tty_comm medium

Disable the httpd_tty_comm SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_tty_comm
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_tty_comm is disabled. If this setting is enabled, it should be disabled. To disable the httpd_tty_comm SELinux boolean, run the following command:

$ sudo setsebool -P httpd_tty_comm off

Rationale

Disable the httpd_unified SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_unified medium

Disable the httpd_unified SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_unified
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_unified is disabled. If this setting is enabled, it should be disabled. To disable the httpd_unified SELinux boolean, run the following command:

$ sudo setsebool -P httpd_unified off

Rationale

Disable the httpd_use_cifs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_use_cifs medium

Disable the httpd_use_cifs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_use_cifs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_use_cifs is disabled. If this setting is enabled, it should be disabled. To disable the httpd_use_cifs SELinux boolean, run the following command:

$ sudo setsebool -P httpd_use_cifs off

Rationale

Disable the httpd_use_fusefs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_use_fusefs medium

Disable the httpd_use_fusefs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_use_fusefs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_use_fusefs is disabled. If this setting is enabled, it should be disabled. To disable the httpd_use_fusefs SELinux boolean, run the following command:

$ sudo setsebool -P httpd_use_fusefs off

Rationale

Disable the httpd_use_gpg SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_use_gpg medium

Disable the httpd_use_gpg SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_use_gpg
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_use_gpg is disabled. If this setting is enabled, it should be disabled. To disable the httpd_use_gpg SELinux boolean, run the following command:

$ sudo setsebool -P httpd_use_gpg off

Rationale

Disable the httpd_use_nfs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_use_nfs medium

Disable the httpd_use_nfs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_use_nfs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_use_nfs is disabled. If this setting is enabled, it should be disabled. To disable the httpd_use_nfs SELinux boolean, run the following command:

$ sudo setsebool -P httpd_use_nfs off

Rationale

Disable the httpd_use_openstack SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_use_openstack medium

Disable the httpd_use_openstack SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_use_openstack
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_use_openstack is disabled. If this setting is enabled, it should be disabled. To disable the httpd_use_openstack SELinux boolean, run the following command:

$ sudo setsebool -P httpd_use_openstack off

Rationale

Disable the httpd_use_sasl SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_use_sasl medium

Disable the httpd_use_sasl SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_use_sasl
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_use_sasl is disabled. If this setting is enabled, it should be disabled. To disable the httpd_use_sasl SELinux boolean, run the following command:

$ sudo setsebool -P httpd_use_sasl off

Rationale

Disable the httpd_verify_dns SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_httpd_verify_dns medium

Disable the httpd_verify_dns SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_httpd_verify_dns
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean httpd_verify_dns is disabled. If this setting is enabled, it should be disabled. To disable the httpd_verify_dns SELinux boolean, run the following command:

$ sudo setsebool -P httpd_verify_dns off

Rationale

Disable the icecast_use_any_tcp_ports SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_icecast_use_any_tcp_ports medium

Disable the icecast_use_any_tcp_ports SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_icecast_use_any_tcp_ports
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean icecast_use_any_tcp_ports is disabled. If this setting is enabled, it should be disabled. To disable the icecast_use_any_tcp_ports SELinux boolean, run the following command:

$ sudo setsebool -P icecast_use_any_tcp_ports off

Rationale

Disable the irc_use_any_tcp_ports SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_irc_use_any_tcp_ports medium

Disable the irc_use_any_tcp_ports SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_irc_use_any_tcp_ports
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean irc_use_any_tcp_ports is disabled. If this setting is enabled, it should be disabled. To disable the irc_use_any_tcp_ports SELinux boolean, run the following command:

$ sudo setsebool -P irc_use_any_tcp_ports off

Rationale

Disable the irssi_use_full_network SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_irssi_use_full_network medium

Disable the irssi_use_full_network SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_irssi_use_full_network
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean irssi_use_full_network is disabled. If this setting is enabled, it should be disabled. To disable the irssi_use_full_network SELinux boolean, run the following command:

$ sudo setsebool -P irssi_use_full_network off

Rationale

Disable the kdumpgui_run_bootloader SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_kdumpgui_run_bootloader medium

Disable the kdumpgui_run_bootloader SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_kdumpgui_run_bootloader
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean kdumpgui_run_bootloader is disabled. If this setting is enabled, it should be disabled. To disable the kdumpgui_run_bootloader SELinux boolean, run the following command:

$ sudo setsebool -P kdumpgui_run_bootloader off

Rationale

Enable the kerberos_enabled SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_kerberos_enabled medium

Enable the kerberos_enabled SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_kerberos_enabled
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean kerberos_enabled is enabled. If this setting is disabled, it should be enabled to allow confined applications to run with Kerberos. To enable the kerberos_enabled SELinux boolean, run the following command:

$ sudo setsebool -P kerberos_enabled on

Rationale

Disable the ksmtuned_use_cifs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_ksmtuned_use_cifs medium

Disable the ksmtuned_use_cifs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_ksmtuned_use_cifs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean ksmtuned_use_cifs is disabled. If this setting is enabled, it should be disabled. To disable the ksmtuned_use_cifs SELinux boolean, run the following command:

$ sudo setsebool -P ksmtuned_use_cifs off

Rationale

Disable the ksmtuned_use_nfs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_ksmtuned_use_nfs medium

Disable the ksmtuned_use_nfs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_ksmtuned_use_nfs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean ksmtuned_use_nfs is disabled. If this setting is enabled, it should be disabled. To disable the ksmtuned_use_nfs SELinux boolean, run the following command:

$ sudo setsebool -P ksmtuned_use_nfs off

Rationale

Enable the logadm_exec_content SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_logadm_exec_content medium

Enable the logadm_exec_content SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_logadm_exec_content
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean logadm_exec_content is enabled. If this setting is disabled, it should be enabled. To enable the logadm_exec_content SELinux boolean, run the following command:

$ sudo setsebool -P logadm_exec_content on

Rationale

Disable the logging_syslogd_can_sendmail SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_logging_syslogd_can_sendmail medium

Disable the logging_syslogd_can_sendmail SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_logging_syslogd_can_sendmail
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean logging_syslogd_can_sendmail is disabled. If this setting is enabled, it should be disabled. To disable the logging_syslogd_can_sendmail SELinux boolean, run the following command:

$ sudo setsebool -P logging_syslogd_can_sendmail off

Rationale

Disable the logging_syslogd_run_nagios_plugins SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_logging_syslogd_run_nagios_plugins medium

Disable the logging_syslogd_run_nagios_plugins SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_logging_syslogd_run_nagios_plugins
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean logging_syslogd_run_nagios_plugins is disabled. If this setting is enabled, it should be disabled. To disable the logging_syslogd_run_nagios_plugins SELinux boolean, run the following command:

$ sudo setsebool -P logging_syslogd_run_nagios_plugins off

Rationale

Enable the logging_syslogd_use_tty SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_logging_syslogd_use_tty medium

Enable the logging_syslogd_use_tty SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_logging_syslogd_use_tty
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean logging_syslogd_use_tty is enabled. If this setting is disabled, it should be enabled as it allows syslog the ability to read/write to terminal. To enable the logging_syslogd_use_tty SELinux boolean, run the following command:

$ sudo setsebool -P logging_syslogd_use_tty on

Rationale

Disable the logrotate_use_nfs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_logrotate_use_nfs medium

Disable the logrotate_use_nfs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_logrotate_use_nfs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean logrotate_use_nfs is disabled. If this setting is enabled, it should be disabled. To disable the logrotate_use_nfs SELinux boolean, run the following command:

$ sudo setsebool -P logrotate_use_nfs off

Rationale

Disable the logwatch_can_network_connect_mail SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_logwatch_can_network_connect_mail medium

Disable the logwatch_can_network_connect_mail SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_logwatch_can_network_connect_mail
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean logwatch_can_network_connect_mail is disabled. If this setting is enabled, it should be disabled. To disable the logwatch_can_network_connect_mail SELinux boolean, run the following command:

$ sudo setsebool -P logwatch_can_network_connect_mail off

Rationale

Disable the lsmd_plugin_connect_any SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_lsmd_plugin_connect_any medium

Disable the lsmd_plugin_connect_any SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_lsmd_plugin_connect_any
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean lsmd_plugin_connect_any is disabled. If this setting is enabled, it should be disabled. To disable the lsmd_plugin_connect_any SELinux boolean, run the following command:

$ sudo setsebool -P lsmd_plugin_connect_any off

Rationale

Disable the mailman_use_fusefs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_mailman_use_fusefs medium

Disable the mailman_use_fusefs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_mailman_use_fusefs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean mailman_use_fusefs is disabled. If this setting is enabled, it should be disabled. To disable the mailman_use_fusefs SELinux boolean, run the following command:

$ sudo setsebool -P mailman_use_fusefs off

Rationale

Disable the mcelog_client SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_mcelog_client medium

Disable the mcelog_client SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_mcelog_client
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean mcelog_client is disabled. If this setting is enabled, it should be disabled. To disable the mcelog_client SELinux boolean, run the following command:

$ sudo setsebool -P mcelog_client off

Rationale

Enable the mcelog_exec_scripts SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_mcelog_exec_scripts medium

Enable the mcelog_exec_scripts SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_mcelog_exec_scripts
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean mcelog_exec_scripts is enabled. If this setting is disabled, it should be enabled. To enable the mcelog_exec_scripts SELinux boolean, run the following command:

$ sudo setsebool -P mcelog_exec_scripts on

Rationale

Disable the mcelog_foreground SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_mcelog_foreground medium

Disable the mcelog_foreground SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_mcelog_foreground
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean mcelog_foreground is disabled. If this setting is enabled, it should be disabled. To disable the mcelog_foreground SELinux boolean, run the following command:

$ sudo setsebool -P mcelog_foreground off

Rationale

Disable the mcelog_server SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_mcelog_server medium

Disable the mcelog_server SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_mcelog_server
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean mcelog_server is disabled. If this setting is enabled, it should be disabled. To disable the mcelog_server SELinux boolean, run the following command:

$ sudo setsebool -P mcelog_server off

Rationale

Disable the minidlna_read_generic_user_content SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_minidlna_read_generic_user_content medium

Disable the minidlna_read_generic_user_content SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_minidlna_read_generic_user_content
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean minidlna_read_generic_user_content is disabled. If this setting is enabled, it should be disabled. To disable the minidlna_read_generic_user_content SELinux boolean, run the following command:

$ sudo setsebool -P minidlna_read_generic_user_content off

Rationale

Disable the mmap_low_allowed SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_mmap_low_allowed medium

Disable the mmap_low_allowed SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_mmap_low_allowed
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean mmap_low_allowed is disabled. If this setting is enabled, it should be disabled. To disable the mmap_low_allowed SELinux boolean, run the following command:

$ sudo setsebool -P mmap_low_allowed off

Rationale

Disable the mock_enable_homedirs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_mock_enable_homedirs medium

Disable the mock_enable_homedirs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_mock_enable_homedirs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean mock_enable_homedirs is disabled. If this setting is enabled, it should be disabled. To disable the mock_enable_homedirs SELinux boolean, run the following command:

$ sudo setsebool -P mock_enable_homedirs off

Rationale

Enable the mount_anyfile SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_mount_anyfile medium

Enable the mount_anyfile SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_mount_anyfile
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean mount_anyfile is enabled. If this setting is disabled, it should be enabled to allow any file or directory to be mounted. To enable the mount_anyfile SELinux boolean, run the following command:

$ sudo setsebool -P mount_anyfile on

Rationale

Disable the mozilla_plugin_bind_unreserved_ports SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_mozilla_plugin_bind_unreserved_ports medium

Disable the mozilla_plugin_bind_unreserved_ports SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_mozilla_plugin_bind_unreserved_ports
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean mozilla_plugin_bind_unreserved_ports is disabled. If this setting is enabled, it should be disabled. To disable the mozilla_plugin_bind_unreserved_ports SELinux boolean, run the following command:

$ sudo setsebool -P mozilla_plugin_bind_unreserved_ports off

Rationale

Disable the mozilla_plugin_can_network_connect SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_mozilla_plugin_can_network_connect medium

Disable the mozilla_plugin_can_network_connect SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_mozilla_plugin_can_network_connect
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean mozilla_plugin_can_network_connect is disabled. If this setting is enabled, it should be disabled. To disable the mozilla_plugin_can_network_connect SELinux boolean, run the following command:

$ sudo setsebool -P mozilla_plugin_can_network_connect off

Rationale

Disable the mozilla_plugin_use_bluejeans SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_mozilla_plugin_use_bluejeans medium

Disable the mozilla_plugin_use_bluejeans SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_mozilla_plugin_use_bluejeans
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean mozilla_plugin_use_bluejeans is disabled. If this setting is enabled, it should be disabled. To disable the mozilla_plugin_use_bluejeans SELinux boolean, run the following command:

$ sudo setsebool -P mozilla_plugin_use_bluejeans off

Rationale

Disable the mozilla_plugin_use_gps SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_mozilla_plugin_use_gps medium

Disable the mozilla_plugin_use_gps SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_mozilla_plugin_use_gps
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean mozilla_plugin_use_gps is disabled. If this setting is enabled, it should be disabled. To disable the mozilla_plugin_use_gps SELinux boolean, run the following command:

$ sudo setsebool -P mozilla_plugin_use_gps off

Rationale

Disable the mozilla_plugin_use_spice SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_mozilla_plugin_use_spice medium

Disable the mozilla_plugin_use_spice SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_mozilla_plugin_use_spice
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean mozilla_plugin_use_spice is disabled. If this setting is enabled, it should be disabled. To disable the mozilla_plugin_use_spice SELinux boolean, run the following command:

$ sudo setsebool -P mozilla_plugin_use_spice off

Rationale

Disable the mozilla_read_content SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_mozilla_read_content medium

Disable the mozilla_read_content SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_mozilla_read_content
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean mozilla_read_content is disabled. If this setting is enabled, it should be disabled. To disable the mozilla_read_content SELinux boolean, run the following command:

$ sudo setsebool -P mozilla_read_content off

Rationale

Disable the mpd_enable_homedirs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_mpd_enable_homedirs medium

Disable the mpd_enable_homedirs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_mpd_enable_homedirs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean mpd_enable_homedirs is disabled. If this setting is enabled, it should be disabled. To disable the mpd_enable_homedirs SELinux boolean, run the following command:

$ sudo setsebool -P mpd_enable_homedirs off

Rationale

Disable the mpd_use_cifs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_mpd_use_cifs medium

Disable the mpd_use_cifs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_mpd_use_cifs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean mpd_use_cifs is disabled. If this setting is enabled, it should be disabled. To disable the mpd_use_cifs SELinux boolean, run the following command:

$ sudo setsebool -P mpd_use_cifs off

Rationale

Disable the mpd_use_nfs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_mpd_use_nfs medium

Disable the mpd_use_nfs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_mpd_use_nfs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean mpd_use_nfs is disabled. If this setting is enabled, it should be disabled. To disable the mpd_use_nfs SELinux boolean, run the following command:

$ sudo setsebool -P mpd_use_nfs off

Rationale

Disable the mplayer_execstack SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_mplayer_execstack medium

Disable the mplayer_execstack SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_mplayer_execstack
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean mplayer_execstack is disabled. If this setting is enabled, it should be disabled. To disable the mplayer_execstack SELinux boolean, run the following command:

$ sudo setsebool -P mplayer_execstack off

Rationale

Disable the mysql_connect_any SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_mysql_connect_any medium

Disable the mysql_connect_any SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_mysql_connect_any
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean mysql_connect_any is disabled. If this setting is enabled, it should be disabled. To disable the mysql_connect_any SELinux boolean, run the following command:

$ sudo setsebool -P mysql_connect_any off

Rationale

Disable the nagios_run_pnp4nagios SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_nagios_run_pnp4nagios medium

Disable the nagios_run_pnp4nagios SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_nagios_run_pnp4nagios
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean nagios_run_pnp4nagios is disabled. If this setting is enabled, it should be disabled. To disable the nagios_run_pnp4nagios SELinux boolean, run the following command:

$ sudo setsebool -P nagios_run_pnp4nagios off

Rationale

Disable the nagios_run_sudo SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_nagios_run_sudo medium

Disable the nagios_run_sudo SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_nagios_run_sudo
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean nagios_run_sudo is disabled. If this setting is enabled, it should be disabled. To disable the nagios_run_sudo SELinux boolean, run the following command:

$ sudo setsebool -P nagios_run_sudo off

Rationale

Disable the named_tcp_bind_http_port SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_named_tcp_bind_http_port medium

Disable the named_tcp_bind_http_port SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_named_tcp_bind_http_port
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean named_tcp_bind_http_port is disabled. If this setting is enabled, it should be disabled. To disable the named_tcp_bind_http_port SELinux boolean, run the following command:

$ sudo setsebool -P named_tcp_bind_http_port off

Rationale

Disable the named_write_master_zones SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_named_write_master_zones medium

Disable the named_write_master_zones SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_named_write_master_zones
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean named_write_master_zones is disabled. If this setting is enabled, it should be disabled. To disable the named_write_master_zones SELinux boolean, run the following command:

$ sudo setsebool -P named_write_master_zones off

Rationale

Disable the neutron_can_network SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_neutron_can_network medium

Disable the neutron_can_network SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_neutron_can_network
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean neutron_can_network is disabled. If this setting is enabled, it should be disabled. To disable the neutron_can_network SELinux boolean, run the following command:

$ sudo setsebool -P neutron_can_network off

Rationale

Disable the nfsd_anon_write SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_nfsd_anon_write medium

Disable the nfsd_anon_write SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_nfsd_anon_write
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean nfsd_anon_write is disabled. If this setting is enabled, it should be disabled. To disable the nfsd_anon_write SELinux boolean, run the following command:

$ sudo setsebool -P nfsd_anon_write off

Rationale

Enable the nfs_export_all_ro SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_nfs_export_all_ro medium

Enable the nfs_export_all_ro SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_nfs_export_all_ro
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean nfs_export_all_ro is enabled. If this setting is disabled, it should be enabled as it allows NFS to export read-only mounts. To enable the nfs_export_all_ro SELinux boolean, run the following command:

$ sudo setsebool -P nfs_export_all_ro on

Rationale

Enable the nfs_export_all_rw SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_nfs_export_all_rw medium

Enable the nfs_export_all_rw SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_nfs_export_all_rw
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean nfs_export_all_rw is enabled. If this setting is disabled, it should be enabled as it allows NFS to export read/write mounts. To enable the nfs_export_all_rw SELinux boolean, run the following command:

$ sudo setsebool -P nfs_export_all_rw on

Rationale

Disable the nis_enabled SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_nis_enabled medium

Disable the nis_enabled SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_nis_enabled
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean nis_enabled is disabled. If this setting is enabled, it should be disabled. To disable the nis_enabled SELinux boolean, run the following command:

$ sudo setsebool -P nis_enabled off

Rationale

Enable the nscd_use_shm SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_nscd_use_shm medium

Enable the nscd_use_shm SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_nscd_use_shm
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean nscd_use_shm is enabled. If this setting is disabled, it should be enabled to allow nscd to use shared memory. To enable the nscd_use_shm SELinux boolean, run the following command:

$ sudo setsebool -P nscd_use_shm on

Rationale

Disable the openshift_use_nfs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_openshift_use_nfs medium

Disable the openshift_use_nfs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_openshift_use_nfs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean openshift_use_nfs is disabled. If this setting is enabled, it should be disabled. To disable the openshift_use_nfs SELinux boolean, run the following command:

$ sudo setsebool -P openshift_use_nfs off

Rationale

Disable the openvpn_can_network_connect SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_openvpn_can_network_connect medium

Disable the openvpn_can_network_connect SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_openvpn_can_network_connect
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean openvpn_can_network_connect is enabled. This setting should be disabled. To disable the openvpn_can_network_connect SELinux boolean, run the following command:

$ sudo setsebool -P openvpn_can_network_connect off

Rationale

Disable the openvpn_enable_homedirs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_openvpn_enable_homedirs medium

Disable the openvpn_enable_homedirs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_openvpn_enable_homedirs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean openvpn_enable_homedirs is enabled. This setting should be disabled. To disable the openvpn_enable_homedirs SELinux boolean, run the following command:

$ sudo setsebool -P openvpn_enable_homedirs off

Rationale

Disable the openvpn_run_unconfined SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_openvpn_run_unconfined medium

Disable the openvpn_run_unconfined SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_openvpn_run_unconfined
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean openvpn_run_unconfined is disabled. If this setting is enabled, it should be disabled. To disable the openvpn_run_unconfined SELinux boolean, run the following command:

$ sudo setsebool -P openvpn_run_unconfined off

Rationale

Disable the pcp_bind_all_unreserved_ports SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_pcp_bind_all_unreserved_ports medium

Disable the pcp_bind_all_unreserved_ports SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_pcp_bind_all_unreserved_ports
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean pcp_bind_all_unreserved_ports is disabled. If this setting is enabled, it should be disabled. To disable the pcp_bind_all_unreserved_ports SELinux boolean, run the following command:

$ sudo setsebool -P pcp_bind_all_unreserved_ports off

Rationale

Disable the pcp_read_generic_logs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_pcp_read_generic_logs medium

Disable the pcp_read_generic_logs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_pcp_read_generic_logs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean pcp_read_generic_logs is disabled. If this setting is enabled, it should be disabled. To disable the pcp_read_generic_logs SELinux boolean, run the following command:

$ sudo setsebool -P pcp_read_generic_logs off

Rationale

Disable the piranha_lvs_can_network_connect SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_piranha_lvs_can_network_connect medium

Disable the piranha_lvs_can_network_connect SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_piranha_lvs_can_network_connect
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean piranha_lvs_can_network_connect is disabled. If this setting is enabled, it should be disabled. To disable the piranha_lvs_can_network_connect SELinux boolean, run the following command:

$ sudo setsebool -P piranha_lvs_can_network_connect off

Rationale

Disable the polipo_connect_all_unreserved SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_polipo_connect_all_unreserved medium

Disable the polipo_connect_all_unreserved SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_polipo_connect_all_unreserved
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean polipo_connect_all_unreserved is disabled. If this setting is enabled, it should be disabled. To disable the polipo_connect_all_unreserved SELinux boolean, run the following command:

$ sudo setsebool -P polipo_connect_all_unreserved off

Rationale

Disable the polipo_session_bind_all_unreserved_ports SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_polipo_session_bind_all_unreserved_ports medium

Disable the polipo_session_bind_all_unreserved_ports SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_polipo_session_bind_all_unreserved_ports
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean polipo_session_bind_all_unreserved_ports is disabled. If this setting is enabled, it should be disabled. To disable the polipo_session_bind_all_unreserved_ports SELinux boolean, run the following command:

$ sudo setsebool -P polipo_session_bind_all_unreserved_ports off

Rationale

Disable the polipo_session_users SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_polipo_session_users medium

Disable the polipo_session_users SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_polipo_session_users
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean polipo_session_users is disabled. If this setting is enabled, it should be disabled. To disable the polipo_session_users SELinux boolean, run the following command:

$ sudo setsebool -P polipo_session_users off

Rationale

Disable the polipo_use_cifs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_polipo_use_cifs medium

Disable the polipo_use_cifs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_polipo_use_cifs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean polipo_use_cifs is disabled. If this setting is enabled, it should be disabled. To disable the polipo_use_cifs SELinux boolean, run the following command:

$ sudo setsebool -P polipo_use_cifs off

Rationale

Disable the polipo_use_nfs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_polipo_use_nfs medium

Disable the polipo_use_nfs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_polipo_use_nfs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean polipo_use_nfs is disabled. If this setting is enabled, it should be disabled. To disable the polipo_use_nfs SELinux boolean, run the following command:

$ sudo setsebool -P polipo_use_nfs off

Rationale

Disable the polyinstantiation_enabled SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_polyinstantiation_enabled medium

Disable the polyinstantiation_enabled SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_polyinstantiation_enabled
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean polyinstantiation_enabled is disabled. If this setting is enabled, it should be disabled. To disable the polyinstantiation_enabled SELinux boolean, run the following command:

$ sudo setsebool -P polyinstantiation_enabled off

Rationale

Enable the postfix_local_write_mail_spool SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_postfix_local_write_mail_spool medium

Enable the postfix_local_write_mail_spool SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_postfix_local_write_mail_spool
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean postfix_local_write_mail_spool is enabled. If this setting is disabled, it should be enabled as it allows Postfix to write to the mail spool directories. To enable the postfix_local_write_mail_spool SELinux boolean, run the following command:

$ sudo setsebool -P postfix_local_write_mail_spool on

Rationale

Disable the postgresql_can_rsync SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_postgresql_can_rsync medium

Disable the postgresql_can_rsync SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_postgresql_can_rsync
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean postgresql_can_rsync is disabled. If this setting is enabled, it should be disabled. To disable the postgresql_can_rsync SELinux boolean, run the following command:

$ sudo setsebool -P postgresql_can_rsync off

Rationale

Disable the postgresql_selinux_transmit_client_label SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_postgresql_selinux_transmit_client_label medium

Disable the postgresql_selinux_transmit_client_label SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_postgresql_selinux_transmit_client_label
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean postgresql_selinux_transmit_client_label is disabled. If this setting is enabled, it should be disabled. To disable the postgresql_selinux_transmit_client_label SELinux boolean, run the following command:

$ sudo setsebool -P postgresql_selinux_transmit_client_label off

Rationale

Enable the postgresql_selinux_unconfined_dbadm SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_postgresql_selinux_unconfined_dbadm medium

Enable the postgresql_selinux_unconfined_dbadm SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_postgresql_selinux_unconfined_dbadm
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean postgresql_selinux_unconfined_dbadm is enabled. If this setting is disabled, it should be enabled as it allows Database Administrators to execute Data Manipulation Language (DML) statements. To enable the postgresql_selinux_unconfined_dbadm SELinux boolean, run the following command:

$ sudo setsebool -P postgresql_selinux_unconfined_dbadm on

Rationale

Enable the postgresql_selinux_users_ddl SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_postgresql_selinux_users_ddl medium

Enable the postgresql_selinux_users_ddl SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_postgresql_selinux_users_ddl
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean postgresql_selinux_users_ddl is enabled. If this setting is disabled, it should be enabled as it allows Database Administrators to execute Data Definition Language (DDL) statements. To enable the postgresql_selinux_users_ddl SELinux boolean, run the following command:

$ sudo setsebool -P postgresql_selinux_users_ddl on

Rationale

Disable the pppd_can_insmod SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_pppd_can_insmod medium

Disable the pppd_can_insmod SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_pppd_can_insmod
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean pppd_can_insmod is disabled. If this setting is enabled, it should be disabled. To disable the pppd_can_insmod SELinux boolean, run the following command:

$ sudo setsebool -P pppd_can_insmod off

Rationale

Disable the pppd_for_user SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_pppd_for_user medium

Disable the pppd_for_user SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_pppd_for_user
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean pppd_for_user is disabled. If this setting is enabled, it should be disabled. To disable the pppd_for_user SELinux boolean, run the following command:

$ sudo setsebool -P pppd_for_user off

Rationale

Disable the privoxy_connect_any SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_privoxy_connect_any medium

Disable the privoxy_connect_any SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_privoxy_connect_any
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean privoxy_connect_any is enabled. This setting should be disabled. To disable the privoxy_connect_any SELinux boolean, run the following command:

$ sudo setsebool -P privoxy_connect_any off

Rationale

Disable the prosody_bind_http_port SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_prosody_bind_http_port medium

Disable the prosody_bind_http_port SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_prosody_bind_http_port
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean prosody_bind_http_port is disabled. If this setting is enabled, it should be disabled. To disable the prosody_bind_http_port SELinux boolean, run the following command:

$ sudo setsebool -P prosody_bind_http_port off

Rationale

Disable the puppetagent_manage_all_files SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_puppetagent_manage_all_files medium

Disable the puppetagent_manage_all_files SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_puppetagent_manage_all_files
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean puppetagent_manage_all_files is disabled. If this setting is enabled, it should be disabled. To disable the puppetagent_manage_all_files SELinux boolean, run the following command:

$ sudo setsebool -P puppetagent_manage_all_files off

Rationale

Disable the puppetmaster_use_db SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_puppetmaster_use_db medium

Disable the puppetmaster_use_db SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_puppetmaster_use_db
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean puppetmaster_use_db is disabled. If this setting is enabled, it should be disabled. To disable the puppetmaster_use_db SELinux boolean, run the following command:

$ sudo setsebool -P puppetmaster_use_db off

Rationale

Disable the racoon_read_shadow SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_racoon_read_shadow medium

Disable the racoon_read_shadow SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_racoon_read_shadow
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean racoon_read_shadow is disabled. If this setting is enabled, it should be disabled. To disable the racoon_read_shadow SELinux boolean, run the following command:

$ sudo setsebool -P racoon_read_shadow off

Rationale

Disable the rsync_anon_write SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_rsync_anon_write medium

Disable the rsync_anon_write SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_rsync_anon_write
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean rsync_anon_write is disabled. If this setting is enabled, it should be disabled. To disable the rsync_anon_write SELinux boolean, run the following command:

$ sudo setsebool -P rsync_anon_write off

Rationale

Disable the rsync_client SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_rsync_client medium

Disable the rsync_client SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_rsync_client
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean rsync_client is disabled. If this setting is enabled, it should be disabled. To disable the rsync_client SELinux boolean, run the following command:

$ sudo setsebool -P rsync_client off

Rationale

Disable the rsync_export_all_ro SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_rsync_export_all_ro medium

Disable the rsync_export_all_ro SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_rsync_export_all_ro
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean rsync_export_all_ro is disabled. If this setting is enabled, it should be disabled. To disable the rsync_export_all_ro SELinux boolean, run the following command:

$ sudo setsebool -P rsync_export_all_ro off

Rationale

Disable the rsync_full_access SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_rsync_full_access medium

Disable the rsync_full_access SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_rsync_full_access
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean rsync_full_access is disabled. If this setting is enabled, it should be disabled. To disable the rsync_full_access SELinux boolean, run the following command:

$ sudo setsebool -P rsync_full_access off

Rationale

Disable the samba_create_home_dirs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_samba_create_home_dirs medium

Disable the samba_create_home_dirs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_samba_create_home_dirs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean samba_create_home_dirs is disabled. If this setting is enabled, it should be disabled. To disable the samba_create_home_dirs SELinux boolean, run the following command:

$ sudo setsebool -P samba_create_home_dirs off

Rationale

Disable the samba_domain_controller SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_samba_domain_controller medium

Disable the samba_domain_controller SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_samba_domain_controller
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean samba_domain_controller is disabled. If this setting is enabled, it should be disabled. To disable the samba_domain_controller SELinux boolean, run the following command:

$ sudo setsebool -P samba_domain_controller off

Rationale

Disable the samba_enable_home_dirs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_samba_enable_home_dirs medium

Disable the samba_enable_home_dirs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_samba_enable_home_dirs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean samba_enable_home_dirs is disabled. If this setting is enabled, it should be disabled. To disable the samba_enable_home_dirs SELinux boolean, run the following command:

$ sudo setsebool -P samba_enable_home_dirs off

Rationale

Disable the samba_export_all_ro SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_samba_export_all_ro medium

Disable the samba_export_all_ro SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_samba_export_all_ro
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean samba_export_all_ro is disabled. If this setting is enabled, it should be disabled. To disable the samba_export_all_ro SELinux boolean, run the following command:

$ sudo setsebool -P samba_export_all_ro off

Rationale

Disable the samba_export_all_rw SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_samba_export_all_rw medium

Disable the samba_export_all_rw SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_samba_export_all_rw
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean samba_export_all_rw is disabled. If this setting is enabled, it should be disabled. To disable the samba_export_all_rw SELinux boolean, run the following command:

$ sudo setsebool -P samba_export_all_rw off

Rationale

Disable the samba_load_libgfapi SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_samba_load_libgfapi medium

Disable the samba_load_libgfapi SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_samba_load_libgfapi
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean samba_load_libgfapi is disabled. If this setting is enabled, it should be disabled. To disable the samba_load_libgfapi SELinux boolean, run the following command:

$ sudo setsebool -P samba_load_libgfapi off

Rationale

Disable the samba_portmapper SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_samba_portmapper medium

Disable the samba_portmapper SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_samba_portmapper
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean samba_portmapper is disabled. If this setting is enabled, it should be disabled. To disable the samba_portmapper SELinux boolean, run the following command:

$ sudo setsebool -P samba_portmapper off

Rationale

Disable the samba_run_unconfined SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_samba_run_unconfined medium

Disable the samba_run_unconfined SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_samba_run_unconfined
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean samba_run_unconfined is disabled. If this setting is enabled, it should be disabled. To disable the samba_run_unconfined SELinux boolean, run the following command:

$ sudo setsebool -P samba_run_unconfined off

Rationale

Disable the samba_share_fusefs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_samba_share_fusefs medium

Disable the samba_share_fusefs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_samba_share_fusefs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean samba_share_fusefs is disabled. If this setting is enabled, it should be disabled. To disable the samba_share_fusefs SELinux boolean, run the following command:

$ sudo setsebool -P samba_share_fusefs off

Rationale

Disable the samba_share_nfs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_samba_share_nfs medium

Disable the samba_share_nfs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_samba_share_nfs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean samba_share_nfs is disabled. If this setting is enabled, it should be disabled. To disable the samba_share_nfs SELinux boolean, run the following command:

$ sudo setsebool -P samba_share_nfs off

Rationale

Disable the sanlock_use_fusefs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_sanlock_use_fusefs medium

Disable the sanlock_use_fusefs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_sanlock_use_fusefs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean sanlock_use_fusefs is disabled. If this setting is enabled, it should be disabled. To disable the sanlock_use_fusefs SELinux boolean, run the following command:

$ sudo setsebool -P sanlock_use_fusefs off

Rationale

Disable the sanlock_use_nfs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_sanlock_use_nfs medium

Disable the sanlock_use_nfs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_sanlock_use_nfs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean sanlock_use_nfs is disabled. If this setting is enabled, it should be disabled. To disable the sanlock_use_nfs SELinux boolean, run the following command:

$ sudo setsebool -P sanlock_use_nfs off

Rationale

Disable the sanlock_use_samba SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_sanlock_use_samba medium

Disable the sanlock_use_samba SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_sanlock_use_samba
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean sanlock_use_samba is disabled. If this setting is enabled, it should be disabled. To disable the sanlock_use_samba SELinux boolean, run the following command:

$ sudo setsebool -P sanlock_use_samba off

Rationale

Disable the saslauthd_read_shadow SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_saslauthd_read_shadow medium

Disable the saslauthd_read_shadow SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_saslauthd_read_shadow
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean saslauthd_read_shadow is disabled. If this setting is enabled, it should be disabled. To disable the saslauthd_read_shadow SELinux boolean, run the following command:

$ sudo setsebool -P saslauthd_read_shadow off

Rationale

Enable the secadm_exec_content SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_secadm_exec_content medium

Enable the secadm_exec_content SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_secadm_exec_content
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean secadm_exec_content is enabled. If this setting is disabled, it should be enabled. To enable the secadm_exec_content SELinux boolean, run the following command:

$ sudo setsebool -P secadm_exec_content on

Rationale

Disable the secure_mode_insmod SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_secure_mode_insmod medium

Disable the secure_mode_insmod SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_secure_mode_insmod
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean secure_mode_insmod is disabled. If this setting is enabled, it should be disabled. To disable the secure_mode_insmod SELinux boolean, run the following command:

$ sudo setsebool -P secure_mode_insmod off

Rationale

Disable the secure_mode SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_secure_mode medium

Disable the secure_mode SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_secure_mode
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean secure_mode is disabled. If this setting is enabled, it should be disabled. To disable the secure_mode SELinux boolean, run the following command:

$ sudo setsebool -P secure_mode off

Rationale

Disable the secure_mode_policyload SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_secure_mode_policyload medium

Disable the secure_mode_policyload SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_secure_mode_policyload
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean secure_mode_policyload is disabled. If this setting is enabled, it should be disabled. To disable the secure_mode_policyload SELinux boolean, run the following command:

$ sudo setsebool -P secure_mode_policyload off

Rationale

Configure the selinuxuser_direct_dri_enabled SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_selinuxuser_direct_dri_enabled medium

Configure the selinuxuser_direct_dri_enabled SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_selinuxuser_direct_dri_enabled
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean selinuxuser_direct_dri_enabled is enabled. If XWindows is not installed or used on the system, this setting should be disabled. Otherwise, enable it. To disable the selinuxuser_direct_dri_enabled SELinux boolean, run the following command:

$ sudo setsebool -P selinuxuser_direct_dri_enabled off

Rationale

Disable the selinuxuser_execheap SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_selinuxuser_execheap medium

Disable the selinuxuser_execheap SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_selinuxuser_execheap
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean selinuxuser_execheap is disabled. If this setting is enabled, it should be disabled. To disable the selinuxuser_execheap SELinux boolean, run the following command:

$ sudo setsebool -P selinuxuser_execheap off

Rationale

Enable the selinuxuser_execmod SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_selinuxuser_execmod medium

Enable the selinuxuser_execmod SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_selinuxuser_execmod
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean selinuxuser_execmod is enabled. If this setting is disabled, it should be enabled. To enable the selinuxuser_execmod SELinux boolean, run the following command:

$ sudo setsebool -P selinuxuser_execmod on

Rationale

disable the selinuxuser_execstack SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_selinuxuser_execstack medium

disable the selinuxuser_execstack SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_selinuxuser_execstack
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean selinuxuser_execstack is enabled. This setting should be disabled as unconfined executables should not be able to make their stack executable. To disable the selinuxuser_execstack SELinux boolean, run the following command:

$ sudo setsebool -P selinuxuser_execstack off

Rationale

Disable the selinuxuser_mysql_connect_enabled SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_selinuxuser_mysql_connect_enabled medium

Disable the selinuxuser_mysql_connect_enabled SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_selinuxuser_mysql_connect_enabled
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean selinuxuser_mysql_connect_enabled is disabled. If this setting is enabled, it should be disabled. To disable the selinuxuser_mysql_connect_enabled SELinux boolean, run the following command:

$ sudo setsebool -P selinuxuser_mysql_connect_enabled off

Rationale

Enable the selinuxuser_ping SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_selinuxuser_ping medium

Enable the selinuxuser_ping SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_selinuxuser_ping
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean selinuxuser_ping is enabled. If this setting is disabled, it should be enabled as it allows confined users to use ping and traceroute which is helpful for network troubleshooting. To enable the selinuxuser_ping SELinux boolean, run the following command:

$ sudo setsebool -P selinuxuser_ping on

Rationale

Disable the selinuxuser_postgresql_connect_enabled SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_selinuxuser_postgresql_connect_enabled medium

Disable the selinuxuser_postgresql_connect_enabled SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_selinuxuser_postgresql_connect_enabled
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean selinuxuser_postgresql_connect_enabled is disabled. If this setting is enabled, it should be disabled. To disable the selinuxuser_postgresql_connect_enabled SELinux boolean, run the following command:

$ sudo setsebool -P selinuxuser_postgresql_connect_enabled off

Rationale

Disable the selinuxuser_rw_noexattrfile SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_selinuxuser_rw_noexattrfile medium

Disable the selinuxuser_rw_noexattrfile SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_selinuxuser_rw_noexattrfile
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean selinuxuser_rw_noexattrfile is enabled. This setting should be disabled as users should not be able to read/write files on filesystems that do not have extended attributes e.g. FAT, CDROM, FLOPPY, etc. To disable the selinuxuser_rw_noexattrfile SELinux boolean, run the following command:

$ sudo setsebool -P selinuxuser_rw_noexattrfile off

Rationale

Disable the selinuxuser_share_music SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_selinuxuser_share_music medium

Disable the selinuxuser_share_music SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_selinuxuser_share_music
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean selinuxuser_share_music is disabled. If this setting is enabled, it should be disabled. To disable the selinuxuser_share_music SELinux boolean, run the following command:

$ sudo setsebool -P selinuxuser_share_music off

Rationale

Disable the selinuxuser_tcp_server SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_selinuxuser_tcp_server medium

Disable the selinuxuser_tcp_server SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_selinuxuser_tcp_server
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean selinuxuser_tcp_server is disabled. If this setting is enabled, it should be disabled. To disable the selinuxuser_tcp_server SELinux boolean, run the following command:

$ sudo setsebool -P selinuxuser_tcp_server off

Rationale

Disable the selinuxuser_udp_server SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_selinuxuser_udp_server medium

Disable the selinuxuser_udp_server SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_selinuxuser_udp_server
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean selinuxuser_udp_server is disabled. If this setting is enabled, it should be disabled. To disable the selinuxuser_udp_server SELinux boolean, run the following command:

$ sudo setsebool -P selinuxuser_udp_server off

Rationale

Disable the selinuxuser_use_ssh_chroot SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_selinuxuser_use_ssh_chroot medium

Disable the selinuxuser_use_ssh_chroot SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_selinuxuser_use_ssh_chroot
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean selinuxuser_use_ssh_chroot is disabled. If this setting is enabled, it should be disabled. To disable the selinuxuser_use_ssh_chroot SELinux boolean, run the following command:

$ sudo setsebool -P selinuxuser_use_ssh_chroot off

Rationale

Disable the sftpd_anon_write SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_sftpd_anon_write medium

Disable the sftpd_anon_write SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_sftpd_anon_write
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean sftpd_anon_write is disabled. If this setting is enabled, it should be disabled. To disable the sftpd_anon_write SELinux boolean, run the following command:

$ sudo setsebool -P sftpd_anon_write off

Rationale

Disable the sftpd_enable_homedirs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_sftpd_enable_homedirs medium

Disable the sftpd_enable_homedirs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_sftpd_enable_homedirs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean sftpd_enable_homedirs is disabled. If this setting is enabled, it should be disabled. To disable the sftpd_enable_homedirs SELinux boolean, run the following command:

$ sudo setsebool -P sftpd_enable_homedirs off

Rationale

Disable the sftpd_full_access SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_sftpd_full_access medium

Disable the sftpd_full_access SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_sftpd_full_access
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean sftpd_full_access is disabled. If this setting is enabled, it should be disabled. To disable the sftpd_full_access SELinux boolean, run the following command:

$ sudo setsebool -P sftpd_full_access off

Rationale

Disable the sftpd_write_ssh_home SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_sftpd_write_ssh_home medium

Disable the sftpd_write_ssh_home SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_sftpd_write_ssh_home
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean sftpd_write_ssh_home is disabled. If this setting is enabled, it should be disabled. To disable the sftpd_write_ssh_home SELinux boolean, run the following command:

$ sudo setsebool -P sftpd_write_ssh_home off

Rationale

Disable the sge_domain_can_network_connect SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_sge_domain_can_network_connect medium

Disable the sge_domain_can_network_connect SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_sge_domain_can_network_connect
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean sge_domain_can_network_connect is disabled. If this setting is enabled, it should be disabled. To disable the sge_domain_can_network_connect SELinux boolean, run the following command:

$ sudo setsebool -P sge_domain_can_network_connect off

Rationale

Disable the sge_use_nfs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_sge_use_nfs medium

Disable the sge_use_nfs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_sge_use_nfs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean sge_use_nfs is disabled. If this setting is enabled, it should be disabled. To disable the sge_use_nfs SELinux boolean, run the following command:

$ sudo setsebool -P sge_use_nfs off

Rationale

Disable the smartmon_3ware SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_smartmon_3ware medium

Disable the smartmon_3ware SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_smartmon_3ware
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean smartmon_3ware is disabled. If this setting is enabled, it should be disabled. To disable the smartmon_3ware SELinux boolean, run the following command:

$ sudo setsebool -P smartmon_3ware off

Rationale

Disable the smbd_anon_write SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_smbd_anon_write medium

Disable the smbd_anon_write SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_smbd_anon_write
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean smbd_anon_write is disabled. If this setting is enabled, it should be disabled. To disable the smbd_anon_write SELinux boolean, run the following command:

$ sudo setsebool -P smbd_anon_write off

Rationale

Disable the spamassassin_can_network SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_spamassassin_can_network medium

Disable the spamassassin_can_network SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_spamassassin_can_network
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean spamassassin_can_network is disabled. If this setting is enabled, it should be disabled. To disable the spamassassin_can_network SELinux boolean, run the following command:

$ sudo setsebool -P spamassassin_can_network off

Rationale

Enable the spamd_enable_home_dirs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_spamd_enable_home_dirs medium

Enable the spamd_enable_home_dirs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_spamd_enable_home_dirs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean spamd_enable_home_dirs is enabled. If this setting is disabled, it should be enabled. To enable the spamd_enable_home_dirs SELinux boolean, run the following command:

$ sudo setsebool -P spamd_enable_home_dirs on

Rationale

Disable the squid_connect_any SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_squid_connect_any medium

Disable the squid_connect_any SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_squid_connect_any
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean squid_connect_any is enabled. This setting should be disabled as squid should only connect on specified ports. To disable the squid_connect_any SELinux boolean, run the following command:

$ sudo setsebool -P squid_connect_any off

Rationale

Disable the squid_use_tproxy SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_squid_use_tproxy medium

Disable the squid_use_tproxy SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_squid_use_tproxy
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean squid_use_tproxy is disabled. If this setting is enabled, it should be disabled. To disable the squid_use_tproxy SELinux boolean, run the following command:

$ sudo setsebool -P squid_use_tproxy off

Rationale

Disable the ssh_chroot_rw_homedirs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_ssh_chroot_rw_homedirs medium

Disable the ssh_chroot_rw_homedirs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_ssh_chroot_rw_homedirs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean ssh_chroot_rw_homedirs is disabled. If this setting is enabled, it should be disabled. To disable the ssh_chroot_rw_homedirs SELinux boolean, run the following command:

$ sudo setsebool -P ssh_chroot_rw_homedirs off

Rationale

Disable the ssh_keysign SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_ssh_keysign medium

Disable the ssh_keysign SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_ssh_keysign
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean ssh_keysign is disabled. If this setting is enabled, it should be disabled. To disable the ssh_keysign SELinux boolean, run the following command:

$ sudo setsebool -P ssh_keysign off

Rationale

Enable the staff_exec_content SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_staff_exec_content medium

Enable the staff_exec_content SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_staff_exec_content
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean staff_exec_content is enabled. If this setting is disabled, it should be enabled. To enable the staff_exec_content SELinux boolean, run the following command:

$ sudo setsebool -P staff_exec_content on

Rationale

Disable the staff_use_svirt SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_staff_use_svirt medium

Disable the staff_use_svirt SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_staff_use_svirt
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean staff_use_svirt is disabled. If this setting is enabled, it should be disabled. To disable the staff_use_svirt SELinux boolean, run the following command:

$ sudo setsebool -P staff_use_svirt off

Rationale

Disable the swift_can_network SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_swift_can_network medium

Disable the swift_can_network SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_swift_can_network
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean swift_can_network is disabled. If this setting is enabled, it should be disabled. To disable the swift_can_network SELinux boolean, run the following command:

$ sudo setsebool -P swift_can_network off

Rationale

Enable the sysadm_exec_content SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_sysadm_exec_content medium

Enable the sysadm_exec_content SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_sysadm_exec_content
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean sysadm_exec_content is enabled. If this setting is disabled, it should be enabled. To enable the sysadm_exec_content SELinux boolean, run the following command:

$ sudo setsebool -P sysadm_exec_content on

Rationale

Disable the telepathy_connect_all_ports SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_telepathy_connect_all_ports medium

Disable the telepathy_connect_all_ports SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_telepathy_connect_all_ports
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean telepathy_connect_all_ports is disabled. If this setting is enabled, it should be disabled. To disable the telepathy_connect_all_ports SELinux boolean, run the following command:

$ sudo setsebool -P telepathy_connect_all_ports off

Rationale

Disable the telepathy_tcp_connect_generic_network_ports SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_telepathy_tcp_connect_generic_network_ports medium

Disable the telepathy_tcp_connect_generic_network_ports SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_telepathy_tcp_connect_generic_network_ports
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean telepathy_tcp_connect_generic_network_ports is enabled. This setting should be disabled as telepathy should not connect to any generic network ports. To disable the telepathy_tcp_connect_generic_network_ports SELinux boolean, run the following command:

$ sudo setsebool -P telepathy_tcp_connect_generic_network_ports off

Rationale

Disable the tftp_anon_write SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_tftp_anon_write medium

Disable the tftp_anon_write SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_tftp_anon_write
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean tftp_anon_write is disabled. If this setting is enabled, it should be disabled. To disable the tftp_anon_write SELinux boolean, run the following command:

$ sudo setsebool -P tftp_anon_write off

Rationale

Disable the tftp_home_dir SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_tftp_home_dir medium

Disable the tftp_home_dir SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_tftp_home_dir
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean tftp_home_dir is disabled. If this setting is enabled, it should be disabled. To disable the tftp_home_dir SELinux boolean, run the following command:

$ sudo setsebool -P tftp_home_dir off

Rationale

Disable the tmpreaper_use_nfs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_tmpreaper_use_nfs medium

Disable the tmpreaper_use_nfs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_tmpreaper_use_nfs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean tmpreaper_use_nfs is disabled. If this setting is enabled, it should be disabled. To disable the tmpreaper_use_nfs SELinux boolean, run the following command:

$ sudo setsebool -P tmpreaper_use_nfs off

Rationale

Disable the tmpreaper_use_samba SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_tmpreaper_use_samba medium

Disable the tmpreaper_use_samba SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_tmpreaper_use_samba
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean tmpreaper_use_samba is disabled. If this setting is enabled, it should be disabled. To disable the tmpreaper_use_samba SELinux boolean, run the following command:

$ sudo setsebool -P tmpreaper_use_samba off

Rationale

Disable the tor_bind_all_unreserved_ports SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_tor_bind_all_unreserved_ports medium

Disable the tor_bind_all_unreserved_ports SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_tor_bind_all_unreserved_ports
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean tor_bind_all_unreserved_ports is disabled. If this setting is enabled, it should be disabled. To disable the tor_bind_all_unreserved_ports SELinux boolean, run the following command:

$ sudo setsebool -P tor_bind_all_unreserved_ports off

Rationale

Disable the tor_can_network_relay SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_tor_can_network_relay medium

Disable the tor_can_network_relay SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_tor_can_network_relay
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean tor_can_network_relay is disabled. If this setting is enabled, it should be disabled. To disable the tor_can_network_relay SELinux boolean, run the following command:

$ sudo setsebool -P tor_can_network_relay off

Rationale

Enable the unconfined_chrome_sandbox_transition SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_unconfined_chrome_sandbox_transition medium

Enable the unconfined_chrome_sandbox_transition SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_unconfined_chrome_sandbox_transition
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean unconfined_chrome_sandbox_transition is enabled. If this setting is disabled, it should be enabled. To enable the unconfined_chrome_sandbox_transition SELinux boolean, run the following command:

$ sudo setsebool -P unconfined_chrome_sandbox_transition on

Rationale

Enable the unconfined_mozilla_plugin_transition SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_unconfined_mozilla_plugin_transition medium

Enable the unconfined_mozilla_plugin_transition SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_unconfined_mozilla_plugin_transition
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean unconfined_mozilla_plugin_transition is enabled. If this setting is disabled, it should be enabled. To enable the unconfined_mozilla_plugin_transition SELinux boolean, run the following command:

$ sudo setsebool -P unconfined_mozilla_plugin_transition on

Rationale

Disable the unprivuser_use_svirt SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_unprivuser_use_svirt medium

Disable the unprivuser_use_svirt SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_unprivuser_use_svirt
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean unprivuser_use_svirt is disabled. If this setting is enabled, it should be disabled. To disable the unprivuser_use_svirt SELinux boolean, run the following command:

$ sudo setsebool -P unprivuser_use_svirt off

Rationale

Disable the use_ecryptfs_home_dirs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_use_ecryptfs_home_dirs medium

Disable the use_ecryptfs_home_dirs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_use_ecryptfs_home_dirs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean use_ecryptfs_home_dirs is disabled. If this setting is enabled, it should be disabled. To disable the use_ecryptfs_home_dirs SELinux boolean, run the following command:

$ sudo setsebool -P use_ecryptfs_home_dirs off

Rationale

Disable the use_fusefs_home_dirs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_use_fusefs_home_dirs medium

Disable the use_fusefs_home_dirs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_use_fusefs_home_dirs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean use_fusefs_home_dirs is disabled. If this setting is enabled, it should be disabled. To disable the use_fusefs_home_dirs SELinux boolean, run the following command:

$ sudo setsebool -P use_fusefs_home_dirs off

Rationale

Disable the use_lpd_server SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_use_lpd_server medium

Disable the use_lpd_server SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_use_lpd_server
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean use_lpd_server is disabled. If this setting is enabled, it should be disabled. To disable the use_lpd_server SELinux boolean, run the following command:

$ sudo setsebool -P use_lpd_server off

Rationale

Disable the use_nfs_home_dirs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_use_nfs_home_dirs medium

Disable the use_nfs_home_dirs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_use_nfs_home_dirs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean use_nfs_home_dirs is disabled. If this setting is enabled, it should be disabled. To disable the use_nfs_home_dirs SELinux boolean, run the following command:

$ sudo setsebool -P use_nfs_home_dirs off

Rationale

Enable the user_exec_content SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_user_exec_content medium

Enable the user_exec_content SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_user_exec_content
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean user_exec_content is enabled. If this setting is disabled, it should be enabled. To enable the user_exec_content SELinux boolean, run the following command:

$ sudo setsebool -P user_exec_content on

Rationale

Disable the use_samba_home_dirs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_use_samba_home_dirs medium

Disable the use_samba_home_dirs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_use_samba_home_dirs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean use_samba_home_dirs is disabled. If this setting is enabled, it should be disabled. To disable the use_samba_home_dirs SELinux boolean, run the following command:

$ sudo setsebool -P use_samba_home_dirs off

Rationale

Disable the varnishd_connect_any SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_varnishd_connect_any medium

Disable the varnishd_connect_any SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_varnishd_connect_any
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean varnishd_connect_any is disabled. If this setting is enabled, it should be disabled. To disable the varnishd_connect_any SELinux boolean, run the following command:

$ sudo setsebool -P varnishd_connect_any off

Rationale

Disable the virt_read_qemu_ga_data SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_virt_read_qemu_ga_data medium

Disable the virt_read_qemu_ga_data SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_virt_read_qemu_ga_data
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean virt_read_qemu_ga_data is disabled. If this setting is enabled, it should be disabled. To disable the virt_read_qemu_ga_data SELinux boolean, run the following command:

$ sudo setsebool -P virt_read_qemu_ga_data off

Rationale

Disable the virt_rw_qemu_ga_data SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_virt_rw_qemu_ga_data medium

Disable the virt_rw_qemu_ga_data SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_virt_rw_qemu_ga_data
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean virt_rw_qemu_ga_data is disabled. If this setting is enabled, it should be disabled. To disable the virt_rw_qemu_ga_data SELinux boolean, run the following command:

$ sudo setsebool -P virt_rw_qemu_ga_data off

Rationale

Disable the virt_sandbox_use_all_caps SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_virt_sandbox_use_all_caps medium

Disable the virt_sandbox_use_all_caps SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_virt_sandbox_use_all_caps
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean virt_sandbox_use_all_caps is enabled. This setting is disabled as containers should not run with privileges. To disable the virt_sandbox_use_all_caps SELinux boolean, run the following command:

$ sudo setsebool -P virt_sandbox_use_all_caps off

Rationale

Enable the virt_sandbox_use_audit SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_virt_sandbox_use_audit medium

Enable the virt_sandbox_use_audit SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_virt_sandbox_use_audit
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean virt_sandbox_use_audit is enabled. If this setting is disabled, it should be enabled to allow sandboxed containers to send audit messages. To enable the virt_sandbox_use_audit SELinux boolean, run the following command:

$ sudo setsebool -P virt_sandbox_use_audit on

Rationale

Disable the virt_sandbox_use_mknod SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_virt_sandbox_use_mknod medium

Disable the virt_sandbox_use_mknod SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_virt_sandbox_use_mknod
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean virt_sandbox_use_mknod is disabled. If this setting is enabled, it should be disabled. To disable the virt_sandbox_use_mknod SELinux boolean, run the following command:

$ sudo setsebool -P virt_sandbox_use_mknod off

Rationale

Disable the virt_sandbox_use_nfs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_virt_sandbox_use_nfs medium

Disable the virt_sandbox_use_nfs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_virt_sandbox_use_nfs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean virt_sandbox_use_nfs is disabled. If this setting is enabled, it should be disabled. To disable the virt_sandbox_use_nfs SELinux boolean, run the following command:

$ sudo setsebool -P virt_sandbox_use_nfs off

Rationale

Disable the virt_sandbox_use_samba SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_virt_sandbox_use_samba medium

Disable the virt_sandbox_use_samba SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_virt_sandbox_use_samba
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean virt_sandbox_use_samba is disabled. If this setting is enabled, it should be disabled. To disable the virt_sandbox_use_samba SELinux boolean, run the following command:

$ sudo setsebool -P virt_sandbox_use_samba off

Rationale

Disable the virt_sandbox_use_sys_admin SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_virt_sandbox_use_sys_admin medium

Disable the virt_sandbox_use_sys_admin SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_virt_sandbox_use_sys_admin
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean virt_sandbox_use_sys_admin is disabled. If this setting is enabled, it should be disabled. To disable the virt_sandbox_use_sys_admin SELinux boolean, run the following command:

$ sudo setsebool -P virt_sandbox_use_sys_admin off

Rationale

Disable the virt_transition_userdomain SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_virt_transition_userdomain medium

Disable the virt_transition_userdomain SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_virt_transition_userdomain
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean virt_transition_userdomain is disabled. If this setting is enabled, it should be disabled. To disable the virt_transition_userdomain SELinux boolean, run the following command:

$ sudo setsebool -P virt_transition_userdomain off

Rationale

Disable the virt_use_comm SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_virt_use_comm medium

Disable the virt_use_comm SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_virt_use_comm
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean virt_use_comm is disabled. If this setting is enabled, it should be disabled. To disable the virt_use_comm SELinux boolean, run the following command:

$ sudo setsebool -P virt_use_comm off

Rationale

Disable the virt_use_execmem SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_virt_use_execmem medium

Disable the virt_use_execmem SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_virt_use_execmem
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean virt_use_execmem is disabled. If this setting is enabled, it should be disabled. To disable the virt_use_execmem SELinux boolean, run the following command:

$ sudo setsebool -P virt_use_execmem off

Rationale

Disable the virt_use_fusefs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_virt_use_fusefs medium

Disable the virt_use_fusefs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_virt_use_fusefs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean virt_use_fusefs is disabled. If this setting is enabled, it should be disabled. To disable the virt_use_fusefs SELinux boolean, run the following command:

$ sudo setsebool -P virt_use_fusefs off

Rationale

Disable the virt_use_nfs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_virt_use_nfs medium

Disable the virt_use_nfs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_virt_use_nfs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean virt_use_nfs is disabled. If this setting is enabled, it should be disabled. To disable the virt_use_nfs SELinux boolean, run the following command:

$ sudo setsebool -P virt_use_nfs off

Rationale

Disable the virt_use_rawip SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_virt_use_rawip medium

Disable the virt_use_rawip SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_virt_use_rawip
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean virt_use_rawip is disabled. If this setting is enabled, it should be disabled. To disable the virt_use_rawip SELinux boolean, run the following command:

$ sudo setsebool -P virt_use_rawip off

Rationale

Disable the virt_use_samba SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_virt_use_samba medium

Disable the virt_use_samba SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_virt_use_samba
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean virt_use_samba is disabled. If this setting is enabled, it should be disabled. To disable the virt_use_samba SELinux boolean, run the following command:

$ sudo setsebool -P virt_use_samba off

Rationale

Disable the virt_use_sanlock SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_virt_use_sanlock medium

Disable the virt_use_sanlock SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_virt_use_sanlock
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean virt_use_sanlock is disabled. If this setting is enabled, it should be disabled. To disable the virt_use_sanlock SELinux boolean, run the following command:

$ sudo setsebool -P virt_use_sanlock off

Rationale

Disable the virt_use_usb SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_virt_use_usb medium

Disable the virt_use_usb SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_virt_use_usb
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean virt_use_usb is enabled. This setting should be disabled. To disable the virt_use_usb SELinux boolean, run the following command:

$ sudo setsebool -P virt_use_usb off

Rationale

Disable the virt_use_xserver SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_virt_use_xserver medium

Disable the virt_use_xserver SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_virt_use_xserver
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean virt_use_xserver is disabled. If this setting is enabled, it should be disabled. To disable the virt_use_xserver SELinux boolean, run the following command:

$ sudo setsebool -P virt_use_xserver off

Rationale

Disable the webadm_manage_user_files SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_webadm_manage_user_files medium

Disable the webadm_manage_user_files SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_webadm_manage_user_files
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean webadm_manage_user_files is disabled. If this setting is enabled, it should be disabled. To disable the webadm_manage_user_files SELinux boolean, run the following command:

$ sudo setsebool -P webadm_manage_user_files off

Rationale

Disable the webadm_read_user_files SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_webadm_read_user_files medium

Disable the webadm_read_user_files SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_webadm_read_user_files
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean webadm_read_user_files is disabled. If this setting is enabled, it should be disabled. To disable the webadm_read_user_files SELinux boolean, run the following command:

$ sudo setsebool -P webadm_read_user_files off

Rationale

Disable the wine_mmap_zero_ignore SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_wine_mmap_zero_ignore medium

Disable the wine_mmap_zero_ignore SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_wine_mmap_zero_ignore
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean wine_mmap_zero_ignore is disabled. If this setting is enabled, it should be disabled. To disable the wine_mmap_zero_ignore SELinux boolean, run the following command:

$ sudo setsebool -P wine_mmap_zero_ignore off

Rationale

Disable the xdm_bind_vnc_tcp_port SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_xdm_bind_vnc_tcp_port medium

Disable the xdm_bind_vnc_tcp_port SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_xdm_bind_vnc_tcp_port
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean xdm_bind_vnc_tcp_port is disabled. If this setting is enabled, it should be disabled. To disable the xdm_bind_vnc_tcp_port SELinux boolean, run the following command:

$ sudo setsebool -P xdm_bind_vnc_tcp_port off

Rationale

Disable the xdm_exec_bootloader SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_xdm_exec_bootloader medium

Disable the xdm_exec_bootloader SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_xdm_exec_bootloader
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean xdm_exec_bootloader is disabled. If this setting is enabled, it should be disabled. To disable the xdm_exec_bootloader SELinux boolean, run the following command:

$ sudo setsebool -P xdm_exec_bootloader off

Rationale

Disable the xdm_write_home SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_xdm_write_home medium

Disable the xdm_write_home SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_xdm_write_home
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean xdm_write_home is disabled. If this setting is enabled, it should be disabled. To disable the xdm_write_home SELinux boolean, run the following command:

$ sudo setsebool -P xdm_write_home off

Rationale

Enable the xend_run_blktap SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_xend_run_blktap medium

Enable the xend_run_blktap SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_xend_run_blktap
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean xend_run_blktap is enabled. If this setting is disabled, it should be enabled. To enable the xend_run_blktap SELinux boolean, run the following command:

$ sudo setsebool -P xend_run_blktap on

Rationale

Enable the xend_run_qemu SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_xend_run_qemu medium

Enable the xend_run_qemu SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_xend_run_qemu
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean xend_run_qemu is enabled. If this setting is disabled, it should be enabled. To enable the xend_run_qemu SELinux boolean, run the following command:

$ sudo setsebool -P xend_run_qemu on

Rationale

Disable the xen_use_nfs SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_xen_use_nfs medium

Disable the xen_use_nfs SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_xen_use_nfs
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean xen_use_nfs is disabled. If this setting is enabled, it should be disabled. To disable the xen_use_nfs SELinux boolean, run the following command:

$ sudo setsebool -P xen_use_nfs off

Rationale

Disable the xguest_connect_network SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_xguest_connect_network medium

Disable the xguest_connect_network SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_xguest_connect_network
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean xguest_connect_network is enabled. This setting should be disabled as guest users should not be able to configure NetworkManager. To disable the xguest_connect_network SELinux boolean, run the following command:

$ sudo setsebool -P xguest_connect_network off

Rationale

Disable the xguest_exec_content SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_xguest_exec_content medium

Disable the xguest_exec_content SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_xguest_exec_content
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean xguest_exec_content is enabled. This setting should be disabled as guest users should not be able to run executables. To disable the xguest_exec_content SELinux boolean, run the following command:

$ sudo setsebool -P xguest_exec_content off

Rationale

Disable the xguest_mount_media SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_xguest_mount_media medium

Disable the xguest_mount_media SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_xguest_mount_media
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean xguest_mount_media is enabled. This setting should be disabled as guest users should not be able to mount any media. To disable the xguest_mount_media SELinux boolean, run the following command:

$ sudo setsebool -P xguest_mount_media off

Rationale

Disable the xguest_use_bluetooth SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_xguest_use_bluetooth medium

Disable the xguest_use_bluetooth SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_xguest_use_bluetooth
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean xguest_use_bluetooth is enabled. This setting should be disabled as guests users should not be able to access or use bluetooth. To disable the xguest_use_bluetooth SELinux boolean, run the following command:

$ sudo setsebool -P xguest_use_bluetooth off

Rationale

Disable the xserver_clients_write_xshm SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_xserver_clients_write_xshm medium

Disable the xserver_clients_write_xshm SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_xserver_clients_write_xshm
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean xserver_clients_write_xshm is disabled. If this setting is enabled, it should be disabled. To disable the xserver_clients_write_xshm SELinux boolean, run the following command:

$ sudo setsebool -P xserver_clients_write_xshm off

Rationale

Disable the xserver_execmem SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_xserver_execmem medium

Disable the xserver_execmem SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_xserver_execmem
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean xserver_execmem is disabled. If this setting is enabled, it should be disabled. To disable the xserver_execmem SELinux boolean, run the following command:

$ sudo setsebool -P xserver_execmem off

Rationale

Disable the xserver_object_manager SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_xserver_object_manager medium

Disable the xserver_object_manager SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_xserver_object_manager
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean xserver_object_manager is disabled. If this setting is enabled, it should be disabled. To disable the xserver_object_manager SELinux boolean, run the following command:

$ sudo setsebool -P xserver_object_manager off

Rationale

Disable the zabbix_can_network SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_zabbix_can_network medium

Disable the zabbix_can_network SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_zabbix_can_network
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean zabbix_can_network is disabled. If this setting is enabled, it should be disabled. To disable the zabbix_can_network SELinux boolean, run the following command:

$ sudo setsebool -P zabbix_can_network off

Rationale

Disable the zarafa_setrlimit SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_zarafa_setrlimit medium

Disable the zarafa_setrlimit SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_zarafa_setrlimit
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean zarafa_setrlimit is disabled. If this setting is enabled, it should be disabled. To disable the zarafa_setrlimit SELinux boolean, run the following command:

$ sudo setsebool -P zarafa_setrlimit off

Rationale

Disable the zebra_write_config SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_zebra_write_config medium

Disable the zebra_write_config SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_zebra_write_config
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean zebra_write_config is disabled. If this setting is enabled, it should be disabled. To disable the zebra_write_config SELinux boolean, run the following command:

$ sudo setsebool -P zebra_write_config off

Rationale

Disable the zoneminder_anon_write SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_zoneminder_anon_write medium

Disable the zoneminder_anon_write SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_zoneminder_anon_write
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean zoneminder_anon_write is disabled. If this setting is enabled, it should be disabled. To disable the zoneminder_anon_write SELinux boolean, run the following command:

$ sudo setsebool -P zoneminder_anon_write off

Rationale

Disable the zoneminder_run_sudo SELinux Booleanxccdf_org.ssgproject.content_rule_sebool_zoneminder_run_sudo medium

Disable the zoneminder_run_sudo SELinux Boolean

Rule IDxccdf_org.ssgproject.content_rule_sebool_zoneminder_run_sudo
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  TBD, TBD, TBD

Description

By default, the SELinux boolean zoneminder_run_sudo is disabled. If this setting is enabled, it should be disabled. To disable the zoneminder_run_sudo SELinux boolean, run the following command:

$ sudo setsebool -P zoneminder_run_sudo off

Rationale

Ensure SELinux Not Disabled in /etc/default/grubxccdf_org.ssgproject.content_rule_enable_selinux_bootloader medium

Ensure SELinux Not Disabled in /etc/default/grub

Rule IDxccdf_org.ssgproject.content_rule_enable_selinux_bootloader
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-3, AC-3(3), AC-3(4), AC-4, AC-6, AU-9, SI-6(a), 22, 32, 1.4.1, 3.1.2, 3.7.2

Description

SELinux can be disabled at boot time by an argument in /etc/default/grub. Remove any instances of selinux=0 from the kernel arguments in that file to prevent SELinux from being disabled at boot.

Rationale

Disabling a major host protection feature, such as SELinux, at boot time prevents it from confining system services at boot time. Further, it increases the chances that it will remain off during system operation.

Ensure SELinux State is Enforcingxccdf_org.ssgproject.content_rule_selinux_state high

Ensure SELinux State is Enforcing

Rule IDxccdf_org.ssgproject.content_rule_selinux_state
Result
pass
Time2017-10-21T14:39:49
Severityhigh
Identifiers and References

References:  AC-3, AC-3(3), AC-3(4), AC-4, AC-6, AU-9, SI-6(a), 2165, 2696, 1.4.2, SRG-OS-000445-GPOS-00199, 3.1.2, 3.7.2

Description

The SELinux state should be set to enforcing at system boot time. In the file /etc/selinux/config, add or correct the following line to configure the system to boot into enforcing mode:

SELINUX=enforcing

Rationale

Setting the SELinux state to enforcing ensures SELinux is able to confine potentially compromised processes to the security policy, which is designed to prevent them from causing damage to the system or further elevating their privileges.

OVAL details

Items found satisfying /selinux/enforce is 1:

PathContent
/etc/selinux/configSELINUX=enforcing
Configure SELinux Policyxccdf_org.ssgproject.content_rule_selinux_policytype high

Configure SELinux Policy

Rule IDxccdf_org.ssgproject.content_rule_selinux_policytype
Result
pass
Time2017-10-21T14:39:49
Severityhigh
Identifiers and References

References:  AC-3, AC-3(3), AC-3(4), AC-4, AC-6, AU-9, SI-6(a), 2696, 1.4.3, SRG-OS-000445-GPOS-00199, 3.1.2, 3.7.2

Description

The SELinux targeted policy is appropriate for general-purpose desktops and servers, as well as systems in many other roles. To configure the system to use this policy, add or correct the following line in /etc/selinux/config:

SELINUXTYPE=targeted
Other policies, such as mls, provide additional security labeling and greater confinement but are not compatible with many general-purpose use cases.

Rationale

Setting the SELinux policy to targeted or a more specialized policy ensures the system will confine processes that are likely to be targeted for exploitation, such as network or system services.

Note: During the development or debugging of SELinux modules, it is common to temporarily place non-production systems in permissive mode. In such temporary cases, SELinux policies should be developed, and once work is completed, the system should be reconfigured to targeted.

OVAL details

Items found satisfying Tests the value of the ^[\s]*SELINUXTYPE[\s]*=[\s]*([^#]*) expression in the /etc/selinux/config file:

PathContent
/etc/selinux/configSELINUXTYPE=targeted
Uninstall setroubleshoot Packagexccdf_org.ssgproject.content_rule_package_setroubleshoot_removed low

Uninstall setroubleshoot Package

Rule IDxccdf_org.ssgproject.content_rule_package_setroubleshoot_removed
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  1.4.4

Description

The SETroubleshoot service notifies desktop users of SELinux denials. The service provides information around configuration errors, unauthorized intrusions, and other potential errors. The setroubleshoot package can be removed with the following command:

$ sudo yum erase setroubleshoot

Rationale

The SETroubleshoot service is an unnecessary daemon to have running on a server

Uninstall mcstrans Packagexccdf_org.ssgproject.content_rule_package_mcstrans_removed low

Uninstall mcstrans Package

Rule IDxccdf_org.ssgproject.content_rule_package_mcstrans_removed
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References
Description

The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf. The mcstrans package can be removed with the following command:

$ sudo yum erase mcstrans

Rationale

Since this service is not used very often, disable it to reduce the amount of potentially vulnerable code running on the system. NOTE: This rule was added in support of the CIS RHEL6 v1.2.0 benchmark. Please note that Red Hat does not feel this rule is security relevant.

Ensure No Daemons are Unconfined by SELinuxxccdf_org.ssgproject.content_rule_selinux_confinement_of_daemons medium

Ensure No Daemons are Unconfined by SELinux

Rule IDxccdf_org.ssgproject.content_rule_selinux_confinement_of_daemons
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-6, AU-9, CM-7, 1.4.6, 3.1.2, 3.1.5, 3.7.2

Description

Daemons for which the SELinux policy does not contain rules will inherit the context of the parent process. Because daemons are launched during startup and descend from the init process, they inherit the initrc_t context.

To check for unconfined daemons, run the following command:

$ sudo ps -eZ | egrep "initrc" | egrep -vw "tr|ps|egrep|bash|awk" | tr ':' ' ' | awk '{ print $NF }'
It should produce no output in a well-configured system.

Rationale

Daemons which run with the initrc_t context may cause AVC denials, or allow privileges that the daemon does not require.

Ensure No Device Files are Unlabeled by SELinuxxccdf_org.ssgproject.content_rule_selinux_all_devicefiles_labeled medium

Ensure No Device Files are Unlabeled by SELinux

Rule IDxccdf_org.ssgproject.content_rule_selinux_all_devicefiles_labeled
Result
fail
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-6, AU-9, CM-3(f), CM-7, 22, 32, 368, 318, 1812, 1813, 1814, SRG-OS-000480-GPOS-00227, 3.1.2, 3.1.5, 3.7.2

Description

Device files, which are used for communication with important system resources, should be labeled with proper SELinux types. If any device files do not carry the SELinux type device_t, report the bug so that policy can be corrected. Supply information about what the device is and what programs use it.

To check for unlabeled device files, run the following command:

$ sudo find /dev -context *:device_t:* \( -type c -o -type b \) -printf "%p %Z\n"
It should produce no output in a well-configured system.

Rationale

If a device file carries the SELinux type device_t, then SELinux cannot properly restrict access to the device file.

OVAL details

Items found violating device_t in /dev:

FilepathPathFilenameUserRoleTypeLow sensitivityRawlow sensitivity
/dev/vmci/devvmcisystem_uobject_rdevice_ts0s0
/dev/char/10:58/dev/char10:58system_uobject_rdevice_ts0s0
Ensure SELinux support is enabled in Dockerxccdf_org.ssgproject.content_rule_docker_selinux_enabled high

Ensure SELinux support is enabled in Docker

Rule IDxccdf_org.ssgproject.content_rule_docker_selinux_enabled
Result
notselected
Time2017-10-21T14:39:49
Severityhigh
Identifiers and References
Description

To enable the SELinux for the Docker service, the Docker service must be configured to run the Docker daemon with --selinux-enabled option. In /etc/sysconfig/docker configuration file, add or correct the following line to enable SELinux support in the Docker daemon:

OPTIONS='--selinux-enabled'

Rationale

If SELinux is not explicitely enabled in the Docker daemon configuration, Docker does not use SELinux which means Docker runs unconfined, and SELinux will not provide security separation for Docker container processes. However enabling SELinux for the Docker service prevents an attacker or rogue container from attacking other container processes and content as well as prevents taking over the host operating system.

Direct root Logins Not Allowedxccdf_org.ssgproject.content_rule_no_direct_root_logins medium

Direct root Logins Not Allowed

Rule IDxccdf_org.ssgproject.content_rule_no_direct_root_logins
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  IA-2(1), 6.4, 3.1.1, 3.1.6

Description

To further limit access to the root account, administrators can disable root logins at the console by editing the /etc/securetty file. This file lists all devices the root user is allowed to login to. If the file does not exist at all, the root user can login through any communication device on the system, whether via the console or via a raw network interface. This is dangerous as user can login to the system as root via Telnet, which sends the password in plain text over the network. By default, Red Hat Enteprise Linux's /etc/securetty file only allows the root user to login at the console physically attached to the system. To prevent root from logging in, remove the contents of this file. To prevent direct root logins, remove the contents of this file by typing the following command:

$ sudo echo > /etc/securetty

Rationale

Disabling direct root logins ensures proper accountability and multifactor authentication to privileged accounts. Users will first login, then escalate to privileged (root) access via su / sudo. This is required for FISMA Low and FISMA Moderate systems.

Restrict Serial Port Root Loginsxccdf_org.ssgproject.content_rule_restrict_serial_port_logins low

Restrict Serial Port Root Logins

Rule IDxccdf_org.ssgproject.content_rule_restrict_serial_port_logins
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  AC-6(2), 770, 3.1.1, 3.1.5

Description

To restrict root logins on serial ports, ensure lines of this form do not appear in /etc/securetty:

ttyS0
ttyS1

Rationale

Preventing direct root login to serial port interfaces helps ensure accountability for actions taken on the systems using the root account.

Restrict Web Browser Use for Administrative Accountsxccdf_org.ssgproject.content_rule_no_root_webbrowsing low

Restrict Web Browser Use for Administrative Accounts

Rule IDxccdf_org.ssgproject.content_rule_no_root_webbrowsing
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References
Description

Enforce policy requiring administrative accounts use web browsers only for local service administration.

Rationale

If a browser vulnerability is exploited while running with administrative privileges, the entire system could be compromised. Specific exceptions for local service administration should be documented in site-defined policy.

Ensure that System Accounts Do Not Run a Shell Upon Loginxccdf_org.ssgproject.content_rule_no_shelllogin_for_systemaccounts medium

Ensure that System Accounts Do Not Run a Shell Upon Login

Rule IDxccdf_org.ssgproject.content_rule_no_shelllogin_for_systemaccounts
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-2, http://iase.disa.mil/stigs/cci/Pages/index.aspx

Description

Some accounts are not associated with a human user of the system, and exist to perform some administrative function. Should an attacker be able to log into these accounts, they should not be granted access to a shell.

The login shell for each local account is stored in the last field of each line in /etc/passwd. System accounts are those user accounts with a user ID less than UID_MIN, where value of UID_MIN directive is set in /etc/login.defs configuration file. In the default configuration UID_MIN is set to 1000, thus system accounts are those user accounts with a user ID less than 1000. The user ID is stored in the third field. If any system account SYSACCT (other than root) has a login shell, disable it with the command:

$ sudo usermod -s /sbin/nologin SYSACCT

Rationale

Ensuring shells are not given to system accounts upon login makes it more difficult for attackers to make use of system accounts.

Warnings
warning  Do not perform the steps in this section on the root account. Doing so might cause the system to become inaccessible.
Verify Only Root Has UID 0xccdf_org.ssgproject.content_rule_accounts_no_uid_except_zero high

Verify Only Root Has UID 0

Rule IDxccdf_org.ssgproject.content_rule_accounts_no_uid_except_zero
Result
pass
Time2017-10-21T14:39:49
Severityhigh
Identifiers and References

References:  AC-6, IA-2(1), IA-4, 366, SRG-OS-000480-GPOS-00227, 3.1.1, 3.1.5

Description

If any account other than root has a UID of 0, this misconfiguration should be investigated and the accounts other than root should be removed or have their UID changed.
If the account is associated with system commands or applications the UID should be changed to one greater than "0" but less than "1000." Otherwise assign a UID greater than "1000" that has not already been assigned.

Rationale

An account has root authority if it has a UID of 0. Multiple accounts with a UID of 0 afford more opportunity for potential intruders to guess a password for a privileged account. Proper configuration of sudo is recommended to afford multiple system administrators access to root privileges in an accountable manner.

OVAL details

Items not found satisfying test that there are no accounts with UID 0 except root in the /etc/passwd file:

Object oval:ssg-object_accounts_no_uid_except_root:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/passwd^(?!root:)[^:]*:[^:]*:01
Root Path Must Be Vendor Defaultxccdf_org.ssgproject.content_rule_root_path_default low

Root Path Must Be Vendor Default

Rule IDxccdf_org.ssgproject.content_rule_root_path_default
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  SA-8

Description

Assuming root shell is bash, edit the following files:

~/.profile
~/.bashrc
Change any PATH variables to the vendor default for root and remove any empty PATH entries or references to relative paths.

Rationale

The root account's executable search path must be the vendor default, and must contain only absolute paths.

Prevent Log In to Accounts With Empty Passwordxccdf_org.ssgproject.content_rule_no_empty_passwords high

Prevent Log In to Accounts With Empty Password

Rule IDxccdf_org.ssgproject.content_rule_no_empty_passwords
Result
pass
Time2017-10-21T14:39:49
Severityhigh
Identifiers and References

References:  AC-6, IA-5(b), IA-5(c), IA-5(1)(a), 366, SRG-OS-000480-GPOS-00227, Req-8.2.3, 5.5.2, 3.1.1, 3.1.5

Description

If an account is configured for password authentication but does not have an assigned password, it may be possible to log into the account without authentication. Remove any instances of the nullok option in /etc/pam.d/system-auth to prevent logins with empty passwords.

Rationale

If an account has an empty password, anyone could log in and run commands with the privileges of that account. Accounts with empty passwords should never be used in operational environments.

OVAL details

Items not found satisfying make sure nullok is not used in /etc/pam.d/system-auth:

Object oval:ssg-object_no_empty_passwords:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/pam.d/system-auth\s*nullok\s*1
Verify All Account Password Hashes are Shadowedxccdf_org.ssgproject.content_rule_accounts_password_all_shadowed medium

Verify All Account Password Hashes are Shadowed

Rule IDxccdf_org.ssgproject.content_rule_accounts_password_all_shadowed
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  IA-5(h), http://iase.disa.mil/stigs/cci/Pages/index.aspx, Req-8.2.1, 5.5.2, 3.5.10

Description

If any password hashes are stored in /etc/passwd (in the second field, instead of an x or *), the cause of this misconfiguration should be investigated. The account should have its password reset and the hash should be properly stored, or the account should be deleted entirely.

Rationale

The hashes for all user account passwords should be stored in the file /etc/shadow and never in /etc/passwd, which is readable by all users.

All GIDs referenced in /etc/passwd must be defined in /etc/groupxccdf_org.ssgproject.content_rule_gid_passwd_group_same low

All GIDs referenced in /etc/passwd must be defined in /etc/group

Rule IDxccdf_org.ssgproject.content_rule_gid_passwd_group_same
Result
pass
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  IA-2, 764, SRG-OS-000104-GPOS-00051, Req-8.5.a, 5.5.2

Description

Add a group to the system for each GID referenced without a corresponding group.

Rationale

If a user is assigned the Group Identifier (GID) of a group not existing on the system, and a group with the Gruop Identifier (GID) is subsequently created, the user may have unintended rights to any files associated with the group.

OVAL details

Items found satisfying Verify all GIDs referenced in /etc/passwd are defined in /etc/group:

PathContent
/etc/passwdroot:x:0:0:
/etc/passwdbin:x:1:1:
/etc/passwddaemon:x:2:2:
/etc/passwdadm:x:3:4:
/etc/passwdlp:x:4:7:
/etc/passwdsync:x:5:0:
/etc/passwdshutdown:x:6:0:
/etc/passwdhalt:x:7:0:
/etc/passwdmail:x:8:12:
/etc/passwdoperator:x:11:0:
/etc/passwdgames:x:12:100:
/etc/passwdftp:x:14:50:
/etc/passwdnobody:x:99:99:
/etc/passwdsystemd-network:x:192:192:
/etc/passwddbus:x:81:81:
/etc/passwdpolkitd:x:999:997:
/etc/passwdpostfix:x:89:89:
/etc/passwdchrony:x:998:996:
/etc/passwdsshd:x:74:74:
/etc/passwdopr:x:1000:1000:
Verify No netrc Files Existxccdf_org.ssgproject.content_rule_no_netrc_files medium

Verify No netrc Files Exist

Rule IDxccdf_org.ssgproject.content_rule_no_netrc_files
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  IA-5(h), AC-3, 196

Description

The .netrc files contain login information used to auto-login into FTP servers and reside in the user's home directory. These files may contain unencrypted passwords to remote FTP servers making them susceptible to access by unauthorized users and should not be used. Any .netrc files should be removed.

Rationale

Unencrypted passwords for remote FTP servers may be stored in .netrc files. DoD policy requires passwords be encrypted in storage and not used in access scripts.

Set Password Retry Prompts Permitted Per-Sessionxccdf_org.ssgproject.content_rule_accounts_password_pam_retry low

Set Password Retry Prompts Permitted Per-Session

Rule IDxccdf_org.ssgproject.content_rule_accounts_password_pam_retry
Result
fail
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  CM-6(b), IA-5(c), 366, 6.3.2, SRG-OS-000480-GPOS-00225, 5.5.3

Description

To configure the number of retry prompts that are permitted per-session:

Edit the pam_pwquality.so statement in /etc/pam.d/system-auth to show retry=3, or a lower value if site policy is more restrictive.

The DoD requirement is a maximum of 3 prompts per session.

Rationale

Setting the password retry prompts that are permitted on a per-session basis to a low value requires some software, such as SSH, to re-connect. This can slow down and draw additional attention to some types of password-guessing attacks. Note that this is different from account lockout, which is provided by the pam_faillock module.

OVAL details

Items not found violating check the configuration of /etc/pam.d/system-auth:

Object oval:ssg-obj_password_pam_cracklib_retry:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/pam.d/system-auth^\s*password\s+(?:(?:required)|(?:requisite))\s+pam_cracklib\.so.*retry=([0-9]*).*$1
State oval:ssg-state_password_pam_retry:ste:1 of type textfilecontent54_state
Subexpression
3

Items found violating check the configuration of /etc/pam.d/system-auth:

PathContent
/etc/pam.d/system-auth password requisite pam_pwquality.so try_first_pass local_users_only retry=3

Items found violating check the configuration of /etc/pam.d/system-auth:

PathContent
/etc/pam.d/system-auth password requisite pam_pwquality.so try_first_pass local_users_only retry=3
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable

var_password_pam_retry="3"

if grep -q "retry=" /etc/pam.d/system-auth; then   
	sed -i --follow-symlinks "s/\(retry *= *\).*/\1$var_password_pam_retry/" /etc/pam.d/system-auth
else
	sed -i --follow-symlinks "/pam_pwquality.so/ s/$/ retry=$var_password_pam_retry/" /etc/pam.d/system-auth
fi
Set Password Maximum Consecutive Repeating Charactersxccdf_org.ssgproject.content_rule_accounts_password_pam_maxrepeat medium

Set Password Maximum Consecutive Repeating Characters

Rule IDxccdf_org.ssgproject.content_rule_accounts_password_pam_maxrepeat
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  IA-5, IA-5(c), 195, SRG-OS-000072-GPOS-00040

Description

The pam_pwquality module's maxrepeat parameter controls requirements for consecutive repeating characters. When set to a positive number, it will reject passwords which contain more than that number of consecutive characters. Modify the maxrepeat setting in /etc/security/pwquality.conf to equal 2 to prevent a run of (2 + 1) or more identical characters.

Rationale

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.

Passwords with excessive repeating characters may be more vulnerable to password-guessing attacks.

OVAL details

Items found satisfying check the configuration of /etc/security/pwquality.conf:

PathContent
/etc/security/pwquality.confmaxrepeat = 2
Set Password to Maximum of Consecutive Repeating Characters from Same Character Classxccdf_org.ssgproject.content_rule_accounts_password_pam_maxclassrepeat medium

Set Password to Maximum of Consecutive Repeating Characters from Same Character Class

Rule IDxccdf_org.ssgproject.content_rule_accounts_password_pam_maxclassrepeat
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  IA-5, IA-5(c), 195, SRG-OS-000072-GPOS-00040

Description

The pam_pwquality module's maxclassrepeat parameter controls requirements for consecutive repeating characters from the same character class. When set to a positive number, it will reject passwords which contain more than that number of consecutive characters from the same character class. Modify the maxclassrepeat setting in /etc/security/pwquality.conf to equal 4 to prevent a run of (4 + 1) or more identical characters.

Rationale

Use of a complex password helps to increase the time and resources required to comrpomise 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 a password, the greater the number of possible combinations that need to be tested before the password is compromised.

OVAL details

Items found satisfying check the configuration of /etc/security/pwquality.conf:

PathContent
/etc/security/pwquality.confmaxclassrepeat = 4
Set Password Strength Minimum Digit Charactersxccdf_org.ssgproject.content_rule_accounts_password_pam_dcredit medium

Set Password Strength Minimum Digit Characters

Rule IDxccdf_org.ssgproject.content_rule_accounts_password_pam_dcredit
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  IA-5(1)(a), IA-5(b), IA-5(c), 194, 194, SRG-OS-000071-GPOS-00039, Req-8.2.3, 6.3.2

Description

The pam_pwquality module's dcredit parameter controls requirements for usage of digits in a password. When set to a negative number, any password will be required to contain that many digits. When set to a positive number, pam_pwquality will grant +1 additional length credit for each digit. Modify the dcredit setting in /etc/security/pwquality.conf to require the use of a digit in passwords.

Rationale

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 possble combinations that need to be tested before the password is compromised. Requiring digits makes password guessing attacks more difficult by ensuring a larger search space.

OVAL details

Items found satisfying check the configuration of /etc/security/pwquality.conf:

PathContent
/etc/security/pwquality.confdcredit = -1
Set Password Minimum Lengthxccdf_org.ssgproject.content_rule_accounts_password_pam_minlen medium

Set Password Minimum Length

Rule IDxccdf_org.ssgproject.content_rule_accounts_password_pam_minlen
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  IA-5(1)(a), 205, SRG-OS-000078-GPOS-00046, Req-8.2.3, 6.3.2

Description

The pam_pwquality module's minlen parameter controls requirements for minimum characters required in a password. Add minlen=15 after pam_pwquality to set minimum password length requirements.

Rationale

The shorter the password, the lower the number of possible combinations that need to be tested before the password is compromised.
Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. Password length is one factor of several that helps to determine strength and how long it takes to crack a password. Use of more characters in a password helps to exponentially increase the time and/or resources required to compromose the password.

OVAL details

Items found satisfying check the configuration of /etc/security/pwquality.conf:

PathContent
/etc/security/pwquality.confminlen = 15
Set Password Strength Minimum Uppercase Charactersxccdf_org.ssgproject.content_rule_accounts_password_pam_ucredit medium

Set Password Strength Minimum Uppercase Characters

Rule IDxccdf_org.ssgproject.content_rule_accounts_password_pam_ucredit
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  IA-5(b), IA-5(c), IA-5(1)(a), 192, SRG-OS-000069-GPOS-00037, Req-8.2.3, 6.3.2

Description

The pam_pwquality module's ucredit= parameter controls requirements for usage of uppercase letters in a password. When set to a negative number, any password will be required to contain that many uppercase characters. When set to a positive number, pam_pwquality will grant +1 additional length credit for each uppercase character. Modify the ucredit setting in /etc/security/pwquality.conf to require the use of an uppercase character in passwords.

Rationale

Use of a complex password helps to increase the time and resources reuiqred 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.

OVAL details

Items found satisfying check the configuration of /etc/security/pwquality.conf:

PathContent
/etc/security/pwquality.confucredit = -1
Set Password Strength Minimum Special Charactersxccdf_org.ssgproject.content_rule_accounts_password_pam_ocredit medium

Set Password Strength Minimum Special Characters

Rule IDxccdf_org.ssgproject.content_rule_accounts_password_pam_ocredit
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  IA-5(b), IA-5(c), IA-5(1)(a), 1619, SRG-OS-000266-GPOS-00101

Description

The pam_pwquality module's ocredit= parameter controls requirements for usage of special (or "other") characters in a password. When set to a negative number, any password will be required to contain that many special characters. When set to a positive number, pam_pwquality will grant +1 additional length credit for each special character. Modify the ocredit setting in /etc/security/pwquality.conf to equal -1 to require use of a special character in passwords.

Rationale

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 possble combinations that need to be tested before the password is compromised. Requiring a minimum number of special characters makes password guessing attacks more difficult by ensuring a larger search space.

OVAL details

Items found satisfying check the configuration of /etc/security/pwquality.conf:

PathContent
/etc/security/pwquality.confocredit = -1
Set Password Strength Minimum Lowercase Charactersxccdf_org.ssgproject.content_rule_accounts_password_pam_lcredit medium

Set Password Strength Minimum Lowercase Characters

Rule IDxccdf_org.ssgproject.content_rule_accounts_password_pam_lcredit
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  IA-5(b), IA-5(c), IA-5(1)(a), 193, SRG-OS-000070-GPOS-00038, Req-8.2.3

Description

The pam_pwquality module's lcredit parameter controls requirements for usage of lowercase letters in a password. When set to a negative number, any password will be required to contain that many lowercase characters. When set to a positive number, pam_pwquality will grant +1 additional length credit for each lowercase character. Modify the lcredit setting in /etc/security/pwquality.conf to require the use of a lowercase character in passwords.

Rationale

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 possble combinations that need to be tested before the password is compromised. Requiring a minimum number of lowercase characters makes password guessing attacks more difficult by ensuring a larger search space.

OVAL details

Items found satisfying check the configuration of /etc/security/pwquality.conf:

PathContent
/etc/security/pwquality.conflcredit = -1
Set Password Strength Minimum Different Charactersxccdf_org.ssgproject.content_rule_accounts_password_pam_difok medium

Set Password Strength Minimum Different Characters

Rule IDxccdf_org.ssgproject.content_rule_accounts_password_pam_difok
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  IA-5(b), IA-5(c), IA-5(1)(b), 195, SRG-OS-000072-GPOS-00040

Description

The pam_pwquality module's difok parameter sets the number of characters in a password that must not be present in and old password during a password change.

Modify the difok setting in /etc/security/pwquality.conf to equal 8 to require differing characters when changing passwords.

Rationale

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.

Requiring a minimum number of different characters during password changes ensures that newly changed passwords should not resemble previously compromised ones. Note that passwords which are changed on compromised systems will still be compromised, however.

OVAL details

Items found satisfying check the configuration of /etc/security/pwquality.conf:

PathContent
/etc/security/pwquality.confdifok = 8
Set Password Strength Minimum Different Categoriesxccdf_org.ssgproject.content_rule_accounts_password_pam_minclass medium

Set Password Strength Minimum Different Categories

Rule IDxccdf_org.ssgproject.content_rule_accounts_password_pam_minclass
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  IA-5, 195, SRG-OS-000072-GPOS-00040

Description

The pam_pwquality module's minclass parameter controls requirements for usage of different character classes, or types, of character that must exist in a password before it is considered valid. For example, setting this value to three (3) requires that any password must have characters from at least three different categories in order to be approved. The default value is zero (0), meaning there are no required classes. There are four categories available:

* Upper-case characters
* Lower-case characters
* Digits
* Special characters (for example, punctuation)
Modify the minclass setting in /etc/security/pwquality.conf entry to require 4 differing categories of characters when changing passwords.

Rationale

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.

Requiring a minimum number of character categories makes password guessing attacks more difficult by ensuring a larger search space.

OVAL details

Items found satisfying check the configuration of /etc/security/pwquality.conf:

PathContent
/etc/security/pwquality.confminclass = 4
Set Deny For Failed Password Attemptsxccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_deny medium

Set Deny For Failed Password Attempts

Rule IDxccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_deny
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-7(b), 2238, SRG-OS-000329-GPOS-00128, SRG-OS-000021-GPOS-00005, Req-8.1.6, 6.3.3, 5.5.3, 3.1.8

Description

To configure the system to lock out accounts after a number of incorrect login attempts using pam_faillock.so, modify the content of both /etc/pam.d/system-auth and /etc/pam.d/password-auth as follows:

  • add the following line immediately before the pam_unix.so statement in the AUTH section:
    auth required pam_faillock.so preauth silent deny=3 unlock_time=never fail_interval=900
  • add the following line immediately after the pam_unix.so statement in the AUTH section:
    auth [default=die] pam_faillock.so authfail deny=3 unlock_time=never fail_interval=900
  • add the following line immediately before the pam_unix.so statement in the ACCOUNT section:
    account required pam_faillock.so

Rationale

Locking out user accounts after a number of incorrect attempts prevents direct password guessing attacks.

OVAL details

Items found satisfying Check pam_faillock.so preauth silent present in /etc/pam.d/system-auth:

PathContent
/etc/pam.d/system-auth auth required pam_faillock.so preauth silent deny=3 unlock_time=never even_deny_root fail_interval=900 auth sufficient pam_unix.so try_first_pass

Items found satisfying Check maximum failed login attempts allowed in /etc/pam.d/system-auth (authfail):

PathContent
/etc/pam.d/system-auth auth sufficient pam_unix.so try_first_pass auth requisite pam_succeed_if.so uid >= 1000 quiet_success auth [default=die] pam_faillock.so authfail deny=3 unlock_time=never fail_interval=900

Items found satisfying Check if pam_faillock_so is called in account phase of /etc/pam.d/system-auth:

PathContent
/etc/pam.d/system-auth account required pam_faillock.so account required pam_unix.so

Items found satisfying Check pam_faillock.so preauth silent present in /etc/pam.d/password-auth:

PathContent
/etc/pam.d/password-auth auth required pam_faillock.so preauth silent deny=3 unlock_time=never even_deny_root fail_interval=900 auth sufficient pam_unix.so nullok try_first_pass

Items found satisfying Check maximum failed login attempts allowed in /etc/pam.d/password-auth (authfail):

PathContent
/etc/pam.d/password-auth auth sufficient pam_unix.so nullok try_first_pass auth requisite pam_succeed_if.so uid >= 1000 quiet_success auth [default=die] pam_faillock.so authfail deny=3 unlock_time=never fail_interval=900

Items found satisfying Check if pam_faillock_so is called in account phase of /etc/pam.d/password-auth:

PathContent
/etc/pam.d/password-auth account required pam_faillock.so account required pam_unix.so
Set Lockout Time For Failed Password Attemptsxccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_unlock_time medium

Set Lockout Time For Failed Password Attempts

Rule IDxccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_unlock_time
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-7(b), 002238, SRG-OS-000329-GPOS-00128, SRG-OS-000021-GPOS-00005, Req-8.1.7, 6.3.3, 5.5.3, 3.1.8

Description

To configure the system to lock out accounts after a number of incorrect login attempts and require an administrator to unlock the account using pam_faillock.so, modify the content of both /etc/pam.d/system-auth and /etc/pam.d/password-auth as follows:

  • add the following line immediately before the pam_unix.so statement in the AUTH section:
    auth required pam_faillock.so preauth silent deny=3 unlock_time=never fail_interval=900
  • add the following line immediately after the pam_unix.so statement in the AUTH section:
    auth [default=die] pam_faillock.so authfail deny=3 unlock_time=never fail_interval=900
  • add the following line immediately before the pam_unix.so statement in the ACCOUNT section:
    account required pam_faillock.so

Rationale

Locking out user accounts after a number of incorrect attempts prevents direct password guessing attacks. Ensuring that an administrator is involved in unlocking locked accounts draws appropriate attention to such situations.

OVAL details

Items found satisfying check preauth maximum failed login attempts allowed in /etc/pam.d/system-auth:

PathContent
/etc/pam.d/system-authauth required pam_faillock.so preauth silent deny=3 unlock_time=never even_deny_root fail_interval=900

Items found satisfying check authfail maximum failed login attempts allowed in /etc/pam.d/system-auth:

PathContent
/etc/pam.d/system-authauth [default=die] pam_faillock.so authfail deny=3 unlock_time=never fail_interval=900

Items found satisfying check authfail maximum failed login attempts allowed in /etc/pam.d/password-auth:

PathContent
/etc/pam.d/password-authauth [default=die] pam_faillock.so authfail deny=3 unlock_time=never fail_interval=900

Items found satisfying check preauth maximum failed login attempts allowed in /etc/pam.d/password-auth:

PathContent
/etc/pam.d/password-authauth required pam_faillock.so preauth silent deny=3 unlock_time=never even_deny_root fail_interval=900
Configure the root Account for Failed Password Attemptsxccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_deny_root medium

Configure the root Account for Failed Password Attempts

Rule IDxccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_deny_root
Result
fail
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-7(b), 2238, SRG-OS-000329-GPOS-00128, SRG-OS-000021-GPOS-00005

Description

To configure the system to lock out the root account after a number of incorrect login attempts using pam_faillock.so, modify the content of both /etc/pam.d/system-auth and /etc/pam.d/password-auth as follows:

  • Modify the following line in the AUTH section to add even_deny_root:
    auth required pam_faillock.so preauth silent even_deny_root deny=3 unlock_time=never fail_interval=900
  • Modify the following line in the AUTH section to add even_deny_root:
    auth [default=die] pam_faillock.so authfail even_deny_root deny=3 unlock_time=never fail_interval=900

Rationale

By limiting the number of failed logon attempts, the risk of unauthorized system access via user password guessing, otherwise known as brute-forcing, is reduced. Limits are imposed by locking the account.

OVAL details

Items found violating Check pam_faillock.so preauth silent present in /etc/pam.d/system-auth:

PathContent
/etc/pam.d/system-auth auth required pam_faillock.so preauth silent deny=3 unlock_time=never even_deny_root fail_interval=900 auth sufficient pam_unix.so try_first_pass

Items not found violating Check maximum failed login attempts allowed in /etc/pam.d/system-auth (authfail):

Object oval:ssg-object_pam_faillock_authfail_deny_root_system-auth:obj:1 of type textfilecontent54_object
BehaviorsFilepathPatternInstance
no value/etc/pam.d/system-auth[\n][\s]*auth[\s]+(?:(?:sufficient)|(?:\[.*default=die.*\]))[\s]+pam_unix\.so[^\n]+(?s).*[\n][\s]*auth[\s]+\[default=die\][\s]+pam_faillock\.so[\s]+authfail[\s]+[^\n]*even_deny_root[^\n]*[\n]1

Items found violating Check pam_faillock.so preauth silent present in /etc/pam.d/password-auth:

PathContent
/etc/pam.d/password-auth auth required pam_faillock.so preauth silent deny=3 unlock_time=never even_deny_root fail_interval=900 auth sufficient pam_unix.so nullok try_first_pass

Items not found violating Check maximum failed login attempts allowed in /etc/pam.d/password-auth (authfail):

Object oval:ssg-object_pam_faillock_authfail_deny_root_password-auth:obj:1 of type textfilecontent54_object
BehaviorsFilepathPatternInstance
no value/etc/pam.d/password-auth[\n][\s]*auth[\s]+(?:(?:sufficient)|(?:\[.*default=die.*\]))[\s]+pam_unix\.so[^\n]+(?s).*[\n][\s]*auth[\s]+\[default=die\][\s]+pam_faillock\.so[\s]+authfail[\s]+[^\n]*even_deny_root[^\n]*[\n]1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable

AUTH_FILES[0]="/etc/pam.d/system-auth"
AUTH_FILES[1]="/etc/pam.d/password-auth"

# This script fixes absence of pam_faillock.so in PAM stack or the
# absense of even_deny_root and deny=[0-9]+ in pam_faillock.so arguments
# When inserting auth pam_faillock.so entries,
# the entry with preauth argument will be added before pam_unix.so module
# and entry with authfail argument will be added before pam_deny.so module.

# The placement of pam_faillock.so entries will not be changed
# if they are already present

for pamFile in "${AUTH_FILES[@]}"
do
	# pam_faillock.so already present?
	if grep -q "^auth.*pam_faillock.so.*" $pamFile; then

		# pam_faillock.so present, preauth even_deny_root directive present?
		if ! grep -q "^auth.*required.*pam_faillock.so.*preauth.*even_deny_root" $pamFile; then
			# even_deny_root is not present
			sed -i --follow-symlinks "s/\(^auth.*required.*pam_faillock.so.*preauth.*\).*/\1 even_deny_root/" $pamFile
		fi

		# pam_faillock.so present, authfail even_deny_root directive present?
		if ! grep -q "^auth.*\[default=die\].*pam_faillock.so.*authfail.*even_deny_root" $pamFile; then
			# even_deny_root is not present
			sed -i --follow-symlinks "s/\(^auth.*\[default=die\].*pam_faillock.so.*authfail.*silent.*\).*/\1 even_deny_root/" $pamFile
		fi

	# pam_faillock.so not present yet
	else

		# insert pam_faillock.so preauth row with proper value of the 'deny' option before pam_unix.so
		sed -i --follow-symlinks "/^auth.*pam_unix.so.*/i auth        required      pam_faillock.so preauth silent even_deny_root" $pamFile
		# insert pam_faillock.so authfail row with proper value of the 'deny' option before pam_deny.so, after all modules which determine authentication outcome.
		sed -i --follow-symlinks "/^auth.*pam_deny.so.*/i auth        [default=die] pam_faillock.so authfail silent even_deny_root" $pamFile
	fi

done
Set Interval For Counting Failed Password Attemptsxccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_interval medium

Set Interval For Counting Failed Password Attempts

Rule IDxccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_interval
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-7(b), 2238, SRG-OS-000329-GPOS-00128, SRG-OS-000021-GPOS-00005

Description

Utilizing pam_faillock.so, the fail_interval directive configures the system to lock out an accounts after a number of incorrect login attempts within a specified time period. Modify the content of both /etc/pam.d/system-auth and /etc/pam.d/password-auth as follows:

  • Add the following line immediately before the pam_unix.so statement in the AUTH section:
    auth required pam_faillock.so preauth silent deny=3 unlock_time=never fail_interval=900
  • Add the following line immediately after the pam_unix.so statement in the AUTH section:
    auth [default=die] pam_faillock.so authfail deny=3 unlock_time=never fail_interval=900
  • Add the following line immediately before the pam_unix.so statement in the ACCOUNT section:
    account required pam_faillock.so

Rationale

By limiting the number of failed logon attempts the risk of unauthorized system access via user password guessing, otherwise known as brute-forcing, is reduced. Limits are imposed by locking the account.

OVAL details

Items found satisfying check maximum preauth fail_interval allowed in /etc/pam.d/system-auth:

PathContent
/etc/pam.d/system-authauth required pam_faillock.so preauth silent deny=3 unlock_time=never even_deny_root fail_interval=900

Items found satisfying check maximum authfail fail_interval allowed in /etc/pam.d/system-auth:

PathContent
/etc/pam.d/system-authauth [default=die] pam_faillock.so authfail deny=3 unlock_time=never fail_interval=900

Items found satisfying check maximum authfail fail_interval allowed in /etc/pam.d/password-auth:

PathContent
/etc/pam.d/password-authauth [default=die] pam_faillock.so authfail deny=3 unlock_time=never fail_interval=900

Items found satisfying check maximum preauth fail_interval allowed in /etc/pam.d/password-auth:

PathContent
/etc/pam.d/password-authauth required pam_faillock.so preauth silent deny=3 unlock_time=never even_deny_root fail_interval=900
Limit Password Reusexccdf_org.ssgproject.content_rule_accounts_password_pam_unix_remember medium

Limit Password Reuse

Rule IDxccdf_org.ssgproject.content_rule_accounts_password_pam_unix_remember
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  IA-5(f), IA-5(1)(e), 200, SRG-OS-000077-GPOS-00045, Req-8.2.5, 6.3.4, 5.6.2.1.1, 3.5.8

Description

Do not allow users to reuse recent passwords. This can be accomplished by using the remember option for the pam_unix or pam_pwhistory PAM modules.

In the file /etc/pam.d/system-auth, append remember=5 to the line which refers to the pam_unix.so or pam_pwhistory.somodule, as shown below:

  • for the pam_unix.so case:
    password sufficient pam_unix.so ...existing_options... remember=5
  • for the pam_pwhistory.so case:
    password requisite pam_pwhistory.so ...existing_options... remember=5
The DoD STIG requirement is 5 passwords.

Rationale

Preventing re-use of previous passwords helps ensure that a compromised password is not re-used by a user.

OVAL details

Items found satisfying Test if remember attribute of pam_unix.so is set correctly in /etc/pam.d/system-auth:

PathContent
/etc/pam.d/system-authpassword sufficient pam_unix.so sha512 shadow try_first_pass use_authtok remember=5

Items not found satisfying Test if remember attribute of pam_pwhistory.so is set correctly in /etc/pam.d/system-auth:

Object oval:ssg-object_accounts_password_pam_pwhistory_remember:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/pam.d/system-auth^\s*password\s+(?:(?:requisite)|(?:required))\s+pam_pwhistory\.so.*remember=([0-9]*).*$1
State oval:ssg-state_accounts_password_pam_unix_remember:ste:1 of type textfilecontent54_state
Subexpression
5
Set PAM's Password Hashing Algorithmxccdf_org.ssgproject.content_rule_set_password_hashing_algorithm_systemauth medium

Set PAM's Password Hashing Algorithm

Rule IDxccdf_org.ssgproject.content_rule_set_password_hashing_algorithm_systemauth
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  IA-5(b), IA-5(c), IA-5(1)(c), IA-7, 196, SRG-OS-000073-GPOS-00041, Req-8.2.1, 6.3.1, 5.6.2.2, 3.13.11

Description

The PAM system service can be configured to only store encrypted representations of passwords. In /etc/pam.d/system-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.

OVAL details

Items found satisfying check /etc/pam.d/system-auth for correct settings:

PathContent
/etc/pam.d/system-authpassword sufficient pam_unix.so sha512 shadow try_first_pass use_authtok remember=5
Set Password Hashing Algorithm in /etc/login.defsxccdf_org.ssgproject.content_rule_set_password_hashing_algorithm_logindefs medium

Set Password Hashing Algorithm in /etc/login.defs

Rule IDxccdf_org.ssgproject.content_rule_set_password_hashing_algorithm_logindefs
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  IA-5(b), IA-5(c), IA-5(1)(c), IA-7, 196, SRG-OS-000073-GPOS-00041, Req-8.2.1, 6.3.1, 5.6.2.2, 3.13.11

Description

In /etc/login.defs, add or correct the following line to ensure the system will use SHA-512 as the hashing algorithm:

ENCRYPT_METHOD SHA512

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 kept in plain text.

Using a stronger hashing algorithm makes password cracking attacks more difficult.

OVAL details

Items found satisfying The value of ENCRYPT_METHOD should be set appropriately in /etc/login.defs:

Var refValue
oval:ssg-variable_last_encrypt_method_instance_value:var:1SHA512
Set Password Hashing Algorithm in /etc/libuser.confxccdf_org.ssgproject.content_rule_set_password_hashing_algorithm_libuserconf medium

Set Password Hashing Algorithm in /etc/libuser.conf

Rule IDxccdf_org.ssgproject.content_rule_set_password_hashing_algorithm_libuserconf
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  IA-5(b), IA-5(c), IA-5(1)(c), IA-7, 196, SRG-OS-000073-GPOS-00041, Req-8.2.1, 5.6.2.2, 3.13.11

Description

In /etc/libuser.conf, add or correct the following line in its [defaults] section to ensure the system will use the SHA-512 algorithm for password hashing:

crypt_style = sha512

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.

OVAL details

Items found satisfying The password hashing algorithm should be set correctly in /etc/libuser.conf:

PathContent
/etc/libuser.conf crypt_style = sha512
Ensure that Root's Path Does Not Include Relative Paths or Null Directoriesxccdf_org.ssgproject.content_rule_root_path_no_dot low

Ensure that Root's Path Does Not Include Relative Paths or Null Directories

Rule IDxccdf_org.ssgproject.content_rule_root_path_no_dot
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  CM-6(b), 366

Description

Ensure that none of the directories in root's path is equal to a single . character, or that it contains any instances that lead to relative path traversal, such as .. or beginning a path without the slash (/) character. Also ensure that there are no "empty" elements in the path, such as in these examples:

PATH=:/bin
PATH=/bin:
PATH=/bin::/sbin
These empty elements have the same effect as a single . character.

Rationale

Including these entries increases the risk that root could execute code from an untrusted location.

Ensure that Root's Path Does Not Include World or Group-Writable Directoriesxccdf_org.ssgproject.content_rule_accounts_root_path_dirs_no_write low

Ensure that Root's Path Does Not Include World or Group-Writable Directories

Rule IDxccdf_org.ssgproject.content_rule_accounts_root_path_dirs_no_write
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  CM-6(b), 366

Description

For each element in root's path, run:

# ls -ld DIR
and ensure that write permissions are disabled for group and other.

Rationale

Such entries increase the risk that root could execute code provided by unprivileged users, and potentially malicious code.

Ensure the Default Bash Umask is Set Correctlyxccdf_org.ssgproject.content_rule_accounts_umask_etc_bashrc low

Ensure the Default Bash Umask is Set Correctly

Rule IDxccdf_org.ssgproject.content_rule_accounts_umask_etc_bashrc
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  SA-8, 366

Description

To ensure the default umask for users of the Bash shell is set properly, add or correct the umask setting in /etc/bashrc to read as follows:

umask 077

Rationale

The umask value influences the permissions assigned to files when they are created. A misconfigured umask value could result in files with excessive permissions that can be read or written to by unauthorized users.

Ensure the Default C Shell Umask is Set Correctlyxccdf_org.ssgproject.content_rule_accounts_umask_etc_csh_cshrc low

Ensure the Default C Shell Umask is Set Correctly

Rule IDxccdf_org.ssgproject.content_rule_accounts_umask_etc_csh_cshrc
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  SA-8, 366

Description

To ensure the default umask for users of the C shell is set properly, add or correct the umask setting in /etc/csh.cshrc to read as follows:

umask 077

Rationale

The umask value influences the permissions assigned to files when they are created. A misconfigured umask value could result in files with excessive permissions that can be read or written to by unauthorized users.

Ensure the Default Umask is Set Correctly in /etc/profilexccdf_org.ssgproject.content_rule_accounts_umask_etc_profile low

Ensure the Default Umask is Set Correctly in /etc/profile

Rule IDxccdf_org.ssgproject.content_rule_accounts_umask_etc_profile
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  SA-8, 366

Description

To ensure the default umask controlled by /etc/profile is set properly, add or correct the umask setting in /etc/profile to read as follows:

umask 077

Rationale

The umask value influences the permissions assigned to files when they are created. A misconfigured umask value could result in files with excessive permissions that can be read or written to by unauthorized users.

Set Interactive Session Timeoutxccdf_org.ssgproject.content_rule_accounts_tmout medium

Set Interactive Session Timeout

Rule IDxccdf_org.ssgproject.content_rule_accounts_tmout
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-12, SC-10, 1133, 0361, SRG-OS-000163-GPOS-00072, 3.1.11

Description

Setting the TMOUT option in /etc/profile ensures that all user sessions will terminate based on inactivity. The TMOUT setting in /etc/profile should read as follows:

TMOUT=600

Rationale

Terminating an idle 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.

OVAL details

Items found satisfying TMOUT in /etc/profile:

PathContent
/etc/profileTMOUT=600

Items not found satisfying TMOUT in /etc/profile.d/*.sh:

Object oval:ssg-object_etc_profiled_tmout:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/etc/profile.d^.*\.sh$^[\s]*TMOUT[\s]*=[\s]*(.*)[\s]*$1
State oval:ssg-state_etc_profile_tmout:ste:1 of type textfilecontent54_state
Subexpression
600
Ensure the Logon Failure Delay is Set Correctly in login.defsxccdf_org.ssgproject.content_rule_accounts_logon_fail_delay low

Ensure the Logon Failure Delay is Set Correctly in login.defs

Rule IDxccdf_org.ssgproject.content_rule_accounts_logon_fail_delay
Result
pass
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  CM-6(b), 366, SRG-OS-000480-GPOS-00226

Description

To ensure the logon failure delay controlled by /etc/login.defs is set properly, add or correct the FAIL_DELAY setting in /etc/login.defs to read as follows:

FAIL_DELAY 4

Rationale

Increasing the time between a failed authentication attempt and re-prompting to enter credentials helps to slow a single-threaded brute force attack.

OVAL details

Items found satisfying check FAIL_DELAY in /etc/login.defs:

PathContent
/etc/login.defsFAIL_DELAY 4
Ensure that User Home Directories are not Group-Writable or World-Readablexccdf_org.ssgproject.content_rule_file_permissions_home_dirs low

Ensure that User Home Directories are not Group-Writable or World-Readable

Rule IDxccdf_org.ssgproject.content_rule_file_permissions_home_dirs
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  AC-6(7), 225

Description

For each human user of the system, view the permissions of the user's home directory:

# ls -ld /home/USER
Ensure that the directory is not group-writable and that it is not world-readable. If necessary, repair the permissions:
# chmod g-w /home/USER
# chmod o-rwx /home/USER

Rationale

User home directories contain many configuration files which affect the behavior of a user's account. No user should ever have write permission to another user's home directory. Group shared directories can be configured in sub-directories or elsewhere in the filesystem if they are needed. Typically, user home directories should not be world-readable, as it would disclose file names to other users. If a subset of users need read access to one another's home directories, this can be provided using groups or ACLs.

Warnings
warning  This action may involve modifying user home directories. Notify your user community, and solicit input if appropriate, before making this type of change.
Verify /boot/grub2/grub.cfg User Ownershipxccdf_org.ssgproject.content_rule_file_user_owner_grub2_cfg medium

Verify /boot/grub2/grub.cfg User Ownership

Rule IDxccdf_org.ssgproject.content_rule_file_user_owner_grub2_cfg
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-6(7), 225, Req-7.1, 1.5.1, 5.5.2.2, 3.4.5

Description

The file /boot/grub2/grub.cfg should be owned by the root user to prevent destruction or modification of the file. To properly set the owner of /boot/grub2/grub.cfg, run the command:

$ sudo chown root /boot/grub2/grub.cfg

Rationale

Only root should be able to modify important boot parameters.

Verify /boot/grub2/grub.cfg Group Ownershipxccdf_org.ssgproject.content_rule_file_group_owner_grub2_cfg medium

Verify /boot/grub2/grub.cfg Group Ownership

Rule IDxccdf_org.ssgproject.content_rule_file_group_owner_grub2_cfg
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-6(7), 225, Req-7.1, 1.5.1, 5.5.2.2, 3.4.5

Description

The file /boot/grub2/grub.cfg should be group-owned by the root group to prevent destruction or modification of the file. To properly set the group owner of /boot/grub2/grub.cfg, run the command:

$ sudo chgrp root /boot/grub2/grub.cfg

Rationale

The root group is a highly-privileged group. Furthermore, the group-owner of this file should not have any access privileges anyway.

Verify /boot/grub2/grub.cfg Permissionsxccdf_org.ssgproject.content_rule_file_permissions_grub2_cfg medium

Verify /boot/grub2/grub.cfg Permissions

Rule IDxccdf_org.ssgproject.content_rule_file_permissions_grub2_cfg
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-6(7), 225, 1.5.2, 3.4.5

Description

File permissions for /boot/grub2/grub.cfg should be set to 600. To properly set the permissions of /boot/grub2/grub.cfg, run the command:

$ sudo chmod 600 /boot/grub2/grub.cfg

Rationale

Proper permissions ensure that only the root user can modify important boot parameters.

Set Boot Loader Passwordxccdf_org.ssgproject.content_rule_bootloader_password high

Set Boot Loader Password

Rule IDxccdf_org.ssgproject.content_rule_bootloader_password
Result
fail
Time2017-10-21T14:39:49
Severityhigh
Identifiers and References

References:  IA-2(1), IA-5(e), AC-3, 213, SRG-OS-000080-GPOS-00048, 1.5.3, 3.4.5

Description

The grub2 boot loader should have a superuser account and password protection enabled to protect boot-time settings.

To do so, select a superuser account and password and add them into the /etc/grub.d/01_users configuration file.

Since plaintext passwords are a security risk, generate a hash for the pasword by running the following command:

$ grub2-mkpasswd-pbkdf2
When prompted, enter the password that was selected and insert the returned password hash into the /etc/grub.d/01_users configuration file immediately after the superuser account. (Use the output from grub2-mkpasswd-pbkdf2 as the value of password-hash):
password_pbkdf2 superusers-account password-hash
NOTE: It is recommended not to use common administrator account names like root, admin, or administrator for the grub2 superuser account.

To meet FISMA Moderate, the bootloader superuser account and password MUST differ from the root account and password. Once the superuser account and password have been added, update the grub.cfg file by running:
grub2-mkconfig -o /boot/grub2/grub.cfg
NOTE: Do NOT manually add the superuser account and password to the grub.cfg file as the grub2-mkconfig command overwrites this file.

Rationale

Password protection on the boot loader configuration ensures users with physical access cannot trivially alter important bootloader settings. These include which kernel to use, and whether to enter single-user mode. For more information on how to configure the grub2 superuser account and password, please refer to

Warnings
warning  To prevent hard-coded passwords, automatic remediation of this control is not available. Remediation must be automated as a component of machine provisioning, or followed manually as outlined above.
OVAL details

Items found violating /boot/grub2/grub.cfg does not exist:

PathTypeUIDGIDSize (B)Permissions
/boot/grub2/grub.cfgregular004290rw-r--r-- 

Items not found violating make sure a password is defined in /boot/grub2/grub.cfg:

Object oval:ssg-object_bootloader_password:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/boot/grub2/grub.cfg^[\s]*password_pbkdf2[\s]+.*[\s]+grub\.pbkdf2\.sha512.*$1

Items not found violating superuser is defined in /boot/grub2/grub.cfg files. Superuser is not root, admin, or administrator:

Object oval:ssg-object_bootloader_superuser:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/boot/grub2/grub.cfg^[\s]*set[\s]+superusers=\"(?i)(?!root|admin|administrator)(?-i).*\"$1
Set the UEFI Boot Loader Passwordxccdf_org.ssgproject.content_rule_bootloader_uefi_password medium

Set the UEFI Boot Loader Password

Rule IDxccdf_org.ssgproject.content_rule_bootloader_uefi_password
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-3, 213, SRG-OS-000080-GPOS-00048, 3.4.5

Description

The UEFI grub2 boot loader should have a superuser account and password protection enabled to protect boot-time settings.

To do so, select a superuser account and password and add them into the /etc/grub.d/01_users configuration file.

Since plaintext passwords are a security risk, generate a hash for the pasword by running the following command:

$ grub2-mkpasswd-pbkdf2
When prompted, enter the password that was selected and insert the returned password hash into the /etc/grub.d/01_users configuration file immediately after the superuser account. (Use the output from grub2-mkpasswd-pbkdf2 as the value of password-hash):
password_pbkdf2 superusers-account password-hash
NOTE: It is recommended not to use common administrator account names like root, admin, or administrator for the grub2 superuser account.

To meet FISMA Moderate, the bootloader superuser account and password MUST differ from the root account and password. Once the superuser account and password have been added, update the grub.cfg file by running:
grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
NOTE: Do NOT manually add the superuser account and password to the grub.cfg file as the grub2-mkconfig command overwrites this file.

Rationale

Password protection on the boot loader configuration ensures users with physical access cannot trivially alter important bootloader settings. These include which kernel to use, and whether to enter single-user mode. For more information on how to configure the grub2 superuser account and password, please refer to

Warnings
warning  To prevent hard-coded passwords, automatic remediation of this control is not available. Remediation must be automated as a component of machine provisioning, or followed manually as outlined above.
OVAL details

Items not found satisfying /boot/efi/EFI/redhat/grub.cfg does not exist:

Object oval:ssg-object_bootloader_uefi_grub_cfg:obj:1 of type file_object
Filepath
/boot/efi/EFI/(redhat|fedora)/grub.cfg

Items not found satisfying make sure a password is defined in /boot/efi/EFI/redhat/grub.cfg:

Object oval:ssg-object_bootloader_uefi_password:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/boot/efi/EFI/(redhat|fedora)/grub.cfg^[\s]*password_pbkdf2[\s]+.*[\s]+grub\.pbkdf2\.sha512.*$1

Items not found satisfying superuser is defined in /boot/efi/EFI/redhat/grub.cfg. Superuser is not root, admin, or administrator:

Object oval:ssg-object_bootloader_uefi_superuser:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/boot/efi/EFI/(redhat|fedora)/grub.cfg^[\s]*set[\s]+superusers=\"(?i)(?!root|admin|administrator)(?-i).*\"$1
Install the screen Packagexccdf_org.ssgproject.content_rule_package_screen_installed medium

Install the screen Package

Rule IDxccdf_org.ssgproject.content_rule_package_screen_installed
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-11(a), 57, SRG-OS-000029-GPOS-00010, 3.1.10

Description

To enable console screen locking, install the screen package:

$ sudo yum install screen
Instruct users to begin new terminal sessions with the following command:
$ screen
The console can now be locked with the following key combination:
ctrl+a x

Rationale

A session time-out lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but des not logout because of the temporary nature of the absence. Rather than relying on the user to manually lock their operation system session prior to vacating the vicinity, operating systems need to be able to identify when a user's session has idled and take action to initiate the session lock.

The screen package allows for a session lock to be implemented and configured.

OVAL details

Items found satisfying package screen is installed:

NameArchEpochReleaseVersionEvrSignature keyidExtended name
screenx86_64(none)0.23.20120314git3c2946.el7_24.1.00:4.1.0-0.23.20120314git3c2946.el7_224c6a8a7f4a80eb5screen-0:4.1.0-0.23.20120314git3c2946.el7_2.x86_64
Enable Smart Card Loginxccdf_org.ssgproject.content_rule_smartcard_auth medium

Enable Smart Card Login

Rule IDxccdf_org.ssgproject.content_rule_smartcard_auth
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  IA-2(2), 765, 766, 767, 768, 771, 772, 884, Req-8.3, SRG-OS-000104-GPOS-00051, SRG-OS-000106-GPOS-00053, SRG-OS-000107-GPOS-00054, SRG-OS-000109-GPOS-00056, SRG-OS-000108-GPOS-00055, SRG-OS-000108-GPOS-00057, SRG-OS-000108-GPOS-00058

Description

To enable smart card authentication, consult the documentation at:

For guidance on enabling SSH to authenticate against a Common Access Card (CAC), consult documentation at:

Rationale

Smart card login provides two-factor authentication stronger than that provided by a username and password combination. Smart cards leverage PKI (public key infrastructure) in order to provide and verify credentials.

OVAL details

Items found satisfying Test ocsp_on in /etc/pam_pkcs11/pkcs11.conf:

PathContent
/etc/pam_pkcs11/pam_pkcs11.conf cert_policy = ca, signature, ocsp_on;
/etc/pam_pkcs11/pam_pkcs11.conf cert_policy = ca, signature, ocsp_on;
/etc/pam_pkcs11/pam_pkcs11.conf cert_policy = ca, signature, ocsp_on;

Items found satisfying Test smartcard authentication is enabled in /etc/pam.d/system-auth file:

PathContent
/etc/pam.d/system-auth auth required pam_env.so auth [success=1 default=ignore] pam_succeed_if.so service notin login:gdm:xdm:kdm:xscreensaver:gnome-screensaver:kscreensaver quiet use_uid auth [success=done authinfo_unavail=ignore ignore=ignore default=die] pam_pkcs11.so nodebug

Items not found satisfying Test smartcard authentication is required in /etc/pam.d/system-auth file:

Object oval:ssg-object_smart_card_required_system_auth:obj:1 of type textfilecontent54_object
BehaviorsFilepathPatternInstance
\nauth[\s]+required[\s]+pam_env.so\nauth[\s]+\[success=1[\s]default=ignore\][\s]pam_succeed_if.so[\s]service[\s]notin[\s]login:gdm:xdm:kdm:xscreensaver:gnome-screensaver:kscreensaver[\s]quiet[\s]use_uid\nauth[\s]+\[success=done[\s]ignore=ignore[\s]default=die\][\s]pam_pkcs11.so[\s]nodebug[\s]wait_for_card\nno value/etc/pam.d/system-auth1

Items found satisfying Test smartcard authentication is required in /etc/pam.d/smartcard-auth file:

PathContent
/etc/pam.d/smartcard-auth auth required pam_env.so auth [success=done ignore=ignore default=die] pam_pkcs11.so nodebug wait_for_card auth required pam_deny.so account required pam_unix.so account sufficient pam_localuser.so account sufficient pam_succeed_if.so uid < 1000 quiet account required pam_permit.so password required pam_pkcs11.so
Require Authentication for Single User Modexccdf_org.ssgproject.content_rule_require_singleuser_auth medium

Require Authentication for Single User Mode

Rule IDxccdf_org.ssgproject.content_rule_require_singleuser_auth
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  IA-2(1), AC-3, 213, 3.1.1, 3.4.5

Description

Single-user mode is intended as a system recovery method, providing a single user root access to the system by providing a boot option at startup. By default, no authentication is performed if single-user mode is selected.

By default, single-user mode is protected by requiring a password and is set in /usr/lib/systemd/system/rescue.service.

Rationale

This prevents attackers with physical access from trivially bypassing security on the machine and gaining root access. Such accesses are further prevented by configuring the bootloader password.

Disable debug-shell SystemD Servicexccdf_org.ssgproject.content_rule_service_debug-shell_disabled medium

Disable debug-shell SystemD Service

Rule IDxccdf_org.ssgproject.content_rule_service_debug-shell_disabled
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  3.4.5

Description

SystemD's debug-shell service is intended to diagnose SystemD related boot issues with various systemctl commands. Once enabled and following a system reboot, the root shell will be available on tty9 which is access by pressing CTRL-ALT-F9. The debug-shell service should only be used for SystemD related issues and should otherwise be disabled.

By default, the debug-shell SystemD service is disabled. The debug-shell service can be disabled with the following command:

$ sudo systemctl disable debug-shell.service

Rationale

This prevents attackers with physical access from trivially bypassing security on the machine through valid troubleshooting configurations and gaining root access when the system is rebooted.

Disable Ctrl-Alt-Del Reboot Activationxccdf_org.ssgproject.content_rule_disable_ctrlaltdel_reboot high

Disable Ctrl-Alt-Del Reboot Activation

Rule IDxccdf_org.ssgproject.content_rule_disable_ctrlaltdel_reboot
Result
pass
Time2017-10-21T14:39:49
Severityhigh
Identifiers and References

References:  AC-6, 366, SRG-OS-000480-GPOS-00227, 3.4.5

Description

By default, SystemD will reboot the system if the Ctrl-Alt-Del key sequence is pressed.

To configure the system to ignore the Ctrl-Alt-Del key sequence from the command line instead of rebooting the system, do either of the following:

ln -sf /dev/null /etc/systemd/system/ctrl-alt-del.target
or
systemctl mask ctrl-alt-del.target


Do not simply delete the /usr/lib/systemd/system/ctrl-alt-del.service file, as this file may be restored during future system updates.

Rationale

A locally logged-in user who presses Ctrl-Alt-Del, when at the console, can reboot the system. If accidentally pressed, as could happen in the case of mixed OS environment, this can create the risk of short-term loss of availability of systems due to unintentional reboot.

Warnings
warning  Disabling the Ctrl-Alt-Del key sequence with SystemD DOES NOT disable the Ctrl-Alt-Del key sequence if running in graphical.target mode (e.g. in GNOME, KDE, etc.)! The Ctrl-Alt-Del key sequence will only be disabled if running in the non-graphical multi-user.target mode.
OVAL details

Items found satisfying Disable Ctrl-Alt-Del key sequence override exists:

FilepathCanonical path
/etc/systemd/system/ctrl-alt-del.target/dev/null
Verify that Interactive Boot is Disabledxccdf_org.ssgproject.content_rule_disable_interactive_boot medium

Verify that Interactive Boot is Disabled

Rule IDxccdf_org.ssgproject.content_rule_disable_interactive_boot
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  SC-2, AC-3, 213, 3.1.2, 3.4.5

Description

Red Hat Enterprise Linux systems support an "interactive boot" option that can be used to prevent services from being started. On a Red Hat Enterprise Linux 7 system, interactive boot can be enabled by providing a 1, yes, true, or on value to the systemd.confirm_spawn kernel argument in /etc/default/grub. Remove any instance of

systemd.confirm_spawn=(1|yes|true|on)
from the kernel arguments in that file to disable interactive boot.

Rationale

Using interactive boot, the console user could disable auditing, firewalls, or other services, weakening system security.

Warnings
warning  The GRUB 2 configuration file, grub.cfg, is automatically updated each time a new kernel is installed. Note that any changes to /etc/default/grub require rebuilding the grub.cfg file. To update the GRUB 2 configuration file manually, use the
grub2-mkconfig -o
command as follows:
  • On BIOS-based machines, issue the following command as root:
    ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
  • On UEFI-based machines, issue the following command as root:
    ~]# grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
Enable GNOME3 Login Warning Bannerxccdf_org.ssgproject.content_rule_dconf_gnome_banner_enabled medium

Enable GNOME3 Login Warning Banner

Rule IDxccdf_org.ssgproject.content_rule_dconf_gnome_banner_enabled
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-8(a), AC-8(b), AC-8(c)(1), AC-8(c)(2), AC-8(c)(3), 48, OS-SRG-000023-GPOS-00006, SRG-OS-000024-GPOS-00007, SRG-OS-000228-GPOS-00088, 3.1.9

Description

In the default graphical environment, displaying a login warning banner in the GNOME Display Manager's login screen can be enabled on the login screen by setting banner-message-enable to true.

To enable, add or edit banner-message-enable to /etc/dconf/db/gdm.d/00-security-settings. For example:

[org/gnome/login-screen]
banner-message-enable=true
Once the setting has been added, add a lock to /etc/dconf/db/gdm.d/locks/00-security-settings-lock to prevent user modification. For example:
/org/gnome/login-screen/banner-message-enable
After the settings have been set, run dconf update. The banner text must also be set.

Rationale

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.

For U.S. Government systems, system use notifications are required only for access via login interfaces with human users and are not required when such human interfaces do not exist.

OVAL details

Items not found satisfying GUI banner is enabled:

Object oval:ssg-obj_banner_gui_enabled:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/etc/dconf/db/gdm.d/^.*$^\[org/gnome/login-screen]([^\n]*\n+)+?banner-message-enable=true$1

Items not found satisfying GUI banner cannot be changed by user:

Object oval:ssg-obj_prevent_user_banner_gui_enabled_change:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/etc/dconf/db/gdm.d/locks/^.*$^/org/gnome/login-screen/banner-message-enable$1
Modify the System Login Bannerxccdf_org.ssgproject.content_rule_banner_etc_issue medium

Modify the System Login Banner

Rule IDxccdf_org.ssgproject.content_rule_banner_etc_issue
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-8(a), AC-8(b), AC-8(c)(1), AC-8(c)(2), AC-8(c)(3), 48, SRG-OS-000023-GPOS-00006, SRG-OS-000024-GPOS-00007, 3.1.9

Description

To configure the system login banner edit /etc/issue. Replace the default text with a message compliant with the local site policy or a legal disclaimer. The DoD required text is either:

You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only. By using this IS (which includes any device attached to this IS), you consent to the following conditions:
-The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations.
-At any time, the USG may inspect and seize data stored on this IS.
-Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose.
-This IS includes security measures (e.g., authentication and access controls) to protect USG interests -- not for your personal benefit or privacy.
-Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details.


OR:

I've read & consent to terms in IS user agreem't.

Rationale

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 login interfaces with human users and are not required when such human interfaces do not exist.

OVAL details

Items found satisfying correct banner in /etc/issue:

PathContent
/etc/issueYou are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only. By using this IS (which includes any device attached to this IS), you consent to the following conditions: -The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations. -At any time, the USG may inspect and seize data stored on this IS. -Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose. -This IS includes security measures (e.g., authentication and access controls) to protect USG interests -- not for your personal benefit or privacy. -Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details.
Disable Kernel Parameter for Sending ICMP Redirects by Defaultxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_conf_default_send_redirects medium

Disable Kernel Parameter for Sending ICMP Redirects by Default

Rule IDxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_conf_default_send_redirects
Result
fail
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-4, CM-7, SC-5, SC-7, 366, 4.1.2, SRG-OS-000480-GPOS-00227, 5.10.1.1, 3.1.20

Description

To set the runtime status of the net.ipv4.conf.default.send_redirects kernel parameter, run the following command:

$ sudo sysctl -w net.ipv4.conf.default.send_redirects=0
If this is not the system's default value, add the following line to /etc/sysctl.conf:
net.ipv4.conf.default.send_redirects = 0

Rationale

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.
The ability to send ICMP redirects is only appropriate for systems acting as routers.

Remediation Shell script:   (show)

Complexity:low
Disruption:medium
Reboot:true
Strategy:disable


#
# Set runtime for net.ipv4.conf.default.send_redirects
#
/sbin/sysctl -q -n -w net.ipv4.conf.default.send_redirects=0

#
# If net.ipv4.conf.default.send_redirects present in /etc/sysctl.conf, change value to "0"
#	else, add "net.ipv4.conf.default.send_redirects = 0" to /etc/sysctl.conf
#

function replace_or_append {
  local config_file=$1
  local key=$2
  local value=$3
  local cce=$4
  local format=$5

  # Check sanity of the input
  if [ $# -lt "3" ]
  then
        echo "Usage: replace_or_append 'config_file_location' 'key_to_search' 'new_value'"
        echo
        echo "If symlinks need to be taken into account, add yes/no to the last argument"
        echo "to allow to 'follow_symlinks'."
        echo "Aborting."
        exit 1
  fi

  # Test if the config_file is a symbolic link. If so, use --follow-symlinks with sed.
  # Otherwise, regular sed command will do.
  if test -L $config_file; then
    sed_command="sed -i --follow-symlinks"
  else
    sed_command="sed -i"
  fi

  # Test that the cce arg is not empty or does not equal @CCENUM@.
  # If @CCENUM@ exists, it means that there is no CCE assigned.
  if ! [ "x$cce" = x ] && [ "$cce" != '@CCENUM@' ]; then
    cce="CCE-${cce}"
  else
    cce="CCE"
  fi

  # Strip any search characters in the key arg so that the key can be replaced without
  # adding any search characters to the config file.
  stripped_key=$(sed "s/[\^=\$,;+]*//g" <<< $key)

  # If there is no print format specified in the last arg, use the default format.
  if ! [ "x$format" = x ] ; then
    printf -v formatted_output "$format" "$stripped_key" "$value"
  else
    formatted_output="$stripped_key = $value"
  fi

  # If the key exists, change it. Otherwise, add it to the config_file.
  if `grep -qi $key $config_file` ; then
    $sed_command "s/$key.*/$formatted_output/g" $config_file
  else
    # \n is precaution for case where file ends without trailing newline
    echo -e "\n# Per $cce: Set $formatted_output in $config_file" >> $config_file
    echo -e "$formatted_output" >> $config_file
  fi

}

replace_or_append '/etc/sysctl.conf' '^net.ipv4.conf.default.send_redirects' "0" 'CCE-80156-3'
Disable Kernel Parameter for Sending ICMP Redirects for All Interfacesxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_conf_all_send_redirects medium

Disable Kernel Parameter for Sending ICMP Redirects for All Interfaces

Rule IDxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_conf_all_send_redirects
Result
fail
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-4, CM-7, SC-5(1), 366, 4.1.2, SRG-OS-000480-GPOS-00227, 5.10.1.1, 3.1.20

Description

To set the runtime status of the net.ipv4.conf.all.send_redirects kernel parameter, run the following command:

$ sudo sysctl -w net.ipv4.conf.all.send_redirects=0
If this is not the system's default value, add the following line to /etc/sysctl.conf:
net.ipv4.conf.all.send_redirects = 0

Rationale

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.
The ability to send ICMP redirects is only appropriate for systems acting as routers.

Remediation Shell script:   (show)

Complexity:low
Disruption:medium
Reboot:true
Strategy:disable


#
# Set runtime for net.ipv4.conf.all.send_redirects
#
/sbin/sysctl -q -n -w net.ipv4.conf.all.send_redirects=0

#
# If net.ipv4.conf.all.send_redirects present in /etc/sysctl.conf, change value to "0"
#	else, add "net.ipv4.conf.all.send_redirects = 0" to /etc/sysctl.conf
#

function replace_or_append {
  local config_file=$1
  local key=$2
  local value=$3
  local cce=$4
  local format=$5

  # Check sanity of the input
  if [ $# -lt "3" ]
  then
        echo "Usage: replace_or_append 'config_file_location' 'key_to_search' 'new_value'"
        echo
        echo "If symlinks need to be taken into account, add yes/no to the last argument"
        echo "to allow to 'follow_symlinks'."
        echo "Aborting."
        exit 1
  fi

  # Test if the config_file is a symbolic link. If so, use --follow-symlinks with sed.
  # Otherwise, regular sed command will do.
  if test -L $config_file; then
    sed_command="sed -i --follow-symlinks"
  else
    sed_command="sed -i"
  fi

  # Test that the cce arg is not empty or does not equal @CCENUM@.
  # If @CCENUM@ exists, it means that there is no CCE assigned.
  if ! [ "x$cce" = x ] && [ "$cce" != '@CCENUM@' ]; then
    cce="CCE-${cce}"
  else
    cce="CCE"
  fi

  # Strip any search characters in the key arg so that the key can be replaced without
  # adding any search characters to the config file.
  stripped_key=$(sed "s/[\^=\$,;+]*//g" <<< $key)

  # If there is no print format specified in the last arg, use the default format.
  if ! [ "x$format" = x ] ; then
    printf -v formatted_output "$format" "$stripped_key" "$value"
  else
    formatted_output="$stripped_key = $value"
  fi

  # If the key exists, change it. Otherwise, add it to the config_file.
  if `grep -qi $key $config_file` ; then
    $sed_command "s/$key.*/$formatted_output/g" $config_file
  else
    # \n is precaution for case where file ends without trailing newline
    echo -e "\n# Per $cce: Set $formatted_output in $config_file" >> $config_file
    echo -e "$formatted_output" >> $config_file
  fi

}

replace_or_append '/etc/sysctl.conf' '^net.ipv4.conf.all.send_redirects' "0" 'CCE-80156-3'
Disable Kernel Parameter for IP Forwardingxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_ip_forward medium

Disable Kernel Parameter for IP Forwarding

Rule IDxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_ip_forward
Result
fail
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  CM-7, SC-5, SC-32, 366, 4.1.1, SRG-OS-000480-GPOS-00227, 3.1.20

Description

To set the runtime status of the net.ipv4.ip_forward kernel parameter, run the following command:

$ sudo sysctl -w net.ipv4.ip_forward=0
If this is not the system's default value, add the following line to /etc/sysctl.conf:
net.ipv4.ip_forward = 0

Rationale

Routing protocol daemons are typically used on routers to exchange network topology information with other routers. If this capability is used when not required, system network information may be unnecessarily transmitted across the network.

Remediation Shell script:   (show)

Complexity:low
Disruption:medium
Reboot:true
Strategy:disable


#
# Set runtime for net.ipv4.ip_forward
#
/sbin/sysctl -q -n -w net.ipv4.ip_forward=0

#
# If net.ipv4.ip_forward present in /etc/sysctl.conf, change value to "0"
#	else, add "net.ipv4.ip_forward = 0" to /etc/sysctl.conf
#

function replace_or_append {
  local config_file=$1
  local key=$2
  local value=$3
  local cce=$4
  local format=$5

  # Check sanity of the input
  if [ $# -lt "3" ]
  then
        echo "Usage: replace_or_append 'config_file_location' 'key_to_search' 'new_value'"
        echo
        echo "If symlinks need to be taken into account, add yes/no to the last argument"
        echo "to allow to 'follow_symlinks'."
        echo "Aborting."
        exit 1
  fi

  # Test if the config_file is a symbolic link. If so, use --follow-symlinks with sed.
  # Otherwise, regular sed command will do.
  if test -L $config_file; then
    sed_command="sed -i --follow-symlinks"
  else
    sed_command="sed -i"
  fi

  # Test that the cce arg is not empty or does not equal @CCENUM@.
  # If @CCENUM@ exists, it means that there is no CCE assigned.
  if ! [ "x$cce" = x ] && [ "$cce" != '@CCENUM@' ]; then
    cce="CCE-${cce}"
  else
    cce="CCE"
  fi

  # Strip any search characters in the key arg so that the key can be replaced without
  # adding any search characters to the config file.
  stripped_key=$(sed "s/[\^=\$,;+]*//g" <<< $key)

  # If there is no print format specified in the last arg, use the default format.
  if ! [ "x$format" = x ] ; then
    printf -v formatted_output "$format" "$stripped_key" "$value"
  else
    formatted_output="$stripped_key = $value"
  fi

  # If the key exists, change it. Otherwise, add it to the config_file.
  if `grep -qi $key $config_file` ; then
    $sed_command "s/$key.*/$formatted_output/g" $config_file
  else
    # \n is precaution for case where file ends without trailing newline
    echo -e "\n# Per $cce: Set $formatted_output in $config_file" >> $config_file
    echo -e "$formatted_output" >> $config_file
  fi

}

replace_or_append '/etc/sysctl.conf' '^net.ipv4.ip_forward' "0" 'CCE-80157-1'
Configure Kernel Parameter for Accepting Source-Routed Packets for All Interfacesxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_conf_all_accept_source_route medium

Configure Kernel Parameter for Accepting Source-Routed Packets for All Interfaces

Rule IDxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_conf_all_accept_source_route
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-4, CM-7, SC-5, 366, SRG-OS-000480-GPOS-00227, 4.2.1, 3.1.20

Description

To set the runtime status of the net.ipv4.conf.all.accept_source_route kernel parameter, run the following command:

$ sudo sysctl -w net.ipv4.conf.all.accept_source_route=0
If this is not the system's default value, add the following line to /etc/sysctl.conf:
net.ipv4.conf.all.accept_source_route = 0

Rationale

Source-routed packets allow the source of the packet to suggest 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-routerd traffic, such as when IPv4 forwarding is enabled and the system is functioning as a router.

Accepting source-routed packets in the IPv4 protocol has few legitimate uses. It should be disabled unless it is absolutely required.

Configure Kernel Parameter for Accepting ICMP Redirects for All Interfacesxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_conf_all_accept_redirects medium

Configure Kernel Parameter for Accepting ICMP Redirects for All Interfaces

Rule IDxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_conf_all_accept_redirects
Result
fail
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  CM-6(d), CM-7, SC-5, 366, 1503, 1551, 4.2.2, SRG-OS-000480-GPOS-00227, 5.10.1.1, 3.1.20

Description

To set the runtime status of the net.ipv4.conf.all.accept_redirects kernel parameter, run the following command:

$ sudo sysctl -w net.ipv4.conf.all.accept_redirects=0
If this is not the system's default value, add the following line to /etc/sysctl.conf:
net.ipv4.conf.all.accept_redirects = 0

Rationale

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.
This feature of the IPv4 protocol has few legitimate uses. It should be disabled unless absolutely required.

Remediation Shell script:   (show)

Complexity:low
Disruption:medium
Reboot:true
Strategy:disable

sysctl_net_ipv4_conf_all_accept_redirects_value="0"

#
# Set runtime for net.ipv4.conf.all.accept_redirects
#
/sbin/sysctl -q -n -w net.ipv4.conf.all.accept_redirects=$sysctl_net_ipv4_conf_all_accept_redirects_value

#
# If net.ipv4.conf.all.accept_redirects present in /etc/sysctl.conf, change value to appropriate value
#	else, add "net.ipv4.conf.all.accept_redirects = value" to /etc/sysctl.conf
#

function replace_or_append {
  local config_file=$1
  local key=$2
  local value=$3
  local cce=$4
  local format=$5

  # Check sanity of the input
  if [ $# -lt "3" ]
  then
        echo "Usage: replace_or_append 'config_file_location' 'key_to_search' 'new_value'"
        echo
        echo "If symlinks need to be taken into account, add yes/no to the last argument"
        echo "to allow to 'follow_symlinks'."
        echo "Aborting."
        exit 1
  fi

  # Test if the config_file is a symbolic link. If so, use --follow-symlinks with sed.
  # Otherwise, regular sed command will do.
  if test -L $config_file; then
    sed_command="sed -i --follow-symlinks"
  else
    sed_command="sed -i"
  fi

  # Test that the cce arg is not empty or does not equal @CCENUM@.
  # If @CCENUM@ exists, it means that there is no CCE assigned.
  if ! [ "x$cce" = x ] && [ "$cce" != '@CCENUM@' ]; then
    cce="CCE-${cce}"
  else
    cce="CCE"
  fi

  # Strip any search characters in the key arg so that the key can be replaced without
  # adding any search characters to the config file.
  stripped_key=$(sed "s/[\^=\$,;+]*//g" <<< $key)

  # If there is no print format specified in the last arg, use the default format.
  if ! [ "x$format" = x ] ; then
    printf -v formatted_output "$format" "$stripped_key" "$value"
  else
    formatted_output="$stripped_key = $value"
  fi

  # If the key exists, change it. Otherwise, add it to the config_file.
  if `grep -qi $key $config_file` ; then
    $sed_command "s/$key.*/$formatted_output/g" $config_file
  else
    # \n is precaution for case where file ends without trailing newline
    echo -e "\n# Per $cce: Set $formatted_output in $config_file" >> $config_file
    echo -e "$formatted_output" >> $config_file
  fi

}

replace_or_append '/etc/sysctl.conf' '^net.ipv4.conf.all.accept_redirects' "$sysctl_net_ipv4_conf_all_accept_redirects_value" 'CCE-80158-9'
Configure Kernel Parameter for Accepting Secure Redirects for All Interfacesxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_conf_all_secure_redirects medium

Configure Kernel Parameter for Accepting Secure Redirects for All Interfaces

Rule IDxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_conf_all_secure_redirects
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-4, CM-7, SC-5, 1503, 1551, 4.2.3, 3.1.20

Description

To set the runtime status of the net.ipv4.conf.all.secure_redirects kernel parameter, run the following command:

$ sudo sysctl -w net.ipv4.conf.all.secure_redirects=0
If this is not the system's default value, add the following line to /etc/sysctl.conf:
net.ipv4.conf.all.secure_redirects = 0

Rationale

Accepting "secure" ICMP redirects (from those gateways listed as default gateways) has few legitimate uses. It should be disabled unless it is absolutely required.

Configure Kernel Parameter to Log Martian Packetsxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_conf_all_log_martians low

Configure Kernel Parameter to Log Martian Packets

Rule IDxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_conf_all_log_martians
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  AC-17(7), CM-7, SC-5(3), 126, 4.2.4, 3.1.20

Description

To set the runtime status of the net.ipv4.conf.all.log_martians kernel parameter, run the following command:

$ sudo sysctl -w net.ipv4.conf.all.log_martians=1
If this is not the system's default value, add the following line to /etc/sysctl.conf:
net.ipv4.conf.all.log_martians = 1

Rationale

The presence of "martian" packets (which have impossible addresses) as well as spoofed packets, source-routed packets, and redirects could be a sign of nefarious network activity. Logging these packets enables this activity to be detected.

Configure Kernel Parameter to Log Martian Packets By Defaultxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_conf_default_log_martians low

Configure Kernel Parameter to Log Martian Packets By Default

Rule IDxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_conf_default_log_martians
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  AC-17(7), CM-7, SC-5(3), 126, 4.2.4, 3.1.20

Description

To set the runtime status of the net.ipv4.conf.default.log_martians kernel parameter, run the following command:

$ sudo sysctl -w net.ipv4.conf.default.log_martians=1
If this is not the system's default value, add the following line to /etc/sysctl.conf:
net.ipv4.conf.default.log_martians = 1

Rationale

The presence of "martian" packets (which have impossible addresses) as well as spoofed packets, source-routed packets, and redirects could be a sign of nefarious network activity. Logging these packets enables this activity to be detected.

Configure Kernel Parameter for Accepting Source-Routed Packets By Defaultxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_conf_default_accept_source_route medium

Configure Kernel Parameter for Accepting Source-Routed Packets By Default

Rule IDxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_conf_default_accept_source_route
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-4, CM-7, SC-5, SC-7, 366, 1551, SRG-OS-000480-GPOS-00227, 4.2.1, 5.10.1.1, 3.1.20

Description

To set the runtime status of the net.ipv4.conf.default.accept_source_route kernel parameter, run the following command:

$ sudo sysctl -w net.ipv4.conf.default.accept_source_route=0
If this is not the system's default value, add the following line to /etc/sysctl.conf:
net.ipv4.conf.default.accept_source_route = 0

Rationale

Source-routed packets allow the source of the packet to suggest routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures.
Accepting source-routed packets in the IPv4 protocol has few legitimate uses. It should be disabled unless it is absolutely required, such as when IPv4 forwarding is enabled and the system is legitimately functioning as a router.

Configure Kernel Parameter for Accepting ICMP Redirects By Defaultxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_conf_default_accept_redirects medium

Configure Kernel Parameter for Accepting ICMP Redirects By Default

Rule IDxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_conf_default_accept_redirects
Result
fail
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-4, CM-7, SC-5, SC-7, 1551, 4.2.2, SRG-OS-000480-GPOS-00227, 5.10.1.1, 3.1.20

Description

To set the runtime status of the net.ipv4.conf.default.accept_redirects kernel parameter, run the following command:

$ sudo sysctl -w net.ipv4.conf.default.accept_redirects=0
If this is not the system's default value, add the following line to /etc/sysctl.conf:
net.ipv4.conf.default.accept_redirects = 0

Rationale

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.
This feature of the IPv4 protocol has few legitimate uses. It should be disabled unless absolutely required.

Remediation Shell script:   (show)

Complexity:low
Disruption:medium
Reboot:true
Strategy:disable

sysctl_net_ipv4_conf_default_accept_redirects_value="0"

#
# Set runtime for net.ipv4.conf.default.accept_redirects
#
/sbin/sysctl -q -n -w net.ipv4.conf.default.accept_redirects=$sysctl_net_ipv4_conf_default_accept_redirects_value

#
# If net.ipv4.conf.default.accept_redirects present in /etc/sysctl.conf, change value to appropriate value
#	else, add "net.ipv4.conf.default.accept_redirects = value" to /etc/sysctl.conf
#

function replace_or_append {
  local config_file=$1
  local key=$2
  local value=$3
  local cce=$4
  local format=$5

  # Check sanity of the input
  if [ $# -lt "3" ]
  then
        echo "Usage: replace_or_append 'config_file_location' 'key_to_search' 'new_value'"
        echo
        echo "If symlinks need to be taken into account, add yes/no to the last argument"
        echo "to allow to 'follow_symlinks'."
        echo "Aborting."
        exit 1
  fi

  # Test if the config_file is a symbolic link. If so, use --follow-symlinks with sed.
  # Otherwise, regular sed command will do.
  if test -L $config_file; then
    sed_command="sed -i --follow-symlinks"
  else
    sed_command="sed -i"
  fi

  # Test that the cce arg is not empty or does not equal @CCENUM@.
  # If @CCENUM@ exists, it means that there is no CCE assigned.
  if ! [ "x$cce" = x ] && [ "$cce" != '@CCENUM@' ]; then
    cce="CCE-${cce}"
  else
    cce="CCE"
  fi

  # Strip any search characters in the key arg so that the key can be replaced without
  # adding any search characters to the config file.
  stripped_key=$(sed "s/[\^=\$,;+]*//g" <<< $key)

  # If there is no print format specified in the last arg, use the default format.
  if ! [ "x$format" = x ] ; then
    printf -v formatted_output "$format" "$stripped_key" "$value"
  else
    formatted_output="$stripped_key = $value"
  fi

  # If the key exists, change it. Otherwise, add it to the config_file.
  if `grep -qi $key $config_file` ; then
    $sed_command "s/$key.*/$formatted_output/g" $config_file
  else
    # \n is precaution for case where file ends without trailing newline
    echo -e "\n# Per $cce: Set $formatted_output in $config_file" >> $config_file
    echo -e "$formatted_output" >> $config_file
  fi

}

replace_or_append '/etc/sysctl.conf' '^net.ipv4.conf.default.accept_redirects' "$sysctl_net_ipv4_conf_default_accept_redirects_value" 'CCE-80163-9'
Configure Kernel Parameter for Accepting Secure Redirects By Defaultxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_conf_default_secure_redirects medium

Configure Kernel Parameter for Accepting Secure Redirects By Default

Rule IDxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_conf_default_secure_redirects
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-4, CM-7, SC-5, SC-7, 1551, 4.2.3, 3.1.20

Description

To set the runtime status of the net.ipv4.conf.default.secure_redirects kernel parameter, run the following command:

$ sudo sysctl -w net.ipv4.conf.default.secure_redirects=0
If this is not the system's default value, add the following line to /etc/sysctl.conf:
net.ipv4.conf.default.secure_redirects = 0

Rationale

Accepting "secure" ICMP redirects (from those gateways listed as default gateways) has few legitimate uses. It should be disabled unless it is absolutely required.

Configure Kernel Parameter to Ignore ICMP Broadcast Echo Requestsxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_icmp_echo_ignore_broadcasts medium

Configure Kernel Parameter to Ignore ICMP Broadcast Echo Requests

Rule IDxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_icmp_echo_ignore_broadcasts
Result
fail
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-4, CM-7, SC-5, 366, SRG-OS-000480-GPOS-00227, 4.2.5, 5.10.1.1, 3.1.20

Description

To set the runtime status of the net.ipv4.icmp_echo_ignore_broadcasts kernel parameter, run the following command:

$ sudo sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1
If this is not the system's default value, add the following line to /etc/sysctl.conf:
net.ipv4.icmp_echo_ignore_broadcasts = 1

Rationale

Responding to broadcast (ICMP) echoes facilitates network mapping and provides a vector for amplification attacks.
Ignoring ICMP echo requests (pings) sent to broadcast or multicast addresses makes the system slightly more difficult to enumerate on the network.

Remediation Shell script:   (show)

Complexity:low
Disruption:medium
Reboot:true
Strategy:disable

sysctl_net_ipv4_icmp_echo_ignore_broadcasts_value="1"

#
# Set runtime for net.ipv4.icmp_echo_ignore_broadcasts
#
/sbin/sysctl -q -n -w net.ipv4.icmp_echo_ignore_broadcasts=$sysctl_net_ipv4_icmp_echo_ignore_broadcasts_value

#
# If net.ipv4.icmp_echo_ignore_broadcasts present in /etc/sysctl.conf, change value to appropriate value
#	else, add "net.ipv4.icmp_echo_ignore_broadcasts = value" to /etc/sysctl.conf
#

function replace_or_append {
  local config_file=$1
  local key=$2
  local value=$3
  local cce=$4
  local format=$5

  # Check sanity of the input
  if [ $# -lt "3" ]
  then
        echo "Usage: replace_or_append 'config_file_location' 'key_to_search' 'new_value'"
        echo
        echo "If symlinks need to be taken into account, add yes/no to the last argument"
        echo "to allow to 'follow_symlinks'."
        echo "Aborting."
        exit 1
  fi

  # Test if the config_file is a symbolic link. If so, use --follow-symlinks with sed.
  # Otherwise, regular sed command will do.
  if test -L $config_file; then
    sed_command="sed -i --follow-symlinks"
  else
    sed_command="sed -i"
  fi

  # Test that the cce arg is not empty or does not equal @CCENUM@.
  # If @CCENUM@ exists, it means that there is no CCE assigned.
  if ! [ "x$cce" = x ] && [ "$cce" != '@CCENUM@' ]; then
    cce="CCE-${cce}"
  else
    cce="CCE"
  fi

  # Strip any search characters in the key arg so that the key can be replaced without
  # adding any search characters to the config file.
  stripped_key=$(sed "s/[\^=\$,;+]*//g" <<< $key)

  # If there is no print format specified in the last arg, use the default format.
  if ! [ "x$format" = x ] ; then
    printf -v formatted_output "$format" "$stripped_key" "$value"
  else
    formatted_output="$stripped_key = $value"
  fi

  # If the key exists, change it. Otherwise, add it to the config_file.
  if `grep -qi $key $config_file` ; then
    $sed_command "s/$key.*/$formatted_output/g" $config_file
  else
    # \n is precaution for case where file ends without trailing newline
    echo -e "\n# Per $cce: Set $formatted_output in $config_file" >> $config_file
    echo -e "$formatted_output" >> $config_file
  fi

}

replace_or_append '/etc/sysctl.conf' '^net.ipv4.icmp_echo_ignore_broadcasts' "$sysctl_net_ipv4_icmp_echo_ignore_broadcasts_value" 'CCE-80165-4'
Configure Kernel Parameter to Ignore Bogus ICMP Error Responsesxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_icmp_ignore_bogus_error_responses low

Configure Kernel Parameter to Ignore Bogus ICMP Error Responses

Rule IDxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_icmp_ignore_bogus_error_responses
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  CM-7, SC-5, 4.2.6, 3.1.20

Description

To set the runtime status of the net.ipv4.icmp_ignore_bogus_error_responses kernel parameter, run the following command:

$ sudo sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1
If this is not the system's default value, add the following line to /etc/sysctl.conf:
net.ipv4.icmp_ignore_bogus_error_responses = 1

Rationale

Ignoring bogus ICMP error responses reduces log size, although some activity would not be logged.

Configure Kernel Parameter to Use TCP Syncookiesxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_tcp_syncookies medium

Configure Kernel Parameter to Use TCP Syncookies

Rule IDxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_tcp_syncookies
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-4, SC-5(1)(2), SC-5(2), SC-5(3), 366, SRG-OS-000480-GPOS-00227, 4.2.8, 5.10.1.1, 3.1.20

Description

To set the runtime status of the net.ipv4.tcp_syncookies kernel parameter, run the following command:

$ sudo sysctl -w net.ipv4.tcp_syncookies=1
If this is not the system's default value, add the following line to /etc/sysctl.conf:
net.ipv4.tcp_syncookies = 1

Rationale

A TCP SYN flood attack can cause a denial of service by filling a system's TCP connection table with connections in the SYN_RCVD state. Syncookies can be used to track a connection when a subsequent ACK is received, verifying the initiator is attempting a valid connection and is not a flood source. This feature is activated when a flood condition is detected, and enables the system to continue servicing valid connection requests.

Configure Kernel Parameter to Use Reverse Path Filtering for All Interfacesxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_conf_all_rp_filter medium

Configure Kernel Parameter to Use Reverse Path Filtering for All Interfaces

Rule IDxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_conf_all_rp_filter
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-4, SC-5, SC-7, 1551, 4.2.7, 3.1.20

Description

To set the runtime status of the net.ipv4.conf.all.rp_filter kernel parameter, run the following command:

$ sudo sysctl -w net.ipv4.conf.all.rp_filter=1
If this is not the system's default value, add the following line to /etc/sysctl.conf:
net.ipv4.conf.all.rp_filter = 1

Rationale

Enabling reverse path filtering drops packets with source addresses that should not have been able to be received on the interface they were received on. It should not be used on systems which are routers for complicated networks, but is helpful for end hosts and routers serving small networks.

Configure Kernel Parameter to Use Reverse Path Filtering by Defaultxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_conf_default_rp_filter medium

Configure Kernel Parameter to Use Reverse Path Filtering by Default

Rule IDxccdf_org.ssgproject.content_rule_sysctl_net_ipv4_conf_default_rp_filter
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-4, SC-5, SC-7, 4.2.7, 3.1.20

Description

To set the runtime status of the net.ipv4.conf.default.rp_filter kernel parameter, run the following command:

$ sudo sysctl -w net.ipv4.conf.default.rp_filter=1
If this is not the system's default value, add the following line to /etc/sysctl.conf:
net.ipv4.conf.default.rp_filter = 1

Rationale

Enabling reverse path filtering drops packets with source addresses that should not have been able to be received on the interface they were received on. It should not be used on systems which are routers for complicated networks, but is helpful for end hosts and routers serving small networks.

Disable WiFi or Bluetooth in BIOSxccdf_org.ssgproject.content_rule_wireless_disable_in_bios low

Disable WiFi or Bluetooth in BIOS

Rule IDxccdf_org.ssgproject.content_rule_wireless_disable_in_bios
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  AC-17(8), AC-18(a), AC-18(d), AC-18(3), CM-7, 85

Description

Some machines that include built-in wireless support offer the ability to disable the device through the BIOS. This is hardware-specific; consult your hardware manual or explore the BIOS setup during boot.

Rationale

Disabling wireless support in the BIOS prevents easy activation of the wireless interface, generally requiring administrators to reboot the system first.

Deactivate Wireless Network Interfacesxccdf_org.ssgproject.content_rule_wireless_disable_interfaces low

Deactivate Wireless Network Interfaces

Rule IDxccdf_org.ssgproject.content_rule_wireless_disable_interfaces
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  AC-17(8), AC-18(a), AC-18(d), AC-18(3), CM-7, 85, 4.3.1, 3.1.16

Description

Deactivating wireless network interfaces should prevent normal usage of the wireless capability.

First, identify the interfaces available with the command:

$ ifconfig -a
Additionally, the following command may be used to determine whether wireless support is included for a particular interface, though this may not always be a clear indicator:
$ iwconfig
After identifying any wireless interfaces (which may have names like wlan0, ath0, wifi0, em1 or eth0), deactivate the interface with the command:
$ sudo ifdown interface
These changes will only last until the next reboot. To disable the interface for future boots, remove the appropriate interface file from /etc/sysconfig/network-scripts:
$ sudo rm /etc/sysconfig/network-scripts/ifcfg-interface

Rationale

Wireless networking allows attackers within physical proximity to launch network-based attacks against systems, including those against local LAN protocols which were not designed with security in mind.

Disable Bluetooth Servicexccdf_org.ssgproject.content_rule_service_bluetooth_disabled medium

Disable Bluetooth Service

Rule IDxccdf_org.ssgproject.content_rule_service_bluetooth_disabled
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-17(8), AC-18(a), AC-18(d), AC-18(3), CM-7, 85, 1551, 3.1.16

Description

The bluetooth service can be disabled with the following command:

$ sudo systemctl disable bluetooth.service
$ sudo service bluetooth stop

Rationale

Disabling the bluetooth service prevents the system from attempting connections to Bluetooth devices, which entails some security risk. Nevertheless, variation in this risk decision may be expected due to the utility of Bluetooth connectivity and its limited range.

Disable Bluetooth Kernel Modulesxccdf_org.ssgproject.content_rule_kernel_module_bluetooth_disabled medium

Disable Bluetooth Kernel Modules

Rule IDxccdf_org.ssgproject.content_rule_kernel_module_bluetooth_disabled
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-17(8), AC-18(a), AC-18(d), AC-18(3), CM-7, 85, 1551, 5.13.1.3, 3.1.16

Description

The kernel's module loading system can be configured to prevent loading of the Bluetooth module. Add the following to the appropriate /etc/modprobe.d configuration file to prevent the loading of the Bluetooth module:

install bluetooth /bin/true

Rationale

If Bluetooth functionality must be disabled, preventing the kernel from loading the kernel module provides an additional safeguard against its activation.

Disable IPv6 Networking Support Automatic Loadingxccdf_org.ssgproject.content_rule_sysctl_kernel_ipv6_disable medium

Disable IPv6 Networking Support Automatic Loading

Rule IDxccdf_org.ssgproject.content_rule_sysctl_kernel_ipv6_disable
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  CM-7, 1551, 4.4.2, 3.1.20

Description

To disable support for (ipv6) add the following line to /etc/sysctl.d/ipv6.conf (or another file in /etc/sysctl.d):

net.ipv6.conf.all.disable_ipv6 = 1
This disables IPv6 on all network interfaces as other services and system functionality require the IPv6 stack loaded to work.

Rationale

Any unnecessary network stacks - including IPv6 - should be disabled, to reduce the vulnerability to exploitation.

Disable Interface Usage of IPv6xccdf_org.ssgproject.content_rule_network_ipv6_disable_interfaces low

Disable Interface Usage of IPv6

Rule IDxccdf_org.ssgproject.content_rule_network_ipv6_disable_interfaces
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References
Description

To disable interface usage of IPv6, add or correct the following lines in /etc/sysconfig/network:

NETWORKING_IPV6=no
IPV6INIT=no

Disable Support for RPC IPv6xccdf_org.ssgproject.content_rule_network_ipv6_disable_rpc low

Disable Support for RPC IPv6

Rule IDxccdf_org.ssgproject.content_rule_network_ipv6_disable_rpc
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  CM-7, 3.1.20

Description

RPC services for NFSv4 try to load transport modules for udp6 and tcp6 by default, even if IPv6 has been disabled in /etc/modprobe.d. To prevent RPC services such as rpc.mountd from attempting to start IPv6 network listeners, remove or comment out the following two lines in /etc/netconfig:

udp6       tpi_clts      v     inet6    udp     -       -
tcp6       tpi_cots_ord  v     inet6    tcp     -       -

Configure Kernel Parameter for Accepting Source-Routed Packets for All Interfacesxccdf_org.ssgproject.content_rule_sysctl_net_ipv6_conf_all_accept_source_route medium

Configure Kernel Parameter for Accepting Source-Routed Packets for All Interfaces

Rule IDxccdf_org.ssgproject.content_rule_sysctl_net_ipv6_conf_all_accept_source_route
Result
fail
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-4, 366, SRG-OS-000480-GPOS-00227, 3.1.20

Description

To set the runtime status of the net.ipv6.conf.all.accept_source_route kernel parameter, run the following command:

$ sudo sysctl -w net.ipv6.conf.all.accept_source_route=0
If this is not the system's default value, add the following line to /etc/sysctl.conf:
net.ipv6.conf.all.accept_source_route = 0

Rationale

Source-routed packets allow the source of the packet to suggest 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-routerd traffic, such as when IPv6 forwarding is enabled and the system is functioning as a router.

Accepting source-routed packets in the IPv6 protocol has few legitimate uses. It should be disabled unless it is absolutely required.

Remediation Shell script:   (show)

Complexity:low
Disruption:medium
Reboot:true
Strategy:disable

sysctl_net_ipv6_conf_all_accept_source_route_value="0"

#
# Set runtime for net.ipv6.conf.all.accept_source_route
#
/sbin/sysctl -q -n -w net.ipv6.conf.all.accept_source_route=$sysctl_net_ipv6_conf_all_accept_source_route_value

#
# If net.ipv6.conf.all.accept_source_route present in /etc/sysctl.conf, change value to appropriate value
#	else, add "net.ipv6.conf.all.accept_source_route = value" to /etc/sysctl.conf
#

function replace_or_append {
  local config_file=$1
  local key=$2
  local value=$3
  local cce=$4
  local format=$5

  # Check sanity of the input
  if [ $# -lt "3" ]
  then
        echo "Usage: replace_or_append 'config_file_location' 'key_to_search' 'new_value'"
        echo
        echo "If symlinks need to be taken into account, add yes/no to the last argument"
        echo "to allow to 'follow_symlinks'."
        echo "Aborting."
        exit 1
  fi

  # Test if the config_file is a symbolic link. If so, use --follow-symlinks with sed.
  # Otherwise, regular sed command will do.
  if test -L $config_file; then
    sed_command="sed -i --follow-symlinks"
  else
    sed_command="sed -i"
  fi

  # Test that the cce arg is not empty or does not equal @CCENUM@.
  # If @CCENUM@ exists, it means that there is no CCE assigned.
  if ! [ "x$cce" = x ] && [ "$cce" != '@CCENUM@' ]; then
    cce="CCE-${cce}"
  else
    cce="CCE"
  fi

  # Strip any search characters in the key arg so that the key can be replaced without
  # adding any search characters to the config file.
  stripped_key=$(sed "s/[\^=\$,;+]*//g" <<< $key)

  # If there is no print format specified in the last arg, use the default format.
  if ! [ "x$format" = x ] ; then
    printf -v formatted_output "$format" "$stripped_key" "$value"
  else
    formatted_output="$stripped_key = $value"
  fi

  # If the key exists, change it. Otherwise, add it to the config_file.
  if `grep -qi $key $config_file` ; then
    $sed_command "s/$key.*/$formatted_output/g" $config_file
  else
    # \n is precaution for case where file ends without trailing newline
    echo -e "\n# Per $cce: Set $formatted_output in $config_file" >> $config_file
    echo -e "$formatted_output" >> $config_file
  fi

}

replace_or_append '/etc/sysctl.conf' '^net.ipv6.conf.all.accept_source_route' "$sysctl_net_ipv6_conf_all_accept_source_route_value" 'CCE-80179-5'
Configure Accepting IPv6 Router Advertisementsxccdf_org.ssgproject.content_rule_sysctl_net_ipv6_conf_all_accept_ra low

Configure Accepting IPv6 Router Advertisements

Rule IDxccdf_org.ssgproject.content_rule_sysctl_net_ipv6_conf_all_accept_ra
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  CM-7, 4.4.1.1, 3.1.20

Description

To set the runtime status of the net.ipv6.conf.all.accept_ra kernel parameter, run the following command:

$ sudo sysctl -w net.ipv6.conf.all.accept_ra=0
If this is not the system's default value, add the following line to /etc/sysctl.conf:
net.ipv6.conf.all.accept_ra = 0

Rationale

An illicit router advertisement message could result in a man-in-the-middle attack.

Configure Accepting IPv6 Router Advertisementsxccdf_org.ssgproject.content_rule_sysctl_net_ipv6_conf_default_accept_ra low

Configure Accepting IPv6 Router Advertisements

Rule IDxccdf_org.ssgproject.content_rule_sysctl_net_ipv6_conf_default_accept_ra
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  CM-7, 4.4.1.1, 3.1.20

Description

To set the runtime status of the net.ipv6.conf.default.accept_ra kernel parameter, run the following command:

$ sudo sysctl -w net.ipv6.conf.default.accept_ra=0
If this is not the system's default value, add the following line to /etc/sysctl.conf:
net.ipv6.conf.default.accept_ra = 0

Rationale

An illicit router advertisement message could result in a man-in-the-middle attack.

Configure Accepting IPv6 Redirects By Defaultxccdf_org.ssgproject.content_rule_sysctl_net_ipv6_conf_all_accept_redirects medium

Configure Accepting IPv6 Redirects By Default

Rule IDxccdf_org.ssgproject.content_rule_sysctl_net_ipv6_conf_all_accept_redirects
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  CM-7, 1551, 4.4.1.2, 3.1.20

Description

To set the runtime status of the net.ipv6.conf.all.accept_redirects kernel parameter, run the following command:

$ sudo sysctl -w net.ipv6.conf.all.accept_redirects=0
If this is not the system's default value, add the following line to /etc/sysctl.conf:
net.ipv6.conf.all.accept_redirects = 0

Rationale

An illicit ICMP redirect message could result in a man-in-the-middle attack.

Configure Accepting IPv6 Redirects By Defaultxccdf_org.ssgproject.content_rule_sysctl_net_ipv6_conf_default_accept_redirects medium

Configure Accepting IPv6 Redirects By Default

Rule IDxccdf_org.ssgproject.content_rule_sysctl_net_ipv6_conf_default_accept_redirects
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  CM-7, 1551, 4.4.1.2, 3.1.20

Description

To set the runtime status of the net.ipv6.conf.default.accept_redirects kernel parameter, run the following command:

$ sudo sysctl -w net.ipv6.conf.default.accept_redirects=0
If this is not the system's default value, add the following line to /etc/sysctl.conf:
net.ipv6.conf.default.accept_redirects = 0

Rationale

An illicit ICMP redirect message could result in a man-in-the-middle attack.

Configure Kernel Parameter for Accepting Source-Routed Packets for Interfaces By Defaultxccdf_org.ssgproject.content_rule_sysctl_net_ipv6_conf_default_accept_source_route medium

Configure Kernel Parameter for Accepting Source-Routed Packets for Interfaces By Default

Rule IDxccdf_org.ssgproject.content_rule_sysctl_net_ipv6_conf_default_accept_source_route
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-4, 366, 3.1.20

Description

To set the runtime status of the net.ipv6.conf.default.accept_source_route kernel parameter, run the following command:

$ sudo sysctl -w net.ipv6.conf.default.accept_source_route=0
If this is not the system's default value, add the following line to /etc/sysctl.conf:
net.ipv6.conf.default.accept_source_route = 0

Rationale

Source-routed packets allow the source of the packet to suggest 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-routerd traffic, such as when IPv6 forwarding is enabled and the system is functioning as a router. Accepting source-routed packets in the IPv6 protocol has few legitimate uses. It should be disabled unless it is absolutely required.

Disable Kernel Parameter for IPv6 Forwardingxccdf_org.ssgproject.content_rule_sysctl_net_ipv6_conf_all_forwarding medium

Disable Kernel Parameter for IPv6 Forwarding

Rule IDxccdf_org.ssgproject.content_rule_sysctl_net_ipv6_conf_all_forwarding
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  CM-7, SC-5, 366, 4.1.1

Description

To set the runtime status of the net.ipv6.conf.all.forwarding kernel parameter, run the following command:

$ sudo sysctl -w net.ipv6.conf.all.forwarding=0
If this is not the system's default value, add the following line to /etc/sysctl.conf:
net.ipv6.conf.all.forwarding = 0

Rationale

IP forwarding permits the kernel to forward packets from one network interface to another. The ability to forward packets between two networks is only appropriate for systems acting as routers.

Manually Assign Global IPv6 Addressxccdf_org.ssgproject.content_rule_network_ipv6_static_address low

Manually Assign Global IPv6 Address

Rule IDxccdf_org.ssgproject.content_rule_network_ipv6_static_address
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  366

Description

To manually assign an IP address for an interface, edit the file /etc/sysconfig/network-scripts/ifcfg-interface. Add or correct the following line (substituting the correct IPv6 address):

IPV6ADDR=2001:0DB8::ABCD/64
Manually assigning an IP address is preferable to accepting one from routers or from the network otherwise. The example address here is an IPv6 address reserved for documentation purposes, as defined by RFC3849.

Use Privacy Extensions for Addressxccdf_org.ssgproject.content_rule_network_ipv6_privacy_extensions low

Use Privacy Extensions for Address

Rule IDxccdf_org.ssgproject.content_rule_network_ipv6_privacy_extensions
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  366, 3.1.20

Description

To introduce randomness into the automatic generation of IPv6 addresses, add or correct the following line in /etc/sysconfig/network-scripts/ifcfg-interface:

IPV6_PRIVACY=rfc3041
Automatically-generated IPv6 addresses are based on the underlying hardware (e.g. Ethernet) address, and so it becomes possible to track a piece of hardware over its lifetime using its traffic. If it is important for a system's IP address to not trivially reveal its hardware address, this setting should be applied.

Manually Assign IPv6 Router Addressxccdf_org.ssgproject.content_rule_network_ipv6_default_gateway low

Manually Assign IPv6 Router Address

Rule IDxccdf_org.ssgproject.content_rule_network_ipv6_default_gateway
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  366

Description

Edit the file /etc/sysconfig/network-scripts/ifcfg-interface, and add or correct the following line (substituting your gateway IP as appropriate):

IPV6_DEFAULTGW=2001:0DB8::0001
Router addresses should be manually set and not accepted via any auto-configuration or router advertisement.

Verify firewalld Enabledxccdf_org.ssgproject.content_rule_service_firewalld_enabled medium

Verify firewalld Enabled

Rule IDxccdf_org.ssgproject.content_rule_service_firewalld_enabled
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  CM-6(b), 366, 4.7, SRG-OS-000480-GPOS-00227, 3.1.3, 3.4.7

Description

The firewalld service can be enabled with the following command:

$ sudo systemctl enable firewalld.service

Rationale

Access control methods provide the ability to enhance system security posture by restricting services and known good IP addresses and address ranges. This prevents connections from unknown hosts and protocols.

OVAL details

Items found satisfying systemd test:

UnitDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependency
multi-user.targetbasic.targetsysinit.targetsystemd-journal-catalog-update.servicesystemd-update-utmp.servicelocal-fs.target-.mountboot.mountrhel-readonly.servicesystemd-remount-fs.servicerhel-import-state.servicesystemd-journald.servicesystemd-update-done.serviceplymouth-start.servicelvm2-lvmetad.socketsys-kernel-debug.mountsystemd-random-seed.servicesystemd-firstboot.servicesystemd-ask-password-console.pathcryptsetup.targetsystemd-tmpfiles-setup.serviceplymouth-read-write.servicesystemd-machine-id-commit.servicelvm2-monitor.servicedev-hugepages.mountswap.targetdev-mapper-centos\x2dswap.swapsystemd-tmpfiles-setup-dev.servicesys-fs-fuse-connections.mountsystemd-journal-flush.servicesystemd-udevd.servicesystemd-udev-trigger.serviceproc-sys-fs-binfmt_misc.automountsystemd-binfmt.servicesystemd-hwdb-update.servicelvm2-lvmpolld.socketsys-kernel-config.mountkmod-static-nodes.servicedev-mqueue.mountsystemd-vconsole-setup.servicesystemd-sysctl.servicesystemd-modules-load.serviceslices.targetsystem.slice-.slicesockets.targetsystemd-shutdownd.socketdm-event.socketsystemd-journald.socketsystemd-udevd-control.socketdbus.socketsystemd-initctl.socketpcscd.socketsystemd-udevd-kernel.socketmicrocode.servicerhel-dmesg.servicepaths.targetrhel-autorelabel.servicerhel-autorelabel-mark.serviceselinux-policy-migrate-local-changes@targeted.servicetimers.targetsystemd-tmpfiles-clean.timerrhel-configure.servicerhel-loadmodules.servicedbus.serviceremote-fs.targetpostfix.serviceauditd.servicesystemd-ask-password-wall.pathcrond.servicetuned.servicegetty.targetgetty@tty1.servicesystemd-readahead-replay.servicebrandbot.pathsshd.servicesystemd-update-utmp-runlevel.serviceplymouth-quit-wait.servicersyslog.servicefirewalld.serviceirqbalance.servicekdump.servicechronyd.servicesystemd-logind.serviceplymouth-quit.serviceNetworkManager.servicenetwork.servicesystemd-readahead-collect.servicesystemd-user-sessions.service
Set Default firewalld Zone for Incoming Packetsxccdf_org.ssgproject.content_rule_set_firewalld_default_zone medium

Set Default firewalld Zone for Incoming Packets

Rule IDxccdf_org.ssgproject.content_rule_set_firewalld_default_zone
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  CM-6(b), CM-7, 366, SRG-OS-000480-GPOS-00227, 5.10.1, 3.1.3, 3.4.7, 3.13.6

Description

To set the default zone to drop for the built-in default zone which processes incoming IPv4 and IPv6 packets, modify the following line in /etc/firewalld/firewalld.conf to be:

DefaultZone=drop

Rationale

In firewalld the default zone is applied only after all the applicable rules in the table are examined for a match. Setting the default zone to drop implements proper design for a firewall, i.e. any packets which are not explicitly permitted should not be accepted.

OVAL details

Items found satisfying Check /etc/firewalld/firewalld.conf DefaultZone for drop:

PathContent
/etc/firewalld/firewalld.confDefaultZone=drop
Disable DCCP Supportxccdf_org.ssgproject.content_rule_kernel_module_dccp_disabled medium

Disable DCCP Support

Rule IDxccdf_org.ssgproject.content_rule_kernel_module_dccp_disabled
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  CM-7, http://iase.disa.mil/stigs/cci/Pages/index.aspx, 4.6.1, 5.10.1, 3.4.6

Description

The Datagram Congestion Control Protocol (DCCP) is a relatively new transport layer protocol, designed to support streaming media and telephony. To configure the system to prevent the dccp kernel module from being loaded, add the following line to a file in the directory /etc/modprobe.d:

install dccp /bin/true

Rationale

Disabling DCCP protects the system against exploitation of any flaws in its implementation.

Disable SCTP Supportxccdf_org.ssgproject.content_rule_kernel_module_sctp_disabled medium

Disable SCTP Support

Rule IDxccdf_org.ssgproject.content_rule_kernel_module_sctp_disabled
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  CM-7, http://iase.disa.mil/stigs/cci/Pages/index.aspx, 4.6.2, 5.10.1, 3.4.6

Description

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. To configure the system to prevent the sctp kernel module from being loaded, add the following line to a file in the directory /etc/modprobe.d:

install sctp /bin/true

Rationale

Disabling SCTP protects the system against exploitation of any flaws in its implementation.

Install libreswan Packagexccdf_org.ssgproject.content_rule_package_libreswan_installed medium

Install libreswan Package

Rule IDxccdf_org.ssgproject.content_rule_package_libreswan_installed
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-17, MA-4, SC-9, 1130, 1131, Req-4.1

Description

The Libreswan package provides an implementation of IPsec and IKE, which permits the creation of secure tunnels over untrusted networks. The libreswan package can be installed with the following command:

$ sudo yum install libreswan

Rationale

Providing the ability for remote users or systems to initiate a secure VPN connection protects information when it is transmitted over a wide area network.

Verify Any Configured IPSec Tunnel Connectionsxccdf_org.ssgproject.content_rule_libreswan_approved_tunnels medium

Verify Any Configured IPSec Tunnel Connections

Rule IDxccdf_org.ssgproject.content_rule_libreswan_approved_tunnels
Result
notchecked
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-4, 336, SRG-OS-000480-GPOS-00227

Description

Libreswan provides an implementation of IPsec and IKE, which permits the creation of secure tunnels over untrusted networks. As such, IPsec can be used to circumvent certain network requirements such as filtering. Verify that if any IPsec connection (conn) configured in /etc/ipsec.conf and /etc/ipsec.d exists is an approved organizational connection.

Rationale

IP tunneling mechanisms can be used to bypass network filtering.

Evaluation messages
info 
No candidate or applicable check found.
Disable Client Dynamic DNS Updatesxccdf_org.ssgproject.content_rule_network_disable_ddns_interfaces medium

Disable Client Dynamic DNS Updates

Rule IDxccdf_org.ssgproject.content_rule_network_disable_ddns_interfaces
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  CM-6(b), 366, SRG-OS-000480-GPOS-00227

Description

Dynamic DNS allows clients to dynamically update their own DNS records. The updates are transmitted by unencrypted means which can reveal information to a potential malicious user. If the system does not require Dynamic DNS, remove all DHCP_HOSTNAME references from the /etc/sysconfig/network-scripts/ifcfg-interface scripts. If dhclient is used, remove all send host-name hostname references from the /etc/dhclient.conf configuration file and/or any reference from the /etc/dhcp directory.

Rationale

Dynamic DNS updates transmit unencrypted information about a system including its name and address and should not be used unless needed.

Disable Zeroconf Networkingxccdf_org.ssgproject.content_rule_network_disable_zeroconf low

Disable Zeroconf Networking

Rule IDxccdf_org.ssgproject.content_rule_network_disable_zeroconf
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  CM-7

Description

Zeroconf networking allows the system to assign itself an IP address and engage in IP communication without a statically-assigned address or even a DHCP server. Automatic address assignment via Zeroconf (or DHCP) is not recommended. To disable Zeroconf automatic route assignment in the 169.254.0.0 subnet, add or correct the following line in /etc/sysconfig/network:

NOZEROCONF=yes

Rationale

Zeroconf addresses are in the network 169.254.0.0. The networking scripts add entries to the system's routing table for these addresses. Zeroconf address assignment commonly occurs when the system is configured to use DHCP but fails to receive an address assignment from the DHCP server.

Configure Multiple DNS Servers in /etc/resolv.confxccdf_org.ssgproject.content_rule_network_configure_name_resolution low

Configure Multiple DNS Servers in /etc/resolv.conf

Rule IDxccdf_org.ssgproject.content_rule_network_configure_name_resolution
Result
fail
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  SC-22, 366, SRG-OS-000480-GPOS-00227

Description

Multiple Domain Name System (DNS) Servers should be configured in /etc/resolv.conf. This provides redundant name resolution services in the event that a domain server crashes. To configure the system to contain as least 2 DNS servers, add a corresponding nameserver ip_address entry in /etc/resolv.conf for each DNS server where ip_address is the IP address of a valid DNS server. For example:

search example.com
nameserver 192.168.0.1
nameserver 192.168.0.2

Rationale

To provide availability for name resolution services, multiple redundant name servers are mandated. A failure in name resolution could lead to the failure of security functions requiring name resolution, which may include time synchronization, centralized authentication, and remote system logging.

OVAL details

Items not found violating check if more than one nameserver in /etc/resolv.conf:

Object oval:ssg-obj_network_configure_name_resolution:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/resolv.conf^[\s]*nameserver[\s]+([0-9\.]+)$1
Ensure System is Not Acting as a Network Snifferxccdf_org.ssgproject.content_rule_network_sniffer_disabled medium

Ensure System is Not Acting as a Network Sniffer

Rule IDxccdf_org.ssgproject.content_rule_network_sniffer_disabled
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  CM-7, CM-7(2).1(i), http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf, MA-3, 366, SRG-OS-000480-GPOS-00227

Description

The system should not be acting as a network sniffer, which can capture all traffic on the network to which it is connected. Run the following to determine if any interface is running in promiscuous mode:

$ ip link | grep PROMISC

Rationale

Network interfaces in promiscuous mode allow for the capture of all network traffic visible to the system. If unauthorized individuals can access these applications, it may allow them to collect information such as logon IDs, passwords, and key exchanges between systems.

If the system is being used to perform a network troubleshooting function, the use of these tools must be documented with the Information Systems Security Manager (ISSM) and restricted to only authorized personnel.

OVAL details

Items not found satisfying random:

Object oval:ssg-object_promisc_interfaces:obj:1 of type interface_object
NameFilter
^.*$oval:ssg-state_promisc:ste:1
State oval:ssg-state_promisc:ste:1 of type interface_state
Flag
PROMISC
Ensure Log Files Are Owned By Appropriate Userxccdf_org.ssgproject.content_rule_rsyslog_files_ownership medium

Ensure Log Files Are Owned By Appropriate User

Rule IDxccdf_org.ssgproject.content_rule_rsyslog_files_ownership
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-6, SI-11, 1314, Req-10.5.1, Req-10.5.2

Description

The owner of all log files written by rsyslog should be root. These log files are determined by the second part of each Rule line in /etc/rsyslog.conf and typically all appear in /var/log. For each log file LOGFILE referenced in /etc/rsyslog.conf, run the following command to inspect the file's owner:

$ ls -l LOGFILE
If the owner is not root, run the following command to correct this:
$ sudo chown root LOGFILE

Rationale

The log files generated by rsyslog contain valuable information regarding system configuration, user authentication, and other such information. Log files should be protected from unauthorized access.

Ensure Log Files Are Owned By Appropriate Groupxccdf_org.ssgproject.content_rule_rsyslog_files_groupownership medium

Ensure Log Files Are Owned By Appropriate Group

Rule IDxccdf_org.ssgproject.content_rule_rsyslog_files_groupownership
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AC-6, SI-11, 1314, Req-10.5.1, Req-10.5.2

Description

The group-owner of all log files written by rsyslog should be root. These log files are determined by the second part of each Rule line in /etc/rsyslog.conf and typically all appear in /var/log. For each log file LOGFILE referenced in /etc/rsyslog.conf, run the following command to inspect the file's group owner:

$ ls -l LOGFILE
If the owner is not root, run the following command to correct this:
$ sudo chgrp root LOGFILE

Rationale

The log files generated by rsyslog contain valuable information regarding system configuration, user authentication, and other such information. Log files should be protected from unauthorized access.

Ensure System Log Files Have Correct Permissionsxccdf_org.ssgproject.content_rule_rsyslog_files_permissions medium

Ensure System Log Files Have Correct Permissions

Rule IDxccdf_org.ssgproject.content_rule_rsyslog_files_permissions
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  SI-11, 1314, Req-10.5.1, Req-10.5.2, 5.1.4

Description

The file permissions for all log files written by rsyslog should be set to 600, or more restrictive. These log files are determined by the second part of each Rule line in /etc/rsyslog.conf and typically all appear in /var/log. For each log file LOGFILE referenced in /etc/rsyslog.conf, run the following command to inspect the file's permissions:

$ ls -l LOGFILE
If the permissions are not 600 or more restrictive, run the following command to correct this:
$ sudo chmod 0600 LOGFILE

Rationale

Log files can contain valuable information regarding system configuration. If the system log files are not protected unauthorized users could change the logged data, eliminating their forensic value.

Ensure cron Is Logging To Rsyslogxccdf_org.ssgproject.content_rule_rsyslog_cron_logging medium

Ensure cron Is Logging To Rsyslog

Rule IDxccdf_org.ssgproject.content_rule_rsyslog_cron_logging
Result
pass
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AU-2(d), 366, SRG-OS-000480-GPOS-00227

Description

Cron logging must be implemented to spot intrusions or trace cron job status. If cron is not logging to rsyslog, it can be implemented by adding the following to the RULES section of /etc/rsyslog.conf:

cron.*                                                  /var/log/cron

Rationale

Cron logging can be used to trace the successful or unsuccessful execution of cron jobs. It can also be used to spot intrusions into the use of the cron facility by unauthorized and malicious users.

OVAL details

Items found satisfying cron is configured in /etc/rsyslog.conf:

PathContent
/etc/rsyslog.confcron.* /var/log/cron

Items not found satisfying cron is configured in /etc/rsyslog.d:

Object oval:ssg-obj_cron_logging_rsyslog_dir:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/etc/rsyslog.d^.*$^[\s]*cron\.\*[\s]*/var/log/cron$1
Ensure Logs Sent To Remote Hostxccdf_org.ssgproject.content_rule_rsyslog_remote_loghost low

Ensure Logs Sent To Remote Host

Rule IDxccdf_org.ssgproject.content_rule_rsyslog_remote_loghost
Result
fail
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  AU-3(2), AU-4(1), AU-9, 366, 1348, 136, 1851, 5.1.5, SRG-OS-000480-GPOS-00227

Description

To configure rsyslog to send logs to a remote log server, open /etc/rsyslog.conf and read and understand the last section of the file, which describes the multiple directives necessary to activate remote logging. Along with these other directives, the system can be configured to forward its logs to a particular log server by adding or correcting one of the following lines, substituting loghost.example.com appropriately. The choice of protocol depends on the environment of the system; although TCP and RELP provide more reliable message delivery, they may not be supported in all environments.
To use UDP for log message delivery:

*.* @loghost.example.com

To use TCP for log message delivery:
*.* @@loghost.example.com

To use RELP for log message delivery:
*.* :omrelp:loghost.example.com

Rationale

A log server (loghost) receives syslog messages from one or more systems. This data can be used as an additional log source in the event a system is compromised and its local logs are suspect. Forwarding log messages to a remote loghost also provides system administrators with a centralized place to view the status of multiple hosts within the enterprise.

OVAL details

Items not found violating Ensures system configured to export logs to remote host:

Object oval:ssg-object_remote_loghost_rsyslog_conf:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/rsyslog.conf^\*\.\*[\s]+(?:@|\:omrelp\:)1

Items not found violating Ensures system configured to export logs to remote host:

Object oval:ssg-object_remote_loghost_rsyslog_d:obj:1 of type textfilecontent54_object
PathFilenamePatternInstance
/etc/rsyslog.d.*^\*\.\*[\s]+(?:@|\:omrelp\:)1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable

rsyslog_remote_loghost_address="NULL"

if [ "$rsyslog_remote_loghost_address" != "NULL" ]
then

function replace_or_append {
  local config_file=$1
  local key=$2
  local value=$3
  local cce=$4
  local format=$5

  # Check sanity of the input
  if [ $# -lt "3" ]
  then
        echo "Usage: replace_or_append 'config_file_location' 'key_to_search' 'new_value'"
        echo
        echo "If symlinks need to be taken into account, add yes/no to the last argument"
        echo "to allow to 'follow_symlinks'."
        echo "Aborting."
        exit 1
  fi

  # Test if the config_file is a symbolic link. If so, use --follow-symlinks with sed.
  # Otherwise, regular sed command will do.
  if test -L $config_file; then
    sed_command="sed -i --follow-symlinks"
  else
    sed_command="sed -i"
  fi

  # Test that the cce arg is not empty or does not equal @CCENUM@.
  # If @CCENUM@ exists, it means that there is no CCE assigned.
  if ! [ "x$cce" = x ] && [ "$cce" != '@CCENUM@' ]; then
    cce="CCE-${cce}"
  else
    cce="CCE"
  fi

  # Strip any search characters in the key arg so that the key can be replaced without
  # adding any search characters to the config file.
  stripped_key=$(sed "s/[\^=\$,;+]*//g" <<< $key)

  # If there is no print format specified in the last arg, use the default format.
  if ! [ "x$format" = x ] ; then
    printf -v formatted_output "$format" "$stripped_key" "$value"
  else
    formatted_output="$stripped_key = $value"
  fi

  # If the key exists, change it. Otherwise, add it to the config_file.
  if `grep -qi $key $config_file` ; then
    $sed_command "s/$key.*/$formatted_output/g" $config_file
  else
    # \n is precaution for case where file ends without trailing newline
    echo -e "\n# Per $cce: Set $formatted_output in $config_file" >> $config_file
    echo -e "$formatted_output" >> $config_file
  fi

}

    replace_or_append '/etc/rsyslog.conf' '^\*\.\*' "@@$rsyslog_remote_loghost_address" 'CCE-27343-3' '%s %s'
fi
Ensure rsyslog Does Not Accept Remote Messages Unless Acting As Log Serverxccdf_org.ssgproject.content_rule_rsyslog_nolisten low

Ensure rsyslog Does Not Accept Remote Messages Unless Acting As Log Server

Rule IDxccdf_org.ssgproject.content_rule_rsyslog_nolisten
Result
pass
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  AU-9(2), AC-4, CM-6(c), 318, 368, 1812, 1813, 1814, SRG-OS-000480-GPOS-00227

Description

The rsyslog daemon should not accept remote messages unless the system acts as a log server. To ensure that it is not listening on the network, ensure the following lines are not found in /etc/rsyslog.conf:

$ModLoad imtcp
$InputTCPServerRun port
$ModLoad imudp
$UDPServerRun port
$ModLoad imrelp
$InputRELPServerRun port

Rationale

Any process which receives messages from the network incurs some risk of receiving malicious messages. This risk can be eliminated for rsyslog by configuring it not to listen on the network.

OVAL details

Items not found satisfying Ensure that the /etc/rsyslog.conf does not contain $InputTCPServerRun | $UDPServerRun | $InputRELPServerRun:

Object oval:ssg-object_rsyslog_nolisten:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/rsyslog.conf^[\s]*\$(?:Input(?:TCP|RELP)|UDP)ServerRun1
Enable rsyslog to Accept Messages via TCP, if Acting As Log Serverxccdf_org.ssgproject.content_rule_rsyslog_accept_remote_messages_tcp low

Enable rsyslog to Accept Messages via TCP, if Acting As Log Server

Rule IDxccdf_org.ssgproject.content_rule_rsyslog_accept_remote_messages_tcp
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  AU-9, 5.1.6

Description

The rsyslog daemon should not accept remote messages unless the system acts as a log server. If the system needs to act as a central log server, add the following lines to /etc/rsyslog.conf to enable reception of messages over TCP:

$ModLoad imtcp
$InputTCPServerRun 514

Rationale

If the system needs to act as a log server, this ensures that it can receive messages over a reliable TCP connection.

Enable rsyslog to Accept Messages via UDP, if Acting As Log Serverxccdf_org.ssgproject.content_rule_rsyslog_accept_remote_messages_udp low

Enable rsyslog to Accept Messages via UDP, if Acting As Log Server

Rule IDxccdf_org.ssgproject.content_rule_rsyslog_accept_remote_messages_udp
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  AU-9, 5.1.6

Description

The rsyslog daemon should not accept remote messages unless the system acts as a log server. If the system needs to act as a central log server, add the following lines to /etc/rsyslog.conf to enable reception of messages over UDP:

$ModLoad imudp
$UDPServerRun 514

Rationale

Many devices, such as switches, routers, and other Unix-like systems, may only support the traditional syslog transmission over UDP. If the system must act as a log server, this enables it to receive their messages as well.

Ensure Logrotate Runs Periodicallyxccdf_org.ssgproject.content_rule_ensure_logrotate_activated low

Ensure Logrotate Runs Periodically

Rule IDxccdf_org.ssgproject.content_rule_ensure_logrotate_activated
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References

References:  AU-9, 366, Req-10.7

Description

The logrotate utility allows for the automatic rotation of log files. The frequency of rotation is specified in /etc/logrotate.conf, which triggers a cron task. To configure logrotate to run daily, add or correct the following line in /etc/logrotate.conf:

# rotate log files frequency
daily

Rationale

Log files that are not properly rotated run the risk of growing so large that they fill up the /var/log partition. Valuable logging information could be lost if the /var/log partition becomes full.

Configure Logwatch HostLimit Linexccdf_org.ssgproject.content_rule_logwatch_configured_hostlimit low

Configure Logwatch HostLimit Line

Rule IDxccdf_org.ssgproject.content_rule_logwatch_configured_hostlimit
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References
Description

On a central logserver, you want Logwatch to summarize all syslog entries, including those which did not originate on the logserver itself. The HostLimit setting tells Logwatch to report on all hosts, not just the one on which it is running.

 HostLimit = no 

Configure Logwatch SplitHosts Linexccdf_org.ssgproject.content_rule_logwatch_configured_splithosts low

Configure Logwatch SplitHosts Line

Rule IDxccdf_org.ssgproject.content_rule_logwatch_configured_splithosts
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References
Description

If SplitHosts is set, Logwatch will separate entries by hostname. This makes the report longer but significantly more usable. If it is not set, then Logwatch will not report which host generated a given log entry, and that information is almost always necessary

 SplitHosts = yes 

Ensure rsyslog is Installedxccdf_org.ssgproject.content_rule_package_rsyslog_installed medium

Ensure rsyslog is Installed

Rule IDxccdf_org.ssgproject.content_rule_package_rsyslog_installed
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AU-9(2), 1311, 1312, 5.1.1

Description

Rsyslog is installed by default. The rsyslog package can be installed with the following command:

$ sudo yum install rsyslog

Rationale

The rsyslog package provides the rsyslog daemon, which provides system logging services.

Enable rsyslog Servicexccdf_org.ssgproject.content_rule_service_rsyslog_enabled medium

Enable rsyslog Service

Rule IDxccdf_org.ssgproject.content_rule_service_rsyslog_enabled
Result
notselected
Time2017-10-21T14:39:49
Severitymedium
Identifiers and References

References:  AU-4(1), AU-12, 1311, 1312, 1557, 1851, 5.1.2

Description

The rsyslog service provides syslog-style logging by default on Red Hat Enterprise Linux 7. The rsyslog service can be enabled with the following command:

$ sudo systemctl enable rsyslog.service

Rationale

The rsyslog service must be running in order to provide logging services, which are essential to system administration.

Disable Logwatch on Clients if a Logserver Existsxccdf_org.ssgproject.content_rule_disable_logwatch_for_logserver low

Disable Logwatch on Clients if a Logserver Exists

Rule IDxccdf_org.ssgproject.content_rule_disable_logwatch_for_logserver
Result
notselected
Time2017-10-21T14:39:49
Severitylow
Identifiers and References
Description

Does your site have a central logserver which has been configured to report on logs received from all systems? If so:

 
$ sudo rm /etc/cron.daily/0logwatch 
If no logserver exists, it will be necessary for each system to run Logwatch individually. Using a central logserver provides the security and reliability benefits discussed earlier, and also makes monitoring logs easier and less time-intensive for administrators.

Configure auditd Number of Logs Retainedxccdf_org.ssgproject.content_rule_auditd_data_retention_num_logs medium

Configure auditd Number of Logs Retained

Rule IDxccdf_org.ssgproject.content_rule_auditd_data_retention_num_logs
Result
notselected
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AU-1(b), AU-11, IR-5, Req-10.7, 5.4.1.1, 3.3.1

Description

Determine how many log files auditd should retain when it rotates logs. Edit the file /etc/audit/auditd.conf. Add or modify the following line, substituting NUMLOGS with the correct value of 5:

num_logs = NUMLOGS
Set the value to 5 for general-purpose systems. Note that values less than 2 result in no log rotation.

Rationale

The total storage for audit log files must be large enough to retain log information over the period required. This is a function of the maximum log file size and the number of logs retained.

Configure auditd Max Log File Sizexccdf_org.ssgproject.content_rule_auditd_data_retention_max_log_file medium

Configure auditd Max Log File Size

Rule IDxccdf_org.ssgproject.content_rule_auditd_data_retention_max_log_file
Result
notselected
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AU-1(b), AU-11, IR-5, Req-10.7, 5.2.1.1, 5.4.1.1

Description

Determine the amount of audit data (in megabytes) which should be retained in each log file. Edit the file /etc/audit/auditd.conf. Add or modify the following line, substituting the correct value of 6 for STOREMB:

max_log_file = STOREMB
Set the value to 6 (MB) or higher for general-purpose systems. Larger values, of course, support retention of even more audit data.

Rationale

The total storage for audit log files must be large enough to retain log information over the period required. This is a function of the maximum log file size and the number of logs retained.

Configure auditd max_log_file_action Upon Reaching Maximum Log Sizexccdf_org.ssgproject.content_rule_auditd_data_retention_max_log_file_action medium

Configure auditd max_log_file_action Upon Reaching Maximum Log Size

Rule IDxccdf_org.ssgproject.content_rule_auditd_data_retention_max_log_file_action
Result
notselected
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AU-1(b), AU-4, AU-11, IR-5, Req-10.7, 5.2.1.3, 5.4.1.1

Description

The default action to take when the logs reach their maximum size is to rotate the log files, discarding the oldest one. To configure the action taken by auditd, add or correct the line in /etc/audit/auditd.conf:

max_log_file_action = ACTION
Possible values for ACTION are described in the auditd.conf man page. These include:
  • ignore
  • syslog
  • suspend
  • rotate
  • keep_logs
Set the ACTION to rotate to ensure log rotation occurs. This is the default. The setting is case-insensitive.

Rationale

Automatically rotating logs (by setting this to rotate) minimizes the chances of the system unexpectedly running out of disk space by being overwhelmed with log data. However, for systems that must never discard log data, or which use external processes to transfer it and reclaim space, keep_logs can be employed.

Configure auditd space_left Action on Low Disk Spacexccdf_org.ssgproject.content_rule_auditd_data_retention_space_left_action medium

Configure auditd space_left Action on Low Disk Space

Rule IDxccdf_org.ssgproject.content_rule_auditd_data_retention_space_left_action
Result
fail
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AU-1(b), AU-4, AU-5(1), AU-5(b), IR-5, 1855, Req-10.7, 5.2.1.2, SRG-OS-000343-GPOS-00134, 030340, 5.4.1.1, 3.3.1

Description

The auditd service can be configured to take an action when disk space starts to run low. Edit the file /etc/audit/auditd.conf. Modify the following line, substituting ACTION appropriately:

space_left_action = ACTION
Possible values for ACTION are described in the auditd.conf man page. These include:
  • ignore
  • syslog
  • email
  • exec
  • suspend
  • single
  • halt
Set this to email (instead of the default, which is suspend) as it is more likely to get prompt attention. Acceptable values also include suspend, single, and halt.

Rationale

Notifying administrators of an impending disk space problem may allow them to take corrective action prior to any disruption.

OVAL details

Items found violating space left action:

PathContent
/etc/audit/auditd.confspace_left_action = SYSLOG
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable

var_auditd_space_left_action="email"

grep -q ^space_left_action /etc/audit/auditd.conf && \
  sed -i "s/space_left_action.*/space_left_action = $var_auditd_space_left_action/g" /etc/audit/auditd.conf
if ! [ $? -eq 0 ]; then
    echo "space_left_action = $var_auditd_space_left_action" >> /etc/audit/auditd.conf
fi
Configure auditd admin_space_left Action on Low Disk Spacexccdf_org.ssgproject.content_rule_auditd_data_retention_admin_space_left_action medium

Configure auditd admin_space_left Action on Low Disk Space

Rule IDxccdf_org.ssgproject.content_rule_auditd_data_retention_admin_space_left_action
Result
notselected
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AU-1(b), AU-4, AU-5(b), IR-5, 140, 1343, Req-10.7, 5.2.1.2, 5.4.1.1, 3.3.1

Description

The auditd service can be configured to take an action when disk space is running low but prior to running out of space completely. Edit the file /etc/audit/auditd.conf. Add or modify the following line, substituting ACTION appropriately:

admin_space_left_action = ACTION
Set this value to single to cause the system to switch to single user mode for corrective action. Acceptable values also include suspend and halt. For certain systems, the need for availability outweighs the need to log all actions, and a different setting should be determined. Details regarding all possible values for ACTION are described in the auditd.conf man page.

Rationale

Administrators should be made aware of an inability to record audit records. If a separate partition or logical volume of adequate size is used, running low on space for audit records should never occur.

Configure auditd mail_acct Action on Low Disk Spacexccdf_org.ssgproject.content_rule_auditd_data_retention_action_mail_acct medium

Configure auditd mail_acct Action on Low Disk Space

Rule IDxccdf_org.ssgproject.content_rule_auditd_data_retention_action_mail_acct
Result
pass
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AU-1(b), AU-4, AU-5(1), AU-5(a), IR-5, 1855, Req-10.7.a, 5.2.1.2, SRG-OS-000343-GPOS-00134, 5.4.1.1, 3.3.1

Description

The auditd service can be configured to send email to a designated account in certain situations. Add or correct the following line in /etc/audit/auditd.conf to ensure that administrators are notified via email for those situations:

action_mail_acct = root

Rationale

Email sent to the root account is typically aliased to the administrators of the system, who can take appropriate action.

OVAL details

Items found satisfying email account for actions:

PathContent
/etc/audit/auditd.confaction_mail_acct = root
Configure auditd flush priorityxccdf_org.ssgproject.content_rule_auditd_data_retention_flush low

Configure auditd flush priority

Rule IDxccdf_org.ssgproject.content_rule_auditd_data_retention_flush
Result
notselected
Time2017-10-21T14:39:50
Severitylow
Identifiers and References

References:  AU-9, AU-12(1), 1576, 3.3.1

Description

The auditd service can be configured to synchronously write audit event data to disk. Add or correct the following line in /etc/audit/auditd.conf to ensure that audit event data is fully synchronized with the log files on the disk:

flush = data

Rationale

Audit data should be synchronously written to disk to ensure log integrity. These parameters assure that all audit event data is fully synchronized with the log files on the disk.

Configure auditd to use audispd's syslog pluginxccdf_org.ssgproject.content_rule_auditd_audispd_syslog_plugin_activated medium

Configure auditd to use audispd's syslog plugin

Rule IDxccdf_org.ssgproject.content_rule_auditd_audispd_syslog_plugin_activated
Result
notselected
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AU-1(b), AU-3(2), IR-5, 136, Req-10.5.3, 5.4.1.1, 3.3.1

Description

To configure the auditd service to use the syslog plug-in of the audispd audit event multiplexor, set the active line in /etc/audisp/plugins.d/syslog.conf to yes. Restart the auditd service:

$ sudo service auditd restart

Rationale

The auditd service does not include the ability to send audit records to a centralized server for management directly. It does, however, include a plug-in for audit event multiplexor (audispd) to pass audit records to the local syslog server

Record attempts to alter time through adjtimexxccdf_org.ssgproject.content_rule_audit_rules_time_adjtimex low

Record attempts to alter time through adjtimex

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_time_adjtimex
Result
notselected
Time2017-10-21T14:39:50
Severitylow
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 5.2.4, Req-10.4.2.b, 1487, 169, 5.4.1.1, 3.1.7

Description

If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F arch=b32 -S adjtimex -F key=audit_time_rules
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S adjtimex -F key=audit_time_rules
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file:
-a always,exit -F arch=b32 -S adjtimex -F key=audit_time_rules
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S adjtimex -F key=audit_time_rules
The -k option allows for the specification of a key in string form that can be used for better reporting capability through ausearch and aureport. Multiple system calls can be defined on the same line to save space if desired, but is not required. See an example of multiple combined syscalls:
-a always,exit -F arch=b64 -S adjtimex,settimeofday -F key=audit_time_rules

Rationale

Arbitrary changes to the system time can be used to obfuscate nefarious activities in log files, as well as to confuse network services that are highly dependent upon an accurate system time (such as sshd). All changes to the system time should be audited.

Record attempts to alter time through settimeofdayxccdf_org.ssgproject.content_rule_audit_rules_time_settimeofday low

Record attempts to alter time through settimeofday

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_time_settimeofday
Result
notselected
Time2017-10-21T14:39:50
Severitylow
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 5.2.4, Req-10.4.2.b, 1487, 169, 5.4.1.1, 3.1.7

Description

If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F arch=b32 -S settimeofday -F key=audit_time_rules
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S settimeofday -F key=audit_time_rules
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file:
-a always,exit -F arch=b32 -S settimeofday -F key=audit_time_rules
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S settimeofday -F key=audit_time_rules
The -k option allows for the specification of a key in string form that can be used for better reporting capability through ausearch and aureport. Multiple system calls can be defined on the same line to save space if desired, but is not required. See an example of multiple combined syscalls:
-a always,exit -F arch=b64 -S adjtimex,settimeofday -F key=audit_time_rules

Rationale

Arbitrary changes to the system time can be used to obfuscate nefarious activities in log files, as well as to confuse network services that are highly dependent upon an accurate system time (such as sshd). All changes to the system time should be audited.

Record Attempts to Alter Time Through stimexccdf_org.ssgproject.content_rule_audit_rules_time_stime low

Record Attempts to Alter Time Through stime

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_time_stime
Result
notselected
Time2017-10-21T14:39:50
Severitylow
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, Req-10.4.2.b, 1487, 169, 5.4.1.1, 3.1.7

Description

If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d for both 32 bit and 64 bit systems:

-a always,exit -F arch=b32 -S stime -F key=audit_time_rules
Since the 64 bit version of the "stime" system call is not defined in the audit lookup table, the corresponding "-F arch=b64" form of this rule is not expected to be defined on 64 bit systems (the aforementioned "-F arch=b32" stime rule form itself is sufficient for both 32 bit and 64 bit systems). If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file for both 32 bit and 64 bit systems:
-a always,exit -F arch=b32 -S stime -F key=audit_time_rules
Since the 64 bit version of the "stime" system call is not defined in the audit lookup table, the corresponding "-F arch=b64" form of this rule is not expected to be defined on 64 bit systems (the aforementioned "-F arch=b32" stime rule form itself is sufficient for both 32 bit and 64 bit systems). The -k option allows for the specification of a key in string form that can be used for better reporting capability through ausearch and aureport. Multiple system calls can be defined on the same line to save space if desired, but is not required. See an example of multiple combined system calls:
-a always,exit -F arch=b64 -S adjtimex,settimeofday -F key=audit_time_rules

Rationale

Arbitrary changes to the system time can be used to obfuscate nefarious activities in log files, as well as to confuse network services that are highly dependent upon an accurate system time (such as sshd). All changes to the system time should be audited.

Record Attempts to Alter Time Through clock_settimexccdf_org.ssgproject.content_rule_audit_rules_time_clock_settime low

Record Attempts to Alter Time Through clock_settime

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_time_clock_settime
Result
notselected
Time2017-10-21T14:39:50
Severitylow
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 5.2.4, Req-10.4.2.b, 1487, 169, 5.4.1.1, 3.1.7

Description

If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F arch=b32 -S clock_settime -F a0=0x0 -F key=time-change
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S clock_settime -F a0=0x0 -F key=time-change
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file:
-a always,exit -F arch=b32 -S clock_settime -F a0=0x0 -F key=time-change
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S clock_settime -F a0=0x0 -F key=time-change
The -k option allows for the specification of a key in string form that can be used for better reporting capability through ausearch and aureport. Multiple system calls can be defined on the same line to save space if desired, but is not required. See an example of multiple combined syscalls:
-a always,exit -F arch=b64 -S adjtimex,settimeofday -F key=audit_time_rules

Rationale

Arbitrary changes to the system time can be used to obfuscate nefarious activities in log files, as well as to confuse network services that are highly dependent upon an accurate system time (such as sshd). All changes to the system time should be audited.

Record Attempts to Alter the localtime Filexccdf_org.ssgproject.content_rule_audit_rules_time_watch_localtime low

Record Attempts to Alter the localtime File

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_time_watch_localtime
Result
notselected
Time2017-10-21T14:39:50
Severitylow
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(b), IR-5, 5.2.4, Req-10.4.2.b, 1487, 169, 5.4.1.1, 3.1.7

Description

If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d:

-w /etc/localtime -p wa -k audit_time_rules
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file:
-w /etc/localtime -p wa -k audit_time_rules
The -k option allows for the specification of a key in string form that can be used for better reporting capability through ausearch and aureport and should always be used.

Rationale

Arbitrary changes to the system time can be used to obfuscate nefarious activities in log files, as well as to confuse network services that are highly dependent upon an accurate system time (such as sshd). All changes to the system time should be audited.

Record Events that Modify the System's Discretionary Access Controls - chmodxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_chmod low

Record Events that Modify the System's Discretionary Access Controls - chmod

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_chmod
Result
fail
Time2017-10-21T14:39:50
Severitylow
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 126, 172, Req-10.5.5, 5.2.10, SRG-OS-000064-GPOS-00033, SRG-OS-000392-GPOS-00172, SRG-OS-000458-GPOS-00203, 5.4.1.1, 3.1.7

Description

At a minimum, the audit system should collect file permission changes for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F arch=b32 -S chmod -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S chmod -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file:
-a always,exit -F arch=b32 -S chmod -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S chmod -F auid>=1000 -F auid!=4294967295 -F key=perm_mod

Rationale

The changing of file permissions could indicate that a user is attempting to gain access to information that would otherwise be disallowed. Auditing DAC modifications can facilitate the identification of patterns of abuse among both authorized and unauthorized users.

Warnings
warning  Note that these rules can be configured in a number of ways while still achieving the desired effect. Here the system calls have been placed independent of other system calls. Grouping these system calls with others as identifying earlier in this guide is more efficient.
OVAL details

Items not found violating audit augenrules 32-bit chmod:

Object oval:ssg-object_32bit_ardm_chmod_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+chmod[\s]+|([\s]+|[,])chmod([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit chmod:

Object oval:ssg-object_64bit_ardm_chmod_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+chmod[\s]+|([\s]+|[,])chmod([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit chmod:

Object oval:ssg-object_32bit_ardm_chmod_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+chmod[\s]+|([\s]+|[,])chmod([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit chmod:

Object oval:ssg-object_64bit_ardm_chmod_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+chmod[\s]+|([\s]+|[,])chmod([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# Perform the remediation for the syscall rule
# Retrieve hardware architecture of the underlying system
[ $(getconf LONG_BIT) = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit -F arch=$ARCH -S .* -F auid>=1000 -F auid!=4294967295 -k *"
	GROUP="chmod"
	FULL_RULE="-a always,exit -F arch=$ARCH -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Record Events that Modify the System's Discretionary Access Controls - chownxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_chown low

Record Events that Modify the System's Discretionary Access Controls - chown

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_chown
Result
fail
Time2017-10-21T14:39:50
Severitylow
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 126, 172, Req-10.5.5, 5.2.10, SRG-OS-000064-GPOS-00033, SRG-OS-000392-GPOS-00172, SRG-OS-000458-GPOS-00203, SRG-OS-000474-GPOS-00219, 5.4.1.1, 3.1.7

Description

At a minimum, the audit system should collect file permission changes for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F arch=b32 -S chown -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S chown -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file:
-a always,exit -F arch=b32 -S chown -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S chown -F auid>=1000 -F auid!=4294967295 -F key=perm_mod

Rationale

The changing of file permissions could indicate that a user is attempting to gain access to information that would otherwise be disallowed. Auditing DAC modifications can facilitate the identification of patterns of abuse among both authorized and unauthorized users.

Warnings
warning  Note that these rules can be configured in a number of ways while still achieving the desired effect. Here the system calls have been placed independent of other system calls. Grouping these system calls with others as identifying earlier in this guide is more efficient.
OVAL details

Items not found violating audit augenrules 32-bit chown:

Object oval:ssg-object_32bit_ardm_chown_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+chown[\s]+|([\s]+|[,])chown([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit chown:

Object oval:ssg-object_64bit_ardm_chown_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+chown[\s]+|([\s]+|[,])chown([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit chown:

Object oval:ssg-object_32bit_ardm_chown_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+chown[\s]+|([\s]+|[,])chown([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit chown:

Object oval:ssg-object_64bit_ardm_chown_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+chown[\s]+|([\s]+|[,])chown([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# Perform the remediation for the syscall rule
# Retrieve hardware architecture of the underlying system
[ $(getconf LONG_BIT) = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit -F arch=${ARCH} -S .* -F auid>=1000 -F auid!=4294967295 -k *"
	GROUP="chown"
	FULL_RULE="-a always,exit -F arch=${ARCH} -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Record Events that Modify the System's Discretionary Access Controls - fchmodxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_fchmod low

Record Events that Modify the System's Discretionary Access Controls - fchmod

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_fchmod
Result
fail
Time2017-10-21T14:39:50
Severitylow
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 126, 172, Req-10.5.5, 5.2.10, SRG-OS-000064-GPOS-00033, SRG-OS-000392-GPOS-00172, SRG-OS-000458-GPOS-00203, 5.4.1.1, 3.1.7

Description

At a minimum, the audit system should collect file permission changes for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F arch=b32 -S fchmod -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S fchmod -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file:
-a always,exit -F arch=b32 -S fchmod -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S fchmod -F auid>=1000 -F auid!=4294967295 -F key=perm_mod

Rationale

The changing of file permissions could indicate that a user is attempting to gain access to information that would otherwise be disallowed. Auditing DAC modifications can facilitate the identification of patterns of abuse among both authorized and unauthorized users.

Warnings
warning  Note that these rules can be configured in a number of ways while still achieving the desired effect. Here the system calls have been placed independent of other system calls. Grouping these system calls with others as identifying earlier in this guide is more efficient.
OVAL details

Items not found violating audit augenrules 32-bit fchmod:

Object oval:ssg-object_32bit_ardm_fchmod_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+fchmod[\s]+|([\s]+|[,])fchmod([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit fchmod:

Object oval:ssg-object_64bit_ardm_fchmod_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+fchmod[\s]+|([\s]+|[,])fchmod([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit fchmod:

Object oval:ssg-object_32bit_ardm_fchmod_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+fchmod[\s]+|([\s]+|[,])fchmod([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit fchmod:

Object oval:ssg-object_64bit_ardm_fchmod_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+fchmod[\s]+|([\s]+|[,])fchmod([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# Perform the remediation for the syscall rule
# Retrieve hardware architecture of the underlying system
[ $(getconf LONG_BIT) = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit -F arch=$ARCH -S .* -F auid>=1000 -F auid!=4294967295 -k *"
	GROUP="chmod"
	FULL_RULE="-a always,exit -F arch=$ARCH -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Record Events that Modify the System's Discretionary Access Controls - fchmodatxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_fchmodat low

Record Events that Modify the System's Discretionary Access Controls - fchmodat

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_fchmodat
Result
fail
Time2017-10-21T14:39:50
Severitylow
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 126, 172, Req-10.5.5, 5.2.10, SRG-OS-000064-GPOS-00033, SRG-OS-000392-GPOS-00172, SRG-OS-000458-GPOS-00203, 5.4.1.1, 3.1.7

Description

At a minimum, the audit system should collect file permission changes for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F arch=b32 -S fchmodat -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S fchmodat -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file:
-a always,exit -F arch=b32 -S fchmodat -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S fchmodat -F auid>=1000 -F auid!=4294967295 -F key=perm_mod

Rationale

The changing of file permissions could indicate that a user is attempting to gain access to information that would otherwise be disallowed. Auditing DAC modifications can facilitate the identification of patterns of abuse among both authorized and unauthorized users.

Warnings
warning  Note that these rules can be configured in a number of ways while still achieving the desired effect. Here the system calls have been placed independent of other system calls. Grouping these system calls with others as identifying earlier in this guide is more efficient.
OVAL details

Items not found violating audit augenrules 32-bit fchmodat:

Object oval:ssg-object_32bit_ardm_fchmodat_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+fchmodat[\s]+|([\s]+|[,])fchmodat([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit fchmodat:

Object oval:ssg-object_64bit_ardm_fchmodat_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+fchmodat[\s]+|([\s]+|[,])fchmodat([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit fchmodat:

Object oval:ssg-object_32bit_ardm_fchmodat_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+fchmodat[\s]+|([\s]+|[,])fchmodat([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit fchmodat:

Object oval:ssg-object_64bit_ardm_fchmodat_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+fchmodat[\s]+|([\s]+|[,])fchmodat([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# Perform the remediation for the syscall rule
# Retrieve hardware architecture of the underlying system
[ $(getconf LONG_BIT) = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit -F arch=$ARCH -S .* -F auid>=1000 -F auid!=4294967295 -k *"
	GROUP="chmod"
	FULL_RULE="-a always,exit -F arch=$ARCH -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Record Events that Modify the System's Discretionary Access Controls - fchownxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_fchown low

Record Events that Modify the System's Discretionary Access Controls - fchown

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_fchown
Result
fail
Time2017-10-21T14:39:50
Severitylow
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 126, 172, Req-10.5.5, 5.2.10, SRG-OS-000064-GPOS-00033, SRG-OS-000392-GPOS-00172, SRG-OS-000458-GPOS-00203, SRG-OS-000474-GPOS-00219, 5.4.1.1, 3.1.7

Description

At a minimum, the audit system should collect file permission changes for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F arch=b32 -S fchown -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S fchown -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file:
-a always,exit -F arch=b32 -S fchown -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S fchown -F auid>=1000 -F auid!=4294967295 -F key=perm_mod

Rationale

The changing of file permissions could indicate that a user is attempting to gain access to information that would otherwise be disallowed. Auditing DAC modifications can facilitate the identification of patterns of abuse among both authorized and unauthorized users.

Warnings
warning  Note that these rules can be configured in a number of ways while still achieving the desired effect. Here the system calls have been placed independent of other system calls. Grouping these system calls with others as identifying earlier in this guide is more efficient.
OVAL details

Items not found violating audit augenrules 32-bit fchown:

Object oval:ssg-object_32bit_ardm_fchown_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+fchown[\s]+|([\s]+|[,])fchown([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit fchown:

Object oval:ssg-object_64bit_ardm_fchown_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+fchown[\s]+|([\s]+|[,])fchown([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit fchown:

Object oval:ssg-object_32bit_ardm_fchown_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+fchown[\s]+|([\s]+|[,])fchown([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit fchown:

Object oval:ssg-object_64bit_ardm_fchown_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+fchown[\s]+|([\s]+|[,])fchown([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# Perform the remediation for the syscall rule
# Retrieve hardware architecture of the underlying system
[ $(getconf LONG_BIT) = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit -F arch=${ARCH} -S .* -F auid>=1000 -F auid!=4294967295 -k *"
	GROUP="chown"
	FULL_RULE="-a always,exit -F arch=${ARCH} -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Record Events that Modify the System's Discretionary Access Controls - fchownatxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_fchownat low

Record Events that Modify the System's Discretionary Access Controls - fchownat

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_fchownat
Result
fail
Time2017-10-21T14:39:50
Severitylow
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 126, 172, Req-10.5.5, 5.2.10, SRG-OS-000064-GPOS-00033, SRG-OS-000392-GPOS-00172, SRG-OS-000458-GPOS-00203, SRG-OS-000474-GPOS-00219, 5.4.1.1, 3.1.7

Description

At a minimum, the audit system should collect file permission changes for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F arch=b32 -S fchownat -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S fchownat -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file:
-a always,exit -F arch=b32 -S fchownat -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S fchownat -F auid>=1000 -F auid!=4294967295 -F key=perm_mod

Rationale

The changing of file permissions could indicate that a user is attempting to gain access to information that would otherwise be disallowed. Auditing DAC modifications can facilitate the identification of patterns of abuse among both authorized and unauthorized users.

Warnings
warning  Note that these rules can be configured in a number of ways while still achieving the desired effect. Here the system calls have been placed independent of other system calls. Grouping these system calls with others as identifying earlier in this guide is more efficient.
OVAL details

Items not found violating audit augenrules 32-bit fchownat:

Object oval:ssg-object_32bit_ardm_fchownat_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+fchownat[\s]+|([\s]+|[,])fchownat([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit fchownat:

Object oval:ssg-object_64bit_ardm_fchownat_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+fchownat[\s]+|([\s]+|[,])fchownat([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit fchownat:

Object oval:ssg-object_32bit_ardm_fchownat_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+fchownat[\s]+|([\s]+|[,])fchownat([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit fchownat:

Object oval:ssg-object_64bit_ardm_fchownat_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+fchownat[\s]+|([\s]+|[,])fchownat([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# Perform the remediation for the syscall rule
# Retrieve hardware architecture of the underlying system
[ $(getconf LONG_BIT) = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit -F arch=${ARCH} -S .* -F auid>=1000 -F auid!=4294967295 -k *"
	GROUP="chown"
	FULL_RULE="-a always,exit -F arch=${ARCH} -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Record Events that Modify the System's Discretionary Access Controls - fremovexattrxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_fremovexattr medium

Record Events that Modify the System's Discretionary Access Controls - fremovexattr

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_fremovexattr
Result
fail
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 172, Req-10.5.5, 5.2.10, SRG-OS-000064-GPOS-00033, SRG-OS-000392-GPOS-00172, SRG-OS-000458-GPOS-00203, 5.4.1.1, 3.1.7

Description

At a minimum, the audit system should collect file permission changes for all users and root.

If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F arch=b32 -S fremovexattr -F auid>=1000 -F auid!=4294967295 -F key=perm_mod


If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S fremovexattr -F auid>=1000 -F auid!=4294967295 -F key=perm_mod


If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file:
-a always,exit -F arch=b32 -S fremovexattr -F auid>=1000 -F auid!=4294967295 -F key=perm_mod


If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S fremovexattr -F auid>=1000 -F auid!=4294967295 -F key=perm_mod

Rationale

The changing of file permissions could indicate that a user is attempting to gain access to information that would otherwise be disallowed. Auditing DAC modifications can facilitate the identification of patterns of abuse among both authorized and unauthorized users.

Warnings
warning  Note that these rules can be configured in a number of ways while still achieving the desired effect. Here the system calls have been placed independent of other system calls. Grouping these system calls with others as identifying earlier in this guide is more efficient.
OVAL details

Items not found violating audit augenrules 32-bit fremovexattr:

Object oval:ssg-object_32bit_ardm_fremovexattr_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+fremovexattr[\s]+|([\s]+|[,])fremovexattr([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit fremovexattr:

Object oval:ssg-object_64bit_ardm_fremovexattr_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+fremovexattr[\s]+|([\s]+|[,])fremovexattr([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit fremovexattr:

Object oval:ssg-object_32bit_ardm_fremovexattr_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+fremovexattr[\s]+|([\s]+|[,])fremovexattr([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit fremovexattr:

Object oval:ssg-object_64bit_ardm_fremovexattr_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+fremovexattr[\s]+|([\s]+|[,])fremovexattr([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# Perform the remediation for the syscall rule
# Retrieve hardware architecture of the underlying system
[ $(getconf LONG_BIT) = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit .* -F auid>=1000 -F auid!=4294967295 -k *"
	GROUP="xattr"
	FULL_RULE="-a always,exit -F arch=${ARCH} -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Record Events that Modify the System's Discretionary Access Controls - fsetxattrxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_fsetxattr low

Record Events that Modify the System's Discretionary Access Controls - fsetxattr

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_fsetxattr
Result
fail
Time2017-10-21T14:39:50
Severitylow
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 126, 172, Req-10.5.5, 5.2.10, SRG-OS-000064-GPOS-00033, SRG-OS-000392-GPOS-00172, SRG-OS-000458-GPOS-00203, 5.4.1.1, 3.1.7

Description

At a minimum, the audit system should collect file permission changes for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F arch=b32 -S fsetxattr -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S fsetxattr -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file:
-a always,exit -F arch=b32 -S fsetxattr -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S fsetxattr -F auid>=1000 -F auid!=4294967295 -F key=perm_mod

Rationale

The changing of file permissions could indicate that a user is attempting to gain access to information that would otherwise be disallowed. Auditing DAC modifications can facilitate the identification of patterns of abuse among both authorized and unauthorized users.

Warnings
warning  Note that these rules can be configured in a number of ways while still achieving the desired effect. Here the system calls have been placed independent of other system calls. Grouping these system calls with others as identifying earlier in this guide is more efficient.
OVAL details

Items not found violating audit augenrules 32-bit fsetxattr:

Object oval:ssg-object_32bit_ardm_fsetxattr_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+fsetxattr[\s]+|([\s]+|[,])fsetxattr([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit fsetxattr:

Object oval:ssg-object_64bit_ardm_fsetxattr_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+fsetxattr[\s]+|([\s]+|[,])fsetxattr([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit fsetxattr:

Object oval:ssg-object_32bit_ardm_fsetxattr_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+fsetxattr[\s]+|([\s]+|[,])fsetxattr([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit fsetxattr:

Object oval:ssg-object_64bit_ardm_fsetxattr_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+fsetxattr[\s]+|([\s]+|[,])fsetxattr([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# Perform the remediation for the syscall rule
# Retrieve hardware architecture of the underlying system
[ $(getconf LONG_BIT) = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit .* -F auid>=1000 -F auid!=4294967295 -k *"
	GROUP="xattr"
	FULL_RULE="-a always,exit -F arch=${ARCH} -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Record Events that Modify the System's Discretionary Access Controls - lchownxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_lchown low

Record Events that Modify the System's Discretionary Access Controls - lchown

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_lchown
Result
fail
Time2017-10-21T14:39:50
Severitylow
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 126, 172, Req-10.5.5, 5.2.10, SRG-OS-000064-GPOS-00033, SRG-OS-000392-GPOS-00172, SRG-OS-000458-GPOS-00203, SRG-OS-000474-GPOS-00219, 5.4.1.1, 3.1.7

Description

At a minimum, the audit system should collect file permission changes for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F arch=b32 -S lchown -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S lchown -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file:
-a always,exit -F arch=b32 -S lchown -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S lchown -F auid>=1000 -F auid!=4294967295 -F key=perm_mod

Rationale

The changing of file permissions could indicate that a user is attempting to gain access to information that would otherwise be disallowed. Auditing DAC modifications can facilitate the identification of patterns of abuse among both authorized and unauthorized users.

Warnings
warning  Note that these rules can be configured in a number of ways while still achieving the desired effect. Here the system calls have been placed independent of other system calls. Grouping these system calls with others as identifying earlier in this guide is more efficient.
OVAL details

Items not found violating audit augenrules 32-bit lchown:

Object oval:ssg-object_32bit_ardm_lchown_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+lchown[\s]+|([\s]+|[,])lchown([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit lchown:

Object oval:ssg-object_64bit_ardm_lchown_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+lchown[\s]+|([\s]+|[,])lchown([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit lchown:

Object oval:ssg-object_32bit_ardm_lchown_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+lchown[\s]+|([\s]+|[,])lchown([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit lchown:

Object oval:ssg-object_64bit_ardm_lchown_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+lchown[\s]+|([\s]+|[,])lchown([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# Perform the remediation for the syscall rule
# Retrieve hardware architecture of the underlying system
[ $(getconf LONG_BIT) = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit -F arch=${ARCH} -S .* -F auid>=1000 -F auid!=4294967295 -k *"
	GROUP="chown"
	FULL_RULE="-a always,exit -F arch=${ARCH} -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Record Events that Modify the System's Discretionary Access Controls - lremovexattrxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_lremovexattr medium

Record Events that Modify the System's Discretionary Access Controls - lremovexattr

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_lremovexattr
Result
fail
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 172, Req-10.5.5, 5.2.10, SRG-OS-000064-GPOS-00033, SRG-OS-000392-GPOS-00172, SRG-OS-000458-GPOS-00203, 5.4.1.1, 3.1.7

Description

At a minimum, the audit system should collect file permission changes for all users and root.

If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F arch=b32 -S lremovexattr -F auid>=1000 -F auid!=4294967295 -F key=perm_mod


If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S lremovexattr -F auid>=1000 -F auid!=4294967295 -F key=perm_mod


If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file:
-a always,exit -F arch=b32 -S lremovexattr -F auid>=1000 -F auid!=4294967295 -F key=perm_mod


If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S lremovexattr -F auid>=1000 -F auid!=4294967295 -F key=perm_mod

Rationale

The changing of file permissions could indicate that a user is attempting to gain access to information that would otherwise be disallowed. Auditing DAC modifications can facilitate the identification of patterns of abuse among both authorized and unauthorized users.

Warnings
warning  Note that these rules can be configured in a number of ways while still achieving the desired effect. Here the system calls have been placed independent of other system calls. Grouping these system calls with others as identifying earlier in this guide is more efficient.
OVAL details

Items not found violating audit augenrules 32-bit lremovexattr:

Object oval:ssg-object_32bit_ardm_lremovexattr_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+lremovexattr[\s]+|([\s]+|[,])chmod([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit lremovexattr:

Object oval:ssg-object_64bit_ardm_lremovexattr_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+lremovexattr[\s]+|([\s]+|[,])chmod([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit lremovexattr:

Object oval:ssg-object_32bit_ardm_lremovexattr_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+lremovexattr[\s]+|([\s]+|[,])chmod([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit lremovexattr:

Object oval:ssg-object_64bit_ardm_lremovexattr_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+lremovexattr[\s]+|([\s]+|[,])chmod([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# Perform the remediation for the syscall rule
# Retrieve hardware architecture of the underlying system
[ $(getconf LONG_BIT) = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit .* -F auid>=1000 -F auid!=4294967295 -k *"
	GROUP="xattr"
	FULL_RULE="-a always,exit -F arch=${ARCH} -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Record Events that Modify the System's Discretionary Access Controls - lsetxattrxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_lsetxattr low

Record Events that Modify the System's Discretionary Access Controls - lsetxattr

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_lsetxattr
Result
fail
Time2017-10-21T14:39:50
Severitylow
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 126, 172, Req-10.5.5, 5.2.10, SRG-OS-000064-GPOS-00033, SRG-OS-000392-GPOS-00172, SRG-OS-000458-GPOS-00203, SRG-OS-000474-GPOS-00219, 5.4.1.1, 3.1.7

Description

At a minimum, the audit system should collect file permission changes for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F arch=b32 -S lsetxattr -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S lsetxattr -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file:
-a always,exit -F arch=b32 -S lsetxattr -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S lsetxattr -F auid>=1000 -F auid!=4294967295 -F key=perm_mod

Rationale

The changing of file permissions could indicate that a user is attempting to gain access to information that would otherwise be disallowed. Auditing DAC modifications can facilitate the identification of patterns of abuse among both authorized and unauthorized users.

Warnings
warning  Note that these rules can be configured in a number of ways while still achieving the desired effect. Here the system calls have been placed independent of other system calls. Grouping these system calls with others as identifying earlier in this guide is more efficient.
OVAL details

Items not found violating audit augenrules 32-bit lsetxattr:

Object oval:ssg-object_32bit_ardm_lsetxattr_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+lsetxattr[\s]+|([\s]+|[,])lsetxattr([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit lsetxattr:

Object oval:ssg-object_64bit_ardm_lsetxattr_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+lsetxattr[\s]+|([\s]+|[,])lsetxattr([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit lsetxattr:

Object oval:ssg-object_32bit_ardm_lsetxattr_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+lsetxattr[\s]+|([\s]+|[,])lsetxattr([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctls 64-bit lsetxattr:

Object oval:ssg-object_64bit_ardm_lsetxattr_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+lsetxattr[\s]+|([\s]+|[,])lsetxattr([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# Perform the remediation for the syscall rule
# Retrieve hardware architecture of the underlying system
[ $(getconf LONG_BIT) = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit .* -F auid>=1000 -F auid!=4294967295 -k *"
	GROUP="xattr"
	FULL_RULE="-a always,exit -F arch=${ARCH} -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Record Events that Modify the System's Discretionary Access Controls - removexattrxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_removexattr medium

Record Events that Modify the System's Discretionary Access Controls - removexattr

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_removexattr
Result
fail
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 172, Req-10.5.5, 5.2.10, SRG-OS-000064-GPOS-00033, SRG-OS-000392-GPOS-00172, SRG-OS-000458-GPOS-00203, 5.4.1.1, 3.1.7

Description

At a minimum, the audit system should collect file permission changes for all users and root.

If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F arch=b32 -S removexattr -F auid>=1000 -F auid!=4294967295 -F key=perm_mod


If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S removexattr -F auid>=1000 -F auid!=4294967295 -F key=perm_mod


If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file:
-a always,exit -F arch=b32 -S removexattr -F auid>=1000 -F auid!=4294967295 -F key=perm_mod


If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S removexattr -F auid>=1000 -F auid!=4294967295 -F key=perm_mod

Rationale

The changing of file permissions could indicate that a user is attempting to gain access to information that would otherwise be disallowed. Auditing DAC modifications can facilitate the identification of patterns of abuse among both authorized and unauthorized users.

Warnings
warning  Note that these rules can be configured in a number of ways while still achieving the desired effect. Here the system calls have been placed independent of other system calls. Grouping these system calls with others as identifying earlier in this guide is more efficient.
OVAL details

Items not found violating audit augenrules 32-bit removexattr:

Object oval:ssg-object_32bit_ardm_removexattr_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+removexattr[\s]+|([\s]+|[,])removexattr([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit removexattr:

Object oval:ssg-object_64bit_ardm_removexattr_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+removexattr[\s]+|([\s]+|[,])removexattr([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit removexattr:

Object oval:ssg-object_32bit_ardm_removexattr_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+removexattr[\s]+|([\s]+|[,])removexattr([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit removexattr:

Object oval:ssg-object_64bit_ardm_removexattr_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+removexattr[\s]+|([\s]+|[,])removexattr([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# Perform the remediation for the syscall rule
# Retrieve hardware architecture of the underlying system
[ $(getconf LONG_BIT) = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit .* -F auid>=1000 -F auid!=4294967295 -k *"
	GROUP="xattr"
	FULL_RULE="-a always,exit -F arch=${ARCH} -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Record Events that Modify the System's Discretionary Access Controls - setxattrxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_setxattr low

Record Events that Modify the System's Discretionary Access Controls - setxattr

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_dac_modification_setxattr
Result
fail
Time2017-10-21T14:39:50
Severitylow
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 126, 172, Req-10.5.5, 5.2.10, SRG-OS-000064-GPOS-00033, SRG-OS-000392-GPOS-00172, SRG-OS-000458-GPOS-00203, 5.4.1.1, 3.1.7

Description

At a minimum, the audit system should collect file permission changes for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F arch=b32 -S setxattr -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S setxattr -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file:
-a always,exit -F arch=b32 -S setxattr -F auid>=1000 -F auid!=4294967295 -F key=perm_mod
If the system is 64 bit then also add the following line:
-a always,exit -F arch=b64 -S setxattr -F auid>=1000 -F auid!=4294967295 -F key=perm_mod

Rationale

The changing of file permissions could indicate that a user is attempting to gain access to information that would otherwise be disallowed. Auditing DAC modifications can facilitate the identification of patterns of abuse among both authorized and unauthorized users.

Warnings
warning  Note that these rules can be configured in a number of ways while still achieving the desired effect. Here the system calls have been placed independent of other system calls. Grouping these system calls with others as identifying earlier in this guide is more efficient.
OVAL details

Items not found violating audit augenrules 32-bit setxattr:

Object oval:ssg-object_32bit_ardm_setxattr_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+setxattr[\s]+|([\s]+|[,])setxattr([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit setxattr:

Object oval:ssg-object_64bit_ardm_setxattr_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+setxattr[\s]+|([\s]+|[,])setxattr([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit setxattr:

Object oval:ssg-object_32bit_ardm_setxattr_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+setxattr[\s]+|([\s]+|[,])setxattr([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit setxattr:

Object oval:ssg-object_64bit_ardm_setxattr_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+setxattr[\s]+|([\s]+|[,])setxattr([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# Perform the remediation for the syscall rule
# Retrieve hardware architecture of the underlying system
[ $(getconf LONG_BIT) = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit .* -F auid>=1000 -F auid!=4294967295 -k *"
	GROUP="xattr"
	FULL_RULE="-a always,exit -F arch=${ARCH} -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Ensure auditd Collects Unauthorized Access Attempts to Files (unsuccessful)xccdf_org.ssgproject.content_rule_audit_rules_unsuccessful_file_modification medium

Ensure auditd Collects Unauthorized Access Attempts to Files (unsuccessful)

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_unsuccessful_file_modification
Result
notselected
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 172, 2884, Req-10.2.4, Req-10.2.1, 5.2.10, 5.4.1.1, 3.1.7

Description

At a minimum the audit system should collect unauthorized file accesses for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F arch=b32 -S creat,open,openat,open_by_handle_at,truncate,ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b32 -S creat,open,openat,open_by_handle_at,truncate,ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access
If the system is 64 bit then also add the following lines:
-a always,exit -F arch=b64 -S creat,open,openat,open_by_handle_at,truncate,ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b64 -S creat,open,openat,open_by_handle_at,truncate,ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file:
-a always,exit -F arch=b32 -S creat,open,openat,open_by_handle_at,truncate,ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b32 -S creat,open,openat,open_by_handle_at,truncate,ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access
If the system is 64 bit then also add the following lines:
-a always,exit -F arch=b64 -S creat,open,openat,open_by_handle_at,truncate,ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b64 -S creat,open,openat,open_by_handle_at,truncate,ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access

Rationale

Unsuccessful attempts to access files could be an indicator of malicious activity on a system. Auditing these events could serve as evidence of potential system compromise.

Record Unauthorized Access Attempts to Files (unsuccessful) - creatxccdf_org.ssgproject.content_rule_audit_rules_unsuccessful_file_modification_creat medium

Record Unauthorized Access Attempts to Files (unsuccessful) - creat

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_unsuccessful_file_modification_creat
Result
fail
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 172, 2884, SRG-OS-000064-GPOS-00033, SRG-OS-000458-GPOS-00203, SRG-OS-000461-GPOS-00205, SRG-OS-000392-GPOS-00172, Req-10.2.4, Req-10.2.1, 5.2.10, 3.1.7

Description

At a minimum, the audit system should collect unauthorized file accesses for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F arch=b32 -S creat -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b32 -S creat -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access
If the system is 64 bit then also add the following lines:
-a always,exit -F arch=b64 -S creat -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b64 -S creat -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file:
-a always,exit -F arch=b32 -S creat -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b32 -S creat -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access
If the system is 64 bit then also add the following lines:
-a always,exit -F arch=b64 -S creat -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b64 -S creat -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access

Rationale

Unsuccessful attempts to access files could be an indicator of malicious activity on a system. Auditing these events could serve as evidence of potential system compromise.

Warnings
warning  Note that these rules can be configured in a number of ways while still achieving the desired effect. Here the system calls have been placed independent of other system calls. Grouping these system calls with others as identifying earlier in this guide is more efficient.
OVAL details

Items not found violating audit augenrules 32-bit file eaccess:

Object oval:ssg-object_32bit_arufm_eaccess_creat_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+creat[\s]+|([\s]+|[,])creat([\s]+|[,])))(?:.*-F\s+exit=\-EACCES[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 32-bit file eperm:

Object oval:ssg-object_32bit_arufm_eperm_creat_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+creat[\s]+|([\s]+|[,])creat([\s]+|[,])))(?:.*-F\s+exit=\-EPERM[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit file eaccess:

Object oval:ssg-object_64bit_arufm_eaccess_creat_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+creat[\s]+|([\s]+|[,])creat([\s]+|[,])))(?:.*-F\s+exit=\-EACCES[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit file eperm:

Object oval:ssg-object_64bit_arufm_eperm_creat_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+creat[\s]+|([\s]+|[,])creat([\s]+|[,])))(?:.*-F\s+exit=\-EPERM[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit file eaccess:

Object oval:ssg-object_32bit_arufm_eaccess_creat_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+creat[\s]+|([\s]+|[,])creat([\s]+|[,])))(?:.*-F\s+exit=\-EACCES[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit file eperm:

Object oval:ssg-object_32bit_arufm_eperm_creat_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+creat[\s]+|([\s]+|[,])creat([\s]+|[,])))(?:.*-F\s+exit=\-EPERM[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit file eaccess:

Object oval:ssg-object_64bit_arufm_eaccess_creat_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+creat[\s]+|([\s]+|[,])creat([\s]+|[,])))(?:.*-F\s+exit=\-EACCES[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit file eperm:

Object oval:ssg-object_64bit_arufm_eperm_creat_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+creat[\s]+|([\s]+|[,])creat([\s]+|[,])))(?:.*-F\s+exit=\-EPERM[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# First perform the remediation of the syscall rule
# Retrieve hardware architecture of the underlying system
[ "$(getconf LONG_BIT)" = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit -F arch=$ARCH -S creat -F exit=-EACCESS.*"
	GROUP="access"
	FULL_RULE="-a always,exit -F arch=$ARCH -S creat -F exit=-EACCESS -F auid>=1000 -F auid!=4294967295 -F key=access"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done

for ARCH in "${RULE_ARCHS[@]}"
do
        PATTERN="-a always,exit -F arch=$ARCH -S creat -F exit=-EPERM.*" 
        GROUP="access"
        FULL_RULE="-a always,exit -F arch=$ARCH -S creat -F exit=-EPRM -F auid>=1000 -F auid!=4294967295 -F key=access"
        # Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

        fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
        fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Record Unauthorized Access Attempts to Files (unsuccessful) - openxccdf_org.ssgproject.content_rule_audit_rules_unsuccessful_file_modification_open medium

Record Unauthorized Access Attempts to Files (unsuccessful) - open

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_unsuccessful_file_modification_open
Result
fail
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 172, 2884, SRG-OS-000064-GPOS-00033, SRG-OS-000458-GPOS-00203, SRG-OS-000461-GPOS-00205, SRG-OS-000392-GPOS-00172, Req-10.2.4, Req-10.2.1, 5.2.10, 3.1.7

Description

At a minimum, the audit system should collect unauthorized file accesses for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F arch=b32 -S open -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b32 -S open -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access
If the system is 64 bit then also add the following lines:
-a always,exit -F arch=b64 -S open -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b64 -S open -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file:
-a always,exit -F arch=b32 -S open -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b32 -S open -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access
If the system is 64 bit then also add the following lines:
-a always,exit -F arch=b64 -S open -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b64 -S open -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access

Rationale

Unsuccessful attempts to access files could be an indicator of malicious activity on a system. Auditing these events could serve as evidence of potential system compromise.

Warnings
warning  Note that these rules can be configured in a number of ways while still achieving the desired effect. Here the system calls have been placed independent of other system calls. Grouping these system calls with others as identifying earlier in this guide is more efficient.
OVAL details

Items not found violating audit augenrules 32-bit file eaccess:

Object oval:ssg-object_32bit_arufm_eaccess_open_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+open[\s]+|([\s]+|[,])open([\s]+|[,])))(?:.*-F\s+exit=\-EACCES[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 32-bit file eperm:

Object oval:ssg-object_32bit_arufm_eperm_open_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+open[\s]+|([\s]+|[,])open([\s]+|[,])))(?:.*-F\s+exit=\-EPERM[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit file eaccess:

Object oval:ssg-object_64bit_arufm_eaccess_open_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+open[\s]+|([\s]+|[,])open([\s]+|[,])))(?:.*-F\s+exit=\-EACCES[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit file eperm:

Object oval:ssg-object_64bit_arufm_eperm_open_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+open[\s]+|([\s]+|[,])open([\s]+|[,])))(?:.*-F\s+exit=\-EPERM[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit file eaccess:

Object oval:ssg-object_32bit_arufm_eaccess_open_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+open[\s]+|([\s]+|[,])open([\s]+|[,])))(?:.*-F\s+exit=\-EACCES[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit file eperm:

Object oval:ssg-object_32bit_arufm_eperm_open_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+open[\s]+|([\s]+|[,])open([\s]+|[,])))(?:.*-F\s+exit=\-EPERM[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit file eaccess:

Object oval:ssg-object_64bit_arufm_eaccess_open_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+open[\s]+|([\s]+|[,])open([\s]+|[,])))(?:.*-F\s+exit=\-EACCES[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit file eperm:

Object oval:ssg-object_64bit_arufm_eperm_open_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+open[\s]+|([\s]+|[,])open([\s]+|[,])))(?:.*-F\s+exit=\-EPERM[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# First perform the remediation of the syscall rule
# Retrieve hardware architecture of the underlying system
[ "$(getconf LONG_BIT)" = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit -F arch=$ARCH -S open -F exit=-EACCESS.*"
	GROUP="access"
	FULL_RULE="-a always,exit -F arch=$ARCH -S open -F exit=-EACCESS -F auid>=1000 -F auid!=4294967295 -F key=access"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done

for ARCH in "${RULE_ARCHS[@]}"
do
        PATTERN="-a always,exit -F arch=$ARCH -S open -F exit=-EPERM.*" 
        GROUP="access"
        FULL_RULE="-a always,exit -F arch=$ARCH -S open -F exit=-EPRM -F auid>=1000 -F auid!=4294967295 -F key=access"
        # Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

        fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
        fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Record Unauthorized Access Attempts to Files (unsuccessful) - openatxccdf_org.ssgproject.content_rule_audit_rules_unsuccessful_file_modification_openat medium

Record Unauthorized Access Attempts to Files (unsuccessful) - openat

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_unsuccessful_file_modification_openat
Result
fail
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 172, 2884, SRG-OS-000064-GPOS-00033, SRG-OS-000458-GPOS-00203, SRG-OS-000461-GPOS-00205, SRG-OS-000392-GPOS-00172, Req-10.2.4, Req-10.2.1, 5.2.10, 3.1.7

Description

At a minimum, the audit system should collect unauthorized file accesses for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F arch=b32 -S openat -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b32 -S openat -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access
If the system is 64 bit then also add the following lines:
-a always,exit -F arch=b64 -S openat -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b64 -S openat -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file:
-a always,exit -F arch=b32 -S openat -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b32 -S openat -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access
If the system is 64 bit then also add the following lines:
-a always,exit -F arch=b64 -S openat -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b64 -S openat -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access

Rationale

Unsuccessful attempts to access files could be an indicator of malicious activity on a system. Auditing these events could serve as evidence of potential system compromise.

Warnings
warning  Note that these rules can be configured in a number of ways while still achieving the desired effect. Here the system calls have been placed independent of other system calls. Grouping these system calls with others as identifying earlier in this guide is more efficient.
OVAL details

Items not found violating audit augenrules 32-bit file eaccess:

Object oval:ssg-object_32bit_arufm_eaccess_openat_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+openat[\s]+|([\s]+|[,])openat([\s]+|[,])))(?:.*-F\s+exit=\-EACCES[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 32-bit file eperm:

Object oval:ssg-object_32bit_arufm_eperm_openat_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+openat[\s]+|([\s]+|[,])openat([\s]+|[,])))(?:.*-F\s+exit=\-EPERM[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit file eaccess:

Object oval:ssg-object_64bit_arufm_eaccess_openat_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+openat[\s]+|([\s]+|[,])openat([\s]+|[,])))(?:.*-F\s+exit=\-EACCES[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit file eperm:

Object oval:ssg-object_64bit_arufm_eperm_openat_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+openat[\s]+|([\s]+|[,])openat([\s]+|[,])))(?:.*-F\s+exit=\-EPERM[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit file eaccess:

Object oval:ssg-object_32bit_arufm_eaccess_openat_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+openat[\s]+|([\s]+|[,])openat([\s]+|[,])))(?:.*-F\s+exit=\-EACCES[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit file eperm:

Object oval:ssg-object_32bit_arufm_eperm_openat_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+openat[\s]+|([\s]+|[,])openat([\s]+|[,])))(?:.*-F\s+exit=\-EPERM[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit file eaccess:

Object oval:ssg-object_64bit_arufm_eaccess_openat_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+openat[\s]+|([\s]+|[,])openat([\s]+|[,])))(?:.*-F\s+exit=\-EACCES[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit file eperm:

Object oval:ssg-object_64bit_arufm_eperm_openat_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+openat[\s]+|([\s]+|[,])openat([\s]+|[,])))(?:.*-F\s+exit=\-EPERM[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# First perform the remediation of the syscall rule
# Retrieve hardware architecture of the underlying system
[ "$(getconf LONG_BIT)" = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit -F arch=$ARCH -S openat -F exit=-EACCESS.*"
	GROUP="access"
	FULL_RULE="-a always,exit -F arch=$ARCH -S openat -F exit=-EACCESS -F auid>=1000 -F auid!=4294967295 -F key=access"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done

for ARCH in "${RULE_ARCHS[@]}"
do
        PATTERN="-a always,exit -F arch=$ARCH -S openat -F exit=-EPERM.*" 
        GROUP="access"
        FULL_RULE="-a always,exit -F arch=$ARCH -S openat -F exit=-EPRM -F auid>=1000 -F auid!=4294967295 -F key=access"
        # Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

        fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
        fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Record Unauthorized Access Attempts to Files (unsuccessful) - open_by_handle_atxccdf_org.ssgproject.content_rule_audit_rules_unsuccessful_file_modification_open_by_handle_at medium

Record Unauthorized Access Attempts to Files (unsuccessful) - open_by_handle_at

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_unsuccessful_file_modification_open_by_handle_at
Result
fail
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 172, 2884, SRG-OS-000064-GPOS-00033, SRG-OS-000458-GPOS-00203, SRG-OS-000461-GPOS-00205, SRG-OS-000392-GPOS-00172, Req-10.2.4, Req-10.2.1, 5.2.10, 3.1.7

Description

At a minimum, the audit system should collect unauthorized file accesses for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F arch=b32 -S open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b32 -S open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access
If the system is 64 bit then also add the following lines:
-a always,exit -F arch=b64 -S open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b64 -S open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file:
-a always,exit -F arch=b32 -S open_by_handle_at,truncate,ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b32 -S open_by_handle_at,truncate,ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access
If the system is 64 bit then also add the following lines:
-a always,exit -F arch=b64 -S open_by_handle_at,truncate,ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b64 -S open_by_handle_at,truncate,ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access

Rationale

Unsuccessful attempts to access files could be an indicator of malicious activity on a system. Auditing these events could serve as evidence of potential system compromise.

Warnings
warning  Note that these rules can be configured in a number of ways while still achieving the desired effect. Here the system calls have been placed independent of other system calls. Grouping these system calls with others as identifying earlier in this guide is more efficient.
OVAL details

Items not found violating audit augenrules 32-bit file eaccess:

Object oval:ssg-object_32bit_arufm_eaccess_open_by_handle_at_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+open_by_handle_at[\s]+|([\s]+|[,])open_by_handle_at([\s]+|[,])))(?:.*-F\s+exit=\-EACCES[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 32-bit file eperm:

Object oval:ssg-object_32bit_arufm_eperm_open_by_handle_at_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+open_by_handle_at[\s]+|([\s]+|[,])open_by_handle_at([\s]+|[,])))(?:.*-F\s+exit=\-EPERM[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit file eaccess:

Object oval:ssg-object_64bit_arufm_eaccess_open_by_handle_at_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+open_by_handle_at[\s]+|([\s]+|[,])open_by_handle_at([\s]+|[,])))(?:.*-F\s+exit=\-EACCES[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit file eperm:

Object oval:ssg-object_64bit_arufm_eperm_open_by_handle_at_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+open_by_handle_at[\s]+|([\s]+|[,])open_by_handle_at([\s]+|[,])))(?:.*-F\s+exit=\-EPERM[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit file eaccess:

Object oval:ssg-object_32bit_arufm_eaccess_open_by_handle_at_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+open_by_handle_at[\s]+|([\s]+|[,])open_by_handle_at([\s]+|[,])))(?:.*-F\s+exit=\-EACCES[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit file eperm:

Object oval:ssg-object_32bit_arufm_eperm_open_by_handle_at_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+open_by_handle_at[\s]+|([\s]+|[,])open_by_handle_at([\s]+|[,])))(?:.*-F\s+exit=\-EPERM[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit file eaccess:

Object oval:ssg-object_64bit_arufm_eaccess_open_by_handle_at_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+open_by_handle_at[\s]+|([\s]+|[,])open_by_handle_at([\s]+|[,])))(?:.*-F\s+exit=\-EACCES[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit file eperm:

Object oval:ssg-object_64bit_arufm_eperm_open_by_handle_at_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+open_by_handle_at[\s]+|([\s]+|[,])open_by_handle_at([\s]+|[,])))(?:.*-F\s+exit=\-EPERM[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# First perform the remediation of the syscall rule
# Retrieve hardware architecture of the underlying system
[ "$(getconf LONG_BIT)" = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit -F arch=$ARCH -S open_by_handle_at -F exit=-EACCESS.*"
	GROUP="access"
	FULL_RULE="-a always,exit -F arch=$ARCH -S open_by_handle_at -F exit=-EACCESS -F auid>=1000 -F auid!=4294967295 -F key=access"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done

for ARCH in "${RULE_ARCHS[@]}"
do
        PATTERN="-a always,exit -F arch=$ARCH -S open_by_handle_at -F exit=-EPERM.*" 
        GROUP="access"
        FULL_RULE="-a always,exit -F arch=$ARCH -S open_by_handle_at -F exit=-EPRM -F auid>=1000 -F auid!=4294967295 -F key=access"
        # Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

        fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
        fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Record Unauthorized Access Attempts to Files (unsuccessful) - truncatexccdf_org.ssgproject.content_rule_audit_rules_unsuccessful_file_modification_truncate medium

Record Unauthorized Access Attempts to Files (unsuccessful) - truncate

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_unsuccessful_file_modification_truncate
Result
fail
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 172, 2884, SRG-OS-000064-GPOS-00033, SRG-OS-000458-GPOS-00203, SRG-OS-000461-GPOS-00205, SRG-OS-000392-GPOS-00172, Req-10.2.4, Req-10.2.1, 5.2.10, 3.1.7

Description

At a minimum, the audit system should collect unauthorized file accesses for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F arch=b32 -S truncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b32 -S truncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access
If the system is 64 bit then also add the following lines:
-a always,exit -F arch=b64 -S truncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b64 -S truncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file:
-a always,exit -F arch=b32 -S truncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b32 -S truncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access
If the system is 64 bit then also add the following lines:
-a always,exit -F arch=b64 -S truncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b64 -S truncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access

Rationale

Unsuccessful attempts to access files could be an indicator of malicious activity on a system. Auditing these events could serve as evidence of potential system compromise.

Warnings
warning  Note that these rules can be configured in a number of ways while still achieving the desired effect. Here the system calls have been placed independent of other system calls. Grouping these system calls with others as identifying earlier in this guide is more efficient.
OVAL details

Items not found violating audit augenrules 32-bit file eaccess:

Object oval:ssg-object_32bit_arufm_eaccess_truncate_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+truncate[\s]+|([\s]+|[,])truncate([\s]+|[,])))(?:.*-F\s+exit=\-EACCES[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 32-bit file eperm:

Object oval:ssg-object_32bit_arufm_eperm_truncate_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+truncate[\s]+|([\s]+|[,])truncate([\s]+|[,])))(?:.*-F\s+exit=\-EPERM[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit file eaccess:

Object oval:ssg-object_64bit_arufm_eaccess_truncate_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+truncate[\s]+|([\s]+|[,])truncate([\s]+|[,])))(?:.*-F\s+exit=\-EACCES[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit file eperm:

Object oval:ssg-object_64bit_arufm_eperm_truncate_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+truncate[\s]+|([\s]+|[,])truncate([\s]+|[,])))(?:.*-F\s+exit=\-EPERM[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit file eaccess:

Object oval:ssg-object_32bit_arufm_eaccess_truncate_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+truncate[\s]+|([\s]+|[,])truncate([\s]+|[,])))(?:.*-F\s+exit=\-EACCES[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit file eperm:

Object oval:ssg-object_32bit_arufm_eperm_truncate_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+truncate[\s]+|([\s]+|[,])truncate([\s]+|[,])))(?:.*-F\s+exit=\-EPERM[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit file eaccess:

Object oval:ssg-object_64bit_arufm_eaccess_truncate_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+truncate[\s]+|([\s]+|[,])truncate([\s]+|[,])))(?:.*-F\s+exit=\-EACCES[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit file eperm:

Object oval:ssg-object_64bit_arufm_eperm_truncate_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+truncate[\s]+|([\s]+|[,])truncate([\s]+|[,])))(?:.*-F\s+exit=\-EPERM[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# First perform the remediation of the syscall rule
# Retrieve hardware architecture of the underlying system
[ "$(getconf LONG_BIT)" = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit -F arch=$ARCH -S truncate -F exit=-EACCESS.*"
	GROUP="access"
	FULL_RULE="-a always,exit -F arch=$ARCH -S truncate -F exit=-EACCESS -F auid>=1000 -F auid!=4294967295 -F key=access"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done

for ARCH in "${RULE_ARCHS[@]}"
do
        PATTERN="-a always,exit -F arch=$ARCH -S truncate -F exit=-EPERM.*" 
        GROUP="access"
        FULL_RULE="-a always,exit -F arch=$ARCH -S truncate -F exit=-EPRM -F auid>=1000 -F auid!=4294967295 -F key=access"
        # Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

        fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
        fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Record Unauthorized Access Attempts to Files (unsuccessful) - ftruncatexccdf_org.ssgproject.content_rule_audit_rules_unsuccessful_file_modification_ftruncate medium

Record Unauthorized Access Attempts to Files (unsuccessful) - ftruncate

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_unsuccessful_file_modification_ftruncate
Result
fail
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 172, 2884, SRG-OS-000064-GPOS-00033, SRG-OS-000458-GPOS-00203, SRG-OS-000461-GPOS-00205, SRG-OS-000392-GPOS-00172, Req-10.2.4, Req-10.2.1, 5.2.10, 3.1.7

Description

At a minimum, the audit system should collect unauthorized file accesses for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F arch=b32 -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b32 -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access
If the system is 64 bit then also add the following lines:
-a always,exit -F arch=b64 -S ftruncate -F exiu=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b64 -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file:
-a always,exit -F arch=b32 -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b32 -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access
If the system is 64 bit then also add the following lines:
-a always,exit -F arch=b64 -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -F key=access
-a always,exit -F arch=b64 -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -F key=access

Rationale

Unsuccessful attempts to access files could be an indicator of malicious activity on a system. Auditing these events could serve as evidence of potential system compromise.

Warnings
warning  Note that these rules can be configured in a number of ways while still achieving the desired effect. Here the system calls have been placed independent of other system calls. Grouping these system calls with others as identifying earlier in this guide is more efficient.
OVAL details

Items not found violating audit augenrules 32-bit file eaccess:

Object oval:ssg-object_32bit_arufm_eaccess_ftruncate_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+ftruncate[\s]+|([\s]+|[,])ftruncate([\s]+|[,])))(?:.*-F\s+exit=\-EACCES[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 32-bit file eperm:

Object oval:ssg-object_32bit_arufm_eperm_ftruncate_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+ftruncate[\s]+|([\s]+|[,])ftruncate([\s]+|[,])))(?:.*-F\s+exit=\-EPERM[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit file eaccess:

Object oval:ssg-object_64bit_arufm_eaccess_ftruncate_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+ftruncate[\s]+|([\s]+|[,])ftruncate([\s]+|[,])))(?:.*-F\s+exit=\-EACCES[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit file eperm:

Object oval:ssg-object_64bit_arufm_eperm_ftruncate_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+ftruncate[\s]+|([\s]+|[,])ftruncate([\s]+|[,])))(?:.*-F\s+exit=\-EPERM[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit file eaccess:

Object oval:ssg-object_32bit_arufm_eaccess_ftruncate_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+ftruncate[\s]+|([\s]+|[,])ftruncate([\s]+|[,])))(?:.*-F\s+exit=\-EACCES[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit file eperm:

Object oval:ssg-object_32bit_arufm_eperm_ftruncate_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+ftruncate[\s]+|([\s]+|[,])ftruncate([\s]+|[,])))(?:.*-F\s+exit=\-EPERM[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit file eaccess:

Object oval:ssg-object_64bit_arufm_eaccess_ftruncate_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+ftruncate[\s]+|([\s]+|[,])ftruncate([\s]+|[,])))(?:.*-F\s+exit=\-EACCES[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit file eperm:

Object oval:ssg-object_64bit_arufm_eperm_ftruncate_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+ftruncate[\s]+|([\s]+|[,])ftruncate([\s]+|[,])))(?:.*-F\s+exit=\-EPERM[\s]+)(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# First perform the remediation of the syscall rule
# Retrieve hardware architecture of the underlying system
[ "$(getconf LONG_BIT)" = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit -F arch=$ARCH -S ftruncate -F exit=-EACCESS.*"
	GROUP="access"
	FULL_RULE="-a always,exit -F arch=$ARCH -S ftruncate -F exit=-EACCESS -F auid>=1000 -F auid!=4294967295 -F key=access"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done

for ARCH in "${RULE_ARCHS[@]}"
do
        PATTERN="-a always,exit -F arch=$ARCH -S ftruncate -F exit=-EPERM.*" 
        GROUP="access"
        FULL_RULE="-a always,exit -F arch=$ARCH -S ftruncate -F exit=-EPRM -F auid>=1000 -F auid!=4294967295 -F key=access"
        # Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

        fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
        fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Record Any Attempts to Run semanagexccdf_org.ssgproject.content_rule_audit_rules_execution_semanage medium

Record Any Attempts to Run semanage

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_execution_semanage
Result
fail
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AU-12(c), 172, 2884, SRG-OS-000392-GPOS-00172, SRG-OS-000463-GPOS-00207, SRG-OS-000465-GPOS-00209, 3.1.7

Description

At a minimum, the audit system should collect any execution attempt of the semanage command for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F path=/usr/sbin/semanage -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged-priv_change
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file:
-a always,exit -F path=/usr/sbin/semanage -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged-priv_change

Rationale

Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised 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 and advanced persistent threast.

Privileged programs are subject to escalation-of-privilege attacks, which attempt to subvert their normal role of providing some necessary but limited capability. As such, motivation exists to monitor these programs for unusual activity.

OVAL details

Items not found violating audit augenrules semanage:

Object oval:ssg-object_audit_rules_execution_semanage_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/sbin\/semanage[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl semanage:

Object oval:ssg-object_audit_rules_execution_semanage_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/sbin\/semanage[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:high
Disruption:medium
Strategy:restrict


PATTERN="-a always,exit -F path=/usr/sbin/semanage.*"
GROUP="privileged"
FULL_RULE="-a always,exit -F path=/usr/sbin/semanage -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged"
# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
Record Any Attempts to Run setseboolxccdf_org.ssgproject.content_rule_audit_rules_execution_setsebool medium

Record Any Attempts to Run setsebool

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_execution_setsebool
Result
fail
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AU-12(c), 172, 2884, SRG-OS-000392-GPOS-00172, SRG-OS-000463-GPOS-00207, SRG-OS-000465-GPOS-00209, 3.1.7

Description

At a minimum, the audit system should collect any execution attempt of the setsebool command for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F path=/usr/sbin/setsebool -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged-priv_change
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file:
-a always,exit -F path=/usr/sbin/setsebool -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged-priv_change

Rationale

Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised 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 and advanced persistent threast.

Privileged programs are subject to escalation-of-privilege attacks, which attempt to subvert their normal role of providing some necessary but limited capability. As such, motivation exists to monitor these programs for unusual activity.

OVAL details

Items not found violating audit augenrules setsebool:

Object oval:ssg-object_audit_rules_execution_setsebool_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/sbin\/setsebool[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl setsebool:

Object oval:ssg-object_audit_rules_execution_setsebool_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/sbin\/setsebool[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


PATTERN="-a always,exit -F path=/usr/sbin/setsebool.*"
GROUP="privileged"
FULL_RULE="-a always,exit -F path=/usr/sbin/setsebool -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged"
# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
Record Any Attempts to Run chconxccdf_org.ssgproject.content_rule_audit_rules_execution_chcon medium

Record Any Attempts to Run chcon

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_execution_chcon
Result
fail
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AU-12(c), 172, 2884, SRG-OS-000392-GPOS-00172, SRG-OS-000463-GPOS-00207, SRG-OS-000465-GPOS-00209, 3.1.7

Description

At a minimum, the audit system should collect any execution attempt of the chcon command for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F path=/usr/bin/chcon -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged-priv_change
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file:
-a always,exit -F path=/usr/bin/chcon -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged-priv_change

Rationale

Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised 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 and advanced persistent threast.

Privileged programs are subject to escalation-of-privilege attacks, which attempt to subvert their normal role of providing some necessary but limited capability. As such, motivation exists to monitor these programs for unusual activity.

OVAL details

Items not found violating audit augenrules chcon:

Object oval:ssg-object_audit_rules_execution_chcon_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/bin\/chcon[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl chcon:

Object oval:ssg-object_audit_rules_execution_chcon_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/bin\/chcon[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


PATTERN="-a always,exit -F path=/usr/bin/chcon.*"
GROUP="privileged"
FULL_RULE="-a always,exit -F path=/usr/bin/chcon -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged"
# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
Record Any Attempts to Run restoreconxccdf_org.ssgproject.content_rule_audit_rules_execution_restorecon medium

Record Any Attempts to Run restorecon

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_execution_restorecon
Result
fail
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AU-12(c), 172, 2884, SRG-OS-000392-GPOS-00172, SRG-OS-000463-GPOS-00207, SRG-OS-000465-GPOS-00209, 3.1.7

Description

At a minimum, the audit system should collect any execution attempt of the restorecon command for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F path=/usr/sbin/restorecon -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged-priv_change
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file:
-a always,exit -F path=/usr/sbin/restorecon -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged-priv_change

Rationale

Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised 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 and advanced persistent threast.

Privileged programs are subject to escalation-of-privilege attacks, which attempt to subvert their normal role of providing some necessary but limited capability. As such, motivation exists to monitor these programs for unusual activity.

OVAL details

Items not found violating audit augenrules restorecon:

Object oval:ssg-object_audit_rules_execution_restorecon_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/sbin\/restorecon[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl restorecon:

Object oval:ssg-object_audit_rules_execution_restorecon_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/sbin\/restorecon[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


PATTERN="-a always,exit -F path=/usr/sbin/restorecon.*"
GROUP="privileged"
FULL_RULE="-a always,exit -F path=/usr/sbin/restorecon -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged"
# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
Ensure auditd Collects Information on the Use of Privileged Commandsxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands medium

Ensure auditd Collects Information on the Use of Privileged Commands

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands
Result
fail
Time2017-10-21T14:39:58
Severitymedium
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-2(4), AU-6(9), AU-12(a), AU-12(c), IR-5, 2234, SRG-OS-000327-GPOS-00127, Req-10.2.2, 5.2.10, 5.4.1.1, 3.1.7

Description

At a minimum, the audit system should collect the execution of privileged commands for all users and root. To find the relevant setuid / setgid programs, run the following command for each local partition PART:

$ sudo find PART -xdev -type f -perm -4000 -o -type f -perm -2000 2>/dev/null
If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add a line of the following form to a file with suffix .rules in the directory /etc/audit/rules.d for each setuid / setgid program on the system, replacing the SETUID_PROG_PATH part with the full path of that setuid / setgid program in the list:
-a always,exit -F path=SETUID_PROG_PATH -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add a line of the following form to /etc/audit/audit.rules for each setuid / setgid program on the system, replacing the SETUID_PROG_PATH part with the full path of that setuid / setgid program in the list:
-a always,exit -F path=SETUID_PROG_PATH -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged

Rationale

Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised 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 and advanced persistent threast.

Privileged programs are subject to escalation-of-privilege attacks, which attempt to subvert their normal role of providing some necessary but limited capability. As such, motivation exists to monitor these programs for unusual activity.

OVAL details

Items not found violating audit augenrules suid sgid:

Object oval:ssg-object_arpc_suid_sgid_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstanceFilter
/etc/audit/rules\.d/.*\.rules^[\s]*-a always,exit (?:-F path=([\S]+) )+-F perm=[r|w]?x -F auid>=1000 -F auid!=4294967295 -k privileged[\s]*$1oval:ssg-state_proper_audit_rule_but_for_unprivileged_command:ste:1
State oval:ssg-state_audit_rules_privileged_commands:ste:1 of type textfilecontent54_state
Subexpression
/usr/bin/chfn/usr/bin/ssh-agent/usr/bin/gpasswd/usr/sbin/netreport/usr/sbin/postqueue/usr/libexec/openssh/ssh-keysign/usr/bin/su/usr/bin/umount/usr/bin/screen/usr/lib/polkit-1/polkit-agent-helper-1/usr/bin/passwd/usr/sbin/postdrop/usr/lib64/dbus-1/dbus-daemon-launch-helper/usr/sbin/unix_chkpwd/usr/sbin/usernetctl/usr/bin/write/usr/bin/chage/usr/bin/sudo/usr/bin/pkexec/usr/libexec/utempter/utempter/usr/bin/crontab/usr/bin/chsh/usr/bin/locate/usr/sbin/pam_timestamp_check/usr/bin/newgrp/usr/bin/wall/usr/bin/mount

Items found violating audit augenrules binaries count matches rules count:

Var refValue
oval:ssg-variable_count_of_suid_sgid_binaries_on_system:var:127

Items not found violating audit auditctl suid sgid:

Object oval:ssg-object_arpc_suid_sgid_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstanceFilter
/etc/audit/audit.rules^[\s]*-a always,exit (?:-F path=([\S]+) )+-F perm=[r|w]?x -F auid>=1000 -F auid!=4294967295 -k privileged[\s]*$1oval:ssg-state_proper_audit_rule_but_for_unprivileged_command:ste:1
State oval:ssg-state_audit_rules_privileged_commands:ste:1 of type textfilecontent54_state
Subexpression
/usr/bin/chfn/usr/bin/ssh-agent/usr/bin/gpasswd/usr/sbin/netreport/usr/sbin/postqueue/usr/libexec/openssh/ssh-keysign/usr/bin/su/usr/bin/umount/usr/bin/screen/usr/lib/polkit-1/polkit-agent-helper-1/usr/bin/passwd/usr/sbin/postdrop/usr/lib64/dbus-1/dbus-daemon-launch-helper/usr/sbin/unix_chkpwd/usr/sbin/usernetctl/usr/bin/write/usr/bin/chage/usr/bin/sudo/usr/bin/pkexec/usr/libexec/utempter/utempter/usr/bin/crontab/usr/bin/chsh/usr/bin/locate/usr/sbin/pam_timestamp_check/usr/bin/newgrp/usr/bin/wall/usr/bin/mount

Items found violating audit auditctl binaries count matches rules count:

Var refValue
oval:ssg-variable_count_of_suid_sgid_binaries_on_system:var:127
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function perform_audit_rules_privileged_commands_remediation {
#
# Load function arguments into local variables
local tool="$1"
local min_auid="$2"

# Check sanity of the input
if [ $# -ne "2" ]
then
        echo "Usage: perform_audit_rules_privileged_commands_remediation 'auditctl | augenrules' '500 | 1000'"
        echo "Aborting."
        exit 1
fi

declare -a files_to_inspect=()

# Check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If the audit tool is 'auditctl', then:
# * add '/etc/audit/audit.rules'to the list of files to be inspected,
# * specify '/etc/audit/audit.rules' as the output audit file, where
#   missing rules should be inserted
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("/etc/audit/audit.rules")
        output_audit_file="/etc/audit/audit.rules"
#
# If the audit tool is 'augenrules', then:
# * add '/etc/audit/rules.d/*.rules' to the list of files to be inspected
#   (split by newline),
# * specify /etc/audit/rules.d/privileged.rules' as the output file, where
#   missing rules should be inserted
elif [ "$tool" == 'augenrules' ]
then
        IFS=$'\n' files_to_inspect=($(find /etc/audit/rules.d -maxdepth 1 -type f -name *.rules -print))
        output_audit_file="/etc/audit/rules.d/privileged.rules"
fi

# Obtain the list of SUID/SGID binaries on the particular system (split by newline)
# into privileged_binaries array
IFS=$'\n' privileged_binaries=($(find / -xdev -type f -perm -4000 -o -type f -perm -2000 2>/dev/null))

# Keep list of SUID/SGID binaries that have been already handled within some previous iteration
declare -a sbinaries_to_skip=()

# For each found sbinary in privileged_binaries list
for sbinary in "${privileged_binaries[@]}"
do

        # Replace possible slash '/' character in sbinary definition so we could use it in sed expressions below
        sbinary_esc=${sbinary//$'/'/$'\/'}
        # Check if this sbinary wasn't already handled in some of the previous iterations
        # Return match only if whole sbinary definition matched (not in the case just prefix matched!!!)
        if [[ $(sed -ne "/${sbinary_esc}$/p" <<< ${sbinaries_to_skip[@]}) ]]
        then
                # If so, don't process it second time & go to process next sbinary
                continue
        fi

        # Reset the counter of inspected files when starting to check
        # presence of existing audit rule for new sbinary
        local count_of_inspected_files=0

        # For each audit rules file from the list of files to be inspected
        for afile in "${files_to_inspect[@]}"
        do

                # Search current audit rules file's content for match. Match criteria:
                # * existing rule is for the same SUID/SGID binary we are currently processing (but
                #   can contain multiple -F path= elements covering multiple SUID/SGID binaries)
                # * existing rule contains all arguments from expected rule form (though can contain
                #   them in arbitrary order)

                base_search=$(sed -e "/-a always,exit/!d" -e "/-F path=${sbinary_esc}$/!d"   \
                                  -e "/-F path=[^[:space:]]\+/!d" -e "/-F perm=.*/!d"       \
                                  -e "/-F auid>=${min_auid}/!d" -e "/-F auid!=4294967295/!d"  \
                                  -e "/-k privileged/!d" $afile)

                # Increase the count of inspected files for this sbinary
                count_of_inspected_files=$((count_of_inspected_files + 1))

                # Define expected rule form for this binary
                expected_rule="-a always,exit -F path=${sbinary} -F perm=x -F auid>=${min_auid} -F auid!=4294967295 -k privileged"

                # Require execute access type to be set for existing audit rule
                exec_access='x'

                # Search current audit rules file's content for presence of rule pattern for this sbinary
                if [[ $base_search ]]
                then

                        # Current audit rules file already contains rule for this binary =>
                        # Store the exact form of found rule for this binary for further processing
                        concrete_rule=$base_search

                        # Select all other SUID/SGID binaries possibly also present in the found rule
                        IFS=$'\n' handled_sbinaries=($(grep -o -e "-F path=[^[:space:]]\+" <<< $concrete_rule))
                        IFS=$' ' handled_sbinaries=(${handled_sbinaries[@]//-F path=/})

                        # Merge the list of such SUID/SGID binaries found in this iteration with global list ignoring duplicates
                        sbinaries_to_skip=($(for i in "${sbinaries_to_skip[@]}" "${handled_sbinaries[@]}"; do echo $i; done | sort -du))

                        # Separate concrete_rule into three sections using hash '#'
                        # sign as a delimiter around rule's permission section borders
                        concrete_rule=$(echo $concrete_rule | sed -n "s/\(.*\)\+\(-F perm=[rwax]\+\)\+/\1#\2#/p")

                        # Split concrete_rule into head, perm, and tail sections using hash '#' delimiter
                        IFS=$'#' read rule_head rule_perm rule_tail <<<  "$concrete_rule"

                        # Extract already present exact access type [r|w|x|a] from rule's permission section
                        access_type=${rule_perm//-F perm=/}

                        # Verify current permission access type(s) for rule contain 'x' (execute) permission
                        if ! grep -q "$exec_access" <<< "$access_type"
                        then

                                # If not, append the 'x' (execute) permission to the existing access type bits
                                access_type="$access_type$exec_access"
                                # Reconstruct the permissions section for the rule
                                new_rule_perm="-F perm=$access_type"
                                # Update existing rule in current audit rules file with the new permission section
                                sed -i "s#${rule_head}\(.*\)${rule_tail}#${rule_head}${new_rule_perm}${rule_tail}#" $afile

                        fi

                # If the required audit rule for particular sbinary wasn't found yet, insert it under following conditions:
                #
                # * in the "auditctl" mode of operation insert particular rule each time
                #   (because in this mode there's only one file -- /etc/audit/audit.rules to be inspected for presence of this rule),
                #
                # * in the "augenrules" mode of operation insert particular rule only once and only in case we have already
                #   searched all of the files from /etc/audit/rules.d/*.rules location (since that audit rule can be defined
                #   in any of those files and if not, we want it to be inserted only once into /etc/audit/rules.d/privileged.rules file)
                #
                elif [ "$tool" == "auditctl" ] || [[ "$tool" == "augenrules" && $count_of_inspected_files -eq "${#files_to_inspect[@]}" ]]
                then

                        # Current audit rules file's content doesn't contain expected rule for this
                        # SUID/SGID binary yet => append it
                        echo $expected_rule >> $output_audit_file
                fi

        done

done

}

perform_audit_rules_privileged_commands_remediation "auditctl" "1000"
perform_audit_rules_privileged_commands_remediation "augenrules" "1000"
Ensure auditd Collects Information on the Use of Privileged Commands - passwdxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_passwd medium

Ensure auditd Collects Information on the Use of Privileged Commands - passwd

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_passwd
Result
fail
Time2017-10-21T14:39:58
Severitymedium
Identifiers and References

References:  AU-3(1), AU-12(c), 135, 172, 2884, SRG-OS-000042-GPOS-00020, SRG-OS-000392-GPOS-00172, SRG-OS-000471-GPOS-00215, 3.1.7

Description

At a minimum, the audit system should collect the execution of privileged commands for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add a line of the following form to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F path=/usr/bin/passwd -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add a line of the following form to /etc/audit/audit.rules:
-a always,exit -F path=/usr/bin/passwd -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged

Rationale

Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised 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 and advanced persistent threast.

Privileged programs are subject to escalation-of-privilege attacks, which attempt to subvert their normal role of providing some necessary but limited capability. As such, motivation exists to monitor these programs for unusual activity.

OVAL details

Items not found violating audit augenrules passwd:

Object oval:ssg-object_audit_rules_privileged_commands_passwd_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/bin\/passwd[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl passwd:

Object oval:ssg-object_audit_rules_privileged_commands_passwd_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/bin\/passwd[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


PATTERN="-a always,exit -F path=/usr/bin/passwd.*"
GROUP="privileged"
FULL_RULE="-a always,exit -F path=/usr/bin/passwd -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged"
# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
Ensure auditd Collects Information on the Use of Privileged Commands - unix_chkpwdxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_unix_chkpwd medium

Ensure auditd Collects Information on the Use of Privileged Commands - unix_chkpwd

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_unix_chkpwd
Result
fail
Time2017-10-21T14:39:58
Severitymedium
Identifiers and References

References:  AU-3(1), AU-12(c), 135, 172, 2884, SRG-OS-000042-GPOS-00020, SRG-OS-000392-GPOS-00172, SRG-OS-000471-GPOS-00215, 3.1.7

Description

At a minimum, the audit system should collect the execution of privileged commands for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add a line of the following form to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F path=/usr/bin/unix_chkpwd -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add a line of the following form to /etc/audit/audit.rules:
-a always,exit -F path=/usr/bin/unix_chkpwd -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged

Rationale

Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised 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 and advanced persistent threast.

Privileged programs are subject to escalation-of-privilege attacks, which attempt to subvert their normal role of providing some necessary but limited capability. As such, motivation exists to monitor these programs for unusual activity.

OVAL details

Items not found violating audit augenrules unix_chkpwd:

Object oval:ssg-object_audit_rules_privileged_commands_unix_chkpwd_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/sbin\/unix_chkpwd[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl unix_chkpwd:

Object oval:ssg-object_audit_rules_privileged_commands_unix_chkpwd_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/sbin\/unix_chkpwd[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


PATTERN="-a always,exit -F path=/usr/bin/unix_chkpwd.*"
GROUP="privileged"
FULL_RULE="-a always,exit -F path=/usr/bin/unix_chkpwd -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged"
# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
Ensure auditd Collects Information on the Use of Privileged Commands - gpasswdxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_gpasswd medium

Ensure auditd Collects Information on the Use of Privileged Commands - gpasswd

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_gpasswd
Result
fail
Time2017-10-21T14:39:58
Severitymedium
Identifiers and References

References:  AU-3(1), AU-12(c), 135, 172, 2884, SRG-OS-000042-GPOS-00020, SRG-OS-000392-GPOS-00172, SRG-OS-000471-GPOS-00215, 3.1.7

Description

At a minimum, the audit system should collect the execution of privileged commands for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add a line of the following form to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F path=/usr/bin/gpasswd -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add a line of the following form to /etc/audit/audit.rules:
-a always,exit -F path=/usr/bin/gpasswd -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged

Rationale

Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised 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 and advanced persistent threast.

Privileged programs are subject to escalation-of-privilege attacks, which attempt to subvert their normal role of providing some necessary but limited capability. As such, motivation exists to monitor these programs for unusual activity.

OVAL details

Items not found violating audit augenrules gpasswd:

Object oval:ssg-object_audit_rules_privileged_commands_gpasswd_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/bin\/gpasswd[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl gpasswd:

Object oval:ssg-object_audit_rules_privileged_commands_gpasswd_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/bin\/gpasswd[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


PATTERN="-a always,exit -F path=/usr/bin/gpasswd.*"
GROUP="privileged"
FULL_RULE="-a always,exit -F path=/usr/bin/gpasswd -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged"
# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
Ensure auditd Collects Information on the Use of Privileged Commands - chagexccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_chage medium

Ensure auditd Collects Information on the Use of Privileged Commands - chage

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_chage
Result
fail
Time2017-10-21T14:39:58
Severitymedium
Identifiers and References

References:  AU-3(1), AU-12(c), 135, 172, 2884, SRG-OS-000042-GPOS-00020, SRG-OS-000392-GPOS-00172, SRG-OS-000471-GPOS-00215, 3.1.7

Description

At a minimum, the audit system should collect the execution of privileged commands for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add a line of the following form to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F path=/usr/bin/chage -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add a line of the following form to /etc/audit/audit.rules:
-a always,exit -F path=/usr/bin/chage -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged

Rationale

Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised 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 and advanced persistent threast.

Privileged programs are subject to escalation-of-privilege attacks, which attempt to subvert their normal role of providing some necessary but limited capability. As such, motivation exists to monitor these programs for unusual activity.

OVAL details

Items not found violating audit augenrules chage:

Object oval:ssg-object_audit_rules_privileged_commands_chage_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/bin\/chage[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl chage:

Object oval:ssg-object_audit_rules_privileged_commands_chage_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/bin\/chage[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


PATTERN="-a always,exit -F path=/usr/bin/chage.*"
GROUP="privileged"
FULL_RULE="-a always,exit -F path=/usr/bin/chage -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged"
# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
Ensure auditd Collects Information on the Use of Privileged Commands - userhelperxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_userhelper medium

Ensure auditd Collects Information on the Use of Privileged Commands - userhelper

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_userhelper
Result
fail
Time2017-10-21T14:39:58
Severitymedium
Identifiers and References

References:  AU-3(1), AU-12(c), 135, 172, 2884, SRG-OS-000042-GPOS-00020, SRG-OS-000392-GPOS-00172, SRG-OS-000471-GPOS-00215, 3.1.7

Description

At a minimum, the audit system should collect the execution of privileged commands for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add a line of the following form to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F path=/usr/bin/userhelper -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add a line of the following form to /etc/audit/audit.rules:
-a always,exit -F path=/usr/bin/userhelper -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged

Rationale

Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised 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 and advanced persistent threast.

Privileged programs are subject to escalation-of-privilege attacks, which attempt to subvert their normal role of providing some necessary but limited capability. As such, motivation exists to monitor these programs for unusual activity.

OVAL details

Items not found violating audit augenrules userhelper:

Object oval:ssg-object_audit_rules_privileged_commands_userhelper_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/sbin\/userhelper[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl userhelper:

Object oval:ssg-object_audit_rules_privileged_commands_userhelper_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/sbin\/userhelper[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


PATTERN="-a always,exit -F path=/usr/bin/userhelper.*"
GROUP="privileged"
FULL_RULE="-a always,exit -F path=/usr/bin/userhelper -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged"
# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
Ensure auditd Collects Information on the Use of Privileged Commands - suxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_su medium

Ensure auditd Collects Information on the Use of Privileged Commands - su

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_su
Result
fail
Time2017-10-21T14:39:58
Severitymedium
Identifiers and References

References:  AU-3(1), AU-12(c), 135, 172, 2884, SRG-OS-000042-GPOS-00020, SRG-OS-000392-GPOS-00172, SRG-OS-000471-GPOS-00215, 3.1.7

Description

At a minimum, the audit system should collect the execution of privileged commands for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add a line of the following form to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F path=/usr/bin/su -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add a line of the following form to /etc/audit/audit.rules:
-a always,exit -F path=/usr/bin/su -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged

Rationale

Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised 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 and advanced persistent threast.

Privileged programs are subject to escalation-of-privilege attacks, which attempt to subvert their normal role of providing some necessary but limited capability. As such, motivation exists to monitor these programs for unusual activity.

OVAL details

Items not found violating audit augenrules su:

Object oval:ssg-object_audit_rules_privileged_commands_su_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/bin\/su[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl su:

Object oval:ssg-object_audit_rules_privileged_commands_su_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/bin\/su[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


PATTERN="-a always,exit -F path=/usr/bin/su.*"
GROUP="privileged"
FULL_RULE="-a always,exit -F path=/usr/bin/su -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged"
# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
Ensure auditd Collects Information on the Use of Privileged Commands - sudoxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_sudo medium

Ensure auditd Collects Information on the Use of Privileged Commands - sudo

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_sudo
Result
fail
Time2017-10-21T14:39:58
Severitymedium
Identifiers and References

References:  AU-3(1), AU-12(c), 135, 172, 2884, SRG-OS-000042-GPOS-00020, SRG-OS-000392-GPOS-00172, SRG-OS-000471-GPOS-00215, 3.1.7

Description

At a minimum, the audit system should collect the execution of privileged commands for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add a line of the following form to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F path=/usr/bin/sudo -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add a line of the following form to /etc/audit/audit.rules:
-a always,exit -F path=/usr/bin/sudo -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged

Rationale

Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised 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 and advanced persistent threast.

Privileged programs are subject to escalation-of-privilege attacks, which attempt to subvert their normal role of providing some necessary but limited capability. As such, motivation exists to monitor these programs for unusual activity.

OVAL details

Items not found violating audit augenrules sudo:

Object oval:ssg-object_audit_rules_privileged_commands_sudo_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/bin\/sudo[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl sudo:

Object oval:ssg-object_audit_rules_privileged_commands_sudo_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/bin\/sudo[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


PATTERN="-a always,exit -F path=/usr/bin/sudo.*"
GROUP="privileged"
FULL_RULE="-a always,exit -F path=/usr/bin/sudo -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged"
# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
Ensure auditd Collects Information on the Use of Privileged Commands - sudoeditxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_sudoedit medium

Ensure auditd Collects Information on the Use of Privileged Commands - sudoedit

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_sudoedit
Result
fail
Time2017-10-21T14:39:58
Severitymedium
Identifiers and References

References:  AU-3(1), AU-12(c), 135, 172, 2884, SRG-OS-000042-GPOS-00020, SRG-OS-000392-GPOS-00172, SRG-OS-000471-GPOS-00215, 3.1.7

Description

At a minimum, the audit system should collect the execution of privileged commands for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add a line of the following form to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F path=/usr/bin/sudoedit -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add a line of the following form to /etc/audit/audit.rules:
-a always,exit -F path=/usr/bin/sudoedit -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged

Rationale

Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised 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 and advanced persistent threast.

Privileged programs are subject to escalation-of-privilege attacks, which attempt to subvert their normal role of providing some necessary but limited capability. As such, motivation exists to monitor these programs for unusual activity.

OVAL details

Items not found violating audit augenrules sudoedit:

Object oval:ssg-object_audit_rules_privileged_commands_sudoedit_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/bin\/sudoedit[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl sudoedit:

Object oval:ssg-object_audit_rules_privileged_commands_sudoedit_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/bin\/sudoedit[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


PATTERN="-a always,exit -F path=/usr/bin/sudoedit.*"
GROUP="privileged"
FULL_RULE="-a always,exit -F path=/usr/bin/sudoedit -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged"
# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
Ensure auditd Collects Information on the Use of Privileged Commands - newgrpxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_newgrp medium

Ensure auditd Collects Information on the Use of Privileged Commands - newgrp

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_newgrp
Result
notselected
Time2017-10-21T14:39:58
Severitymedium
Identifiers and References

References:  AU-3(1), AU-12(c), 135, 172, 2884, SRG-OS-000042-GPOS-00020, SRG-OS-000392-GPOS-00172, SRG-OS-000471-GPOS-00215, 3.1.7

Description

At a minimum, the audit system should collect the execution of privileged commands for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add a line of the following form to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F path=/usr/bin/newgrp -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add a line of the following form to /etc/audit/audit.rules:
-a always,exit -F path=/usr/bin/newgrp -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged

Rationale

Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised 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 and advanced persistent threast.

Privileged programs are subject to escalation-of-privilege attacks, which attempt to subvert their normal role of providing some necessary but limited capability. As such, motivation exists to monitor these programs for unusual activity.

Ensure auditd Collects Information on the Use of Privileged Commands - chshxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_chsh medium

Ensure auditd Collects Information on the Use of Privileged Commands - chsh

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_chsh
Result
fail
Time2017-10-21T14:39:58
Severitymedium
Identifiers and References

References:  AU-3(1), AU-12(c), 135, 172, 2884, SRG-OS-000042-GPOS-00020, SRG-OS-000392-GPOS-00172, SRG-OS-000471-GPOS-00215, 3.1.7

Description

At a minimum, the audit system should collect the execution of privileged commands for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add a line of the following form to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F path=/usr/bin/chsh -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add a line of the following form to /etc/audit/audit.rules:
-a always,exit -F path=/usr/bin/chsh -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged

Rationale

Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised 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 and advanced persistent threast.

Privileged programs are subject to escalation-of-privilege attacks, which attempt to subvert their normal role of providing some necessary but limited capability. As such, motivation exists to monitor these programs for unusual activity.

OVAL details

Items not found violating audit augenrules chsh:

Object oval:ssg-object_audit_rules_privileged_commands_chsh_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/bin\/chsh[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl chsh:

Object oval:ssg-object_audit_rules_privileged_commands_chsh_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/bin\/chsh[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


PATTERN="-a always,exit -F path=/usr/bin/chsh.*"
GROUP="privileged"
FULL_RULE="-a always,exit -F path=/usr/bin/chsh -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged"
# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
Ensure auditd Collects Information on the Use of Privileged Commands - umountxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_umount medium

Ensure auditd Collects Information on the Use of Privileged Commands - umount

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_umount
Result
fail
Time2017-10-21T14:39:58
Severitymedium
Identifiers and References

References:  AU-3(1), AU-12(c), 135, 172, 2884, SRG-OS-000042-GPOS-00020, SRG-OS-000392-GPOS-00172, SRG-OS-000471-GPOS-00215, 3.1.7

Description

At a minimum, the audit system should collect the execution of privileged commands for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add a line of the following form to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F path=/usr/bin/umount -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add a line of the following form to /etc/audit/audit.rules:
-a always,exit -F path=/usr/bin/umount -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged

Rationale

Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised 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 and advanced persistent threast.

Privileged programs are subject to escalation-of-privilege attacks, which attempt to subvert their normal role of providing some necessary but limited capability. As such, motivation exists to monitor these programs for unusual activity.

OVAL details

Items not found violating audit augenrules umount:

Object oval:ssg-object_audit_rules_privileged_commands_umount_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/bin\/umount[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl umount:

Object oval:ssg-object_audit_rules_privileged_commands_umount_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/bin\/umount[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


PATTERN="-a always,exit -F path=/usr/bin/umount.*"
GROUP="privileged"
FULL_RULE="-a always,exit -F path=/usr/bin/umount -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged"
# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
Ensure auditd Collects Information on the Use of Privileged Commands - postdropxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_postdrop medium

Ensure auditd Collects Information on the Use of Privileged Commands - postdrop

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_postdrop
Result
fail
Time2017-10-21T14:39:58
Severitymedium
Identifiers and References

References:  AU-3(1), AU-12(c), 135, 172, 2884, SRG-OS-000042-GPOS-00020, SRG-OS-000392-GPOS-00172, SRG-OS-000471-GPOS-00215, 3.1.7

Description

At a minimum, the audit system should collect the execution of privileged commands for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add a line of the following form to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F path=/usr/sbin/postdrop -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add a line of the following form to /etc/audit/audit.rules:
-a always,exit -F path=/usr/sbin/postdrop -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged

Rationale

Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised 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 and advanced persistent threast.

Privileged programs are subject to escalation-of-privilege attacks, which attempt to subvert their normal role of providing some necessary but limited capability. As such, motivation exists to monitor these programs for unusual activity.

OVAL details

Items not found violating audit augenrules postdrop:

Object oval:ssg-object_audit_rules_privileged_commands_postdrop_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/sbin\/postdrop[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl postdrop:

Object oval:ssg-object_audit_rules_privileged_commands_postdrop_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/sbin\/postdrop[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


PATTERN="-a always,exit -F path=/usr/sbin/postdrop.*"
GROUP="privileged"
FULL_RULE="-a always,exit -F path=/usr/sbin/postdrop -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged"
# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
Ensure auditd Collects Information on the Use of Privileged Commands - postqueuexccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_postqueue medium

Ensure auditd Collects Information on the Use of Privileged Commands - postqueue

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_postqueue
Result
fail
Time2017-10-21T14:39:58
Severitymedium
Identifiers and References

References:  AU-3(1), AU-12(c), 135, 172, 2884, SRG-OS-000042-GPOS-00020, SRG-OS-000392-GPOS-00172, SRG-OS-000471-GPOS-00215, 3.1.7

Description

At a minimum, the audit system should collect the execution of privileged commands for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add a line of the following form to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F path=/usr/sbin/postqueue -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add a line of the following form to /etc/audit/audit.rules:
-a always,exit -F path=/usr/sbin/postqueue -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged

Rationale

Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised 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 and advanced persistent threast.

Privileged programs are subject to escalation-of-privilege attacks, which attempt to subvert their normal role of providing some necessary but limited capability. As such, motivation exists to monitor these programs for unusual activity.

OVAL details

Items not found violating audit augenrules postqueue:

Object oval:ssg-object_audit_rules_privileged_commands_postqueue_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/sbin\/postqueue[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl postqueue:

Object oval:ssg-object_audit_rules_privileged_commands_postqueue_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/sbin\/postqueue[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


PATTERN="-a always,exit -F path=/usr/sbin/postqueue.*"
GROUP="privileged"
FULL_RULE="-a always,exit -F path=/usr/sbin/postqueue -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged"
# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
Ensure auditd Collects Information on the Use of Privileged Commands - ssh-keysignxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_ssh_keysign medium

Ensure auditd Collects Information on the Use of Privileged Commands - ssh-keysign

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_ssh_keysign
Result
fail
Time2017-10-21T14:39:58
Severitymedium
Identifiers and References

References:  AU-3(1), AU-12(c), 135, 172, 2884, SRG-OS-000042-GPOS-00020, SRG-OS-000392-GPOS-00172, SRG-OS-000471-GPOS-00215, 3.1.7

Description

At a minimum, the audit system should collect the execution of privileged commands for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add a line of the following form to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F path=/usr/libexec/openssh/ssh-keysign -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add a line of the following form to /etc/audit/audit.rules:
-a always,exit -F path=/usr/libexec/openssh/key-sign -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged

Rationale

Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised 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 and advanced persistent threast.

Privileged programs are subject to escalation-of-privilege attacks, which attempt to subvert their normal role of providing some necessary but limited capability. As such, motivation exists to monitor these programs for unusual activity.

OVAL details

Items not found violating audit augenrules ssh_keysign:

Object oval:ssg-object_audit_rules_privileged_commands_ssh_keysign_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/libexec\/openssh\/ssh-keysign[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl ssh_keysign:

Object oval:ssg-object_audit_rules_privileged_commands_ssh_keysign_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/libexec\/openssh\/ssh-keysign[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


PATTERN="-a always,exit -F path=/usr/libexec/openssh/ssh-keysign.*"
GROUP="privileged"
FULL_RULE="-a always,exit -F path=/usr/libexec/openssh/ssh-keysign -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged"
# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
Ensure auditd Collects Information on the Use of Privileged Commands - pt_chownxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_pt_chown medium

Ensure auditd Collects Information on the Use of Privileged Commands - pt_chown

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_pt_chown
Result
fail
Time2017-10-21T14:39:58
Severitymedium
Identifiers and References

References:  AU-3(1), AU-12(c), 135, 172, 2884, SRG-OS-000042-GPOS-00020, SRG-OS-000392-GPOS-00172, SRG-OS-000471-GPOS-00215, 3.1.7

Description

At a minimum, the audit system should collect the execution of privileged commands for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add a line of the following form to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F path=/usr/libexec/pt_chown -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add a line of the following form to /etc/audit/audit.rules:
-a always,exit -F path=/usr/libexec/pt_chown -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged

Rationale

Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised 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 and advanced persistent threast.

Privileged programs are subject to escalation-of-privilege attacks, which attempt to subvert their normal role of providing some necessary but limited capability. As such, motivation exists to monitor these programs for unusual activity.

OVAL details

Items not found violating audit augenrules pt_chown:

Object oval:ssg-object_audit_rules_privileged_commands_pt_chown_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/libexec\/pt_chown[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl pt_chown:

Object oval:ssg-object_audit_rules_privileged_commands_pt_chown_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/libexec\/pt_chown[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:high
Disruption:medium
Strategy:restrict


PATTERN="-a always,exit -F path=/usr/libexec/pt_chown.*"
GROUP="privileged"
FULL_RULE="-a always,exit -F path=/usr/libexec/pt_chown -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged"
# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
Ensure auditd Collects Information on the Use of Privileged Commands - crontabxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_crontab medium

Ensure auditd Collects Information on the Use of Privileged Commands - crontab

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_crontab
Result
fail
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AU-3(1), AU-12(c), 135, 172, 2884, SRG-OS-000042-GPOS-00020, SRG-OS-000392-GPOS-00172, SRG-OS-000471-GPOS-00215, 3.1.7

Description

At a minimum, the audit system should collect the execution of privileged commands for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add a line of the following form to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F path=/usr/bin/crontab -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add a line of the following form to /etc/audit/audit.rules:
-a always,exit -F path=/usr/bin/crontab -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged

Rationale

Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised 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 and advanced persistent threast.

Privileged programs are subject to escalation-of-privilege attacks, which attempt to subvert their normal role of providing some necessary but limited capability. As such, motivation exists to monitor these programs for unusual activity.

OVAL details

Items not found violating audit augenrules crontab:

Object oval:ssg-object_audit_rules_privileged_commands_crontab_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/bin\/crontab[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl crontab:

Object oval:ssg-object_audit_rules_privileged_commands_crontab_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/bin\/crontab[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


PATTERN="-a always,exit -F path=/usr/bin/crontab.*"
GROUP="privileged"
FULL_RULE="-a always,exit -F path=/usr/bin/crontab -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged"
# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
Ensure auditd Collects Information on the Use of Privileged Commands - pam_timestamp_checkxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_pam_timestamp_check medium

Ensure auditd Collects Information on the Use of Privileged Commands - pam_timestamp_check

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_privileged_commands_pam_timestamp_check
Result
fail
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AU-3(1), AU-12(c), 135, 172, 2884, SRG-OS-000042-GPOS-00020, SRG-OS-000392-GPOS-00172, SRG-OS-000471-GPOS-00215, 3.1.7

Description

At a minimum, the audit system should collect the execution of privileged commands for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add a line of the following form to a file with suffix .rules in the directory /etc/audit/rules.d:

-a always,exit -F path=/usr/sbin/pam_timestamp_check -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add a line of the following form to /etc/audit/audit.rules:
-a always,exit -F path=/usr/sbin/pam_timestamp_check -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged

Rationale

Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised 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 and advanced persistent threast.

Privileged programs are subject to escalation-of-privilege attacks, which attempt to subvert their normal role of providing some necessary but limited capability. As such, motivation exists to monitor these programs for unusual activity.

OVAL details

Items not found violating audit augenrules pam_timestamp_check:

Object oval:ssg-object_audit_rules_privileged_commands_pam_timestamp_check_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/sbin\/pam_timestamp_check[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl pam_timestamp_check:

Object oval:ssg-object_audit_rules_privileged_commands_pam_timestamp_check_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+-F[\s]+path=\/usr\/sbin\/pam_timestamp_check[\s]+-F[\s]+perm=x[\s]+-F[\s]+auid>=1000[\s]+-F[\s]+auid!=4294967295[\s]+(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


PATTERN="-a always,exit -F path=/usr/sbin/pam_timestamp_check.*"
GROUP="privileged"
FULL_RULE="-a always,exit -F path=/usr/sbin/pam_timestamp_check -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged"
# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
Ensure auditd Collects File Deletion Events by Userxccdf_org.ssgproject.content_rule_audit_rules_file_deletion_events medium

Ensure auditd Collects File Deletion Events by User

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_file_deletion_events
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, Req-10.2.7, 5.2.14, 366, 172, 2884, 5.4.1.1, 3.1.7

Description

At a minimum the audit system should collect file deletion events for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d, setting ARCH to either b32 or b64 as appropriate for your system:

-a always,exit -F arch=ARCH -S rmdiri,unlink,unlinkat,rename,renameat -F auid>=1000 -F auid!=4294967295 -F key=delete
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file, setting ARCH to either b32 or b64 as appropriate for your system:
-a always,exit -F arch=ARCH -S rmdir,unlink,unlinkat,rename -S renameat -F auid>=1000 -F auid!=4294967295 -F key=delete

Rationale

Auditing file deletions will create an audit trail for files that are removed from the system. The audit trail could aid in system troubleshooting, as well as, detecting malicious processes that attempt to delete log files to conceal their presence.

Ensure auditd Collects File Deletion Events by User - rmdirxccdf_org.ssgproject.content_rule_audit_rules_file_deletion_events_rmdir medium

Ensure auditd Collects File Deletion Events by User - rmdir

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_file_deletion_events_rmdir
Result
fail
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, MA-4(1)(a), 366, 172, 2884, SRG-OS-000466-GPOS-00210, SRG-OS-000467-GPOS-00210, SRG-OS-000468-GPOS-00212, SRG-OS-000392-GPOS-00172, Req-10.2.7, 5.2.14, 3.1.7

Description

At a minimum, the audit system should collect file deletion events for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d, setting ARCH to either b32 or b64 as appropriate for your system:

-a always,exit -F arch=ARCH -S rmdir -F auid>=1000 -F auid!=4294967295 -F key=delete
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file, setting ARCH to either b32 or b64 as appropriate for your system:
-a always,exit -F arch=ARCH -S rmdir -F auid>=1000 -F auid!=4294967295 -F key=delete

Rationale

Auditing file deletions will create an audit trail for files that are removed from the system. The audit trail could aid in system troubleshooting, as well as, detecting malicious processes that attempt to delete log files to conceal their presence.

OVAL details

Items not found violating audit augenrules 32-bit rmdir:

Object oval:ssg-object_32bit_ardm_rmdir_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+rmdir[\s]+|([\s]+|[,])rmdir([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit rmdir:

Object oval:ssg-object_64bit_ardm_rmdir_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+rmdir[\s]+|([\s]+|[,])rmdir([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit rmdir:

Object oval:ssg-object_32bit_ardm_rmdir_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+rmdir[\s]+|([\s]+|[,])rmdir([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit rmdir:

Object oval:ssg-object_64bit_ardm_rmdir_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+rmdir[\s]+|([\s]+|[,])rmdir([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# First perform the remediation of the syscall rule
# Retrieve hardware architecture of the underlying system
[ "$(getconf LONG_BIT)" = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit -F arch=$ARCH -S rmdir.*"
	GROUP="delete"
	FULL_RULE="-a always,exit -F arch=$ARCH -S rmdir -F auid>=1000 -F auid!=4294967295 -F key=delete"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Ensure auditd Collects File Deletion Events by User - unlinkatxccdf_org.ssgproject.content_rule_audit_rules_file_deletion_events_unlinkat medium

Ensure auditd Collects File Deletion Events by User - unlinkat

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_file_deletion_events_unlinkat
Result
fail
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, MA-4(1)(a), 366, 172, 2884, SRG-OS-000466-GPOS-00210, SRG-OS-000467-GPOS-00210, SRG-OS-000468-GPOS-00212, SRG-OS-000392-GPOS-00172, Req-10.2.7, 5.2.14, 3.1.7

Description

At a minimum, the audit system should collect file deletion events for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d, setting ARCH to either b32 or b64 as appropriate for your system:

-a always,exit -F arch=ARCH -S unlinkat -F auid>=1000 -F auid!=4294967295 -F key=delete
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file, setting ARCH to either b32 or b64 as appropriate for your system:
-a always,exit -F arch=ARCH -S unlinkat -F auid>=1000 -F auid!=4294967295 -F key=delete

Rationale

Auditing file deletions will create an audit trail for files that are removed from the system. The audit trail could aid in system troubleshooting, as well as, detecting malicious processes that attempt to delete log files to conceal their presence.

OVAL details

Items not found violating audit augenrules 32-bit unlinkat:

Object oval:ssg-object_32bit_ardm_unlinkat_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+unlinkat[\s]+|([\s]+|[,])unlinkat([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit unlinkat:

Object oval:ssg-object_64bit_ardm_unlinkat_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+unlinkat[\s]+|([\s]+|[,])unlinkat([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit unlinkat:

Object oval:ssg-object_32bit_ardm_unlinkat_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+unlinkat[\s]+|([\s]+|[,])unlinkat([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit unlinkat:

Object oval:ssg-object_64bit_ardm_unlinkat_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+unlinkat[\s]+|([\s]+|[,])unlinkat([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# First perform the remediation of the syscall rule
# Retrieve hardware architecture of the underlying system
[ "$(getconf LONG_BIT)" = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit -F arch=$ARCH -S unlinkat.*"
	GROUP="delete"
	FULL_RULE="-a always,exit -F arch=$ARCH -S unlinkat -F auid>=1000 -F auid!=4294967295 -F key=delete"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Ensure auditd Collects File Deletion Events by User - renamexccdf_org.ssgproject.content_rule_audit_rules_file_deletion_events_rename medium

Ensure auditd Collects File Deletion Events by User - rename

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_file_deletion_events_rename
Result
fail
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, MA-4(1)(a), 366, 172, 2884, SRG-OS-000466-GPOS-00210, SRG-OS-000467-GPOS-00210, SRG-OS-000468-GPOS-00212, SRG-OS-000392-GPOS-00172, Req-10.2.7, 5.2.14, 3.1.7

Description

At a minimum, the audit system should collect file deletion events for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d, setting ARCH to either b32 or b64 as appropriate for your system:

-a always,exit -F arch=ARCH -S rename -F auid>=1000 -F auid!=4294967295 -F key=delete
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file, setting ARCH to either b32 or b64 as appropriate for your system:
-a always,exit -F arch=ARCH -S rename -F auid>=1000 -F auid!=4294967295 -F key=delete

Rationale

Auditing file deletions will create an audit trail for files that are removed from the system. The audit trail could aid in system troubleshooting, as well as, detecting malicious processes that attempt to delete log files to conceal their presence.

OVAL details

Items not found violating audit augenrules 32-bit rename:

Object oval:ssg-object_32bit_ardm_rename_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+rename[\s]+|([\s]+|[,])rename([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit rename:

Object oval:ssg-object_64bit_ardm_rename_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+rename[\s]+|([\s]+|[,])rename([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit rename:

Object oval:ssg-object_32bit_ardm_rename_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+rename[\s]+|([\s]+|[,])rename([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit rename:

Object oval:ssg-object_64bit_ardm_rename_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+rename[\s]+|([\s]+|[,])rename([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# First perform the remediation of the syscall rule
# Retrieve hardware architecture of the underlying system
[ "$(getconf LONG_BIT)" = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit -F arch=$ARCH -S rename.*"
	GROUP="delete"
	FULL_RULE="-a always,exit -F arch=$ARCH -S rename -F auid>=1000 -F auid!=4294967295 -F key=delete"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Ensure auditd Collects File Deletion Events by User - renameatxccdf_org.ssgproject.content_rule_audit_rules_file_deletion_events_renameat medium

Ensure auditd Collects File Deletion Events by User - renameat

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_file_deletion_events_renameat
Result
fail
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, MA-4(1)(a), 366, 172, 2884, SRG-OS-000466-GPOS-00210, SRG-OS-000467-GPOS-00210, SRG-OS-000468-GPOS-00212, SRG-OS-000392-GPOS-00172, Req-10.2.7, 5.2.14, 3.1.7

Description

At a minimum, the audit system should collect file deletion events for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d, setting ARCH to either b32 or b64 as appropriate for your system:

-a always,exit -F arch=ARCH -S renameat -F auid>=1000 -F auid!=4294967295 -F key=delete
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file, setting ARCH to either b32 or b64 as appropriate for your system:
-a always,exit -F arch=ARCH -S renameat -F auid>=1000 -F auid!=4294967295 -F key=delete

Rationale

Auditing file deletions will create an audit trail for files that are removed from the system. The audit trail could aid in system troubleshooting, as well as, detecting malicious processes that attempt to delete log files to conceal their presence.

OVAL details

Items not found violating audit augenrules 32-bit renameat:

Object oval:ssg-object_32bit_ardm_renameat_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+renameat[\s]+|([\s]+|[,])renameat([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit renameat:

Object oval:ssg-object_64bit_ardm_renameat_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+renameat[\s]+|([\s]+|[,])renameat([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit renameat:

Object oval:ssg-object_32bit_ardm_renameat_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+renameat[\s]+|([\s]+|[,])renameat([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit renameat:

Object oval:ssg-object_64bit_ardm_renameat_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+renameat[\s]+|([\s]+|[,])renameat([\s]+|[,])))(?:.*-F\s+auid>=1000[\s]+)(?:.*-F\s+auid!=4294967295[\s]+).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# First perform the remediation of the syscall rule
# Retrieve hardware architecture of the underlying system
[ "$(getconf LONG_BIT)" = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit -F arch=$ARCH -S renameat.*"
	GROUP="delete"
	FULL_RULE="-a always,exit -F arch=$ARCH -S renameat -F auid>=1000 -F auid!=4294967295 -F key=delete"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Ensure auditd Collects Information on Kernel Module Loading and Unloadingxccdf_org.ssgproject.content_rule_audit_rules_kernel_module_loading medium

Ensure auditd Collects Information on Kernel Module Loading and Unloading

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_kernel_module_loading
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, Req-10.2.7, 5.2.17, 172, 5.4.1.1, 3.1.7

Description

If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix .rules in the directory /etc/audit/rules.d to capture kernel module loading and unloading events, setting ARCH to either b32 or b64 as appropriate for your system:

-w /usr/sbin/insmod -p x -k modules
-w /usr/sbin/rmmod -p x -k modules
-w /usr/sbin/modprobe -p x -k modules
-a always,exit -F arch=ARCH -S init_module -S delete_module -k modules
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file in order to capture kernel module loading and unloading events, setting ARCH to either b32 or b64 as appropriate for your system:
-w /usr/sbin/insmod -p x -k modules
-w /usr/sbin/rmmod -p x -k modules
-w /usr/sbin/modprobe -p x -k modules
-a always,exit -F arch=ARCH -S init_module -S delete_module -k modules

Rationale

The addition/removal of kernel modules can be used to alter the behavior of the kernel and potentially introduce malicious code into kernel space. It is important to have an audit trail of modules that have been introduced into the kernel.

Ensure auditd Collects Information on Kernel Module Loading and Unloading - init_modulexccdf_org.ssgproject.content_rule_audit_rules_kernel_module_loading_init medium

Ensure auditd Collects Information on Kernel Module Loading and Unloading - init_module

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_kernel_module_loading_init
Result
fail
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 172, SRG-OS-000471-GPOS-00216, SRG-OS-000477-GPOS-00222, Req-10.2.7, 5.2.17, 3.1.7

Description

If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix .rules in the directory /etc/audit/rules.d to capture kernel module loading and unloading events, setting ARCH to either b32 or b64 as appropriate for your system:

-a always,exit -F arch=ARCH -S init_module -F key=modules
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file in order to capture kernel module loading and unloading events, setting ARCH to either b32 or b64 as appropriate for your system:
-a always,exit -F arch=ARCH -S init_module -F key=modules

Rationale

The addition/removal of kernel modules can be used to alter the behavior of the kernel and potentially introduce malicious code into kernel space. It is important to have an audit trail of modules that have been introduced into the kernel.

OVAL details

Items not found violating audit augenrules 32-bit init_module:

Object oval:ssg-object_32bit_ardm_init_module_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+init_module[\s]+|([\s]+|[,])init_module([\s]+|[,]))).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit init_module:

Object oval:ssg-object_64bit_ardm_init_module_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+init_module[\s]+|([\s]+|[,])init_module([\s]+|[,]))).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit init_module:

Object oval:ssg-object_32bit_ardm_init_module_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+init_module[\s]+|([\s]+|[,])init_module([\s]+|[,]))).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit init_module:

Object oval:ssg-object_64bit_ardm_init_module_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+init_module[\s]+|([\s]+|[,])init_module([\s]+|[,]))).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# First perform the remediation of the syscall rule
# Retrieve hardware architecture of the underlying system
# Note: 32-bit kernel modules can't be loaded / unloaded on 64-bit kernel =>
#       it's not required on a 64-bit system to check also for the presence
#       of 32-bit's equivalent of the corresponding rule. Therefore for
#       each system it's enought to check presence of system's native rule form.
[ "$(getconf LONG_BIT)" = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit -F arch=$ARCH -S init_module \(-F key=\|-k \).*"
	GROUP="modules"
	FULL_RULE="-a always,exit -F arch=$ARCH -S init_module -k modules"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Ensure auditd Collects Information on Kernel Module Loading and Unloading - delete_modulexccdf_org.ssgproject.content_rule_audit_rules_kernel_module_loading_delete medium

Ensure auditd Collects Information on Kernel Module Loading and Unloading - delete_module

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_kernel_module_loading_delete
Result
fail
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 172, SRG-OS-000471-GPOS-00216, SRG-OS-000477-GPOS-00222, Req-10.2.7, 5.2.17, 3.1.7

Description

If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix .rules in the directory /etc/audit/rules.d to capture kernel module loading and unloading events, setting ARCH to either b32 or b64 as appropriate for your system:

-a always,exit -F arch=ARCH -S delete_module -F key=modules
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file in order to capture kernel module loading and unloading events, setting ARCH to either b32 or b64 as appropriate for your system:
-a always,exit -F arch=ARCH -S delete_module -F key=modules

Rationale

The addition/removal of kernel modules can be used to alter the behavior of the kernel and potentially introduce malicious code into kernel space. It is important to have an audit trail of modules that have been introduced into the kernel.

OVAL details

Items not found violating audit augenrules 32-bit delete_module:

Object oval:ssg-object_32bit_ardm_delete_module_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+delete_module[\s]+|([\s]+|[,])delete_module([\s]+|[,]))).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit augenrules 64-bit delete_module:

Object oval:ssg-object_64bit_ardm_delete_module_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+delete_module[\s]+|([\s]+|[,])delete_module([\s]+|[,]))).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 32-bit delete_module:

Object oval:ssg-object_32bit_ardm_delete_module_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+delete_module[\s]+|([\s]+|[,])delete_module([\s]+|[,]))).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1

Items not found violating audit auditctl 64-bit delete_module:

Object oval:ssg-object_64bit_ardm_delete_module_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+delete_module[\s]+|([\s]+|[,])delete_module([\s]+|[,]))).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# First perform the remediation of the syscall rule
# Retrieve hardware architecture of the underlying system
# Note: 32-bit kernel modules can't be loaded / unloaded on 64-bit kernel =>
#       it's not required on a 64-bit system to check also for the presence
#       of 32-bit's equivalent of the corresponding rule. Therefore for
#       each system it's enought to check presence of system's native rule form.
[ "$(getconf LONG_BIT)" = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit -F arch=$ARCH -S delete_module \(-F key=\|-k \).*"
	GROUP="modules"
	FULL_RULE="-a always,exit -F arch=$ARCH -S delete_module -k modules"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Ensure auditd Collects Information on Kernel Module Loading and Unloading - insmodxccdf_org.ssgproject.content_rule_audit_rules_kernel_module_loading_insmod medium

Ensure auditd Collects Information on Kernel Module Loading and Unloading - insmod

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_kernel_module_loading_insmod
Result
fail
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 172, SRG-OS-000471-GPOS-00216, SRG-OS-000477-GPOS-00222, Req-10.2.7, 5.2.17, 3.1.7

Description

If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix .rules in the directory /etc/audit/rules.d to capture kernel module loading and unloading events, setting ARCH to either b32 or b64 as appropriate for your system:

-w /usr/sbin/insmod -p x -k modules
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file in order to capture kernel module loading and unloading events, setting ARCH to either b32 or b64 as appropriate for your system:
-w /usr/sbin/insmod -p x -k modules

Rationale

The addition/removal of kernel modules can be used to alter the behavior of the kernel and potentially introduce malicious code into kernel space. It is important to have an audit trail of modules that have been introduced into the kernel.

OVAL details

Items not found violating audit augenrules insmod:

Object oval:ssg-object_audit_rule_kernel_module_loading_insmod_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^\-w[\s]+/usr/sbin/insmod[\s]+\-p[\s]+\b([raw]*x[raw]*)\b[\s]+(-k[\s]+|-F[\s]+key=)[-\w]+[\s]*$1

Items not found violating audit auditctl insmod:

Object oval:ssg-object_audit_rule_kernel_module_loading_insmod_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^\-w[\s]+/usr/sbin/insmod[\s]+\-p[\s]+\b([raw]*x[raw]*)\b[\s]+(-k[\s]+|-F[\s]+key=)[-\w]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_watch_rule {

# Load function arguments into local variables
local tool="$1"
local path="$2"
local required_access_bits="$3"
local key="$4"

# Check sanity of the input
if [ $# -ne "4" ]
then
        echo "Usage: fix_audit_watch_rule 'tool' 'path' 'bits' 'key'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
# Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#       auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#       augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#       augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
declare -a files_to_inspect

# Check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If the audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# into the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules')
# If the audit is 'augenrules', then check if rule is already defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to list of files for inspection.
# If rule isn't defined, add '/etc/audit/rules.d/$key.rules' to list of files for inspection.
elif [ "$tool" == 'augenrules' ]
then
        # Case when particular audit rule is already defined in some of /etc/audit/rules.d/*.rules file
        # Get pair -- filepath : matching_row into @matches array
        IFS=$'\n' matches=($(grep -P "[\s]*-w[\s]+$path" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        # For each of the matched entries
        for match in "${matches[@]}"
        do
                # Extract filepath from the match
                rulesd_audit_file=$(echo $match | cut -f1 -d ':')
                # Append that path into list of files for inspection
                files_to_inspect=("${files_to_inspect[@]}" "$rulesd_audit_file")
        done
        # Case when particular audit rule isn't defined yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                # Append '/etc/audit/rules.d/$key.rules' into list of files for inspection
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                # If the $key.rules file doesn't exist yet, create it with correct permissions
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

# Finally perform the inspection and possible subsequent audit rule
# correction for each of the files previously identified for inspection
for audit_rules_file in "${files_to_inspect[@]}"
do

        # Check if audit watch file system object rule for given path already present
        if grep -q -P -- "[\s]*-w[\s]+$path" "$audit_rules_file"
        then
                # Rule is found => verify yet if existing rule definition contains
                # all of the required access type bits

                # Escape slashes in path for use in sed pattern below
                local esc_path=${path//$'/'/$'\/'}
                # Define BRE whitespace class shortcut
                local sp="[[:space:]]"
                # Extract current permission access types (e.g. -p [r|w|x|a] values) from audit rule
                current_access_bits=$(sed -ne "s/$sp*-w$sp\+$esc_path$sp\+-p$sp\+\([rxwa]\{1,4\}\).*/\1/p" "$audit_rules_file")
                # Split required access bits string into characters array
                # (to check bit's presence for one bit at a time)
                for access_bit in $(echo "$required_access_bits" | grep -o .)
                do
                        # For each from the required access bits (e.g. 'w', 'a') check
                        # if they are already present in current access bits for rule.
                        # If not, append that bit at the end
                        if ! grep -q "$access_bit" <<< "$current_access_bits"
                        then
                                # Concatenate the existing mask with the missing bit
                                current_access_bits="$current_access_bits$access_bit"
                        fi
                done
                # Propagate the updated rule's access bits (original + the required
                # ones) back into the /etc/audit/audit.rules file for that rule
                sed -i "s/\($sp*-w$sp\+$esc_path$sp\+-p$sp\+\)\([rxwa]\{1,4\}\)\(.*\)/\1$current_access_bits\3/" "$audit_rules_file"
        else
                # Rule isn't present yet. Append it at the end of $audit_rules_file file
                # with proper key

                echo "-w $path -p $required_access_bits -k $key" >> "$audit_rules_file"
        fi
done
}

fix_audit_watch_rule "auditctl" "/usr/sbin/insmod" "x" "modules"
fix_audit_watch_rule "augenrules" "/usr/sbin/insmod" "x" "modules"
Ensure auditd Collects Information on Kernel Module Loading and Unloading - rmmodxccdf_org.ssgproject.content_rule_audit_rules_kernel_module_loading_rmmod medium

Ensure auditd Collects Information on Kernel Module Loading and Unloading - rmmod

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_kernel_module_loading_rmmod
Result
fail
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 172, SRG-OS-000471-GPOS-00216, SRG-OS-000477-GPOS-00222, Req-10.2.7, 5.2.17, 3.1.7

Description

If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix .rules in the directory /etc/audit/rules.d to capture kernel module loading and unloading events, setting ARCH to either b32 or b64 as appropriate for your system:

-w /usr/sbin/rmmod -p x -k modules
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file in order to capture kernel module loading and unloading events, setting ARCH to either b32 or b64 as appropriate for your system:
-w /usr/sbin/rmmod -p x -k modules

Rationale

The addition/removal of kernel modules can be used to alter the behavior of the kernel and potentially introduce malicious code into kernel space. It is important to have an audit trail of modules that have been introduced into the kernel.

OVAL details

Items not found violating audit augenrules rmmod:

Object oval:ssg-object_audit_rule_kernel_module_loading_rmmod_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^\-w[\s]+/usr/sbin/rmmod[\s]+\-p[\s]+\b([raw]*x[raw]*)\b[\s]+(-k[\s]+|-F[\s]+key=)[-\w]+[\s]*$1

Items not found violating audit auditctl rmmod:

Object oval:ssg-object_audit_rule_kernel_module_loading_rmmod_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^\-w[\s]+/usr/sbin/rmmod[\s]+\-p[\s]+\b([raw]*x[raw]*)\b[\s]+(-k[\s]+|-F[\s]+key=)[-\w]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_watch_rule {

# Load function arguments into local variables
local tool="$1"
local path="$2"
local required_access_bits="$3"
local key="$4"

# Check sanity of the input
if [ $# -ne "4" ]
then
        echo "Usage: fix_audit_watch_rule 'tool' 'path' 'bits' 'key'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
# Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#       auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#       augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#       augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
declare -a files_to_inspect

# Check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If the audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# into the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules')
# If the audit is 'augenrules', then check if rule is already defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to list of files for inspection.
# If rule isn't defined, add '/etc/audit/rules.d/$key.rules' to list of files for inspection.
elif [ "$tool" == 'augenrules' ]
then
        # Case when particular audit rule is already defined in some of /etc/audit/rules.d/*.rules file
        # Get pair -- filepath : matching_row into @matches array
        IFS=$'\n' matches=($(grep -P "[\s]*-w[\s]+$path" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        # For each of the matched entries
        for match in "${matches[@]}"
        do
                # Extract filepath from the match
                rulesd_audit_file=$(echo $match | cut -f1 -d ':')
                # Append that path into list of files for inspection
                files_to_inspect=("${files_to_inspect[@]}" "$rulesd_audit_file")
        done
        # Case when particular audit rule isn't defined yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                # Append '/etc/audit/rules.d/$key.rules' into list of files for inspection
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                # If the $key.rules file doesn't exist yet, create it with correct permissions
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

# Finally perform the inspection and possible subsequent audit rule
# correction for each of the files previously identified for inspection
for audit_rules_file in "${files_to_inspect[@]}"
do

        # Check if audit watch file system object rule for given path already present
        if grep -q -P -- "[\s]*-w[\s]+$path" "$audit_rules_file"
        then
                # Rule is found => verify yet if existing rule definition contains
                # all of the required access type bits

                # Escape slashes in path for use in sed pattern below
                local esc_path=${path//$'/'/$'\/'}
                # Define BRE whitespace class shortcut
                local sp="[[:space:]]"
                # Extract current permission access types (e.g. -p [r|w|x|a] values) from audit rule
                current_access_bits=$(sed -ne "s/$sp*-w$sp\+$esc_path$sp\+-p$sp\+\([rxwa]\{1,4\}\).*/\1/p" "$audit_rules_file")
                # Split required access bits string into characters array
                # (to check bit's presence for one bit at a time)
                for access_bit in $(echo "$required_access_bits" | grep -o .)
                do
                        # For each from the required access bits (e.g. 'w', 'a') check
                        # if they are already present in current access bits for rule.
                        # If not, append that bit at the end
                        if ! grep -q "$access_bit" <<< "$current_access_bits"
                        then
                                # Concatenate the existing mask with the missing bit
                                current_access_bits="$current_access_bits$access_bit"
                        fi
                done
                # Propagate the updated rule's access bits (original + the required
                # ones) back into the /etc/audit/audit.rules file for that rule
                sed -i "s/\($sp*-w$sp\+$esc_path$sp\+-p$sp\+\)\([rxwa]\{1,4\}\)\(.*\)/\1$current_access_bits\3/" "$audit_rules_file"
        else
                # Rule isn't present yet. Append it at the end of $audit_rules_file file
                # with proper key

                echo "-w $path -p $required_access_bits -k $key" >> "$audit_rules_file"
        fi
done
}

fix_audit_watch_rule "auditctl" "/usr/sbin/rmmod" "x" "modules"
fix_audit_watch_rule "augenrules" "/usr/sbin/rmmod" "x" "modules"
Ensure auditd Collects Information on Kernel Module Loading and Unloading - modprobexccdf_org.ssgproject.content_rule_audit_rules_kernel_module_loading_modprobe medium

Ensure auditd Collects Information on Kernel Module Loading and Unloading - modprobe

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_kernel_module_loading_modprobe
Result
fail
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 172, SRG-OS-000471-GPOS-00216, SRG-OS-000477-GPOS-00222, Req-10.2.7, 5.2.17, 3.1.7

Description

If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix .rules in the directory /etc/audit/rules.d to capture kernel module loading and unloading events, setting ARCH to either b32 or b64 as appropriate for your system:

-w /usr/sbin/modprobe -p x -k modules
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file in order to capture kernel module loading and unloading events, setting ARCH to either b32 or b64 as appropriate for your system:
-w /usr/sbin/modprobe -p x -k modules

Rationale

The addition/removal of kernel modules can be used to alter the behavior of the kernel and potentially introduce malicious code into kernel space. It is important to have an audit trail of modules that have been introduced into the kernel.

OVAL details

Items not found violating audit augenrules modprobe:

Object oval:ssg-object_audit_rule_kernel_module_loading_modprobe_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^\-w[\s]+/usr/sbin/modprobe[\s]+\-p[\s]+\b([raw]*x[raw]*)\b[\s]+(-k[\s]+|-F[\s]+key=)[-\w]+[\s]*$1

Items not found violating audit auditctl modprobe:

Object oval:ssg-object_audit_rule_kernel_module_loading_modprobe_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^\-w[\s]+/usr/sbin/modprobe[\s]+\-p[\s]+\b([raw]*x[raw]*)\b[\s]+(-k[\s]+|-F[\s]+key=)[-\w]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_watch_rule {

# Load function arguments into local variables
local tool="$1"
local path="$2"
local required_access_bits="$3"
local key="$4"

# Check sanity of the input
if [ $# -ne "4" ]
then
        echo "Usage: fix_audit_watch_rule 'tool' 'path' 'bits' 'key'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
# Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#       auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#       augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#       augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
declare -a files_to_inspect

# Check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If the audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# into the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules')
# If the audit is 'augenrules', then check if rule is already defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to list of files for inspection.
# If rule isn't defined, add '/etc/audit/rules.d/$key.rules' to list of files for inspection.
elif [ "$tool" == 'augenrules' ]
then
        # Case when particular audit rule is already defined in some of /etc/audit/rules.d/*.rules file
        # Get pair -- filepath : matching_row into @matches array
        IFS=$'\n' matches=($(grep -P "[\s]*-w[\s]+$path" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        # For each of the matched entries
        for match in "${matches[@]}"
        do
                # Extract filepath from the match
                rulesd_audit_file=$(echo $match | cut -f1 -d ':')
                # Append that path into list of files for inspection
                files_to_inspect=("${files_to_inspect[@]}" "$rulesd_audit_file")
        done
        # Case when particular audit rule isn't defined yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                # Append '/etc/audit/rules.d/$key.rules' into list of files for inspection
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                # If the $key.rules file doesn't exist yet, create it with correct permissions
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

# Finally perform the inspection and possible subsequent audit rule
# correction for each of the files previously identified for inspection
for audit_rules_file in "${files_to_inspect[@]}"
do

        # Check if audit watch file system object rule for given path already present
        if grep -q -P -- "[\s]*-w[\s]+$path" "$audit_rules_file"
        then
                # Rule is found => verify yet if existing rule definition contains
                # all of the required access type bits

                # Escape slashes in path for use in sed pattern below
                local esc_path=${path//$'/'/$'\/'}
                # Define BRE whitespace class shortcut
                local sp="[[:space:]]"
                # Extract current permission access types (e.g. -p [r|w|x|a] values) from audit rule
                current_access_bits=$(sed -ne "s/$sp*-w$sp\+$esc_path$sp\+-p$sp\+\([rxwa]\{1,4\}\).*/\1/p" "$audit_rules_file")
                # Split required access bits string into characters array
                # (to check bit's presence for one bit at a time)
                for access_bit in $(echo "$required_access_bits" | grep -o .)
                do
                        # For each from the required access bits (e.g. 'w', 'a') check
                        # if they are already present in current access bits for rule.
                        # If not, append that bit at the end
                        if ! grep -q "$access_bit" <<< "$current_access_bits"
                        then
                                # Concatenate the existing mask with the missing bit
                                current_access_bits="$current_access_bits$access_bit"
                        fi
                done
                # Propagate the updated rule's access bits (original + the required
                # ones) back into the /etc/audit/audit.rules file for that rule
                sed -i "s/\($sp*-w$sp\+$esc_path$sp\+-p$sp\+\)\([rxwa]\{1,4\}\)\(.*\)/\1$current_access_bits\3/" "$audit_rules_file"
        else
                # Rule isn't present yet. Append it at the end of $audit_rules_file file
                # with proper key

                echo "-w $path -p $required_access_bits -k $key" >> "$audit_rules_file"
        fi
done
}

fix_audit_watch_rule "auditctl" "/usr/sbin/modprobe" "x" "modules"
fix_audit_watch_rule "augenrules" "/usr/sbin/modprobe" "x" "modules"
Shutdown System When Auditing Failures Occurxccdf_org.ssgproject.content_rule_audit_rules_system_shutdown medium

Shutdown System When Auditing Failures Occur

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_system_shutdown
Result
fail
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AU-5, AU-5(a), 139, SRG-OS-000046-GPOS-00022, SRG-OS-000047-GPOS-00023, 3.3.1, 3.3.4

Description

If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d:

-f 2
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to the top of the /etc/audit/audit.rules file:
-f 2

Rationale

It is critical for the appropriate personnel to be aware if a system is at risk of failing to process audit logs as required. Without this notification, the security personnel may be unaware of an impending failure of the audit capability, and system operation may be adversely affected.

Audit processing failures include software/hardware errors, failures in the audit capturing mechanisms, and audit storage capacity being reached or exceeded.

OVAL details

Items not found violating audit augenrules configuration shutdown:

Object oval:ssg-object_ars_shutdown_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^\-f\s+2\s*$1

Items not found violating audit auditctl configuration shutdown:

Object oval:ssg-object_ars_shutdown_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^\-f\s+2\s*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable

# Traverse all of:
#
# /etc/audit/audit.rules,			(for auditctl case)
# /etc/audit/rules.d/*.rules			(for augenrules case)
#
# files to check if '-f .*' setting is present in that '*.rules' file already.
# If found, delete such occurrence since auditctl(8) manual page instructs the
# '-f 2' rule should be placed as the last rule in the configuration
find /etc/audit /etc/audit/rules.d -maxdepth 1 -type f -name *.rules -exec sed -i '/-e[[:space:]]\+.*/d' {} ';'

# Append '-f 2' requirement at the end of both:
# * /etc/audit/audit.rules file 		(for auditctl case)
# * /etc/audit/rules.d/immutable.rules		(for augenrules case)

for AUDIT_FILE in "/etc/audit/audit.rules" "/etc/audit/rules.d/immutable.rules"
do
	echo '' >> $AUDIT_FILE
	echo '# Set the audit.rules configuration to halt system upon audit failure per security requirements' >> $AUDIT_FILE
	echo '-f 2' >> $AUDIT_FILE
done
Record Events that Modify User/Group Informationxccdf_org.ssgproject.content_rule_audit_rules_usergroup_modification low

Record Events that Modify User/Group Information

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_usergroup_modification
Result
notselected
Time2017-10-21T14:39:50
Severitylow
Identifiers and References

References:  AC-2(4), AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 18, 172, 1403, 2130, Req-10.2.5, 5.2.5, SRG–OS–000004–GPOS–00004, SRG–OS–000239–GPOS–00089, SRG–OS–000241–GPOS–00090, SRG–OS–000241–GPOS–00091, SRG–OS–000303–GPOS–00120, SRG–OS–000476–GPOS–00221, 5.4.1.1, 3.1.7

Description

If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix .rules in the directory /etc/audit/rules.d, in order to capture events that modify account changes:

-w /etc/group -p wa -k audit_rules_usergroup_modification
-w /etc/passwd -p wa -k audit_rules_usergroup_modification
-w /etc/gshadow -p wa -k audit_rules_usergroup_modification
-w /etc/shadow -p wa -k audit_rules_usergroup_modification
-w /etc/security/opasswd -p wa -k audit_rules_usergroup_modification

If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file, in order to capture events that modify account changes:
-w /etc/group -p wa -k audit_rules_usergroup_modification
-w /etc/passwd -p wa -k audit_rules_usergroup_modification
-w /etc/gshadow -p wa -k audit_rules_usergroup_modification
-w /etc/shadow -p wa -k audit_rules_usergroup_modification
-w /etc/security/opasswd -p wa -k audit_rules_usergroup_modification

Rationale

In addition to auditing new user and group accounts, these watches will alert the system administrator(s) to any modifications. Any unexpected users, groups, or modifications should be investigated for legitimacy.

Record Events that Modify User/Group Information - /etc/groupxccdf_org.ssgproject.content_rule_audit_rules_usergroup_modification_group medium

Record Events that Modify User/Group Information - /etc/group

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_usergroup_modification_group
Result
fail
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AC-2(4), AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 18, 172, 1403, 2130, Req-10.2.5, 5.2.5, SRG-OS-000004-GPOS-00004, 5.4.1.1, 3.1.7

Description

If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix .rules in the directory /etc/audit/rules.d, in order to capture events that modify account changes:

-w /etc/group -p wa -k audit_rules_usergroup_modification


If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file, in order to capture events that modify account changes:

-w /etc/group -p wa -k audit_rules_usergroup_modification

Rationale

In addition to auditing new user and group accounts, these watches will alert the system administrator(s) to any modifications. Any unexpected users, groups, or modifications should be investigated for legitimacy.

OVAL details

Items not found violating audit augenrules /etc/group:

Object oval:ssg-object_audit_rules_usergroup_modification_group_etc_group_augen:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^\-w[\s]+/etc/group[\s]+\-p[\s]+\b([rx]*w[rx]*a[rx]*|[rx]*a[rx]*w[rx]*)\b[\s]+(-k[\s]+|-F[\s]+key=)\w+[\s]*$1

Items not found violating audit /etc/group:

Object oval:ssg-object_audit_rules_usergroup_modification_group_etc_group_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^\-w[\s]+/etc/group[\s]+\-p[\s]+\b([rx]*w[rx]*a[rx]*|[rx]*a[rx]*w[rx]*)\b[\s]+(-k[\s]+|-F[\s]+key=)\w+[\s]*$1
Record Events that Modify User/Group Information - /etc/gshadowxccdf_org.ssgproject.content_rule_audit_rules_usergroup_modification_gshadow medium

Record Events that Modify User/Group Information - /etc/gshadow

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_usergroup_modification_gshadow
Result
fail
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AC-2(4), AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 18, 172, 1403, 2130, Req-10.2.5, 5.2.5, SRG-OS-000004-GPOS-00004, 5.4.1.1, 3.1.7

Description

If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix .rules in the directory /etc/audit/rules.d, in order to capture events that modify account changes:

-w /etc/gshadow -p wa -k audit_rules_usergroup_modification


If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file, in order to capture events that modify account changes:

-w /etc/gshadow -p wa -k audit_rules_usergroup_modification

Rationale

In addition to auditing new user and group accounts, these watches will alert the system administrator(s) to any modifications. Any unexpected users, groups, or modifications should be investigated for legitimacy.

OVAL details

Items not found violating audit augenrules /etc/gshadow:

Object oval:ssg-object_audit_rules_usergroup_modification_gshadow_etc_gshadow_augen:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^\-w[\s]+/etc/gshadow[\s]+\-p[\s]+\b([rx]*w[rx]*a[rx]*|[rx]*a[rx]*w[rx]*)\b[\s]+(-k[\s]+|-F[\s]+key=)\w+[\s]*$1

Items not found violating audit /etc/gshadow:

Object oval:ssg-object_audit_rules_usergroup_modification_gshadow_etc_gshadow_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^\-w[\s]+/etc/gshadow[\s]+\-p[\s]+\b([rx]*w[rx]*a[rx]*|[rx]*a[rx]*w[rx]*)\b[\s]+(-k[\s]+|-F[\s]+key=)\w+[\s]*$1
Record Events that Modify User/Group Information - /etc/shadowxccdf_org.ssgproject.content_rule_audit_rules_usergroup_modification_shadow medium

Record Events that Modify User/Group Information - /etc/shadow

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_usergroup_modification_shadow
Result
fail
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AC-2(4), AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 18, 172, 1403, 2130, Req-10.2.5, 5.2.5, SRG-OS-000004-GPOS-00004, 5.4.1.1, 3.1.7

Description

If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix .rules in the directory /etc/audit/rules.d, in order to capture events that modify account changes:

-w /etc/shadow -p wa -k audit_rules_usergroup_modification


If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file, in order to capture events that modify account changes:

-w /etc/shadow -p wa -k audit_rules_usergroup_modification

Rationale

In addition to auditing new user and group accounts, these watches will alert the system administrator(s) to any modifications. Any unexpected users, groups, or modifications should be investigated for legitimacy.

OVAL details

Items not found violating audit augenrules /etc/shadow:

Object oval:ssg-object_audit_rules_usergroup_modification_shadow_etc_shadow_augen:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^\-w[\s]+/etc/shadow[\s]+\-p[\s]+\b([rx]*w[rx]*a[rx]*|[rx]*a[rx]*w[rx]*)\b[\s]+(-k[\s]+|-F[\s]+key=)\w+[\s]*$1

Items not found violating audit /etc/shadow:

Object oval:ssg-object_audit_rules_usergroup_modification_shadow_etc_shadow_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^\-w[\s]+/etc/shadow[\s]+\-p[\s]+\b([rx]*w[rx]*a[rx]*|[rx]*a[rx]*w[rx]*)\b[\s]+(-k[\s]+|-F[\s]+key=)\w+[\s]*$1
Record Events that Modify User/Group Information - passwdxccdf_org.ssgproject.content_rule_audit_rules_usergroup_modification_passwd medium

Record Events that Modify User/Group Information - passwd

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_usergroup_modification_passwd
Result
fail
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AC-2(4), AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 18, 172, 1403, 2130, Req-10.2.5, 5.2.5, SRG-OS-000004-GPOS-00004, SRG-OS-000239-GPOS-00089, SRG-OS-000240-GPOS-00090, SRG-OS-000241-GPOS-00091, SRG-OS-000303-GPOS-00120, SRG-OS-000476-GPOS-00221, 5.4.1.1, 3.1.7

Description

If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix .rules in the directory /etc/audit/rules.d, in order to capture events that modify account changes:

-w /etc/passwd -p wa -k audit_rules_usergroup_modification


If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file, in order to capture events that modify account changes:

-w /etc/passwd -p wa -k audit_rules_usergroup_modification

Rationale

In addition to auditing new user and group accounts, these watches will alert the system administrator(s) to any modifications. Any unexpected users, groups, or modifications should be investigated for legitimacy.

OVAL details

Items not found violating audit augenrules /etc/passwd:

Object oval:ssg-object_audit_rules_usergroup_modification_passwd_etc_passwd_augen:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^\-w[\s]+/etc/passwd[\s]+\-p[\s]+\b([rx]*w[rx]*a[rx]*|[rx]*a[rx]*w[rx]*)\b[\s]+(-k[\s]+|-F[\s]+key=)\w+[\s]*$1

Items not found violating audit /etc/passwd:

Object oval:ssg-object_audit_rules_usergroup_modification_passwd_etc_passwd_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^\-w[\s]+/etc/passwd[\s]+\-p[\s]+\b([rx]*w[rx]*a[rx]*|[rx]*a[rx]*w[rx]*)\b[\s]+(-k[\s]+|-F[\s]+key=)\w+[\s]*$1
Record Events that Modify User/Group Information - opasswdxccdf_org.ssgproject.content_rule_audit_rules_usergroup_modification_opasswd medium

Record Events that Modify User/Group Information - opasswd

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_usergroup_modification_opasswd
Result
fail
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AC-2(4), AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, 18, 172, 1403, 2130, Req-10.2.5, 5.2.5, SRG-OS-000004-GPOS-00004, 5.4.1.1, 3.1.7

Description

If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix .rules in the directory /etc/audit/rules.d, in order to capture events that modify account changes:

-w /etc/security/opasswd -p wa -k audit_rules_usergroup_modification


If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file, in order to capture events that modify account changes:

-w /etc/security/opasswd -p wa -k audit_rules_usergroup_modification

Rationale

In addition to auditing new user and group accounts, these watches will alert the system administrator(s) to any modifications. Any unexpected users, groups, or modifications should be investigated for legitimacy.

OVAL details

Items not found violating audit augenrules /etc/security/opasswd:

Object oval:ssg-object_audit_rules_usergroup_modification_opasswd_etc_security_opasswd_augen:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^\-w[\s]+/etc/security/opasswd[\s]+\-p[\s]+\b([rx]*w[rx]*a[rx]*|[rx]*a[rx]*w[rx]*)\b[\s]+(-k[\s]+|-F[\s]+key=)\w+[\s]*$1

Items not found violating audit /etc/security/opasswd:

Object oval:ssg-object_audit_rules_usergroup_modification_opasswd_etc_security_opasswd_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^\-w[\s]+/etc/security/opasswd[\s]+\-p[\s]+\b([rx]*w[rx]*a[rx]*|[rx]*a[rx]*w[rx]*)\b[\s]+(-k[\s]+|-F[\s]+key=)\w+[\s]*$1
Record Events that Modify the System's Network Environmentxccdf_org.ssgproject.content_rule_audit_rules_networkconfig_modification low

Record Events that Modify the System's Network Environment

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_networkconfig_modification
Result
notselected
Time2017-10-21T14:39:50
Severitylow
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, Req-10.5.5, 5.4.1.1, 5.2.6, 3.1.7

Description

If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix .rules in the directory /etc/audit/rules.d, setting ARCH to either b32 or b64 as appropriate for your system:

-a always,exit -F arch=ARCH -S sethostname,setdomainname -F key=audit_rules_networkconfig_modification
-w /etc/issue -p wa -k audit_rules_networkconfig_modification
-w /etc/issue.net -p wa -k audit_rules_networkconfig_modification
-w /etc/hosts -p wa -k audit_rules_networkconfig_modification
-w /etc/sysconfig/network -p wa -k audit_rules_networkconfig_modification
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file, setting ARCH to either b32 or b64 as appropriate for your system:
-a always,exit -F arch=ARCH -S sethostname,setdomainname -F key=audit_rules_networkconfig_modification
-w /etc/issue -p wa -k audit_rules_networkconfig_modification
-w /etc/issue.net -p wa -k audit_rules_networkconfig_modification
-w /etc/hosts -p wa -k audit_rules_networkconfig_modification
-w /etc/sysconfig/network -p wa -k audit_rules_networkconfig_modification

Rationale

The network environment should not be modified by anything other than administrator action. Any change to network parameters should be audited.

System Audit Logs Must Have Mode 0640 or Less Permissivexccdf_org.ssgproject.content_rule_file_permissions_var_log_audit medium

System Audit Logs Must Have Mode 0640 or Less Permissive

Rule IDxccdf_org.ssgproject.content_rule_file_permissions_var_log_audit
Result
notselected
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AC-6, AU-1(b), AU-9, IR-5, http://iase.disa.mil/stigs/cci/Pages/index.aspx, Req-10.5, 5.4.1.1, 3.3.1

Description

If log_group in /etc/audit/auditd.conf is set to a group other than the root group account, change the mode of the audit log files with the following command:

$ sudo chmod 0640 audit_file

Otherwise, change the mode of the audit log files with the following command:
$ sudo chmod 0600 audit_file

Rationale

If users can write to audit logs, audit trails can be modified or destroyed.

System Audit Logs Must Be Owned By Rootxccdf_org.ssgproject.content_rule_file_ownership_var_log_audit medium

System Audit Logs Must Be Owned By Root

Rule IDxccdf_org.ssgproject.content_rule_file_ownership_var_log_audit
Result
notselected
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AC-6, AU-1(b), AU-9, IR-5, 163, SRG-OS-000058-GPOS-00028, Req-10.5.1, 5.4.1.1, 3.3.1

Description

All audit logs must be owned by root user and group. By default, the path for audit log is

/var/log/audit/
. To properly set the owner of /var/log/audit, run the command:
$ sudo chown root /var/log/audit
To properly set the owner of /var/log/audit/*, run the command:
$ sudo chown root /var/log/audit/*

Rationale

Unauthorized disclosure of audit records can reveal system and configuration data to attackers, thus compromising its confidentiality.

Record Events that Modify the System's Mandatory Access Controlsxccdf_org.ssgproject.content_rule_audit_rules_mac_modification low

Record Events that Modify the System's Mandatory Access Controls

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_mac_modification
Result
notselected
Time2017-10-21T14:39:50
Severitylow
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, Req-10.5.5, 5.2.7, 5.4.1.1, 3.1.8

Description

If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d:

-w /etc/selinux/ -p wa -k MAC-policy
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file:
-w /etc/selinux/ -p wa -k MAC-policy

Rationale

The system's mandatory access policy (SELinux) should not be arbitrarily changed by anything other than administrator action. All changes to MAC policy should be audited.

Record Attempts to Alter Process and Session Initiation Informationxccdf_org.ssgproject.content_rule_audit_rules_session_events low

Record Attempts to Alter Process and Session Initiation Information

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_session_events
Result
notselected
Time2017-10-21T14:39:50
Severitylow
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-12(a), AU-12(c), IR-5, Req-10.2.3, 5.2.9, 5.4.1.1, 3.1.7

Description

The audit system already collects process information for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix .rules in the directory /etc/audit/rules.d in order to watch for attempted manual edits of files involved in storing such process information:

-w /var/run/utmp -p wa -k session
-w /var/log/btmp -p wa -k session
-w /var/log/wtmp -p wa -k session
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file in order to watch for attempted manual edits of files involved in storing such process information:
-w /var/run/utmp -p wa -k session
-w /var/log/btmp -p wa -k session
-w /var/log/wtmp -p wa -k session

Rationale

Manual editing of these files may indicate nefarious activity, such as an attacker attempting to remove evidence of an intrusion.

Ensure auditd Collects Information on Exporting to Media (successful)xccdf_org.ssgproject.content_rule_audit_rules_media_export medium

Ensure auditd Collects Information on Exporting to Media (successful)

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_media_export
Result
fail
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-3(1), AU-12(a), AU-12(c), IR-5, 135, 2884, SRG-OS-000042-GPOS-00020, SRG-OS-000392-GPOS-00172, Req-10.2.7, 5.2.13, 5.4.1.1, 3.1.7

Description

At a minimum, the audit system should collect media exportation events for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d, setting ARCH to either b32 or b64 as appropriate for your system:

-a always,exit -F arch=ARCH -S mount -F auid>=1000 -F auid!=4294967295 -F key=export
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file, setting ARCH to either b32 or b64 as appropriate for your system:
-a always,exit -F arch=ARCH -S mount -F auid>=1000 -F auid!=4294967295 -F key=export

Rationale

The unauthorized exportation of data to external media could result in an information leak where classified information, Privacy Act information, and intellectual property could be lost. An audit trail should be created each time a filesystem is mounted to help identify and guard against information loss.

OVAL details

Items not found violating audit augenrules mount 32-bit:

Object oval:ssg-object_audit_rules_media_export_mount_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^\-a\s+always,exit\s+(\-F\s+arch=b32\s+)(?:.*(-S[\s]+mount[\s]+|([\s]+|[,])mount([\s]+|[,])))(?:.*-F\s+auid>=1000\s+\-F\s+auid!=4294967295\s+)(-k[\s]+|-F[\s]+key=)[-\w]+\s*$1

Items not found violating audit augenrules mount 64-bit:

Object oval:ssg-object_64bit_ardm_media_export_mount_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^\-a\s+always,exit\s+(\-F\s+arch=b64\s+)(?:.*(-S[\s]+mount[\s]+|([\s]+|[,])mount([\s]+|[,])))(?:.*-F\s+auid>=1000\s+\-F\s+auid!=4294967295\s+)(-k[\s]+|-F[\s]+key=)[-\w]+\s*$1

Items not found violating audit auditctl mount 32-bit:

Object oval:ssg-object_audit_rules_media_export_mount_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^\-a\s+always,exit\s+(\-F\s+arch=b32\s+)(?:.*(-S[\s]+mount[\s]+|([\s]+|[,])mount([\s]+|[,])))(?:.*-F\s+auid>=1000\s+\-F\s+auid!=4294967295\s+)(-k[\s]+|-F[\s]+key=)[-\w]+\s*$1

Items not found violating audit auditctl mount 64-bit:

Object oval:ssg-object_64bit_ardm_media_export_mount_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^\-a\s+always,exit\s+(\-F\s+arch=b64\s+)(?:.*(-S[\s]+mount[\s]+|([\s]+|[,])mount([\s]+|[,])))(?:.*-F\s+auid>=1000\s+\-F\s+auid!=4294967295\s+)(-k[\s]+|-F[\s]+key=)[-\w]+\s*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# Perform the remediation of the syscall rule
# Retrieve hardware architecture of the underlying system
[ $(getconf LONG_BIT) = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
	PATTERN="-a always,exit -F arch=$ARCH -S .* -F auid>=1000 -F auid!=4294967295 -k *"
	GROUP="mount"
	FULL_RULE="-a always,exit -F arch=$ARCH -S mount -F auid>=1000 -F auid!=4294967295 -k export"
	# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch & key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" <<< "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule => existing rule can be deleted
                                # Thus delete the rule from audit.rules & our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' => group='chown'
                                # since 'lchown' & 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array <<< "$rule_syscalls"
                                # Reset IFS back to default
                                unset IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" <<< "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" >> "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture & key => don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch & key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" >> "$audit_file"
        fi
done

}

	fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
	fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done
Ensure auditd Collects System Administrator Actionsxccdf_org.ssgproject.content_rule_audit_rules_sysadmin_actions low

Ensure auditd Collects System Administrator Actions

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_sysadmin_actions
Result
fail
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  AC-2(7)(b), AC-17(7), AU-1(b), AU-2(a), AU-2(c), AU-2(d), iAU-3(1), AU-12(a), AU-12(c), IR-5, 126, 130, 135, 172, 2884, Req-10.2.2, Req-10.2.5.b, 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, 5.4.1.1, 3.1.7

Description

At a minimum, the audit system should collect administrator actions for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d:

-w /etc/sudoers -p wa -k actions
-w /etc/sudoers.d/ -p wa -k actions
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file:
-w /etc/sudoers -p wa -k actions
-w /etc/sudoers.d/ -p wa -k actions

Rationale

The actions taken by system administrators should be audited to keep a record of what was executed on the system, as well as, for accountability purposes.

OVAL details

Items not found violating audit augenrules sudoers:

Object oval:ssg-object_audit_rules_sysadmin_actions_sudoers_augenrules:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/rules\.d/.*\.rules^\-w[\s]+/etc/sudoers[\s]+\-p[\s]+\b([rx]*w[rx]*a[rx]*|[rx]*a[rx]*w[rx]*)\b[\s]+(-k[\s]+|-F[\s]+key=)[-\w]+[\s]*$1

Items not found violating audit auditctl sudoers:

Object oval:ssg-object_audit_rules_sysadmin_actions_sudoers_auditctl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/audit/audit.rules^\-w[\s]+/etc/sudoers[\s]+\-p[\s]+\b([rx]*w[rx]*a[rx]*|[rx]*a[rx]*w[rx]*)\b[\s]+(-k[\s]+|-F[\s]+key=)[-\w]+[\s]*$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable


# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'

function fix_audit_watch_rule {

# Load function arguments into local variables
local tool="$1"
local path="$2"
local required_access_bits="$3"
local key="$4"

# Check sanity of the input
if [ $# -ne "4" ]
then
        echo "Usage: fix_audit_watch_rule 'tool' 'path' 'bits' 'key'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
# Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#       auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#       augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#       augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
declare -a files_to_inspect

# Check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] && [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If the audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# into the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules')
# If the audit is 'augenrules', then check if rule is already defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to list of files for inspection.
# If rule isn't defined, add '/etc/audit/rules.d/$key.rules' to list of files for inspection.
elif [ "$tool" == 'augenrules' ]
then
        # Case when particular audit rule is already defined in some of /etc/audit/rules.d/*.rules file
        # Get pair -- filepath : matching_row into @matches array
        IFS=$'\n' matches=($(grep -P "[\s]*-w[\s]+$path" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset IFS
        # For each of the matched entries
        for match in "${matches[@]}"
        do
                # Extract filepath from the match
                rulesd_audit_file=$(echo $match | cut -f1 -d ':')
                # Append that path into list of files for inspection
                files_to_inspect=("${files_to_inspect[@]}" "$rulesd_audit_file")
        done
        # Case when particular audit rule isn't defined yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                # Append '/etc/audit/rules.d/$key.rules' into list of files for inspection
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                # If the $key.rules file doesn't exist yet, create it with correct permissions
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

# Finally perform the inspection and possible subsequent audit rule
# correction for each of the files previously identified for inspection
for audit_rules_file in "${files_to_inspect[@]}"
do

        # Check if audit watch file system object rule for given path already present
        if grep -q -P -- "[\s]*-w[\s]+$path" "$audit_rules_file"
        then
                # Rule is found => verify yet if existing rule definition contains
                # all of the required access type bits

                # Escape slashes in path for use in sed pattern below
                local esc_path=${path//$'/'/$'\/'}
                # Define BRE whitespace class shortcut
                local sp="[[:space:]]"
                # Extract current permission access types (e.g. -p [r|w|x|a] values) from audit rule
                current_access_bits=$(sed -ne "s/$sp*-w$sp\+$esc_path$sp\+-p$sp\+\([rxwa]\{1,4\}\).*/\1/p" "$audit_rules_file")
                # Split required access bits string into characters array
                # (to check bit's presence for one bit at a time)
                for access_bit in $(echo "$required_access_bits" | grep -o .)
                do
                        # For each from the required access bits (e.g. 'w', 'a') check
                        # if they are already present in current access bits for rule.
                        # If not, append that bit at the end
                        if ! grep -q "$access_bit" <<< "$current_access_bits"
                        then
                                # Concatenate the existing mask with the missing bit
                                current_access_bits="$current_access_bits$access_bit"
                        fi
                done
                # Propagate the updated rule's access bits (original + the required
                # ones) back into the /etc/audit/audit.rules file for that rule
                sed -i "s/\($sp*-w$sp\+$esc_path$sp\+-p$sp\+\)\([rxwa]\{1,4\}\)\(.*\)/\1$current_access_bits\3/" "$audit_rules_file"
        else
                # Rule isn't present yet. Append it at the end of $audit_rules_file file
                # with proper key

                echo "-w $path -p $required_access_bits -k $key" >> "$audit_rules_file"
        fi
done
}

fix_audit_watch_rule "auditctl" "/etc/sudoers" "wa" "actions"
fix_audit_watch_rule "augenrules" "/etc/sudoers" "wa" "actions"
Make the auditd Configuration Immutablexccdf_org.ssgproject.content_rule_audit_rules_immutable medium

Make the auditd Configuration Immutable

Rule IDxccdf_org.ssgproject.content_rule_audit_rules_immutable
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-6, AU-1(b), AU-2(a), AU-2(c), AU-2(d), IR-5, Req-10.5.2, 5.2.18, 5.4.1.1, 3.3.1, 3.4.3

Description

If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following line to a file with suffix .rules in the directory /etc/audit/rules.d in order to make the auditd configuration immutable:

-e 2
If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following line to /etc/audit/audit.rules file in order to make the auditd configuration immutable:
-e 2
With this setting, a reboot will be required to change any audit rules.

Rationale

Making the audit configuration immutable prevents accidental as well as malicious modification of the audit rules, although it may be problematic if legitimate changes are needed during system operation

Enable auditd Servicexccdf_org.ssgproject.content_rule_service_auditd_enabled high

Enable auditd Service

Rule IDxccdf_org.ssgproject.content_rule_service_auditd_enabled
Result
pass
Time2017-10-21T14:39:50
Severityhigh
Identifiers and References

References:  AU-3, AC-17(1), AU-1(b), AU-10, AU-12(a), AU-12(c), AU-14(1), IR-5, 126, 131, SRG-OS-000038-GPOS-00016, SRG-OS-000039-GPOS-00017, SRG-OS-000042-GPOS-00021, SRG-OS-000254-GPOS-00095, SRG-OS-000255-GPOS-00096, Req-10, 5.2.2, 5.4.1.1, 3.3.1, 3.3.2, 3.3.6

Description

The auditd service is an essential userspace component of the Linux Auditing System, as it is responsible for writing audit records to disk. The auditd service can be enabled with the following command:

$ sudo systemctl enable auditd.service

Rationale

Without establishing what type of events occurred, it would be difficult to establish, correlate, and investigate the events leading up to an outage or attack. Ensuring the auditd service is active ensures audit records generated by the kernel are appropriately recorded.

Additionally, a properly configured audit subsystem ensures that actions of individual system users can be uniquely traced to those users so they can be held accountable for their actions.

OVAL details

Items found satisfying systemd test:

UnitDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependency
multi-user.targetbasic.targetsysinit.targetsystemd-journal-catalog-update.servicesystemd-update-utmp.servicelocal-fs.target-.mountboot.mountrhel-readonly.servicesystemd-remount-fs.servicerhel-import-state.servicesystemd-journald.servicesystemd-update-done.serviceplymouth-start.servicelvm2-lvmetad.socketsys-kernel-debug.mountsystemd-random-seed.servicesystemd-firstboot.servicesystemd-ask-password-console.pathcryptsetup.targetsystemd-tmpfiles-setup.serviceplymouth-read-write.servicesystemd-machine-id-commit.servicelvm2-monitor.servicedev-hugepages.mountswap.targetdev-mapper-centos\x2dswap.swapsystemd-tmpfiles-setup-dev.servicesys-fs-fuse-connections.mountsystemd-journal-flush.servicesystemd-udevd.servicesystemd-udev-trigger.serviceproc-sys-fs-binfmt_misc.automountsystemd-binfmt.servicesystemd-hwdb-update.servicelvm2-lvmpolld.socketsys-kernel-config.mountkmod-static-nodes.servicedev-mqueue.mountsystemd-vconsole-setup.servicesystemd-sysctl.servicesystemd-modules-load.serviceslices.targetsystem.slice-.slicesockets.targetsystemd-shutdownd.socketdm-event.socketsystemd-journald.socketsystemd-udevd-control.socketdbus.socketsystemd-initctl.socketpcscd.socketsystemd-udevd-kernel.socketmicrocode.servicerhel-dmesg.servicepaths.targetrhel-autorelabel.servicerhel-autorelabel-mark.serviceselinux-policy-migrate-local-changes@targeted.servicetimers.targetsystemd-tmpfiles-clean.timerrhel-configure.servicerhel-loadmodules.servicedbus.serviceremote-fs.targetpostfix.serviceauditd.servicesystemd-ask-password-wall.pathcrond.servicetuned.servicegetty.targetgetty@tty1.servicesystemd-readahead-replay.servicebrandbot.pathsshd.servicesystemd-update-utmp-runlevel.serviceplymouth-quit-wait.servicersyslog.servicefirewalld.serviceirqbalance.servicekdump.servicechronyd.servicesystemd-logind.serviceplymouth-quit.serviceNetworkManager.servicenetwork.servicesystemd-readahead-collect.servicesystemd-user-sessions.service
Enable Auditing for Processes Which Start Prior to the Audit Daemonxccdf_org.ssgproject.content_rule_bootloader_audit_argument medium

Enable Auditing for Processes Which Start Prior to the Audit Daemon

Rule IDxccdf_org.ssgproject.content_rule_bootloader_audit_argument
Result
notselected
Time2017-10-21T14:39:50
Severitymedium
Identifiers and References

References:  AC-17(1), AU-14(1), AU-1(b), AU-2(a), AU-2(c), AU-2(d), AU-10, IR-5, 1464, 130, Req-10.3, 5.2.3, 5.4.1.1, 3.3.1

Description

To ensure all processes can be audited, even those which start prior to the audit daemon, add the argument audit=1 to the default GRUB 2 command line for the Linux operating system in /etc/default/grub, in the manner below:

GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=VolGroup/LogVol06 rd.lvm.lv=VolGroup/lv_swap rhgb quiet rd.shell=0 audit=1"

Rationale

Each process on the system carries an "auditable" flag which indicates whether its activities can be audited. Although auditd takes care of enabling this for all processes which launch after it does, adding the kernel argument ensures it is set for every process during boot.

Warnings
warning  The GRUB 2 configuration file, grub.cfg, is automatically updated each time a new kernel is installed. Note that any changes to /etc/default/grub require rebuilding the grub.cfg file. To update the GRUB 2 configuration file manually, use the
grub2-mkconfig -o
command as follows:
  • On BIOS-based machines, issue the following command as root:
    ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
  • On UEFI-based machines, issue the following command as root:
    ~]# grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
Disable xinetd Servicexccdf_org.ssgproject.content_rule_service_xinetd_disabled medium

Disable xinetd Service

Rule IDxccdf_org.ssgproject.content_rule_service_xinetd_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-17(8), CM-7, 305, 3.4.7

Description

The xinetd service can be disabled with the following command:

$ sudo systemctl disable xinetd.service

Rationale

The xinetd service provides a dedicated listener service for some programs, which is no longer necessary for commonly-used network services. Disabling it ensures that these uncommon services are not running, and also prevents attacks against xinetd itself.

Uninstall xinetd Packagexccdf_org.ssgproject.content_rule_package_xinetd_removed low

Uninstall xinetd Package

Rule IDxccdf_org.ssgproject.content_rule_package_xinetd_removed
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  AC-17(8), CM-7, 305, 2.1.11

Description

The xinetd package can be uninstalled with the following command:

$ sudo yum erase xinetd

Rationale

Removing the xinetd package decreases the risk of the xinetd service's accidental (or intentional) activation.

Install tcp_wrappers Packagexccdf_org.ssgproject.content_rule_package_tcp_wrappers_installed medium

Install tcp_wrappers Package

Rule IDxccdf_org.ssgproject.content_rule_package_tcp_wrappers_installed
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  CM-6(b), 366, SRG-OS-000480-GPOS-00227

Description

When network services are using the xinetd service, the tcp_wrappers package should be installed. The tcp_wrappers package can be installed with the following command:

$ sudo yum install tcp_wrappers

Rationale

Access control methods provide the ability to enhance system security posture by restricting services and known good IP addresses and address ranges. This prevents connections from unknown hosts and protocols.

Disable telnet Servicexccdf_org.ssgproject.content_rule_service_telnet_disabled high

Disable telnet Service

Rule IDxccdf_org.ssgproject.content_rule_service_telnet_disabled
Result
notselected
Time2017-10-21T14:39:59
Severityhigh
Identifiers and References

References:  AC-17(8), CM-7, IA-5(1)(c), http://iase.disa.mil/stigs/cci/Pages/index.aspx, 3.1.13, 3.4.7

Description

The telnet service configuration file /etc/xinetd.d/telnet is not created automatically. If it was created manually, check the /etc/xinetd.d/telnet file and ensure that disable = no is changed to read disable = yes as follows below:

# description: The telnet server serves telnet sessions; it uses \\
#       unencrypted username/password pairs for authentication.
service telnet
{
        flags           = REUSE
        socket_type     = stream

        wait            = no
        user            = root
        server          = /usr/sbin/in.telnetd
        log_on_failure  += USERID
        disable         = yes
}
If the /etc/xinetd.d/telnet file does not exist, make sure that the activation of the telnet service on system boot is disabled via the following command: The rexec socket can be disabled with the following command:
$ sudo systemctl disable rexec.socket

Rationale

The telnet protocol uses unencrypted network communication, which means that data from the login session, including passwords and all other information transmitted during the session, can be stolen by eavesdroppers on the network. The telnet protocol is also subject to man-in-the-middle attacks.

Uninstall telnet-server Packagexccdf_org.ssgproject.content_rule_package_telnet-server_removed high

Uninstall telnet-server Package

Rule IDxccdf_org.ssgproject.content_rule_package_telnet-server_removed
Result
pass
Time2017-10-21T14:39:59
Severityhigh
Identifiers and References

References:  AC-17(8), CM-7(a), 381, SRG-OS-000095-GPOS-00049, 2.1.1

Description

The telnet-server package can be uninstalled with the following command:

$ sudo yum erase telnet-server

Rationale

It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities are often overlooked and therefore may remain unsecure. They increase the risk to the platform by providing additional attack vectors.
The telnet service provides an unencrypted remote access service which does not provide for the confidentiality and integrity of user passwords or the remote session. If a privileged user were to login using this service, the privileged user password could be compromised.
Removing the telnet-server package decreases the risk of the telnet service's accidental (or intentional) activation.

OVAL details

Items not found satisfying package telnet-server is removed:

Object oval:ssg-obj_package_telnet-server_removed:obj:1 of type rpminfo_object
Name
telnet-server
Remove telnet Clientsxccdf_org.ssgproject.content_rule_package_telnet_removed low

Remove telnet Clients

Rule IDxccdf_org.ssgproject.content_rule_package_telnet_removed
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  2.1.2, 3.1.13

Description

The telnet client allows users to start connections to other systems via the telnet protocol.

Rationale

The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in Red Hat Enterprise Linux.

Uninstall rsh-server Packagexccdf_org.ssgproject.content_rule_package_rsh-server_removed high

Uninstall rsh-server Package

Rule IDxccdf_org.ssgproject.content_rule_package_rsh-server_removed
Result
pass
Time2017-10-21T14:39:59
Severityhigh
Identifiers and References

References:  AC-17(8), CM-7(a), 381, SRG-OS-000095-GPOS-00049, 2.1.3

Description

The rsh-server package can be uninstalled with the following command:

$ sudo yum erase rsh-server

Rationale

The rsh-server service provides unencrypted remote access service which does not provide for the confidentiality and integrity of user passwords or the remote session and has very weak authentication. If a privileged user were to login using this service, the privileged user password could be compromised. The rsh-server package provides several obsolete and insecure network services. Removing it decreases the risk of those services' accidental (or intentional) activation.

OVAL details

Items not found satisfying package rsh-server is removed:

Object oval:ssg-obj_package_rsh-server_removed:obj:1 of type rpminfo_object
Name
rsh-server
Disable rexec Servicexccdf_org.ssgproject.content_rule_service_rexec_disabled high

Disable rexec Service

Rule IDxccdf_org.ssgproject.content_rule_service_rexec_disabled
Result
notselected
Time2017-10-21T14:39:59
Severityhigh
Identifiers and References

References:  AC-17(8), CM-7, 68, 1436, 3.1.13, 3.4.7

Description

The rexec service, which is available with the rsh-server package and runs as a service through xinetd or separately as a systemd socket, should be disabled. If using xinetd, set disable to yes in /etc/xinetd.d/rexec. If using systemd, The rexec socket can be disabled with the following command:

$ sudo systemctl disable rexec.socket

Rationale

The rexec service uses unencrypted network communications, which means that data from the login session, including passwords and all other information transmitted during the session, can be stolen by eavesdroppers on the network.

Disable rsh Servicexccdf_org.ssgproject.content_rule_service_rsh_disabled high

Disable rsh Service

Rule IDxccdf_org.ssgproject.content_rule_service_rsh_disabled
Result
notselected
Time2017-10-21T14:39:59
Severityhigh
Identifiers and References

References:  AC-17(8), CM-7, IA-5(1)(c), 68, 1436, 3.1.13, 3.4.7

Description

The rsh service, which is available with the rsh-server package and runs as a service through xinetd or separately as a systemd socket, should be disabled. If using xinetd, set disable to yes in /etc/xinetd.d/rsh. If using systemd, The rsh socket can be disabled with the following command:

$ sudo systemctl disable rsh.socket

Rationale

The rsh service uses unencrypted network communications, which means that data from the login session, including passwords and all other information transmitted during the session, can be stolen by eavesdroppers on the network.

Uninstall rsh Packagexccdf_org.ssgproject.content_rule_package_rsh_removed low

Uninstall rsh Package

Rule IDxccdf_org.ssgproject.content_rule_package_rsh_removed
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  2.1.4, 3.1.13

Description

The rsh package contains the client commands for the rsh services

Rationale

These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh package removes the clients for rsh,rcp, and rlogin.

Disable rlogin Servicexccdf_org.ssgproject.content_rule_service_rlogin_disabled high

Disable rlogin Service

Rule IDxccdf_org.ssgproject.content_rule_service_rlogin_disabled
Result
notselected
Time2017-10-21T14:39:59
Severityhigh
Identifiers and References

References:  AC-17(8), CM-7, IA-5(1)(c), 1436, 3.1.13, 3.4.7

Description

The rlogin service, which is available with the rsh-server package and runs as a service through xinetd or separately as a systemd socket, should be disabled. If using xinetd, set disable to yes in /etc/xinetd.d/rlogin. If using systemd, The rlogin socket can be disabled with the following command:

$ sudo systemctl disable rlogin.socket

Rationale

The rlogin service uses unencrypted network communications, which means that data from the login session, including passwords and all other information transmitted during the session, can be stolen by eavesdroppers on the network.

Remove Rsh Trust Filesxccdf_org.ssgproject.content_rule_no_rsh_trust_files high

Remove Rsh Trust Files

Rule IDxccdf_org.ssgproject.content_rule_no_rsh_trust_files
Result
notselected
Time2017-10-21T14:39:59
Severityhigh
Identifiers and References

References:  AC-17(8), CM-7, 1436

Description

The files /etc/hosts.equiv and ~/.rhosts (in each user's home directory) list remote hosts and users that are trusted by the local system when using the rshd daemon. To remove these files, run the following command to delete them from any location:

$ sudo rm /etc/hosts.equiv
$ rm ~/.rhosts

Rationale

Trust files are convenient, but when used in conjunction with the R-services, they can allow unauthenticated access to a system.

Uninstall ypserv Packagexccdf_org.ssgproject.content_rule_package_ypserv_removed high

Uninstall ypserv Package

Rule IDxccdf_org.ssgproject.content_rule_package_ypserv_removed
Result
pass
Time2017-10-21T14:39:59
Severityhigh
Identifiers and References

References:  AC-17(8), CM-7(a), 381, SRG-OS-000095-GPOS-00049, 2.1.6

Description

The ypserv package can be uninstalled with the following command:

$ sudo yum erase ypserv

Rationale

The NIS service provides an unencrypted authentication service which does not provide for the confidentiality and integrity of user passwords or the remote session. Removing the ypserv package decreases the risk of the accidental (or intentional) activation of NIS or NIS+ services.

OVAL details

Items not found satisfying package ypserv is removed:

Object oval:ssg-obj_package_ypserv_removed:obj:1 of type rpminfo_object
Name
ypserv
Disable ypbind Servicexccdf_org.ssgproject.content_rule_service_ypbind_disabled medium

Disable ypbind Service

Rule IDxccdf_org.ssgproject.content_rule_service_ypbind_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-17(8), CM-7, 305

Description

The ypbind service, which allows the system to act as a client in a NIS or NIS+ domain, should be disabled. The ypbind service can be disabled with the following command:

$ sudo systemctl disable ypbind.service

Rationale

Disabling the ypbind service ensures the system is not acting as a client in a NIS or NIS+ domain. This service should be disabled unless in use.

Remove NIS Clientxccdf_org.ssgproject.content_rule_package_ypbind_removed low

Remove NIS Client

Rule IDxccdf_org.ssgproject.content_rule_package_ypbind_removed
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  2.1.5

Description

The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client (ypbind) was used to bind a system to an NIS server and receive the distributed configuration files.

Rationale

The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed.

Disable tftp Servicexccdf_org.ssgproject.content_rule_service_tftp_disabled medium

Disable tftp Service

Rule IDxccdf_org.ssgproject.content_rule_service_tftp_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-17(8), CM-7, 1436

Description

The tftp service should be disabled. The tftp service can be disabled with the following command:

$ sudo systemctl disable tftp.service

Rationale

Disabling the tftp service ensures the system is not acting as a TFTP server, which does not provide encryption or authentication.

Uninstall tftp-server Packagexccdf_org.ssgproject.content_rule_package_tftp-server_removed high

Uninstall tftp-server Package

Rule IDxccdf_org.ssgproject.content_rule_package_tftp-server_removed
Result
pass
Time2017-10-21T14:39:59
Severityhigh
Identifiers and References

References:  AC-17(8), CM-6(c), CM-7, 318, 368, 1812, 1813, 1814, SRG-OS-000480-GPOS-00227, 2.1.8

Description

The tftp-server package can be removed with the following command:

$ sudo yum erase tftp-server

Rationale

Removing the tftp-server package decreases the risk of the accidental (or intentional) activation of tftp services.

If TFTP is required for operational support (such as transmission of router configurations), its use must be documented with the Information Systems Securty Manager (ISSM), restricted to only authorized personnel, and have access control rules established.

OVAL details

Items not found satisfying package tftp-server is removed:

Object oval:ssg-obj_package_tftp-server_removed:obj:1 of type rpminfo_object
Name
tftp-server
Remove tftp Daemonxccdf_org.ssgproject.content_rule_package_tftp_removed high

Remove tftp Daemon

Rule IDxccdf_org.ssgproject.content_rule_package_tftp_removed
Result
notselected
Time2017-10-21T14:39:59
Severityhigh
Identifiers and References

References:  2.1.7

Description

Trivial File Transfer Protocol (TFTP) is a simple file transfer protocol, typically used to automatically transfer configuration or boot files between systems. TFTP does not support authentication and can be easily hacked. The package tftp is a client program that allows for connections to a tftp server.

Rationale

It is recommended that TFTP be removed, unless there is a specific need for TFTP (such as a boot server). In that case, use extreme caution when configuring the services.

Ensure tftp Daemon Uses Secure Modexccdf_org.ssgproject.content_rule_tftpd_uses_secure_mode medium

Ensure tftp Daemon Uses Secure Mode

Rule IDxccdf_org.ssgproject.content_rule_tftpd_uses_secure_mode
Result
pass
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-6, AC-17(8), CM-7, 366, SRG-OS-000480-GPOS-00227

Description

If running the tftp service is necessary, it should be configured to change its root directory at startup. To do so, ensure /etc/xinetd.d/tftp includes -s as a command line argument, as shown in the following example (which is also the default):

server_args = -s /var/lib/tftpboot

Rationale

Using the -s option causes the TFTP service to only serve files from the given directory. Serving files from an intentionally-specified directory reduces the risk of sharing files which should remain private.

OVAL details

Items not found satisfying tftpd secure mode:

Object oval:ssg-object_tftpd_uses_secure_mode:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/xinetd.d/tftp^[\s]*server_args[\s]+=[\s]+\-s[\s]+.+$1
Uninstall talk-server Packagexccdf_org.ssgproject.content_rule_package_talk-server_removed medium

Uninstall talk-server Package

Rule IDxccdf_org.ssgproject.content_rule_package_talk-server_removed
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  2.1.10

Description

The talk-server package can be removed with the following command:

$ sudo yum erase talk-server

Rationale

The talk software presents a security risk as it uses unencrypted protocols for communications. Removing the talk-server package decreases the risk of the accidental (or intentional) activation of talk services.

Uninstall talk Packagexccdf_org.ssgproject.content_rule_package_talk_removed low

Uninstall talk Package

Rule IDxccdf_org.ssgproject.content_rule_package_talk_removed
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  2.1.9

Description

The talk package contains the client program for the Internet talk protocol, which allows the user to chat with other users on different systems. Talk is a communication program which copies lines from one terminal to the terminal of another user. The talk package can be removed with the following command:

$ sudo yum erase talk

Rationale

The talk software presents a security risk as it uses unencrypted protocols for communications. Removing the talk package decreases the risk of the accidental (or intentional) activation of talk client program.

Disable Automatic Bug Reporting Tool (abrtd)xccdf_org.ssgproject.content_rule_service_abrtd_disabled low

Disable Automatic Bug Reporting Tool (abrtd)

Rule IDxccdf_org.ssgproject.content_rule_service_abrtd_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  AC-17(8), CM-7, http://iase.disa.mil/stigs/cci/Pages/index.aspx

Description

The Automatic Bug Reporting Tool (abrtd) daemon collects and reports crash data when an application crash is detected. Using a variety of plugins, abrtd can email crash reports to system administrators, log crash reports to files, or forward crash reports to a centralized issue tracking system such as RHTSupport. The abrtd service can be disabled with the following command:

$ sudo systemctl disable abrtd.service

Rationale

Mishandling crash data could expose sensitive information about vulnerabilities in software executing on the system, as well as sensitive information from within a process's address space or registers.

Disable Advanced Configuration and Power Interface (acpid)xccdf_org.ssgproject.content_rule_service_acpid_disabled low

Disable Advanced Configuration and Power Interface (acpid)

Rule IDxccdf_org.ssgproject.content_rule_service_acpid_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

The Advanced Configuration and Power Interface Daemon (acpid) dispatches ACPI events (such as power/reset button depressed) to userspace programs. The acpid service can be disabled with the following command:

$ sudo systemctl disable acpid.service

Rationale

ACPI support is highly desirable for systems in some network roles, such as laptops or desktops. For other systems, such as servers, it may permit accidental or trivially achievable denial of service situations and disabling it is appropriate.

Disable Certmonger Service (certmonger)xccdf_org.ssgproject.content_rule_service_certmonger_disabled low

Disable Certmonger Service (certmonger)

Rule IDxccdf_org.ssgproject.content_rule_service_certmonger_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

Certmonger is a D-Bus based service that attempts to simplify interaction with certifying authorities on networks which use public-key infrastructure. It is often combined with Red Hat's IPA (Identity Policy Audit) security information management solution to aid in the management of certificates. The certmonger service can be disabled with the following command:

$ sudo systemctl disable certmonger.service

Rationale

The services provided by certmonger may be essential for systems fulfilling some roles a PKI infrastructure, but its functionality is not necessary for many other use cases.

Disable Control Group Config (cgconfig)xccdf_org.ssgproject.content_rule_service_cgconfig_disabled low

Disable Control Group Config (cgconfig)

Rule IDxccdf_org.ssgproject.content_rule_service_cgconfig_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

Control groups allow an administrator to allocate system resources (such as CPU, memory, network bandwidth, etc) among a defined group (or groups) of processes executing on a system. The cgconfig daemon starts at boot and establishes the predefined control groups. The cgconfig service can be disabled with the following command:

$ sudo systemctl disable cgconfig.service

Rationale

Unless control groups are used to manage system resources, running the cgconfig service is not necessary.

Disable Control Group Rules Engine (cgred)xccdf_org.ssgproject.content_rule_service_cgred_disabled low

Disable Control Group Rules Engine (cgred)

Rule IDxccdf_org.ssgproject.content_rule_service_cgred_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

The cgred service moves tasks into control groups according to parameters set in the /etc/cgrules.conf configuration file. The cgred service can be disabled with the following command:

$ sudo systemctl disable cgred.service

Rationale

Unless control groups are used to manage system resources, running the cgred service service is not necessary.

Disable CPU Speed (cpupower)xccdf_org.ssgproject.content_rule_service_cpupower_disabled low

Disable CPU Speed (cpupower)

Rule IDxccdf_org.ssgproject.content_rule_service_cpupower_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

The cpupower service can adjust the clock speed of supported CPUs based upon the current processing load thereby conserving power and reducing heat. The cpupower service can be disabled with the following command:

$ sudo systemctl disable cpupower.service

Rationale

The cpupower service is only necessary if adjusting the CPU clock speed provides benefit. Traditionally this has included laptops (to enhance battery life), but may also apply to server or desktop environments where conserving power is highly desirable or necessary.

Enable IRQ Balance (irqbalance)xccdf_org.ssgproject.content_rule_service_irqbalance_enabled low

Enable IRQ Balance (irqbalance)

Rule IDxccdf_org.ssgproject.content_rule_service_irqbalance_enabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

The irqbalance service optimizes the balance between power savings and performance through distribution of hardware interrupts across multiple processors. The irqbalance service can be enabled with the following command:

$ sudo systemctl enable irqbalance.service

Rationale

In an environment with multiple processors (now common), the irqbalance service provides potential speedups for handling interrupt requests.

Disable KDump Kernel Crash Analyzer (kdump)xccdf_org.ssgproject.content_rule_service_kdump_disabled medium

Disable KDump Kernel Crash Analyzer (kdump)

Rule IDxccdf_org.ssgproject.content_rule_service_kdump_disabled
Result
fail
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-17(8), CM-7, CM-6(b), 366, SRG-OS-000480-GPOS-00227

Description

The kdump service provides a kernel crash dump analyzer. It uses the kexec system call to boot a secondary kernel ("capture" kernel) following a system crash, which can load information from the crashed kernel for analysis. The kdump service can be disabled with the following command:

$ sudo systemctl disable kdump.service

Rationale

Kernel core dumps may contain the full contents of system memory at the time of the crash. Kernel core dumps consume a considerable amount of disk space and may result in denial of service by exhausting the available space on the target file system partition. Unless the system is used for kernel development or testing, there is little need to run the kdump service.

OVAL details

Items found violating systemd test:

UnitDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependency
multi-user.targetbasic.targetsysinit.targetsystemd-journal-catalog-update.servicesystemd-update-utmp.servicelocal-fs.target-.mountboot.mountrhel-readonly.servicesystemd-remount-fs.servicerhel-import-state.servicesystemd-journald.servicesystemd-update-done.serviceplymouth-start.servicelvm2-lvmetad.socketsys-kernel-debug.mountsystemd-random-seed.servicesystemd-firstboot.servicesystemd-ask-password-console.pathcryptsetup.targetsystemd-tmpfiles-setup.serviceplymouth-read-write.servicesystemd-machine-id-commit.servicelvm2-monitor.servicedev-hugepages.mountswap.targetdev-mapper-centos\x2dswap.swapsystemd-tmpfiles-setup-dev.servicesys-fs-fuse-connections.mountsystemd-journal-flush.servicesystemd-udevd.servicesystemd-udev-trigger.serviceproc-sys-fs-binfmt_misc.automountsystemd-binfmt.servicesystemd-hwdb-update.servicelvm2-lvmpolld.socketsys-kernel-config.mountkmod-static-nodes.servicedev-mqueue.mountsystemd-vconsole-setup.servicesystemd-sysctl.servicesystemd-modules-load.serviceslices.targetsystem.slice-.slicesockets.targetsystemd-shutdownd.socketdm-event.socketsystemd-journald.socketsystemd-udevd-control.socketdbus.socketsystemd-initctl.socketpcscd.socketsystemd-udevd-kernel.socketmicrocode.servicerhel-dmesg.servicepaths.targetrhel-autorelabel.servicerhel-autorelabel-mark.serviceselinux-policy-migrate-local-changes@targeted.servicetimers.targetsystemd-tmpfiles-clean.timerrhel-configure.servicerhel-loadmodules.servicedbus.serviceremote-fs.targetpostfix.serviceauditd.servicesystemd-ask-password-wall.pathcrond.servicetuned.servicegetty.targetgetty@tty1.servicesystemd-readahead-replay.servicebrandbot.pathsshd.servicesystemd-update-utmp-runlevel.serviceplymouth-quit-wait.servicersyslog.servicefirewalld.serviceirqbalance.servicekdump.servicechronyd.servicesystemd-logind.serviceplymouth-quit.serviceNetworkManager.servicenetwork.servicesystemd-readahead-collect.servicesystemd-user-sessions.service
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable

function service_command {

# Load function arguments into local variables
local service_state=$1
local service=$2
local xinetd=$(echo $3 | cut -d'=' -f2)

# Check sanity of the input
if [ $# -lt "2" ]
then
  echo "Usage: service_command 'enable/disable' 'service_name.service'"
  echo
  echo "To enable or disable xinetd services add \'xinetd=service_name\'"
  echo "as the last argument"
  echo "Aborting."
  exit 1
fi

# If systemctl is installed, use systemctl command; otherwise, use the service/chkconfig commands
if [ -f "/usr/bin/systemctl" ] ; then
  service_util="/usr/bin/systemctl"
else
  service_util="/sbin/service"
  chkconfig_util="/sbin/chkconfig"
fi

# If disable is not specified in arg1, set variables to enable services.
# Otherwise, variables are to be set to disable services.
if [ "$service_state" != 'disable' ] ; then
  service_state="enable"
  service_operation="start"
  chkconfig_state="on"
else
  service_state="disable"
  service_operation="stop"
  chkconfig_state="off"
fi

# If chkconfig_util is not empty, use chkconfig/service commands.
if ! [ "x$chkconfig_util" = x ] ; then
  $service_util $service $service_operation
  $chkconfig_util --level 0123456 $service $chkconfig_state
else
  $service_util $service_operation $service
  $service_util $service_state $service
fi

# Test if local variable xinetd is empty using non-bashism.
# If empty, then xinetd is not being used.
if ! [ "x$xinetd" = x ] ; then
  grep -qi disable /etc/xinetd.d/$xinetd && \

  if ! [ "$service_operation" != 'disable' ] ; then
    sed -i "s/disable.*/disable         = no/gI" /etc/xinetd.d/$xinetd
  else
    sed -i "s/disable.*/disable         = yes/gI" /etc/xinetd.d/$xinetd
  fi
fi

}

service_command disable kdump
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:disable
- name: Disable service kdump
  service:
    name="{{item}}"
    enabled="no"
    state="stopped"
  with_items:
    - kdump

Disable Software RAID Monitor (mdmonitor)xccdf_org.ssgproject.content_rule_service_mdmonitor_disabled low

Disable Software RAID Monitor (mdmonitor)

Rule IDxccdf_org.ssgproject.content_rule_service_mdmonitor_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

The mdmonitor service is used for monitoring a software RAID array; hardware RAID setups do not use this service. The mdmonitor service can be disabled with the following command:

$ sudo systemctl disable mdmonitor.service

Rationale

If software RAID monitoring is not required, there is no need to run this service.

Disable D-Bus IPC Service (messagebus)xccdf_org.ssgproject.content_rule_service_messagebus_disabled low

Disable D-Bus IPC Service (messagebus)

Rule IDxccdf_org.ssgproject.content_rule_service_messagebus_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

D-Bus provides an IPC mechanism used by a growing list of programs, such as those used for Gnome, Bluetooth, and Avahi. Due to these dependencies, disabling D-Bus may not be practical for many systems. The messagebus service can be disabled with the following command:

$ sudo systemctl disable messagebus.service

Rationale

If no services which require D-Bus are needed, then it can be disabled. As a broker for IPC between processes of different privilege levels, it could be a target for attack. However, disabling D-Bus is likely to be impractical for any system which needs to provide a graphical login session.

Disable Network Console (netconsole)xccdf_org.ssgproject.content_rule_service_netconsole_disabled low

Disable Network Console (netconsole)

Rule IDxccdf_org.ssgproject.content_rule_service_netconsole_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  AC-17(8), CM-7, 381

Description

The netconsole service is responsible for loading the netconsole kernel module, which logs kernel printk messages over UDP to a syslog server. This allows debugging of problems where disk logging fails and serial consoles are impractical. The netconsole service can be disabled with the following command:

$ sudo systemctl disable netconsole.service

Rationale

The netconsole service is not necessary unless there is a need to debug kernel panics, which is not common.

Disable ntpdate Service (ntpdate)xccdf_org.ssgproject.content_rule_service_ntpdate_disabled low

Disable ntpdate Service (ntpdate)

Rule IDxccdf_org.ssgproject.content_rule_service_ntpdate_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  AC-17(8), CM-7, 382

Description

The ntpdate service sets the local hardware clock by polling NTP servers when the system boots. It synchronizes to the NTP servers listed in /etc/ntp/step-tickers or /etc/ntp.conf and then sets the local hardware clock to the newly synchronized system time. The ntpdate service can be disabled with the following command:

$ sudo systemctl disable ntpdate.service

Rationale

The ntpdate service may only be suitable for systems which are rebooted frequently enough that clock drift does not cause problems between reboots. In any event, the functionality of the ntpdate service is now available in the ntpd program and should be considered deprecated.

Disable Odd Job Daemon (oddjobd)xccdf_org.ssgproject.content_rule_service_oddjobd_disabled low

Disable Odd Job Daemon (oddjobd)

Rule IDxccdf_org.ssgproject.content_rule_service_oddjobd_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7, 381

Description

The oddjobd service exists to provide an interface and access control mechanism through which specified privileged tasks can run tasks for unprivileged client applications. Communication with oddjobd through the system message bus. The oddjobd service can be disabled with the following command:

$ sudo systemctl disable oddjobd.service

Rationale

The oddjobd service may provide necessary functionality in some environments, and can be disabled if it is not needed. Execution of tasks by privileged programs, on behalf of unprivileged ones, has traditionally been a source of privilege escalation security issues.

Disable Portreserve (portreserve)xccdf_org.ssgproject.content_rule_service_portreserve_disabled low

Disable Portreserve (portreserve)

Rule IDxccdf_org.ssgproject.content_rule_service_portreserve_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  AC-17(8), CM-7

Description

The portreserve service is a TCP port reservation utility that can be used to prevent portmap from binding to well known TCP ports that are required for other services. The portreserve service can be disabled with the following command:

$ sudo systemctl disable portreserve.service

Rationale

The portreserve service provides helpful functionality by preventing conflicting usage of ports in the reserved port range, but it can be disabled if not needed.

Enable Process Accounting (psacct)xccdf_org.ssgproject.content_rule_service_psacct_enabled low

Enable Process Accounting (psacct)

Rule IDxccdf_org.ssgproject.content_rule_service_psacct_enabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  AU-12, CM-7

Description

The process accounting service, psacct, works with programs including acct and ac to allow system administrators to view user activity, such as commands issued by users of the system. The psacct service can be enabled with the following command:

$ sudo systemctl enable psacct.service

Rationale

The psacct service can provide administrators a convenient view into some user activities. However, it should be noted that the auditing system and its audit records provide more authoritative and comprehensive records.

Disable Apache Qpid (qpidd)xccdf_org.ssgproject.content_rule_service_qpidd_disabled low

Disable Apache Qpid (qpidd)

Rule IDxccdf_org.ssgproject.content_rule_service_qpidd_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  AC-17(8), CM-7, 382

Description

The qpidd service provides high speed, secure, guaranteed delivery services. It is an implementation of the Advanced Message Queuing Protocol. By default the qpidd service will bind to port 5672 and listen for connection attempts. The qpidd service can be disabled with the following command:

$ sudo systemctl disable qpidd.service

Rationale

The qpidd service is automatically installed when the "base" package selection is selected during installation. The qpidd service listens for network connections, which increases the attack surface of the system. If the system is not intended to receive AMQP traffic, then the qpidd service is not needed and should be disabled or removed.

Disable Quota Netlink (quota_nld)xccdf_org.ssgproject.content_rule_service_quota_nld_disabled low

Disable Quota Netlink (quota_nld)

Rule IDxccdf_org.ssgproject.content_rule_service_quota_nld_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

The quota_nld service provides notifications to users of disk space quota violations. It listens to the kernel via a netlink socket for disk quota violations and notifies the appropriate user of the violation using D-Bus or by sending a message to the terminal that the user has last accessed. The quota_nld service can be disabled with the following command:

$ sudo systemctl disable quota_nld.service

Rationale

If disk quotas are enforced on the local system, then the quota_nld service likely provides useful functionality and should remain enabled. However, if disk quotas are not used or user notification of disk quota violation is not desired then there is no need to run this service.

Disable Network Router Discovery Daemon (rdisc)xccdf_org.ssgproject.content_rule_service_rdisc_disabled low

Disable Network Router Discovery Daemon (rdisc)

Rule IDxccdf_org.ssgproject.content_rule_service_rdisc_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  AC-17(8), AC-4, CM-7, 382

Description

The rdisc service implements the client side of the ICMP Internet Router Discovery Protocol (IRDP), which allows discovery of routers on the local subnet. If a router is discovered then the local routing table is updated with a corresponding default route. By default this daemon is disabled. The rdisc service can be disabled with the following command:

$ sudo systemctl disable rdisc.service

Rationale

General-purpose systems typically have their network and routing information configured statically by a system administrator. Workstations or some special-purpose systems often use DHCP (instead of IRDP) to retrieve dynamic network configuration information.

Disable Red Hat Network Service (rhnsd)xccdf_org.ssgproject.content_rule_service_rhnsd_disabled low

Disable Red Hat Network Service (rhnsd)

Rule IDxccdf_org.ssgproject.content_rule_service_rhnsd_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  AC-17(8), CM-7, 382, 1.2.4

Description

The Red Hat Network service automatically queries Red Hat Network servers to determine whether there are any actions that should be executed, such as package updates. This only occurs if the system was registered to an RHN server or satellite and managed as such. The rhnsd service can be disabled with the following command:

$ sudo systemctl disable rhnsd.service

Rationale

Although systems management and patching is extremely important to system security, management by a system outside the enterprise enclave is not desirable for some environments. However, if the system is being managed by RHN or RHN Satellite Server the rhnsd daemon can remain on.

Disable Red Hat Subscription Manager Daemon (rhsmcertd)xccdf_org.ssgproject.content_rule_service_rhsmcertd_disabled low

Disable Red Hat Subscription Manager Daemon (rhsmcertd)

Rule IDxccdf_org.ssgproject.content_rule_service_rhsmcertd_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

The Red Hat Subscription Manager (rhsmcertd) periodically checks for changes in the entitlement certificates for a registered system and updates it accordingly. The rhsmcertd service can be disabled with the following command:

$ sudo systemctl disable rhsmcertd.service

Rationale

The rhsmcertd service can provide administrators with some additional control over which of their systems are entitled to particular subscriptions. However, for systems that are managed locally or which are not expected to require remote changes to their subscription status, it is unnecessary and can be disabled.

Disable Cyrus SASL Authentication Daemon (saslauthd)xccdf_org.ssgproject.content_rule_service_saslauthd_disabled low

Disable Cyrus SASL Authentication Daemon (saslauthd)

Rule IDxccdf_org.ssgproject.content_rule_service_saslauthd_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  AC-17(8), CM-7

Description

The saslauthd service handles plaintext authentication requests on behalf of the SASL library. The service isolates all code requiring superuser privileges for SASL authentication into a single process, and can also be used to provide proxy authentication services to clients that do not understand SASL based authentication. The saslauthd service can be disabled with the following command:

$ sudo systemctl disable saslauthd.service

Rationale

The saslauthd service provides essential functionality for performing authentication in some directory environments, such as those which use Kerberos and LDAP. For others, however, in which only local files may be consulted, it is not necessary and should be disabled.

Disable SMART Disk Monitoring Service (smartd)xccdf_org.ssgproject.content_rule_service_smartd_disabled low

Disable SMART Disk Monitoring Service (smartd)

Rule IDxccdf_org.ssgproject.content_rule_service_smartd_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

SMART (Self-Monitoring, Analysis, and Reporting Technology) is a feature of hard drives that allows them to detect symptoms of disk failure and relay an appropriate warning. The smartd service can be disabled with the following command:

$ sudo systemctl disable smartd.service

Rationale

SMART can help protect against denial of service due to failing hardware. Nevertheless, if it is not needed or the system's drives are not SMART-capable (such as solid state drives), it can be disabled.

Disable System Statistics Reset Service (sysstat)xccdf_org.ssgproject.content_rule_service_sysstat_disabled low

Disable System Statistics Reset Service (sysstat)

Rule IDxccdf_org.ssgproject.content_rule_service_sysstat_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

The sysstat service resets various I/O and CPU performance statistics to zero in order to begin counting from a fresh state at boot time. The sysstat service can be disabled with the following command:

$ sudo systemctl disable sysstat.service

Rationale

By default the sysstat service merely runs a program at boot to reset the statistics, which can be retrieved using programs such as sar and sadc. These may provide useful insight into system operation, but unless used this service can be disabled.

Verify User Who Owns /etc/cron.allow filexccdf_org.ssgproject.content_rule_file_owner_cron_allow medium

Verify User Who Owns /etc/cron.allow file

Rule IDxccdf_org.ssgproject.content_rule_file_owner_cron_allow
Result
pass
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-6, 366, SRG-OS-000480-GPOS-00227

Description

If /etc/cron.allow exists, it must be owned by root. To properly set the owner of /etc/cron.allow, run the command:

$ sudo chown root /etc/cron.allow

Rationale

If the owner of the cron.allow file is not set to root, the possibility exists for an unauthorized user to view or edit sensitive information.

OVAL details

Items not found satisfying Testing user ownership of /etc/cron.allow:

Object oval:ssg-object_file_etc_cron_allow:obj:1 of type file_object
Filepath
/etc/cron.allow
State oval:ssg-state_etc_cron_allow_uid_root:ste:1 of type file_state
User id
0
Verify Group Who Owns /etc/cron.allow filexccdf_org.ssgproject.content_rule_file_groupowner_cron_allow medium

Verify Group Who Owns /etc/cron.allow file

Rule IDxccdf_org.ssgproject.content_rule_file_groupowner_cron_allow
Result
pass
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-6, 366, SRG-OS-000480-GPOS-00227

Description

If /etc/cron.allow exists, it must be group-owned by root. To properly set the group owner of /etc/cron.allow, run the command:

$ sudo chgrp root /etc/cron.allow

Rationale

If the owner of the cron.allow file is not set to root, the possibility exists for an unauthorized user to view or edit sensitive information.

OVAL details

Items not found satisfying Testing group ownership /etc/cron.allow:

Object oval:ssg-object_groupowner_cron_allow_file:obj:1 of type file_object
Filepath
/etc/cron.allow
State oval:ssg-state_groupowner_cron_allow_file:ste:1 of type file_state
Group id
0
Enable cron Servicexccdf_org.ssgproject.content_rule_service_crond_enabled medium

Enable cron Service

Rule IDxccdf_org.ssgproject.content_rule_service_crond_enabled
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  CM-7, 6.1.2

Description

The crond service is used to execute commands at preconfigured times. It is required by almost all systems to perform necessary maintenance tasks, such as notifying root of system activity. The crond service can be enabled with the following command:

$ sudo systemctl enable crond.service

Rationale

Due to its usage for maintenance and security-supporting tasks, enabling the cron daemon is essential.

Disable anacron Servicexccdf_org.ssgproject.content_rule_disable_anacron low

Disable anacron Service

Rule IDxccdf_org.ssgproject.content_rule_disable_anacron
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

The cronie-anacron package, which provides anacron functionality, is installed by default. The cronie-anacron package can be removed with the following command:

$ sudo yum erase cronie-anacron

Rationale

The anacron service provides cron functionality for systems such as laptops and workstations that may be shut down during the normal times that cron jobs are scheduled to run. On systems which do not require this additional functionality, anacron could needlessly increase the possible attack surface for an intruder.

Disable At Service (atd)xccdf_org.ssgproject.content_rule_service_atd_disabled low

Disable At Service (atd)

Rule IDxccdf_org.ssgproject.content_rule_service_atd_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7, 381

Description

The at and batch commands can be used to schedule tasks that are meant to be executed only once. This allows delayed execution in a manner similar to cron, except that it is not recurring. The daemon atd keeps track of tasks scheduled via at and batch, and executes them at the specified time. The atd service can be disabled with the following command:

$ sudo systemctl disable atd.service

Rationale

The atd service could be used by an unsophisticated insider to carry out activities outside of a normal login session, which could complicate accountability. Furthermore, the need to schedule tasks with at or batch is not common.

Enable the Docker servicexccdf_org.ssgproject.content_rule_service_docker_enabled medium

Enable the Docker service

Rule IDxccdf_org.ssgproject.content_rule_service_docker_enabled
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf, http://iase.disa.mil/stigs/cci/Pages/index.aspx, http://iase.disa.mil/stigs/srgs/Pages/index.aspx

Description

The docker service is commonly needed to create containers. The docker service can be enabled with the following command:

$ sudo systemctl enable docker.service

Rationale

To be able to find any problems with misconfiguration of the docker daemon and running containers, the docker service has to be enabled.

Use direct-lvm with the Device Mapper Storage Driverxccdf_org.ssgproject.content_rule_docker_storage_configured low

Use direct-lvm with the Device Mapper Storage Driver

Rule IDxccdf_org.ssgproject.content_rule_docker_storage_configured
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

To use Docker in production with the device mapper storage driver, the Docker daemon should be configured to use direct-lvm instead of loopback device as a storage. For setting up the LVM and configuring Docker, see the Docker Device Mapper Storage Documentation.

Rationale

For using Docker in production, the device mapper storage driver with loopback devices is discouraged. The suggested way of configuring device mapper storage driver is direct-lvm. Choosing the right storage driver and backing filesystem is crucial to stability and performance.

Enable SSH Server firewalld Firewall exceptionxccdf_org.ssgproject.content_rule_firewalld_sshd_port_enabled low

Enable SSH Server firewalld Firewall exception

Rule IDxccdf_org.ssgproject.content_rule_firewalld_sshd_port_enabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  3.1.12

Description

By default, inbound connections to SSH's port are allowed. If the SSH server is being used but denied by the firewall, this exception should be added to the firewall configuration.

To configure firewalld to allow access, run the following command(s): firewall-cmd --permanent --add-service=ssh

Rationale

If inbound SSH connections are expected, adding a firewall rule exception will allow remote access through the SSH port.

Allow Only SSH Protocol 2xccdf_org.ssgproject.content_rule_sshd_allow_only_protocol2 high

Allow Only SSH Protocol 2

Rule IDxccdf_org.ssgproject.content_rule_sshd_allow_only_protocol2
Result
pass
Time2017-10-21T14:39:59
Severityhigh
Identifiers and References

References:  AC-17(8).1(ii), IA-5(1)(c), 197, 366, 6.2.1, SRG-OS-000074-GPOS-00042, SRG-OS-000480-GPOS-00227, 5.5.6, 3.1.13, 3.5.4

Description

Only SSH protocol version 2 connections should be permitted. The default setting in /etc/ssh/sshd_config is correct, and can be verified by ensuring that the following line appears:

Protocol 2

Rationale

SSH protocol version 1 is an insecure implementation of the SSH protocol and has many well-known vulnerability exploits. Exploits of the SSH daemon could provide immediate root access to the system.

OVAL details

Items found satisfying sshd uses protocol 2:

PathContent
/etc/ssh/sshd_configProtocol 2 # Per CCE-CCE-80221-5: Set KerberosAuthentication no in /etc/ssh/sshd_config
Limit Users' SSH Accessxccdf_org.ssgproject.content_rule_sshd_limit_user_access low

Limit Users' SSH Access

Rule IDxccdf_org.ssgproject.content_rule_sshd_limit_user_access
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  AC-3, 3.1.12

Description

By default, the SSH configuration allows any user with an account to access the system. In order to specify the users that are allowed to login via SSH and deny all other users, add or correct the following line in the /etc/ssh/sshd_config file:

DenyUsers USER1 USER2
Where USER1 and USER2 are valid user names.

Rationale

Specifying which accounts are allowed SSH access into the system reduces the possibility of unauthorized access to the system.

Disable GSSAPI Authenticationxccdf_org.ssgproject.content_rule_sshd_disable_gssapi_auth medium

Disable GSSAPI Authentication

Rule IDxccdf_org.ssgproject.content_rule_sshd_disable_gssapi_auth
Result
pass
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  CM-6(c), 368, 318, 1812, 1813, 1814, SRG-OS-000364-GPOS-00151, 3.1.12

Description

Unless needed, SSH should not permit extraneous or unnecessary authentication mechanisms like GSSAPI. To disable GSSAPI authentication, add or correct the following line in the /etc/ssh/sshd_config file:

GSSAPIAuthentication no

Rationale

GSSAPI authentication is used to provide additional authentication mechanisms to applications. Allowing GSSAPI authentication through SSH exposes the system's GSSAPI to remote hosts, increasing the attack surface of the system.

OVAL details

Items found satisfying tests the value of GSSAPIAuthentication setting in the /etc/ssh/sshd_config file:

PathContent
/etc/ssh/sshd_configGSSAPIAuthentication no
Disable Kerberos Authenticationxccdf_org.ssgproject.content_rule_sshd_disable_kerb_auth medium

Disable Kerberos Authentication

Rule IDxccdf_org.ssgproject.content_rule_sshd_disable_kerb_auth
Result
pass
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  CM-6(c), 368, 318, 1812, 1813, 1814, SRG-OS-000364-GPOS-00151, 3.1.12

Description

Unless needed, SSH should not permit extraneous or unnecessary authentication mechanisms like Kerberos. To disable Kerberos authentication, add or correct the following line in the /etc/ssh/sshd_config file:

KerberosAuthentication no

Rationale

Kerberos authentication for SSH is often implemented using GSSAPI. If Kerberos is enabled through SSH, the SSH daemon provides a means of access to the system's Kerberos implementation. Vulnerabilities in the system's Kerberos implementations may be subject to exploitation.

OVAL details

Items found satisfying tests the value of KerberosAuthentication setting in the /etc/ssh/sshd_config file:

PathContent
/etc/ssh/sshd_configKerberosAuthentication no # Per CCE-CCE-80222-3: Set StrictModes yes in /etc/ssh/sshd_config
Enable Use of Strict Mode Checkingxccdf_org.ssgproject.content_rule_sshd_enable_strictmodes medium

Enable Use of Strict Mode Checking

Rule IDxccdf_org.ssgproject.content_rule_sshd_enable_strictmodes
Result
pass
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-6, 366, SRG-OS-000480-GPOS-00227, 3.1.12

Description

SSHs StrictModes option checks file and ownership permissions in the user's home directory .ssh folder before accepting login. If world- writable permissions are found, logon is rejected. To enable StrictModes in SSH, add or correct the following line in the /etc/ssh/sshd_config file:

StrictModes yes

Rationale

If other users have access to modify user-specific SSH configuration files, they may be able to log into the system as another user.

OVAL details

Items found satisfying tests the value of StrictModes setting in the /etc/ssh/sshd_config file:

PathContent
/etc/ssh/sshd_configStrictModes yes # Per CCE-CCE-80223-1: Set UsePrivilegeSeparation yes in /etc/ssh/sshd_config
Enable Use of Privilege Separationxccdf_org.ssgproject.content_rule_sshd_use_priv_separation medium

Enable Use of Privilege Separation

Rule IDxccdf_org.ssgproject.content_rule_sshd_use_priv_separation
Result
pass
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-6, 366, SRG-OS-000480-GPOS-00227, 3.1.12

Description

When enabled, SSH will create an unprivileged child process that has the privilege of the authenticated user. To enable privilege separation in SSH, add or correct the following line in the /etc/ssh/sshd_config file:

UsePrivilegeSeparation yes

Rationale

SSH daemon privilege separation causes the SSH process to drop root privileges when not needed which would decrease the impact of software vulnerabilities in the unprivileged section.

OVAL details

Items found satisfying tests the value of UsePrivilegeSeparation setting in the /etc/ssh/sshd_config file:

PathContent
/etc/ssh/sshd_configUsePrivilegeSeparation yes # Per CCE-CCE-80224-9: Set Compression no in /etc/ssh/sshd_config
Disable Compression Or Set Compression to delayedxccdf_org.ssgproject.content_rule_sshd_disable_compression medium

Disable Compression Or Set Compression to delayed

Rule IDxccdf_org.ssgproject.content_rule_sshd_disable_compression
Result
pass
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  CM-6(b), 366, SRG-OS-000480-GPOS-00227, 3.1.12

Description

Compression is useful for slow network connections over long distances but can cause performance issues on local LANs. If use of compression is required, it should be enabled only after a user has authenticated; otherwise , it should be disabled. To disable compression or delay compression until after a user has successfully authenticated, add or correct the following line in the /etc/ssh/sshd_config file:

Compression no
or
Compression delayed

Rationale

If compression is allowed in an SSH connection prior to authentication, vulnerabilities in the compression software could result in compromise of the system from an unauthenticated connection, potentially wih root privileges.

OVAL details

Items found satisfying tests the value of Compression setting in the /etc/ssh/sshd_config file:

PathContent
/etc/ssh/sshd_configCompression no # Per CCE-CCE-80225-6: Set PrintLastLog yes in /etc/ssh/sshd_config
Print Last Logxccdf_org.ssgproject.content_rule_sshd_print_last_log low

Print Last Log

Rule IDxccdf_org.ssgproject.content_rule_sshd_print_last_log
Result
pass
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  AC-9, 366, SRG-OS-000480-GPOS-00227

Description

When enabled, SSH will display the date and time of the last successful account logon. To enable LastLog in SSH, add or correct the following line in the /etc/ssh/sshd_config file:

PrintLastLog yes

Rationale

Providing users feedback on when account accesses last occurred facilitates user recognition and reporting of unauthorized account use.

OVAL details

Items found satisfying tests the value of PrintLastLog setting in the /etc/ssh/sshd_config file:

PathContent
/etc/ssh/sshd_configPrintLastLog yes # Per CCE-CCE-27433-2: Set ClientAliveInterval 600 in /etc/ssh/sshd_config
Set LogLevel to INFOxccdf_org.ssgproject.content_rule_sshd_set_loglevel_info low

Set LogLevel to INFO

Rule IDxccdf_org.ssgproject.content_rule_sshd_set_loglevel_info
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  5.2.9

Description

The INFO parameter specifices that record login and logout activity will be logged. To specify the log level in SSH, add or correct the following line in the /etc/ssh/sshd_config file:

LogLevel INFO

Rationale

SSH provides several logging levels with varying amounts of verbosity. DEBUG is specifically not recommended other than strictly for debugging SSH communications since it provides so much data that it is difficult to identify important security information. INFO level is the basic level that only records login activity of SSH users. In many situations, such as Incident Response, it is important to determine when a particular user was active on a system. The logout record can eliminate those users who disconnected, which helps narrow the field.

Set SSH Idle Timeout Intervalxccdf_org.ssgproject.content_rule_sshd_set_idle_timeout low

Set SSH Idle Timeout Interval

Rule IDxccdf_org.ssgproject.content_rule_sshd_set_idle_timeout
Result
pass
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  AC-2(5), SA-8(i), AC-12, 1133, 2361, SRG-OS-000163-GPOS-00072, SRG-OS-000279-GPOS-00109, Req-8.1.8, 6.2.12, 5.5.6, 3.1.11

Description

SSH allows administrators to set an idle timeout interval. After this interval has passed, the idle user will be automatically logged out.

To set an idle timeout interval, edit the following line in /etc/ssh/sshd_config as follows:

ClientAliveInterval interval
The timeout interval is given in seconds. To have a timeout of 10 minutes, set interval to 600.

If a shorter timeout has already been set for the login shell, that value will preempt any SSH setting made here. Keep in mind that some processes may stop SSH from correctly detecting that the user is idle.

Rationale

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 let unattended.

OVAL details

Items found satisfying timeout is configured:

PathContent
/etc/ssh/sshd_configClientAliveInterval 600 # Per CCE-CCE-27082-7: Set ClientAliveCountMax 0 in /etc/ssh/sshd_config
Set SSH Client Alive Countxccdf_org.ssgproject.content_rule_sshd_set_keepalive medium

Set SSH Client Alive Count

Rule IDxccdf_org.ssgproject.content_rule_sshd_set_keepalive
Result
pass
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-2(5), SA-8, AC-12, 1133, 2361, SRG-OS-000163-GPOS-00072, SRG-OS-000279-GPOS-00109, 6.2.12, 5.5.6, 3.1.11

Description

To ensure the SSH idle timeout occurs precisely when the ClientAliveCountMax is set, edit /etc/ssh/sshd_config as follows:

ClientAliveCountMax 0

Rationale

This ensures a user login will be terminated as soon as the ClientAliveCountMax is reached.

OVAL details

Items found satisfying Tests the value of the ClientAliveCountMax setting in the /etc/ssh/sshd_config file:

PathContent
/etc/ssh/sshd_configClientAliveCountMax 0 # Per CCE-CCE-80372-6: Set IgnoreUserKnownHosts yes in /etc/ssh/sshd_config
Set SSH authentication attempt limitxccdf_org.ssgproject.content_rule_sshd_set_max_auth_tries medium

Set SSH authentication attempt limit

Rule IDxccdf_org.ssgproject.content_rule_sshd_set_max_auth_tries
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References
Description

The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. Once the number of failures reaches half this value, additional failures are logged. to set MaxAUthTries edit /etc/ssh/sshd_config as follows:

MaxAuthTries tries

Rationale

Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server.

Disable SSH Support for .rhosts Filesxccdf_org.ssgproject.content_rule_sshd_disable_rhosts medium

Disable SSH Support for .rhosts Files

Rule IDxccdf_org.ssgproject.content_rule_sshd_disable_rhosts
Result
pass
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-3, CM-6(a), 366, 6.2.6, SRG-OS-000480-GPOS-00227, 5.5.6, 3.1.12

Description

SSH can emulate the behavior of the obsolete rsh command in allowing users to enable insecure access to their accounts via .rhosts files.

To ensure this behavior is disabled, add or correct the following line in /etc/ssh/sshd_config:

IgnoreRhosts yes

Rationale

SSH trust relationships mean a compromise on one host can allow an attacker to move trivially to other hosts.

OVAL details

Items not found satisfying Tests the value of the IgnoreRhosts[\s]*(<:nocomment:>*) setting in the /etc/ssh/sshd_config file:

Object oval:ssg-obj_sshd_rsh_emulation_disabled:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/ssh/sshd_config^[\s]*(?i)IgnoreRhosts(?-i)[\s]+no[\s]*(?:|(?:#.*))?$1
Disable SSH Support for User Known Hostsxccdf_org.ssgproject.content_rule_sshd_disable_user_known_hosts medium

Disable SSH Support for User Known Hosts

Rule IDxccdf_org.ssgproject.content_rule_sshd_disable_user_known_hosts
Result
pass
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  CM-6(a), 366, SRG-OS-000480-GPOS-00227, 3.1.12

Description

SSH can allow system users user host-based authentication to connect to systems if a cache of the remote systems public keys are available. This should be disabled.

To ensure this behavior is disabled, add or correct the following line in /etc/ssh/sshd_config:

IgnoreUserKnownHosts yes

Rationale

Configuring this setting for the SSH daemon provides additional assurance that remove login via SSH will require a password, even in the event of misconfiguration elsewhere.

OVAL details

Items found satisfying Tests the value of the IgnoreUserKnownHosts[\s]*(<:nocomment:>*) setting in the /etc/ssh/sshd_config file:

PathContent
/etc/ssh/sshd_configIgnoreUserKnownHosts yes # Per CCE-CCE-80373-4: Set RhostsRSAAuthentication no in /etc/ssh/sshd_config
Disable SSH Support for Rhosts RSA Authenticationxccdf_org.ssgproject.content_rule_sshd_disable_rhosts_rsa medium

Disable SSH Support for Rhosts RSA Authentication

Rule IDxccdf_org.ssgproject.content_rule_sshd_disable_rhosts_rsa
Result
pass
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  CM-6(a), 366, SRG-OS-000480-GPOS-00227, 3.1.12

Description

SSH can allow authentication through the obsolete rsh command through the use of the authenticating user's SSH keys. This should be disabled.

To ensure this behavior is disabled, add or correct the following line in /etc/ssh/sshd_config:

RhostsRSAAuthentication no

Rationale

Configuring this setting for the SSH daemon provides additional assurance that remove login via SSH will require a password, even in the event of misconfiguration elsewhere.

OVAL details

Items found satisfying Tests the value of the RhostsRSAAuthentication[\s]*(<:nocomment:>*) setting in the /etc/ssh/sshd_config file:

PathContent
/etc/ssh/sshd_configRhostsRSAAuthentication no # PermitRootLogin no
Disable Host-Based Authenticationxccdf_org.ssgproject.content_rule_disable_host_auth medium

Disable Host-Based Authentication

Rule IDxccdf_org.ssgproject.content_rule_disable_host_auth
Result
pass
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-3, CM-6(b), 366, SRG-OS-000480-GPOS-00229, 6.2.7, 5.5.6, 3.1.12

Description

SSH's cryptographic host-based authentication is more secure than .rhosts authentication. However, it is not recommended that hosts unilaterally trust one another, even within an organization.

To disable host-based authentication, add or correct the following line in /etc/ssh/sshd_config:

HostbasedAuthentication no

Rationale

SSH trust relationships mean a compromise on one host can allow an attacker to move trivially to other hosts.

OVAL details

Items not found satisfying sshd HostbasedAuthentication:

Object oval:ssg-object_sshd_hostbasedauthentication:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/ssh/sshd_config^[\s]*(?i)HostbasedAuthentication(?-i)[\s]+yes[\s]*(?:|(?:#.*))?$1
Enable Encrypted X11 Fordwardingxccdf_org.ssgproject.content_rule_sshd_enable_x11_forwarding high

Enable Encrypted X11 Fordwarding

Rule IDxccdf_org.ssgproject.content_rule_sshd_enable_x11_forwarding
Result
pass
Time2017-10-21T14:39:59
Severityhigh
Identifiers and References

References:  CM-2(1)(b), 366, SRG-OS-000480-GPOS-00227, 3.1.13

Description

By default, remote X11 connections are not encrypted when initiated by users. SSH has the capability to encrypt remote X11 connections when SSH's X11Forwarding option is enabled.

To enable X11 Forwarding, add or correct the following line in /etc/ssh/sshd_config:

X11Forwarding yes

Rationale

Open X displays allow an attacker to capture keystrokes and to execute commands remotely.

OVAL details

Items found satisfying tests the value of X11Forwarding setting in the /etc/ssh/sshd_config file:

PathContent
/etc/ssh/sshd_configX11Forwarding yes #X11DisplayOffset 10
Disable SSH Access via Empty Passwordsxccdf_org.ssgproject.content_rule_sshd_disable_empty_passwords high

Disable SSH Access via Empty Passwords

Rule IDxccdf_org.ssgproject.content_rule_sshd_disable_empty_passwords
Result
pass
Time2017-10-21T14:39:59
Severityhigh
Identifiers and References

References:  AC-3, AC-6, CM-6(b), 366, SRG-OS-000480-GPOS-00229, 5.5.6, 3.1.1, 3.1.5

Description

To explicitly disallow SSH login from accounts with empty passwords, add or correct the following line in /etc/ssh/sshd_config:

PermitEmptyPasswords no

Any accounts with empty passwords should be disabled immediately, and PAM configuration should prevent users from being able to assign themselves empty passwords.

Rationale

Configuring this setting for the SSH daemon provides additional assurance that remote login via SSH will require a password, even in the event of misconfiguration elsewhere.

OVAL details

Items found satisfying Tests the value of the PermitEmptyPasswords[\s]*(<:nocomment:>*) setting in the /etc/ssh/sshd_config file:

PathContent
/etc/ssh/sshd_configPermitEmptyPasswords no # Per CCE-CCE-27314-4: Set Banner /etc/issue in /etc/ssh/sshd_config
Enable SSH Warning Bannerxccdf_org.ssgproject.content_rule_sshd_enable_warning_banner medium

Enable SSH Warning Banner

Rule IDxccdf_org.ssgproject.content_rule_sshd_enable_warning_banner
Result
pass
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-8(a), AC-8(b), AC-8(c)(1), AC-8(c)(2), AC-8(c)(3), 48, 50, 1384, 1385, 1386, 1387, 1388, SRG-OS-000023-GPOS-00006, SRG-OS-000024-GPOS-00007, SRG-OS-000228-GPOS-00088, 6.2.14, 5.5.6, 3.1.9

Description

To enable the warning banner and ensure it is consistent across the system, add or correct the following line in /etc/ssh/sshd_config:

Banner /etc/issue
Another section contains information on how to create an appropriate system-wide warning banner.

Rationale

The warning message reinforces policy awareness during the logon process and facilitates possible legal action against attackers. Alternatively, systems whose ownership should not be obvious should ensure usage of a banner that does not provide easy attribution.

OVAL details

Items found satisfying Tests the value of the Banner[\s]+/etc/issue setting in the /etc/ssh/sshd_config file:

PathContent
/etc/ssh/sshd_configBanner /etc/issue # Per CCE-CCE-27363-1: Set PermitUserEnvironment no in /etc/ssh/sshd_config
Do Not Allow SSH Environment Optionsxccdf_org.ssgproject.content_rule_sshd_do_not_permit_user_env medium

Do Not Allow SSH Environment Options

Rule IDxccdf_org.ssgproject.content_rule_sshd_do_not_permit_user_env
Result
fail
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  CM-6(b), 366, SRG-OS-000480-GPOS-00229, 6.2.10, 5.5.6, 3.1.12

Description

To ensure users are not able to override environment options to the SSH daemon, add or correct the following line in /etc/ssh/sshd_config:

PermitUserEnvironment no

Rationale

SSH environment options potentially allow users to bypass access restriction in some configurations.

OVAL details

Items not found violating Check value of PermitUserEnvironment in /etc/ssh/sshd_config:

Object oval:ssg-obj_sshd_no_user_envset:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/ssh/sshd_config^[\s]*(?i)PermitUserEnvironment(?-i)[\s]+no[\s]*(?:|(?:#.*))?$1
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable

function replace_or_append {
  local config_file=$1
  local key=$2
  local value=$3
  local cce=$4
  local format=$5

  # Check sanity of the input
  if [ $# -lt "3" ]
  then
        echo "Usage: replace_or_append 'config_file_location' 'key_to_search' 'new_value'"
        echo
        echo "If symlinks need to be taken into account, add yes/no to the last argument"
        echo "to allow to 'follow_symlinks'."
        echo "Aborting."
        exit 1
  fi

  # Test if the config_file is a symbolic link. If so, use --follow-symlinks with sed.
  # Otherwise, regular sed command will do.
  if test -L $config_file; then
    sed_command="sed -i --follow-symlinks"
  else
    sed_command="sed -i"
  fi

  # Test that the cce arg is not empty or does not equal @CCENUM@.
  # If @CCENUM@ exists, it means that there is no CCE assigned.
  if ! [ "x$cce" = x ] && [ "$cce" != '@CCENUM@' ]; then
    cce="CCE-${cce}"
  else
    cce="CCE"
  fi

  # Strip any search characters in the key arg so that the key can be replaced without
  # adding any search characters to the config file.
  stripped_key=$(sed "s/[\^=\$,;+]*//g" <<< $key)

  # If there is no print format specified in the last arg, use the default format.
  if ! [ "x$format" = x ] ; then
    printf -v formatted_output "$format" "$stripped_key" "$value"
  else
    formatted_output="$stripped_key = $value"
  fi

  # If the key exists, change it. Otherwise, add it to the config_file.
  if `grep -qi $key $config_file` ; then
    $sed_command "s/$key.*/$formatted_output/g" $config_file
  else
    # \n is precaution for case where file ends without trailing newline
    echo -e "\n# Per $cce: Set $formatted_output in $config_file" >> $config_file
    echo -e "$formatted_output" >> $config_file
  fi

}

replace_or_append '/etc/ssh/sshd_config' '^PermitUserEnvironment' 'no' 'CCE-27363-1' '%s %s'
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:disable
- name: "SSHD: Do not permit user environment"
  lineinfile:
    create=yes
    dest="/etc/ssh/sshd_config"
    regexp="^PermitUserEnvironment"
    line="PermitUserEnvironment no"
Use Only FIPS 140-2 Validated Ciphersxccdf_org.ssgproject.content_rule_sshd_use_approved_ciphers medium

Use Only FIPS 140-2 Validated Ciphers

Rule IDxccdf_org.ssgproject.content_rule_sshd_use_approved_ciphers
Result
fail
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-3, AC-17(2), AU-10(5), CM-6(b), IA-5(1)(c), IA-7, 68, 366, 803, SRG-OS-000033-GPOS-00014, SRG-OS-000120-GPOS-00061, SRG-OS-000125-GPOS-00065, SRG-OS-000250-GPOS-00093, SRG-OS-000393-GPOS-00173, 6.2.11, 5.5.6, 3.1.13, 3.13.11, 3.13.8

Description

Limit the ciphers to those algorithms which are FIPS-approved. Counter (CTR) mode is also preferred over cipher-block chaining (CBC) mode. The following line in /etc/ssh/sshd_config demonstrates use of FIPS 140-2 validated ciphers:

Ciphers aes128-ctr,aes192-ctr,aes256-ctr


The following ciphers are FIPS 140-2 certified on RHEL 7:
- aes128-ctr
- aes192-ctr
- aes256-ctr
- aes128-cbc
- aes192-cbc
- aes256-cbc
- 3des-cbc
- rijndael-cbc@lysator.liu.se

Any combination of the above ciphers will pass this check. Official FIPS 140-2 paperwork for RHEL7 can be found at http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp2630.pdf.

Rationale

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 system data may be compromised.
Operating 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 industry and government requirements. For government systems, this allows Security Levels 1, 2, 3, or 4 for use on Red Hat Enterprise Linux.

OVAL details

Items found violating tests the value of Ciphers setting in the /etc/ssh/sshd_config file:

PathContent
/etc/ssh/sshd_configCiphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc # Per CCE-CCE-27455-5: Set MACs hmac-sha2-512,hmac-sha2-256,hmac-sha1,hmac-sha1-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com in /etc/ssh/sshd_config
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable

function replace_or_append {
  local config_file=$1
  local key=$2
  local value=$3
  local cce=$4
  local format=$5

  # Check sanity of the input
  if [ $# -lt "3" ]
  then
        echo "Usage: replace_or_append 'config_file_location' 'key_to_search' 'new_value'"
        echo
        echo "If symlinks need to be taken into account, add yes/no to the last argument"
        echo "to allow to 'follow_symlinks'."
        echo "Aborting."
        exit 1
  fi

  # Test if the config_file is a symbolic link. If so, use --follow-symlinks with sed.
  # Otherwise, regular sed command will do.
  if test -L $config_file; then
    sed_command="sed -i --follow-symlinks"
  else
    sed_command="sed -i"
  fi

  # Test that the cce arg is not empty or does not equal @CCENUM@.
  # If @CCENUM@ exists, it means that there is no CCE assigned.
  if ! [ "x$cce" = x ] && [ "$cce" != '@CCENUM@' ]; then
    cce="CCE-${cce}"
  else
    cce="CCE"
  fi

  # Strip any search characters in the key arg so that the key can be replaced without
  # adding any search characters to the config file.
  stripped_key=$(sed "s/[\^=\$,;+]*//g" <<< $key)

  # If there is no print format specified in the last arg, use the default format.
  if ! [ "x$format" = x ] ; then
    printf -v formatted_output "$format" "$stripped_key" "$value"
  else
    formatted_output="$stripped_key = $value"
  fi

  # If the key exists, change it. Otherwise, add it to the config_file.
  if `grep -qi $key $config_file` ; then
    $sed_command "s/$key.*/$formatted_output/g" $config_file
  else
    # \n is precaution for case where file ends without trailing newline
    echo -e "\n# Per $cce: Set $formatted_output in $config_file" >> $config_file
    echo -e "$formatted_output" >> $config_file
  fi

}

replace_or_append '/etc/ssh/sshd_config' '^Ciphers' 'aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc' 'CCE-27295-5' '%s %s'
Use Only FIPS 140-2 Validated MACsxccdf_org.ssgproject.content_rule_sshd_use_approved_macs medium

Use Only FIPS 140-2 Validated MACs

Rule IDxccdf_org.ssgproject.content_rule_sshd_use_approved_macs
Result
fail
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-17(2), IA-7, SC-13, 1453, SRG-OS-000250-GPOS-00093, 3.1.13, 3.13.11, 3.13.8

Description

Limit the MACs to those hash algorithms which are FIPS-approved. The following line in /etc/ssh/sshd_config demonstrates use of FIPS-approved MACs:

MACs hmac-sha2-512,hmac-sha2-256


Only the following message authentication codes are FIPS 140-2 certified on RHEL 7:
- hmac-sha1
- hmac-sha2-256
- hmac-sha2-512
- hmac-sha1-etm@openssh.com
- hmac-sha2-256-etm@openssh.com
- hmac-sha2-512-etm@openssh.com

Any combination of the above MACs will pass this check. Official FIPS 140-2 paperwork for RHEL7 can be found at http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp2630.pdf.

Rationale

DoD Information Systems are required to use FIPS-approved cryptographic hash functions. The only SSHv2 hash algorithms meeting this requirement is SHA2.

OVAL details

Items not found violating tests the value of MACs setting in the /etc/ssh/sshd_config file:

Object oval:ssg-obj_sshd_use_approved_macs:obj:1 of type variable_object
Var ref
oval:ssg-var_sshd_config_macs:var:1
State oval:ssg-ste_sshd_use_approved_macs:ste:1 of type variable_state
Value
hmac-sha2-512hmac-sha2-256hmac-sha1hmac-sha1-etm@openssh.comhmac-sha2-256-etm@openssh.comhmac-sha2-512-etm@openssh.comhmac-sha2-512,hmac-sha2-256,hmac-sha1,hmac-sha1-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.comReferenced variable has no values (oval:ssg-var_sshd_config_macs:var:1).
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:disable

sshd_approved_macs="hmac-sha2-512,hmac-sha2-256,hmac-sha1,hmac-sha1-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com"

function replace_or_append {
  local config_file=$1
  local key=$2
  local value=$3
  local cce=$4
  local format=$5

  # Check sanity of the input
  if [ $# -lt "3" ]
  then
        echo "Usage: replace_or_append 'config_file_location' 'key_to_search' 'new_value'"
        echo
        echo "If symlinks need to be taken into account, add yes/no to the last argument"
        echo "to allow to 'follow_symlinks'."
        echo "Aborting."
        exit 1
  fi

  # Test if the config_file is a symbolic link. If so, use --follow-symlinks with sed.
  # Otherwise, regular sed command will do.
  if test -L $config_file; then
    sed_command="sed -i --follow-symlinks"
  else
    sed_command="sed -i"
  fi

  # Test that the cce arg is not empty or does not equal @CCENUM@.
  # If @CCENUM@ exists, it means that there is no CCE assigned.
  if ! [ "x$cce" = x ] && [ "$cce" != '@CCENUM@' ]; then
    cce="CCE-${cce}"
  else
    cce="CCE"
  fi

  # Strip any search characters in the key arg so that the key can be replaced without
  # adding any search characters to the config file.
  stripped_key=$(sed "s/[\^=\$,;+]*//g" <<< $key)

  # If there is no print format specified in the last arg, use the default format.
  if ! [ "x$format" = x ] ; then
    printf -v formatted_output "$format" "$stripped_key" "$value"
  else
    formatted_output="$stripped_key = $value"
  fi

  # If the key exists, change it. Otherwise, add it to the config_file.
  if `grep -qi $key $config_file` ; then
    $sed_command "s/$key.*/$formatted_output/g" $config_file
  else
    # \n is precaution for case where file ends without trailing newline
    echo -e "\n# Per $cce: Set $formatted_output in $config_file" >> $config_file
    echo -e "$formatted_output" >> $config_file
  fi

}

replace_or_append '/etc/ssh/sshd_config' '^MACs' "$sshd_approved_macs" 'CCE-27455-5' '%s %s'
Use Only Strong Ciphersxccdf_org.ssgproject.content_rule_sshd_use_strong_ciphers medium

Use Only Strong Ciphers

Rule IDxccdf_org.ssgproject.content_rule_sshd_use_strong_ciphers
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References
Description

Limit the ciphers to strong algorithms. Counter (CTR) mode is also preferred over cipher-block chaining (CBC) mode. The following line in /etc/ssh/sshd_config demonstrates use of those ciphers:

Ciphers aes128-ctr,aes192-ctr,aes256-ctr
chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes128-ctr
The man page sshd_config(5) contains a list of supported ciphers.

Rationale

Based on research conducted at various institutions, it was determined that the symmetric portion of the SSH Transport Protocol (as described in RFC 4253) has security weaknesses that allowed recovery of up to 32 bits of plaintext from a block of ciphertext that was encrypted with the Cipher Block Chaining (CBD) method. From that research, new Counter mode algorithms (as described in RFC4344) were designed that are not vulnerable to these types of attacks and these algorithms are now recommended for standard use.

Use Only Strong MACsxccdf_org.ssgproject.content_rule_sshd_use_strong_macs medium

Use Only Strong MACs

Rule IDxccdf_org.ssgproject.content_rule_sshd_use_strong_macs
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References
Description

Limit the MACs to strong hash algorithms. The following line in /etc/ssh/sshd_config demonstrates use of those MACs:

MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160

Rationale

MD5 and 96-bit MAC algorithms are considered weak and have been shown to increase exploitability in SSH downgrade attacks. Weak algorithms continue to have a great deal of attention as a weak spot that can be exploited with expanded computing power. An attacker that breaks the algorithm could take advantage of a MiTM position to decrypt the SSH tunnel and capture credentials and information

Install the OpenSSH Server Packagexccdf_org.ssgproject.content_rule_package_openssh-server_installed medium

Install the OpenSSH Server Package

Rule IDxccdf_org.ssgproject.content_rule_package_openssh-server_installed
Result
pass
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  SC-8, 2418, 2420, 2421, 2422, SRG-OS-000423-GPOS-00187, SRG-OS-000423-GPOS-00188, SRG-OS-000423-GPOS-00189, SRG-OS000423-GPOS-00190

Description

The openssh-server package should be installed. The openssh-server package can be installed with the following command:

$ sudo yum install openssh-server

Rationale

Without protection of the transmitted information, confidentiality, and integrity may be compromised because unprotected communications can be intercepted and either read or altered.

OVAL details

Items found satisfying package openssh-server is installed:

NameArchEpochReleaseVersionEvrSignature keyidExtended name
openssh-serverx86_64(none)11.el77.4p10:7.4p1-11.el724c6a8a7f4a80eb5openssh-server-0:7.4p1-11.el7.x86_64
Enable the OpenSSH Servicexccdf_org.ssgproject.content_rule_service_sshd_enabled medium

Enable the OpenSSH Service

Rule IDxccdf_org.ssgproject.content_rule_service_sshd_enabled
Result
pass
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  SC-8, 2418, 2420, 2421, 2422, SRG-OS-000423-GPOS-00187, SRG-OS-000423-GPOS-00188, SRG-OS-000423-GPOS-00189, SRG-OS000423-GPOS-00190, 3.1.13, 3.5.4, 3.13.8

Description

The SSH server service, sshd, is commonly needed. The sshd service can be enabled with the following command:

$ sudo systemctl enable sshd.service

Rationale

Without protection of the transmitted information, confidentiality, and integrity may be compromised because unprotected communications can be intercepted and either read or altered.

This checklist item applies to both internal and external networks and all types of information system components from which information can be transmitted (e.g., servers, mobile devices, notebook computers, printers, copiers, scanners, etc). Communication paths outside the physical protection of a controlled boundary are exposed to the possibility of interception and modification.

OVAL details

Items found satisfying systemd test:

UnitDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependencyDependency
multi-user.targetbasic.targetsysinit.targetsystemd-journal-catalog-update.servicesystemd-update-utmp.servicelocal-fs.target-.mountboot.mountrhel-readonly.servicesystemd-remount-fs.servicerhel-import-state.servicesystemd-journald.servicesystemd-update-done.serviceplymouth-start.servicelvm2-lvmetad.socketsys-kernel-debug.mountsystemd-random-seed.servicesystemd-firstboot.servicesystemd-ask-password-console.pathcryptsetup.targetsystemd-tmpfiles-setup.serviceplymouth-read-write.servicesystemd-machine-id-commit.servicelvm2-monitor.servicedev-hugepages.mountswap.targetdev-mapper-centos\x2dswap.swapsystemd-tmpfiles-setup-dev.servicesys-fs-fuse-connections.mountsystemd-journal-flush.servicesystemd-udevd.servicesystemd-udev-trigger.serviceproc-sys-fs-binfmt_misc.automountsystemd-binfmt.servicesystemd-hwdb-update.servicelvm2-lvmpolld.socketsys-kernel-config.mountkmod-static-nodes.servicedev-mqueue.mountsystemd-vconsole-setup.servicesystemd-sysctl.servicesystemd-modules-load.serviceslices.targetsystem.slice-.slicesockets.targetsystemd-shutdownd.socketdm-event.socketsystemd-journald.socketsystemd-udevd-control.socketdbus.socketsystemd-initctl.socketpcscd.socketsystemd-udevd-kernel.socketmicrocode.servicerhel-dmesg.servicepaths.targetrhel-autorelabel.servicerhel-autorelabel-mark.serviceselinux-policy-migrate-local-changes@targeted.servicetimers.targetsystemd-tmpfiles-clean.timerrhel-configure.servicerhel-loadmodules.servicedbus.serviceremote-fs.targetpostfix.serviceauditd.servicesystemd-ask-password-wall.pathcrond.servicetuned.servicegetty.targetgetty@tty1.servicesystemd-readahead-replay.servicebrandbot.pathsshd.servicesystemd-update-utmp-runlevel.serviceplymouth-quit-wait.servicersyslog.servicefirewalld.serviceirqbalance.servicekdump.servicechronyd.servicesystemd-logind.serviceplymouth-quit.serviceNetworkManager.servicenetwork.servicesystemd-readahead-collect.servicesystemd-user-sessions.service
Disable SSH Server If Possible (Unusual)xccdf_org.ssgproject.content_rule_service_sshd_disabled low

Disable SSH Server If Possible (Unusual)

Rule IDxccdf_org.ssgproject.content_rule_service_sshd_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

The SSH server service, sshd, is commonly needed. However, if it can be disabled, do so. The sshd service can be disabled with the following command:

$ sudo systemctl disable sshd.service
This is unusual, as SSH is a common method for encrypted and authenticated remote access.

Verify Permissions on SSH Server Public *.pub Key Filesxccdf_org.ssgproject.content_rule_file_permissions_sshd_pub_key medium

Verify Permissions on SSH Server Public *.pub Key Files

Rule IDxccdf_org.ssgproject.content_rule_file_permissions_sshd_pub_key
Result
pass
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-6, 366, SRG-OS-000480-GPOS-00227, 3.1.13, 3.13.10

Description

To properly set the permissions of /etc/ssh/*.pub, run the command:

$ sudo chmod 0644 /etc/ssh/*.pub

Rationale

If a public host key file is modified by an unauthorized user, the SSH service may be compromised.

OVAL details

Items found satisfying Testing file permissions:

PathTypeUIDGIDSize (B)Permissions
/etc/ssh/ssh_host_ed25519_key.pubregular0082rw-r--r-- 
/etc/ssh/ssh_host_rsa_key.pubregular00382rw-r--r-- 
/etc/ssh/ssh_host_ecdsa_key.pubregular00162rw-r--r-- 
Verify Permissions on SSH Server Private *_key Key Filesxccdf_org.ssgproject.content_rule_file_permissions_sshd_private_key medium

Verify Permissions on SSH Server Private *_key Key Files

Rule IDxccdf_org.ssgproject.content_rule_file_permissions_sshd_private_key
Result
pass
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-6, 366, SRG-OS-000480-GPOS-00227, 3.1.13, 3.13.10

Description

To properly set the permissions of /etc/ssh/*_key, run the command:

$ sudo chmod 0640 /etc/ssh/*_key

Rationale

If an unauthorized user obtains the private SSH host key file, the host could be impersonated.

OVAL details

Items found satisfying Testing file permissions:

PathTypeUIDGIDSize (B)Permissions
/etc/ssh/ssh_host_rsa_keyregular09991679rw-r----- 
/etc/ssh/ssh_host_ecdsa_keyregular0999227rw-r----- 
/etc/ssh/ssh_host_ed25519_keyregular0999387rw-r----- 
Remove SSH Server firewalld Firewall exception (Unusual)xccdf_org.ssgproject.content_rule_firewalld_sshd_disabled low

Remove SSH Server firewalld Firewall exception (Unusual)

Rule IDxccdf_org.ssgproject.content_rule_firewalld_sshd_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  3.1.12

Description

By default, inbound connections to SSH's port are allowed. If the SSH server is not being used, this exception should be removed from the firewall configuration.

To configure firewalld to not allow access, run the following command(s):

Rationale

If inbound SSH connections are not expected, disallowing access to the SSH port will avoid possible exploitation of the port by an attacker.

Install the SSSD Packagexccdf_org.ssgproject.content_rule_package_sssd_installed medium

Install the SSSD Package

Rule IDxccdf_org.ssgproject.content_rule_package_sssd_installed
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  IA-5(10), TBD, TBD

Description

The sssd package should be installed. The sssd package can be installed with the following command:

$ sudo yum install sssd

Rationale

Enable the SSSD Servicexccdf_org.ssgproject.content_rule_service_sssd_enabled medium

Enable the SSSD Service

Rule IDxccdf_org.ssgproject.content_rule_service_sssd_enabled
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  IA-5(10), TBD, TBD

Description

The SSSD service should be enabled. The sssd service can be enabled with the following command:

$ sudo systemctl enable sssd.service

Rationale

Configure SSSD's Memory Cache to Expirexccdf_org.ssgproject.content_rule_sssd_memcache_timeout medium

Configure SSSD's Memory Cache to Expire

Rule IDxccdf_org.ssgproject.content_rule_sssd_memcache_timeout
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  IA-5(13), 2007, SRG-OS-000383-GPOS-00166

Description

SSSD's memory cache should be configured to set to expire records after 1 day. To configure SSSD to expire memory cache, set memcache_timeout to 86400 under the [nss] section in /etc/sssd/sssd.conf. For example:

[nss]
memcache_timeout = 86400

Rationale

If cached authentication information is out-of-date, the validity of the authentication information may be questionable.

Configure SSSD to Expire Offline Credentialsxccdf_org.ssgproject.content_rule_sssd_offline_cred_expiration medium

Configure SSSD to Expire Offline Credentials

Rule IDxccdf_org.ssgproject.content_rule_sssd_offline_cred_expiration
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  IA-5(13), 2007, SRG-OS-000383-GPOS-00166

Description

SSSD should be configured to expire offline credentials after 1 day. To configure SSSD to expire offline credentials, set offline_credentials_expiration to 1 under the [pam] section in /etc/sssd/sssd.conf. For example:

[pam]
offline_credentials_expiration = 1

Rationale

If cached authentication information is out-of-date, the validity of the authentication information may be questionable.

Configure SSSD to Expire SSH Known Hostsxccdf_org.ssgproject.content_rule_sssd_ssh_known_hosts_timeout medium

Configure SSSD to Expire SSH Known Hosts

Rule IDxccdf_org.ssgproject.content_rule_sssd_ssh_known_hosts_timeout
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  IA-5(13), 2007, SRG-OS-000383-GPOS-00166, IA-5(13), 2007

Description

SSSD should be configured to expire keys from known SSH hosts after 1 day. To configure SSSD to known SSH hosts, set ssh_known_hosts_timeout to 86400 under the [ssh] section in /etc/sssd/sssd.conf. For example:

[ssh]
ssh_known_hosts_timeout = 86400

Rationale

If cached authentication information is out-of-date, the validity of the authentication information may be questionable.

Configure PAM in SSSD Servicesxccdf_org.ssgproject.content_rule_sssd_enable_pam_services medium

Configure PAM in SSSD Services

Rule IDxccdf_org.ssgproject.content_rule_sssd_enable_pam_services
Result
fail
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  IA-2(11), 1948, 1953, 1954, SRG-OS-000375-GPOS-00160, SRG-OS-000375-GPOS-00161, SRG-OS-000375-GPOS-00162

Description

SSSD should be configured to run SSSD pam services. To configure SSSD to known SSH hosts, add pam to services under the [sssd] section in /etc/sssd/sssd.conf. For example:

[sssd]
services = sudo, autofs, pam

Rationale

Using an authentication device, such as a CAC or token that is separate from the information system, ensures that even if the information system is compromised, that compromise will not affect credentials stored on the authentication device.

OVAL details

Items not found violating check if pam is configured in the services setting of the sssd section:

Object oval:ssg-obj_sssd_enable_pam_services:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/sssd/sssd.conf^[\s]*\[sssd]([^\n]*\n+)+?[\s]*services.*pam.*$1
Disable X Windows Startup By Setting Default Targetxccdf_org.ssgproject.content_rule_xwindows_runlevel_setting medium

Disable X Windows Startup By Setting Default Target

Rule IDxccdf_org.ssgproject.content_rule_xwindows_runlevel_setting
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-17(8).1(ii), 366, SRG-OS-000480-GPOS-00227

Description

Systems that do not require a graphical user interface should only boot by default into multi-user.target mode. This prevents accidental booting of the system into a graphical.target mode. Setting the system's default target to multi-user.target will prevent automatic startup of the X server. To do so, run:

$ systemctl set-default multi-user.target
You should see the following output:
rm '/etc/systemd/system/default.target'
ln -s '/usr/lib/systemd/system/multi-user.target' '/etc/systemd/system/default.target'

Rationale

Services that are not required for system and application processes must not be active to decrease the attack surface of the system. X windows has a long history of security vulnerabilities and should not be used unless approved and documented.

Remove the X Windows Package Groupxccdf_org.ssgproject.content_rule_package_xorg-x11-server-common_removed medium

Remove the X Windows Package Group

Rule IDxccdf_org.ssgproject.content_rule_package_xorg-x11-server-common_removed
Result
pass
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-17(8).1(ii), 366, 3.2, SRG-OS-000480-GPOS-00227

Description

By removing the xorg-x11-server-common package, the system no longer has X Windows installed. If X Windows is not installed then the system cannot boot into graphical user mode. This prevents the system from being accidentally or maliciously booted into a graphical.target mode. To do so, run the following command:

$ sudo yum groupremove "X Window System"
$ sudo yum remove xorg-x11-server-common

Rationale

Unnecessary service packages must not be installed to decrease the attack surface of the system. X windows has a long history of security vulnerabilities and should not be installed unless approved and documented.

OVAL details

Items not found satisfying package xorg-x11-server-common is removed:

Object oval:ssg-obj_package_xorg-x11-server-common_removed:obj:1 of type rpminfo_object
Name
xorg-x11-server-common
Disable Avahi Server Softwarexccdf_org.ssgproject.content_rule_service_avahi-daemon_disabled low

Disable Avahi Server Software

Rule IDxccdf_org.ssgproject.content_rule_service_avahi-daemon_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7, 366, 3.3

Description

The avahi-daemon service can be disabled with the following command:

$ sudo systemctl disable avahi-daemon.service

Rationale

Because the Avahi daemon service keeps an open network port, it is subject to network attacks. Its functionality is convenient but is only appropriate if the local network can be trusted.

Serve Avahi Only via Required Protocolxccdf_org.ssgproject.content_rule_avahi_ip_only low

Serve Avahi Only via Required Protocol

Rule IDxccdf_org.ssgproject.content_rule_avahi_ip_only
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

If you are using only IPv4, edit /etc/avahi/avahi-daemon.conf and ensure the following line exists in the [server] section:

use-ipv6=no
Similarly, if you are using only IPv6, disable IPv4 sockets with the line:
use-ipv4=no

Check Avahi Responses' TTL Fieldxccdf_org.ssgproject.content_rule_avahi_check_ttl low

Check Avahi Responses' TTL Field

Rule IDxccdf_org.ssgproject.content_rule_avahi_check_ttl
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

To make Avahi ignore packets unless the TTL field is 255, edit /etc/avahi/avahi-daemon.conf and ensure the following line appears in the [server] section:

check-response-ttl=yes

Rationale

This helps to ensure that only mDNS responses from the local network are processed, because the TTL field in a packet is decremented from its initial value of 255 whenever it is routed from one network to another. Although a properly-configured router or firewall should not allow mDNS packets into the local network at all, this option provides another check to ensure they are not permitted.

Prevent Other Programs from Using Avahi's Portxccdf_org.ssgproject.content_rule_avahi_prevent_port_sharing low

Prevent Other Programs from Using Avahi's Port

Rule IDxccdf_org.ssgproject.content_rule_avahi_prevent_port_sharing
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

To prevent other mDNS stacks from running, edit /etc/avahi/avahi-daemon.conf and ensure the following line appears in the [server] section:

disallow-other-stacks=yes

Rationale

This helps ensure that only Avahi is responsible for mDNS traffic coming from that port on the system.

Disable Avahi Publishingxccdf_org.ssgproject.content_rule_avahi_disable_publishing low

Disable Avahi Publishing

Rule IDxccdf_org.ssgproject.content_rule_avahi_disable_publishing
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

To prevent other mDNS stacks from running, edit /etc/avahi/avahi-daemon.conf and ensure the following line appears in the [server] section:

disallow-other-stacks=yes

Rationale

This helps ensure that only Avahi is responsible for mDNS traffic coming from that port on the system.

Restrict Information Published by Avahixccdf_org.ssgproject.content_rule_avahi_restrict_published_information low

Restrict Information Published by Avahi

Rule IDxccdf_org.ssgproject.content_rule_avahi_restrict_published_information
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

If it is necessary to publish some information to the network, it should not be joined by any extraneous information, or by information supplied by a non-trusted source on the system. Prevent user applications from using Avahi to publish services by adding or correcting the following line in the [publish] section:

disable-user-service-publishing=yes
Implement as many of the following lines as possible, to restrict the information published by Avahi.
publish-addresses=no
publish-hinfo=no
publish-workstation=no
publish-domain=no
Inspect the files in the directory /etc/avahi/services/. Unless there is an operational need to publish information about each of these services, delete the corresponding file.

Rationale

These options prevent publishing attempts from succeeding, and can be applied even if publishing is disabled entirely via disable-publishing. Alternatively, these can be used to restrict the types of published information in the event that some information must be published.

Disable Printer Browsing Entirely if Possiblexccdf_org.ssgproject.content_rule_cups_disable_browsing low

Disable Printer Browsing Entirely if Possible

Rule IDxccdf_org.ssgproject.content_rule_cups_disable_browsing
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

By default, CUPS listens on the network for printer list broadcasts on UDP port 631. This functionality is called printer browsing. To disable printer browsing entirely, edit the CUPS configuration file, located at /etc/cups/cupsd.conf, to include the following:

Browsing Off
BrowseAllow none

Rationale

The CUPS print service can be configured to broadcast a list of available printers to the network. Other systems on the network, also running the CUPS print service, can be configured to listen to these broadcasts and add and configure these printers for immediate use. By disabling this browsing capability, the system will no longer generate or receive such broadcasts.

Disable Print Server Capabilitiesxccdf_org.ssgproject.content_rule_cups_disable_printserver low

Disable Print Server Capabilities

Rule IDxccdf_org.ssgproject.content_rule_cups_disable_printserver
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

To prevent remote users from potentially connecting to and using locally configured printers, disable the CUPS print server sharing capabilities. To do so, limit how the server will listen for print jobs by removing the more generic port directive from /etc/cups/cupsd.conf:

Port 631
and replacing it with the Listen directive:
Listen localhost:631
This will prevent remote users from printing to locally configured printers while still allowing local users on the system to print normally.

Rationale

By default, locally configured printers will not be shared over the network, but if this functionality has somehow been enabled, these recommendations will disable it again. Be sure to disable outgoing printer list broadcasts, or remote users will still be able to see the locally configured printers, even if they cannot actually print to them. To limit print serving to a particular set of users, use the Policy directive.

Disable the CUPS Servicexccdf_org.ssgproject.content_rule_service_cups_disabled low

Disable the CUPS Service

Rule IDxccdf_org.ssgproject.content_rule_service_cups_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7, 3.4

Description

The cups service can be disabled with the following command:

$ sudo systemctl disable cups.service

Rationale

Turn off unneeded services to reduce attack surface.

Disable DHCP Servicexccdf_org.ssgproject.content_rule_service_dhcpd_disabled medium

Disable DHCP Service

Rule IDxccdf_org.ssgproject.content_rule_service_dhcpd_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  CM-7, 366

Description

The dhcpd service should be disabled on any system that does not need to act as a DHCP server. The dhcpd service can be disabled with the following command:

$ sudo systemctl disable dhcpd.service

Rationale

Unmanaged or unintentionally activated DHCP servers may provide faulty information to clients, interfering with the operation of a legitimate site DHCP server if there is one.

Uninstall DHCP Server Packagexccdf_org.ssgproject.content_rule_package_dhcp_removed medium

Uninstall DHCP Server Package

Rule IDxccdf_org.ssgproject.content_rule_package_dhcp_removed
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  CM-7, 366, 3.5

Description

If the system does not need to act as a DHCP server, the dhcp package can be uninstalled. The dhcp package can be removed with the following command:

$ sudo yum erase dhcp

Rationale

Removing the DHCP server ensures that it cannot be easily or accidentally reactivated and disrupt network operation.

Do Not Use Dynamic DNSxccdf_org.ssgproject.content_rule_dhcp_server_disable_ddns low

Do Not Use Dynamic DNS

Rule IDxccdf_org.ssgproject.content_rule_dhcp_server_disable_ddns
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

To prevent the DHCP server from receiving DNS information from clients, edit /etc/dhcp/dhcpd.conf, and add or correct the following global option:

ddns-update-style none;

Rationale

The Dynamic DNS protocol is used to remotely update the data served by a DNS server. DHCP servers can use Dynamic DNS to publish information about their clients. This setup carries security risks, and its use is not recommended. If Dynamic DNS must be used despite the risks it poses, it is critical that Dynamic DNS transactions be protected using TSIG or some other cryptographic authentication mechanism. See dhcpd.conf(5) for more information about protecting the DHCP server from passing along malicious DNS data from its clients.

Warnings
warning  The ddns-update-style option controls only whether the DHCP server will attempt to act as a Dynamic DNS client. As long as the DNS server itself is correctly configured to reject DDNS attempts, an incorrect ddns-update-style setting on the client is harmless (but should be fixed as a best practice).
Deny Decline Messagesxccdf_org.ssgproject.content_rule_dhcp_server_deny_decline low

Deny Decline Messages

Rule IDxccdf_org.ssgproject.content_rule_dhcp_server_deny_decline
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

Edit /etc/dhcp/dhcpd.conf and add or correct the following global option to prevent the DHCP server from responding the DHCPDECLINE messages, if possible:

deny declines;

Rationale

The DHCPDECLINE message can be sent by a DHCP client to indicate that it does not consider the lease offered by the server to be valid. By issuing many DHCPDECLINE messages, a malicious client can exhaust the DHCP server's pool of IP addresses, causing the DHCP server to forget old address allocations.

Deny BOOTP Queriesxccdf_org.ssgproject.content_rule_dhcp_server_deny_bootp low

Deny BOOTP Queries

Rule IDxccdf_org.ssgproject.content_rule_dhcp_server_deny_bootp
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

Unless your network needs to support older BOOTP clients, disable support for the bootp protocol by adding or correcting the global option:

deny bootp;

Rationale

The bootp option tells dhcpd to respond to BOOTP queries. If support for this simpler protocol is not needed, it should be disabled to remove attack vectors against the DHCP server.

Configure Loggingxccdf_org.ssgproject.content_rule_dhcp_server_configure_logging low

Configure Logging

Rule IDxccdf_org.ssgproject.content_rule_dhcp_server_configure_logging
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  AU-12

Description

Ensure that the following line exists in /etc/rsyslog.conf:

daemon.*           /var/log/daemon.log
Configure logwatch or other log monitoring tools to summarize error conditions reported by the dhcpd process.

Rationale

By default, dhcpd logs notices to the daemon facility. Sending all daemon messages to a dedicated log file is part of the syslog configuration outlined in the Logging and Auditing section

Disable DHCP Clientxccdf_org.ssgproject.content_rule_sysconfig_networking_bootproto_ifcfg low

Disable DHCP Client

Rule IDxccdf_org.ssgproject.content_rule_sysconfig_networking_bootproto_ifcfg
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7, 366

Description

For each interface on the system (e.g. eth0), edit /etc/sysconfig/network-scripts/ifcfg-interface and make the following changes:

  • Correct the BOOTPROTO line to read:
    BOOTPROTO=none
  • Add or correct the following lines, substituting the appropriate values based on your site's addressing scheme:
    NETMASK=255.255.255.0
    IPADDR=192.168.1.2
    GATEWAY=192.168.1.1

Rationale

DHCP relies on trusting the local network. If the local network is not trusted, then it should not be used. However, the automatic configuration provided by DHCP is commonly used and the alternative, manual configuration, presents an unacceptable burden in many circumstances.

Enable the NTP Daemonxccdf_org.ssgproject.content_rule_service_chronyd_or_ntpd_enabled medium

Enable the NTP Daemon

Rule IDxccdf_org.ssgproject.content_rule_service_chronyd_or_ntpd_enabled
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AU-8(1), 160, Req-10.4, 3.6, 3.3.7

Description

The chronyd service can be enabled with the following command:

$ sudo systemctl enable chronyd.service
Note: The chronyd daemon is enabled by default.

The ntpd service can be enabled with the following command:
$ sudo systemctl enable ntpd.service
Note: The ntpd daemon is not enabled by default. Though as mentioned in the previous sections in certain environments the ntpd daemon might be preferred to be used rather than the chronyd one. Refer to: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/ch-Configuring_NTP_Using_the_chrony_Suite.html for guidance which NTP daemon to choose depending on the environment used.

Rationale

Enabling some of chronyd or ntpd services ensures that the NTP daemon will be running and that the system will synchronize its time to any servers specified. This is important whether the system is configured to be a client (and synchronize only its own clock) or it is also acting as an NTP server to other systems. Synchronizing time is essential for authentication services such as Kerberos, but it is also important for maintaining accurate logs and auditing possible security breaches.

The chronyd and ntpd NTP daemons offer all of the functionality of ntpdate, which is now deprecated. Additional information on this is available at http://support.ntp.org/bin/view/Dev/DeprecatingNtpdate

Specify a Remote NTP Serverxccdf_org.ssgproject.content_rule_chronyd_or_ntpd_specify_remote_server medium

Specify a Remote NTP Server

Rule IDxccdf_org.ssgproject.content_rule_chronyd_or_ntpd_specify_remote_server
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AU-8(1), 160, Req-10.4.1, Req-10.4.3, 3.6, 3.3.7

Description

Depending on specific functional requirements of a concrete production environment, the Red Hat Enterprise Linux 7 Server system can be configured to utilize the services of the chronyd NTP daemon (the default), or services of the ntpd NTP daemon. Refer to https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/ch-Configuring_NTP_Using_the_chrony_Suite.html for more detailed comparison of the features of both of the choices, and for further guidance how to choose between the two NTP daemons.
To specify a remote NTP server for time synchronization, perform the following:

  • if the system is configured to use the chronyd as the NTP daemon (the default), edit the file /etc/chrony.conf as follows,
  • if the system is configured to use the ntpd as the NTP daemon, edit the file /etc/ntp.conf as documented below.
Add or correct the following lines, substituting the IP or hostname of a remote NTP server for ntpserver:
server ntpserver
This instructs the NTP software to contact that remote server to obtain time data.

Rationale

Synchronizing with an NTP server makes it possible to collate system logs from multiple sources or correlate computer events with real time events.

Specify Additional Remote NTP Serversxccdf_org.ssgproject.content_rule_chronyd_or_ntpd_specify_multiple_servers low

Specify Additional Remote NTP Servers

Rule IDxccdf_org.ssgproject.content_rule_chronyd_or_ntpd_specify_multiple_servers
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  AU-8(1), Req-10.4.3

Description

Depending on specific functional requirements of a concrete production environment, the Red Hat Enterprise Linux 7 Server system can be configured to utilize the services of the chronyd NTP daemon (the default), or services of the ntpd NTP daemon. Refer to https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/ch-Configuring_NTP_Using_the_chrony_Suite.html for more detailed comparison of the features of both of the choices, and for further guidance how to choose between the two NTP daemons.
Additional NTP servers can be specified for time synchronization. To do so, perform the following:

  • if the system is configured to use the chronyd as the NTP daemon (the default), edit the file /etc/chrony.conf as follows,
  • if the system is configured to use the ntpd as the NTP daemon, edit the file /etc/ntp.conf as documented below.
Add additional lines of the following form, substituting the IP address or hostname of a remote NTP server for ntpserver:
server ntpserver

Rationale

Specifying additional NTP servers increases the availability of accurate time data, in the event that one of the specified servers becomes unavailable. This is typical for a system acting as an NTP server for other systems.

Configure NTP Maxpoll Intervalxccdf_org.ssgproject.content_rule_ntp_set_maxpoll low

Configure NTP Maxpoll Interval

Rule IDxccdf_org.ssgproject.content_rule_ntp_set_maxpoll
Result
fail
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  AU-8(1)(a), 1891, 2046, SRG-OS-000355-GPOS-00143, SRG-OS-000356-GPOS-00144

Description

The maxpoll should be configured to 17 in /etc/ntp.conf to continuously poll NTP servers. To configure maxpoll in /etc/ntp.conf add the following:

maxpoll 17

Rationale

Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate.

OVAL details

Items not found violating check if maxpoll is set in /etc/ntp.conf:

Object oval:ssg-obj_ntp_set_maxpoll:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/ntp.conf^[\s]*maxpoll[\s]+(\d+)$1
State oval:ssg-state_ntp_set_maxpoll:ste:1 of type textfilecontent54_state
Subexpression
17
Disable Postfix Network Listeningxccdf_org.ssgproject.content_rule_postfix_network_listening_disabled medium

Disable Postfix Network Listening

Rule IDxccdf_org.ssgproject.content_rule_postfix_network_listening_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  CM-7, 382, 3.16

Description

Edit the file /etc/postfix/main.cf to ensure that only the following inet_interfaces line appears:

inet_interfaces = localhost

Rationale

This ensures postfix accepts mail messages (such as cron job reports) from the local system only, and not from the network, which protects it from network attack.

Configure SMTP Greeting Bannerxccdf_org.ssgproject.content_rule_postfix_server_banner medium

Configure SMTP Greeting Banner

Rule IDxccdf_org.ssgproject.content_rule_postfix_server_banner
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-22, AU-13

Description

Edit /etc/postfix/main.cf, and add or correct the following line, substituting some other wording for the banner information if you prefer:

smtpd_banner = $myhostname ESMTP

Rationale

The default greeting banner discloses that the listening mail process is Postfix. When remote mail senders connect to the MTA on port 25, they are greeted by an initial banner as part of the SMTP dialogue. This banner is necessary, but it frequently gives away too much information, including the MTA software which is in use, and sometimes also its version number. Remote mail senders do not need this information in order to send mail, so the banner should be changed to reveal only the hostname (which is already known and may be useful) and the word ESMTP, to indicate that the modern SMTP protocol variant is supported.

Enable Postfix Servicexccdf_org.ssgproject.content_rule_service_postfix_enabled low

Enable Postfix Service

Rule IDxccdf_org.ssgproject.content_rule_service_postfix_enabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

The Postfix mail transfer agent is used for local mail delivery within the system. The default configuration only listens for connections to the default SMTP port (port 25) on the loopback interface (127.0.0.1). It is recommended to leave this service enabled for local mail delivery. The postfix service can be enabled with the following command:

$ sudo systemctl enable postfix.service

Rationale

Local mail delivery is essential to some system maintenance and notification tasks.

Uninstall Sendmail Packagexccdf_org.ssgproject.content_rule_package_sendmail_removed medium

Uninstall Sendmail Package

Rule IDxccdf_org.ssgproject.content_rule_package_sendmail_removed
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  CM-7

Description

Sendmail is not the default mail transfer agent and is not installed by default. The sendmail package can be removed with the following command:

$ sudo yum erase sendmail

Rationale

The sendmail software was not developed with security in mind and its design prevents it from being effectively contained by SELinux. Postfix should be used instead.

Configure LDAP Client to Use TLS For All Transactionsxccdf_org.ssgproject.content_rule_ldap_client_start_tls medium

Configure LDAP Client to Use TLS For All Transactions

Rule IDxccdf_org.ssgproject.content_rule_ldap_client_start_tls
Result
pass
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-17(2), CM-7, 1453, SRG-OS-000250-GPOS-00093

Description

This check verifies that RHEL7 implements cryptography to protect the integrity of remote LDAP authentication sessions.

To determine if LDAP is being used for authentication, use the following command:

$ sudo grep -i useldapauth /etc/sysconfig/authconfig


If USELDAPAUTH=yes, then LDAP is being used. To check if LDAP is configured to use TLS, use the following command:
$ sudo grep -i ssl /etc/pam_ldap.conf

Rationale

Without cryptographic integrity protections, information can be altered by unauthorized users without detection. The ssl directive specifies whether to use TLS or not. If not specified it will default to no. It should be set to start_tls rather than doing LDAP over SSL.

OVAL details

Items not found satisfying Tests the value of the ssl start_tls setting in the /etc/nslcd.conf file:

Object oval:ssg-obj_ldap_client_start_tls_ssl:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/nslcd.conf^[\s]*ssl[\s]+start_tls[\s]*$1
Configure Certificate Directives for LDAP Use of TLSxccdf_org.ssgproject.content_rule_ldap_client_tls_cacertpath medium

Configure Certificate Directives for LDAP Use of TLS

Rule IDxccdf_org.ssgproject.content_rule_ldap_client_tls_cacertpath
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  CM-7, 776, 778, 1453

Description

Ensure a copy of a trusted CA certificate has been placed in the file /etc/pki/tls/CA/cacert.pem. Configure LDAP to enforce TLS use and to trust certificates signed by that CA. First, edit the file /etc/nslcd.conf, and add or correct either of the following lines:

tls_cacertdir /etc/pki/tls/CA
or
tls_cacertfile /etc/pki/tls/CA/cacert.pem
Then review the LDAP server and ensure TLS has been configured.

Rationale

The tls_cacertdir or tls_cacertfile directives are required when tls_checkpeer is configured (which is the default for openldap versions 2.1 and up). These directives define the path to the trust certificates signed by the site CA.

Uninstall openldap-servers Packagexccdf_org.ssgproject.content_rule_package_openldap-servers_removed low

Uninstall openldap-servers Package

Rule IDxccdf_org.ssgproject.content_rule_package_openldap-servers_removed
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7, 366, 3.7

Description

The openldap-servers package should be removed if not in use. Is this system the OpenLDAP server? If not, remove the package.

$ sudo yum erase openldap-servers
The openldap-servers RPM is not installed by default on Red Hat Enterprise Linux 7 system. It is needed only by the OpenLDAP server, not by the clients which use LDAP for authentication. If the system is not intended for use as an LDAP Server it should be removed.

Rationale

Unnecessary packages should not be installed to decrease the attack surface of the system. While this software is clearly essential on an LDAP server, it is not necessary on typical desktop or workstation systems.

Disable Network File System Lock Service (nfslock)xccdf_org.ssgproject.content_rule_service_nfslock_disabled low

Disable Network File System Lock Service (nfslock)

Rule IDxccdf_org.ssgproject.content_rule_service_nfslock_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  3.8

Description

The Network File System Lock (nfslock) service starts the required remote procedure call (RPC) processes which allow clients to lock files on the server. If the local system is not configured to mount NFS filesystems then this service should be disabled. The nfslock service can be disabled with the following command:

$ sudo systemctl disable nfslock.service

Disable Secure RPC Client Service (rpcgssd)xccdf_org.ssgproject.content_rule_service_rpcgssd_disabled low

Disable Secure RPC Client Service (rpcgssd)

Rule IDxccdf_org.ssgproject.content_rule_service_rpcgssd_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  3.8

Description

The rpcgssd service manages RPCSEC GSS contexts required to secure protocols that use RPC (most often Kerberos and NFS). The rpcgssd service is the client-side of RPCSEC GSS. If the system does not require secure RPC then this service should be disabled. The rpcgssd service can be disabled with the following command:

$ sudo systemctl disable rpcgssd.service

Disable rpcbind Servicexccdf_org.ssgproject.content_rule_service_rpcbind_disabled low

Disable rpcbind Service

Rule IDxccdf_org.ssgproject.content_rule_service_rpcbind_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  3.8

Description

The rpcbind utility maps RPC services to the ports on which they listen. RPC processes notify rpcbind when they start, registering the ports they are listening on and the RPC program numbers they expect to serve. The rpcbind service redirects the client to the proper port number so it can communicate with the requested service. If the system does not require RPC (such as for NFS servers) then this service should be disabled. The rpcbind service can be disabled with the following command:

$ sudo systemctl disable rpcbind.service

Disable RPC ID Mapping Service (rpcidmapd)xccdf_org.ssgproject.content_rule_service_rpcidmapd_disabled low

Disable RPC ID Mapping Service (rpcidmapd)

Rule IDxccdf_org.ssgproject.content_rule_service_rpcidmapd_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  3.8

Description

The rpcidmapd service is used to map user names and groups to UID and GID numbers on NFSv4 mounts. If NFS is not in use on the local system then this service should be disabled. The rpcidmapd service can be disabled with the following command:

$ sudo systemctl disable rpcidmapd.service

Configure lockd to use static TCP portxccdf_org.ssgproject.content_rule_nfs_fixed_lockd_tcp_port low

Configure lockd to use static TCP port

Rule IDxccdf_org.ssgproject.content_rule_nfs_fixed_lockd_tcp_port
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

Configure the lockd daemon to use a static TCP port as opposed to letting the RPC Bind service dynamically assign a port. Edit the file /etc/sysconfig/nfs. Add or correct the following line:

LOCKD_TCPPORT=lockd-port
Where lockd-port is a port which is not used by any other service on your network.

Rationale

Restrict service to always use a given port, so that firewalling can be done effectively.

Configure lockd to use static UDP portxccdf_org.ssgproject.content_rule_nfs_fixed_lockd_udp_port low

Configure lockd to use static UDP port

Rule IDxccdf_org.ssgproject.content_rule_nfs_fixed_lockd_udp_port
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

Configure the lockd daemon to use a static UDP port as opposed to letting the RPC Bind service dynamically assign a port. Edit the file /etc/sysconfig/nfs. Add or correct the following line:

LOCKD_UDPPORT=lockd-port
Where lockd-port is a port which is not used by any other service on your network.

Rationale

Restricting services to always use a given port enables firewalling to be done more effectively.

Configure statd to use static portxccdf_org.ssgproject.content_rule_nfs_fixed_statd_port low

Configure statd to use static port

Rule IDxccdf_org.ssgproject.content_rule_nfs_fixed_statd_port
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

Configure the statd daemon to use a static port as opposed to letting the RPC Bind service dynamically assign a port. Edit the file /etc/sysconfig/nfs. Add or correct the following line:

STATD_PORT=statd-port
Where statd-port is a port which is not used by any other service on your network.

Rationale

Restricting services to always use a given port enables firewalling to be done more effectively.

Configure mountd to use static portxccdf_org.ssgproject.content_rule_nfs_fixed_mountd_port low

Configure mountd to use static port

Rule IDxccdf_org.ssgproject.content_rule_nfs_fixed_mountd_port
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

Configure the mountd daemon to use a static port as opposed to letting the RPC Bind service dynamically assign a port. Edit the file /etc/sysconfig/nfs. Add or correct the following line:

MOUNTD_PORT=statd-port
Where mountd-port is a port which is not used by any other service on your network.

Rationale

Restricting services to always use a given port enables firewalling to be done more effectively.

Specify UID and GID for Anonymous NFS Connectionsxccdf_org.ssgproject.content_rule_nfs_no_anonymous low

Specify UID and GID for Anonymous NFS Connections

Rule IDxccdf_org.ssgproject.content_rule_nfs_no_anonymous
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

To specify the UID and GID for remote root users, edit the /etc/exports file and add the following for each export:

anonuid=value greater than UID_MAX from /etc/login.defs
anongid=value greater than GID_MAX from /etc/login.defs 
Alternatively, functionally equivalent values of 60001, 65534, 65535 may be used.

Rationale

Specifying the anonymous UID and GID ensures that the remote root user is mapped to a local account which has no permissions on the system.

Disable Network File System (nfs)xccdf_org.ssgproject.content_rule_service_nfs_disabled low

Disable Network File System (nfs)

Rule IDxccdf_org.ssgproject.content_rule_service_nfs_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  AC-3

Description

The Network File System (NFS) service allows remote hosts to mount and interact with shared filesystems on the local system. If the local system is not designated as a NFS server then this service should be disabled. The nfs service can be disabled with the following command:

$ sudo systemctl disable nfs.service

Rationale

Unnecessary services should be disabled to decrease the attack surface of the system.

Disable Secure RPC Server Service (rpcsvcgssd)xccdf_org.ssgproject.content_rule_service_rpcsvcgssd_disabled low

Disable Secure RPC Server Service (rpcsvcgssd)

Rule IDxccdf_org.ssgproject.content_rule_service_rpcsvcgssd_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

The rpcsvcgssd service manages RPCSEC GSS contexts required to secure protocols that use RPC (most often Kerberos and NFS). The rpcsvcgssd service is the server-side of RPCSEC GSS. If the system does not require secure RPC then this service should be disabled. The rpcsvcgssd service can be disabled with the following command:

$ sudo systemctl disable rpcsvcgssd.service

Rationale

Unnecessary services should be disabled to decrease the attack surface of the system.

Mount Remote Filesystems with nodevxccdf_org.ssgproject.content_rule_mount_option_nodev_remote_filesystems medium

Mount Remote Filesystems with nodev

Rule IDxccdf_org.ssgproject.content_rule_mount_option_nodev_remote_filesystems
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  CM-7, MP-2

Description

Add the nodev option to the fourth column of /etc/fstab for the line which controls mounting of any NFS mounts.

Rationale

Legitimate device files should only exist in the /dev directory. NFS mounts should not present device files to users.

Mount Remote Filesystems with nosuidxccdf_org.ssgproject.content_rule_mount_option_nosuid_remote_filesystems medium

Mount Remote Filesystems with nosuid

Rule IDxccdf_org.ssgproject.content_rule_mount_option_nosuid_remote_filesystems
Result
pass
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-6, 366, SRG-OS-000480-GPOS-00227

Description

Add the nosuid option to the fourth column of /etc/fstab for the line which controls mounting of any NFS mounts.

Rationale

NFS mounts should not present suid binaries to users. Only vendor-supplied suid executables should be installed to their default location on the local filesystem.

OVAL details

Items not found satisfying no nfs:

Object oval:ssg-object_no_nfs_defined_etc_fstab_nosuid:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/fstab^\s*\[?[\.\w-:]+\]?:[/\w-]+\s+[/\w-]+\s+nfs[4]?\s+.*$0

Items not found satisfying all nfs has nosuid:

Object oval:ssg-object_nfs_nosuid_etc_fstab:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/fstab^\s*\[?[\.\w-:]+\]?:[/\w-]+\s+[/\w-]+\s+nfs[4]?\s+(.*)$0
State oval:ssg-state_remote_filesystem_nosuid:ste:1 of type textfilecontent54_state
Subexpression
^.*nosuid.*$
Mount Remote Filesystems with noexecxccdf_org.ssgproject.content_rule_mount_option_noexec_remote_filesystems medium

Mount Remote Filesystems with noexec

Rule IDxccdf_org.ssgproject.content_rule_mount_option_noexec_remote_filesystems
Result
pass
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-6, 366, SRG-OS-000480-GPOS-00227

Description

Add the noexec option to the fourth column of /etc/fstab for the line which controls mounting of any NFS mounts.

Rationale

The noexec mount option causes the system not to 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.

OVAL details

Items not found satisfying no nfs:

Object oval:ssg-object_no_nfs_defined_etc_fstab_noexec:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/fstab^\s*\[?[\.\w-:]+\]?:[/\w-]+\s+[/\w-]+\s+nfs[4]?\s+.*$0

Items not found satisfying all nfs has noexec:

Object oval:ssg-object_nfs_noexec_etc_fstab:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/fstab^\s*\[?[\.\w-:]+\]?:[/\w-]+\s+[/\w-]+\s+nfs[4]?\s+(.*)$0
State oval:ssg-state_remote_filesystem_noexec:ste:1 of type textfilecontent54_state
Subexpression
^.*noexec.*$
Mount Remote Filesystems with Kerberos Securityxccdf_org.ssgproject.content_rule_mount_option_krb_sec_remote_filesystems medium

Mount Remote Filesystems with Kerberos Security

Rule IDxccdf_org.ssgproject.content_rule_mount_option_krb_sec_remote_filesystems
Result
pass
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-14(1), 366, SRG-OS-000480-GPOS-00227

Description

Add the sec=krb5:krb5i:krb5p option to the fourth column of /etc/fstab for the line which controls mounting of any NFS mounts.

Rationale

When an NFS server is configured to use AUTH_SYS a selected userid and groupid are used to handle requests from the remote user. The userid and groupid could mistakenly or maliciously be set incorrectly. The AUTH_GSS method of authentication uses certificates on the server and client systems to more securely authenticate the remote mount request.

OVAL details

Items not found satisfying no nfs:

Object oval:ssg-object_no_nfs_defined_etc_fstab_krb_sec:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/fstab^\s*\[?[\.\w-:]+\]?:[/\w-]+\s+[/\w-]+\s+nfs[4]?\s+.*$0

Items not found satisfying all nfs has krb_sec:

Object oval:ssg-object_nfs_krb_sec_etc_fstab:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/fstab^\s*\[?[\.\w-:]+\]?:[/\w-]+\s+[/\w-]+\s+nfs[4]?\s+(.*)$0
State oval:ssg-state_remote_filesystem_krb_sec:ste:1 of type textfilecontent54_state
Subexpression
^.*sec=krb5:krb5i:krb5p.*$
Use Root-Squashing on All Exportsxccdf_org.ssgproject.content_rule_use_root_squashing_all_exports low

Use Root-Squashing on All Exports

Rule IDxccdf_org.ssgproject.content_rule_use_root_squashing_all_exports
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

If a filesystem is exported using root squashing, requests from root on the client are considered to be unprivileged (mapped to a user such as nobody). This provides some mild protection against remote abuse of an NFS server. Root squashing is enabled by default, and should not be disabled.

Ensure that no line in /etc/exports contains the option no_root_squash.

Rationale

If the NFS server allows root access to local file systems from remote hosts, this access could be used to compromise the system.

Restrict NFS Clients to Privileged Portsxccdf_org.ssgproject.content_rule_restrict_nfs_clients_to_privileged_ports low

Restrict NFS Clients to Privileged Ports

Rule IDxccdf_org.ssgproject.content_rule_restrict_nfs_clients_to_privileged_ports
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  AC-3

Description

By default, the server NFS implementation requires that all client requests be made from ports less than 1024. If your organization has control over systems connected to its network, and if NFS requests are prohibited at the border firewall, this offers some protection against malicious requests from unprivileged users. Therefore, the default should not be changed.

To ensure that the default has not been changed, ensure no line in /etc/exports contains the option insecure.

Rationale

Allowing client requests to be made from ports higher than 1024 could allow a unprivileged user to initiate an NFS connection. If the unprivileged user account has been compromised, an attacker could gain access to data on the NFS server.

Ensure Insecure File Locking is Not Allowedxccdf_org.ssgproject.content_rule_no_insecure_locks_exports medium

Ensure Insecure File Locking is Not Allowed

Rule IDxccdf_org.ssgproject.content_rule_no_insecure_locks_exports
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  764

Description

By default the NFS server requires secure file-lock requests, which require credentials from the client in order to lock a file. Most NFS clients send credentials with file lock requests, however, there are a few clients that do not send credentials when requesting a file-lock, allowing the client to only be able to lock world-readable files. To get around this, the insecure_locks option can be used so these clients can access the desired export. This poses a security risk by potentially allowing the client access to data for which it does not have authorization. Remove any instances of the insecure_locks option from the file /etc/exports.

Rationale

Allowing insecure file locking could allow for sensitive data to be viewed or edited by an unauthorized user.

Use Kerberos Security on All Exportsxccdf_org.ssgproject.content_rule_use_kerberos_security_all_exports medium

Use Kerberos Security on All Exports

Rule IDxccdf_org.ssgproject.content_rule_use_kerberos_security_all_exports
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  AC-14(1), 366, SRG-OS-000480-GPOS-00227

Description

Using Kerberos on all exported mounts prevents a malicious client or user from impersonating a system user. To cryptography authenticate users to the NFS server, add sec=krb5:krb5i:krb5p to each export in /etc/exports.

Rationale

When an NFS server is configured to use AUTH_SYS a selected userid and groupid are used to handle requests from the remote user. The userid and groupid could mistakenly or maliciously be set incorrectly. The AUTH_GSS method of authentication uses certificates on the server and client systems to more securely authenticate the remote mount request.

Disable DNS Serverxccdf_org.ssgproject.content_rule_service_named_disabled low

Disable DNS Server

Rule IDxccdf_org.ssgproject.content_rule_service_named_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7, 366

Description

The named service can be disabled with the following command:

$ sudo systemctl disable named.service

Rationale

All network services involve some risk of compromise due to implementation flaws and should be disabled if possible.

Uninstall bind Packagexccdf_org.ssgproject.content_rule_package_bind_removed low

Uninstall bind Package

Rule IDxccdf_org.ssgproject.content_rule_package_bind_removed
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7, 366, 3.9

Description

To remove the bind package, which contains the named service, run the following command:

$ sudo yum erase bind

Rationale

If there is no need to make DNS server software available, removing it provides a safeguard against its activation.

Disable Zone Transfers from the Nameserverxccdf_org.ssgproject.content_rule_dns_server_disable_zone_transfers low

Disable Zone Transfers from the Nameserver

Rule IDxccdf_org.ssgproject.content_rule_dns_server_disable_zone_transfers
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

Is it necessary for a secondary nameserver to receive zone data via zone transfer from the primary server? If not, follow the instructions in this section. If so, see the next section for instructions on protecting zone transfers. Add or correct the following directive within /etc/named.conf:

options {
  allow-transfer { none; };
  ...
}

Rationale

If both the primary and secondary nameserver are under your control, or if you have only one nameserver, it may be possible to use an external configuration management mechanism to distribute zone updates. In that case, it is not necessary to allow zone transfers within BIND itself, so they should be disabled to avoid the potential for abuse.

Authenticate Zone Transfersxccdf_org.ssgproject.content_rule_dns_server_authenticate_zone_transfers low

Authenticate Zone Transfers

Rule IDxccdf_org.ssgproject.content_rule_dns_server_authenticate_zone_transfers
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

If it is necessary for a secondary nameserver to receive zone data via zone transfer from the primary server, follow the instructions here. Use dnssec-keygen to create a symmetric key file in the current directory:

$ cd /tmp
$ sudo dnssec-keygen -a HMAC-MD5 -b 128 -n HOST dns.example.com
Kdns.example.com .+aaa +iiiii
This output is the name of a file containing the new key. Read the file to find the base64-encoded key string:
$ sudo cat Kdns.example.com .+NNN +MMMMM .key
dns.example.com IN KEY 512 3 157 base64-key-string
Add the directives to /etc/named.conf on the primary server:
key zone-transfer-key {
  algorithm hmac-md5;
  secret "base64-key-string ";
};
zone "example.com " IN {
  type master;
  allow-transfer { key zone-transfer-key; };
  ...
};
Add the directives below to /etc/named.conf on the secondary nameserver:
key zone-transfer-key {
  algorithm hmac-md5;
  secret "base64-key-string ";
};

server IP-OF-MASTER {
  keys { zone-transfer-key; };
};

zone "example.com " IN {
  type slave;
  masters { IP-OF-MASTER ; };
  ...
};

Rationale

The BIND transaction signature (TSIG) functionality allows primary and secondary nameservers to use a shared secret to verify authorization to perform zone transfers. This method is more secure than using IP-based limiting to restrict nameserver access, since IP addresses can be easily spoofed. However, if you cannot configure TSIG between your servers because, for instance, the secondary nameserver is not under your control and its administrators are unwilling to configure TSIG, you can configure an allow-transfer directive with numerical IP addresses or ACLs as a last resort.

Warnings
warning  The purpose of the dnssec-keygen command is to create the shared secret string base64-key-string. Once this secret has been obtained and inserted into named.conf on the primary and secondary servers, the key files Kdns.example.com .+NNN +MMMMM .key and Kdns.example.com .+NNN +MMMMM .private are no longer needed, and may safely be deleted.
Disable Dynamic Updatesxccdf_org.ssgproject.content_rule_dns_server_disable_dynamic_updates low

Disable Dynamic Updates

Rule IDxccdf_org.ssgproject.content_rule_dns_server_disable_dynamic_updates
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

Is there a mission-critical reason to enable the risky dynamic update functionality? If not, edit /etc/named.conf. For each zone specification, correct the following directive if necessary:

zone "example.com " IN {
  allow-update { none; };
  ...
};

Rationale

Dynamic updates allow remote servers to add, delete, or modify any entries in your zone file. Therefore, they should be considered highly risky, and disabled unless there is a very good reason for their use. If dynamic updates must be allowed, IP-based ACLs are insufficient protection, since they are easily spoofed. Instead, use TSIG keys (see the previous section for an example), and consider using the update-policy directive to restrict changes to only the precise type of change needed.

Disable vsftpd Servicexccdf_org.ssgproject.content_rule_service_vsftpd_disabled low

Disable vsftpd Service

Rule IDxccdf_org.ssgproject.content_rule_service_vsftpd_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7, 1436

Description

The vsftpd service can be disabled with the following command:

$ sudo systemctl disable vsftpd.service

Rationale

Running FTP server software provides a network-based avenue of attack, and should be disabled if not needed. Furthermore, the FTP protocol is unencrypted and creates a risk of compromising sensitive information.

Uninstall vsftpd Packagexccdf_org.ssgproject.content_rule_package_vsftpd_removed high

Uninstall vsftpd Package

Rule IDxccdf_org.ssgproject.content_rule_package_vsftpd_removed
Result
pass
Time2017-10-21T14:39:59
Severityhigh
Identifiers and References

References:  CM-6(b), CM-7, 366, SRG-OS-000480-GPOS-00227, 3.10

Description

The vsftpd package can be removed with the following command:

$ sudo yum erase vsftpd

Rationale

Removing the vsftpd package decreases the risk of its accidental activation.

OVAL details

Items not found satisfying package vsftpd is removed:

Object oval:ssg-obj_package_vsftpd_removed:obj:1 of type rpminfo_object
Name
vsftpd
Install vsftpd Packagexccdf_org.ssgproject.content_rule_package_vsftpd_installed low

Install vsftpd Package

Rule IDxccdf_org.ssgproject.content_rule_package_vsftpd_installed
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

If this system must operate as an FTP server, install the vsftpd package via the standard channels.

$ sudo yum install vsftpd

Rationale

After Red Hat Enterprise Linux 2.1, Red Hat switched from distributing wu-ftpd with Red Hat Enterprise Linux to distributing vsftpd. For security and for consistency with future Red Hat releases, the use of vsftpd is recommended.

Restrict Access to Anonymous Users if Possiblexccdf_org.ssgproject.content_rule_ftp_restrict_to_anon low

Restrict Access to Anonymous Users if Possible

Rule IDxccdf_org.ssgproject.content_rule_ftp_restrict_to_anon
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7, AC-3

Description

Is there a mission-critical reason for users to transfer files to/from their own accounts using FTP, rather than using a secure protocol like SCP/SFTP? If not, edit the vsftpd configuration file. Add or correct the following configuration option:

local_enable=NO
If non-anonymous FTP logins are necessary, follow the guidance in the remainder of this section to secure these logins as much as possible.

Rationale

The use of non-anonymous FTP logins is strongly discouraged. Since SSH clients and servers are widely available, and since SSH provides support for a transfer mode which resembles FTP in user interface, there is no good reason to allow password-based FTP access.

Enable Logging of All FTP Transactionsxccdf_org.ssgproject.content_rule_ftp_log_transactions low

Enable Logging of All FTP Transactions

Rule IDxccdf_org.ssgproject.content_rule_ftp_log_transactions
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

Add or correct the following configuration options within the vsftpd configuration file, located at /etc/vsftpd/vsftpd.conf:

xferlog_enable=YES
xferlog_std_format=NO
log_ftp_protocol=YES

Rationale

To trace malicious activity facilitated by the FTP service, it must be configured to ensure that all commands sent to the FTP server are logged using the verbose vsftpd log format. The default vsftpd log file is /var/log/vsftpd.log.

Warnings
warning  If verbose logging to vsftpd.log is done, sparse logging of downloads to /var/log/xferlog will not also occur. However, the information about what files were downloaded is included in the information logged to vsftpd.log
Create Warning Banners for All FTP Usersxccdf_org.ssgproject.content_rule_ftp_present_banner medium

Create Warning Banners for All FTP Users

Rule IDxccdf_org.ssgproject.content_rule_ftp_present_banner
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  48

Description

Edit the vsftpd configuration file, which resides at /etc/vsftpd/vsftpd.conf by default. Add or correct the following configuration options:

banner_file=/etc/issue

Rationale

This setting will cause the system greeting banner to be used for FTP connections as well.

Disable FTP Uploads if Possiblexccdf_org.ssgproject.content_rule_ftp_disable_uploads low

Disable FTP Uploads if Possible

Rule IDxccdf_org.ssgproject.content_rule_ftp_disable_uploads
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

Is there a mission-critical reason for users to upload files via FTP? If not, edit the vsftpd configuration file to add or correct the following configuration options:

write_enable=NO
If FTP uploads are necessary, follow the guidance in the remainder of this section to secure these transactions as much as possible.

Rationale

Anonymous FTP can be a convenient way to make files available for universal download. However, it is less common to have a need to allow unauthenticated users to place files on the FTP server. If this must be done, it is necessary to ensure that files cannot be uploaded and downloaded from the same directory.

Place the FTP Home Directory on its Own Partitionxccdf_org.ssgproject.content_rule_ftp_home_partition low

Place the FTP Home Directory on its Own Partition

Rule IDxccdf_org.ssgproject.content_rule_ftp_home_partition
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

By default, the anonymous FTP root is the home directory of the FTP user account. The df command can be used to verify that this directory is on its own partition.

Rationale

If there is a mission-critical reason for anonymous users to upload files, precautions must be taken to prevent these users from filling a disk used by other services.

Disable httpd Servicexccdf_org.ssgproject.content_rule_service_httpd_disabled low

Disable httpd Service

Rule IDxccdf_org.ssgproject.content_rule_service_httpd_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

The httpd service can be disabled with the following command:

$ sudo systemctl disable httpd.service

Rationale

Running web server software provides a network-based avenue of attack, and should be disabled if not needed.

Uninstall httpd Packagexccdf_org.ssgproject.content_rule_package_httpd_removed low

Uninstall httpd Package

Rule IDxccdf_org.ssgproject.content_rule_package_httpd_removed
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7, 3.11

Description

The httpd package can be removed with the following command:

$ sudo yum erase httpd

Rationale

If there is no need to make the web server software available, removing it provides a safeguard against its activation.

Set httpd ServerTokens Directive to Prodxccdf_org.ssgproject.content_rule_httpd_servertokens_prod low

Set httpd ServerTokens Directive to Prod

Rule IDxccdf_org.ssgproject.content_rule_httpd_servertokens_prod
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

ServerTokens Prod restricts information in page headers, returning only the word "Apache."

Add or correct the following directive in /etc/httpd/conf/httpd.conf:

ServerTokens Prod

Rationale

Information disclosed to clients about the configuration of the web server and system could be used to plan an attack on the given system. This information disclosure should be restricted to a minimum.

Set httpd ServerSignature Directive to Offxccdf_org.ssgproject.content_rule_httpd_serversignature_off low

Set httpd ServerSignature Directive to Off

Rule IDxccdf_org.ssgproject.content_rule_httpd_serversignature_off
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

ServerSignature Off restricts httpd from displaying server version number on error pages.

Add or correct the following directive in /etc/httpd/conf/httpd.conf:

ServerSignature Off

Rationale

Information disclosed to clients about the configuration of the web server and system could be used to plan an attack on the given system. This information disclosure should be restricted to a minimum.

Disable HTTP Digest Authenticationxccdf_org.ssgproject.content_rule_httpd_digest_authentication low

Disable HTTP Digest Authentication

Rule IDxccdf_org.ssgproject.content_rule_httpd_digest_authentication
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

The auth_digest module provides encrypted authentication sessions. If this functionality is unnecessary, comment out the related module:

#LoadModule auth_digest_module modules/mod_auth_digest.so

Rationale

Minimizing the number of loadable modules available to the web server reduces risk by limiting the capabilities allowed by the web server.

Disable HTTP mod_rewritexccdf_org.ssgproject.content_rule_httpd_mod_rewrite low

Disable HTTP mod_rewrite

Rule IDxccdf_org.ssgproject.content_rule_httpd_mod_rewrite
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

The mod_rewrite module is very powerful and can protect against certain classes of web attacks. However, it is also very complex and has a significant history of vulnerabilities itself. If its functionality is unnecessary, comment out the related module:

#LoadModule rewrite_module modules/mod_rewrite.so

Rationale

Minimizing the number of loadable modules available to the web server reduces risk by limiting the capabilities allowed by the web server.

Disable LDAP Supportxccdf_org.ssgproject.content_rule_httpd_ldap_support low

Disable LDAP Support

Rule IDxccdf_org.ssgproject.content_rule_httpd_ldap_support
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

The ldap module provides HTTP authentication via an LDAP directory. If its functionality is unnecessary, comment out the related modules:

#LoadModule ldap_module modules/mod_ldap.so
#LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
If LDAP is to be used, SSL encryption should be used as well.

Rationale

Minimizing the number of loadable modules available to the web server reduces risk by limiting the capabilities allowed by the web server.

Disable Server Side Includesxccdf_org.ssgproject.content_rule_httpd_server_side_includes low

Disable Server Side Includes

Rule IDxccdf_org.ssgproject.content_rule_httpd_server_side_includes
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

Server Side Includes provide a method of dynamically generating web pages through the insertion of server-side code. However, the technology is also deprecated and introduces significant security concerns. If this functionality is unnecessary, comment out the related module:

#LoadModule include_module modules/mod_include.so
If there is a critical need for Server Side Includes, they should be enabled with the option IncludesNoExec to prevent arbitrary code execution. Additionally, user supplied data should be encoded to prevent cross-site scripting vulnerabilities.

Rationale

Minimizing the number of loadable modules available to the web server reduces risk by limiting the capabilities allowed by the web server.

Disable MIME Magicxccdf_org.ssgproject.content_rule_httpd_mime_magic low

Disable MIME Magic

Rule IDxccdf_org.ssgproject.content_rule_httpd_mime_magic
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

The mime_magic module provides a second layer of MIME support that in most configurations is likely extraneous. If its functionality is unnecessary, comment out the related module:

#LoadModule mime_magic_module modules/mod_mime_magic.so

Rationale

Minimizing the number of loadable modules available to the web server reduces risk by limiting the capabilities allowed by the web server.

Disable WebDAV (Distributed Authoring and Versioning)xccdf_org.ssgproject.content_rule_httpd_webdav low

Disable WebDAV (Distributed Authoring and Versioning)

Rule IDxccdf_org.ssgproject.content_rule_httpd_webdav
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

WebDAV is an extension of the HTTP protocol that provides distributed and collaborative access to web content. If its functionality is unnecessary, comment out the related modules:

#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
If there is a critical need for WebDAV, extra care should be taken in its configuration. Since DAV access allows remote clients to manipulate server files, any location on the server that is DAV enabled should be protected by access controls.

Rationale

Minimizing the number of loadable modules available to the web server, reduces risk by limiting the capabilities allowed by the web server.

Disable Server Activity Statusxccdf_org.ssgproject.content_rule_httpd_server_activity_status low

Disable Server Activity Status

Rule IDxccdf_org.ssgproject.content_rule_httpd_server_activity_status
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

The status module provides real-time access to statistics on the internal operation of the web server. This may constitute an unnecessary information leak and should be disabled unless necessary. To do so, comment out the related module:

#LoadModule status_module modules/mod_status.so
If there is a critical need for this module, ensure that access to the status page is properly restricted to a limited set of hosts in the status handler configuration.

Rationale

Minimizing the number of loadable modules available to the web server reduces risk by limiting the capabilities allowed by the web server.

Disable Web Server Configuration Displayxccdf_org.ssgproject.content_rule_httpd_server_configuration_display low

Disable Web Server Configuration Display

Rule IDxccdf_org.ssgproject.content_rule_httpd_server_configuration_display
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

The info module creates a web page illustrating the configuration of the web server. This can create an unnecessary security leak and should be disabled. If its functionality is unnecessary, comment out the module:

#LoadModule info_module modules/mod_info.so
If there is a critical need for this module, use the Location directive to provide an access control list to restrict access to the information.

Rationale

Minimizing the number of loadable modules available to the web server reduces risk by limiting the capabilities allowed by the web server.

Disable URL Correction on Misspelled Entriesxccdf_org.ssgproject.content_rule_httpd_url_correction low

Disable URL Correction on Misspelled Entries

Rule IDxccdf_org.ssgproject.content_rule_httpd_url_correction
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

The speling module attempts to find a document match by allowing one misspelling in an otherwise failed request. If this functionality is unnecessary, comment out the module:

#LoadModule speling_module modules/mod_speling.so
This functionality weakens server security by making site enumeration easier.

Rationale

Minimizing the number of loadable modules available to the web server reduces risk by limiting the capabilities allowed by the web server.

Disable Proxy Supportxccdf_org.ssgproject.content_rule_httpd_proxy_support low

Disable Proxy Support

Rule IDxccdf_org.ssgproject.content_rule_httpd_proxy_support
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

The proxy module provides proxying support, allowing httpd to forward requests and serve as a gateway for other servers. If its functionality is unnecessary, comment out the module:

#LoadModule proxy_module modules/mod_proxy.so
If proxy support is needed, load mod_proxy and the appropriate proxy protocol handler module (one of mod_proxy_http, mod_proxy_ftp, or mod_proxy_connect). Additionally, make certain that a server is secure before enabling proxying, as open proxy servers are a security risk. mod_proxy_balancer enables load balancing, but requires that mod status be enabled.

Rationale

Minimizing the number of loadable modules available to the web server reduces risk by limiting the capabilities allowed by the web server.

Disable Cache Supportxccdf_org.ssgproject.content_rule_httpd_cache_support low

Disable Cache Support

Rule IDxccdf_org.ssgproject.content_rule_httpd_cache_support
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

The cache module allows httpd to cache data, optimizing access to frequently accessed content. However, it introduces potential security flaws such as the possibility of circumventing Allow and Deny directives.

If this functionality is unnecessary, comment out the module:

#LoadModule cache_module modules/mod_cache.so
If caching is required, it should not be enabled for any limited-access content.

Rationale

Minimizing the number of loadable modules available to the web server reduces risk by limiting the capabilities allowed by the web server.

Disable CGI Supportxccdf_org.ssgproject.content_rule_httpd_cgi_support low

Disable CGI Support

Rule IDxccdf_org.ssgproject.content_rule_httpd_cgi_support
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

The cgi module allows HTML to interact with the CGI web programming language.

If this functionality is unnecessary, comment out the module:

#LoadModule cgi_module modules/mod_cgi.so
If the web server requires the use of CGI, enable mod_cgi.

Rationale

Minimizing the number of loadable modules available to the web server reduces risk by limiting the capabilities allowed by the web server.

Restrict Root Directoryxccdf_org.ssgproject.content_rule_httpd_restrict_root_directory low

Restrict Root Directory

Rule IDxccdf_org.ssgproject.content_rule_httpd_restrict_root_directory
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

The httpd root directory should always have the most restrictive configuration enabled.

<Directory / >
   Options None
   AllowOverride None
   Order allow,deny
</Directory>

Rationale

The Web Server's root directory content should be protected from unauthorized access by web clients.

Restrict Web Directoryxccdf_org.ssgproject.content_rule_httpd_restrict_web_directory low

Restrict Web Directory

Rule IDxccdf_org.ssgproject.content_rule_httpd_restrict_web_directory
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

The default configuration for the web (/var/www/html) Directory allows directory indexing (Indexes) and the following of symbolic links (FollowSymLinks). Neither of these is recommended.

The /var/www/html directory hierarchy should not be viewable via the web, and symlinks should only be followed if the owner of the symlink also owns the linked file.

Ensure that this policy is adhered to by altering the related section of the configuration:

<Directory "/var/www/html">
#  ...
   Options SymLinksIfOwnerMatch
#  ...
</Directory>

Rationale

Access to the web server's directory hierarchy could allow access to unauthorized files by web clients. Following symbolic links could also allow such access.

Restrict Other Critical Directoriesxccdf_org.ssgproject.content_rule_httpd_restrict_critical_directories low

Restrict Other Critical Directories

Rule IDxccdf_org.ssgproject.content_rule_httpd_restrict_critical_directories
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

All accessible web directories should be configured with similarly restrictive settings. The Options directive should be limited to necessary functionality and the AllowOverride directive should be used only if needed. The Order and Deny access control tags should be used to deny access by default, allowing access only where necessary.

Rationale

Directories accessible from a web client should be configured with the least amount of access possible in order to avoid unauthorized access to restricted content or server information.

Limit Available Methodsxccdf_org.ssgproject.content_rule_httpd_limit_available_methods low

Limit Available Methods

Rule IDxccdf_org.ssgproject.content_rule_httpd_limit_available_methods
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

Web server methods are defined in section 9 of RFC 2616 (http://www.ietf.org/rfc/rfc2616.txt). If a web server does not require the implementation of all available methods, they should be disabled.

Note: GET and POST are the most common methods. A majority of the others are limited to the WebDAV protocol.

<Directory /var/www/html>
# ...
   # Only allow specific methods (this command is case-sensitive!)
   <LimitExcept GET POST>
      Order allow,deny
   </LimitExcept>
# ...
</Directory>

Rationale

Minimizing the number of available methods to the web client reduces risk by limiting the capabilities allowed by the web server.

Install mod_sslxccdf_org.ssgproject.content_rule_httpd_install_mod_ssl low

Install mod_ssl

Rule IDxccdf_org.ssgproject.content_rule_httpd_install_mod_ssl
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

Install the mod_ssl module:

$ sudo yum install mod_ssl

Rationale

mod_ssl provides encryption capabilities for the httpd Web server. Unencrypted content is transmitted in plain text which could be passively monitored and accessed by unauthorized parties.

Install mod_securityxccdf_org.ssgproject.content_rule_httpd_install_mod_security low

Install mod_security

Rule IDxccdf_org.ssgproject.content_rule_httpd_install_mod_security
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

Install the security module:

$ sudo yum install mod_security

Rationale

mod_security provides an additional level of protection for the web server by enabling the administrator to implement content access policies and filters at the application layer.

Set Permissions on the /var/log/httpd/ Directoryxccdf_org.ssgproject.content_rule_dir_perms_var_log_httpd low

Set Permissions on the /var/log/httpd/ Directory

Rule IDxccdf_org.ssgproject.content_rule_dir_perms_var_log_httpd
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

Ensure that the permissions on the web server log directory is set to 700:

$ sudo chmod 700 /var/log/httpd/
This is its default setting.

Rationale

Access to the web server's log files may allow an unauthorized user or attacker to access information about the web server or alter the server's log files.

Set Permissions on the /etc/httpd/conf/ Directoryxccdf_org.ssgproject.content_rule_dir_perms_etc_httpd_conf low

Set Permissions on the /etc/httpd/conf/ Directory

Rule IDxccdf_org.ssgproject.content_rule_dir_perms_etc_httpd_conf
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

To properly set the permissions of /etc/http/conf, run the command:

$ sudo chmod 0750 /etc/http/conf

Rationale

Access to the web server's configuration files may allow an unauthorized user or attacker to access information about the web server or alter the server's configuration files.

Set Permissions on All Configuration Files Inside /etc/httpd/conf/xccdf_org.ssgproject.content_rule_file_permissions_httpd_server_conf_files low

Set Permissions on All Configuration Files Inside /etc/httpd/conf/

Rule IDxccdf_org.ssgproject.content_rule_file_permissions_httpd_server_conf_files
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

To properly set the permissions of /etc/http/conf/*, run the command:

$ sudo chmod 0640 /etc/http/conf/*

Rationale

Access to the web server's configuration files may allow an unauthorized user or attacker to access information about the web server or to alter the server's configuration files.

Set Permissions on All Configuration Files Inside /etc/httpd/conf.d/xccdf_org.ssgproject.content_rule_file_permissions_httpd_server_conf_d_files low

Set Permissions on All Configuration Files Inside /etc/httpd/conf.d/

Rule IDxccdf_org.ssgproject.content_rule_file_permissions_httpd_server_conf_d_files
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

To properly set the permissions of /etc/http/conf.d/*, run the command:

$ sudo chmod 0640 /etc/http/conf.d/*

Rationale

Access to the web server's configuration files may allow an unauthorized user or attacker to access information about the web server or to alter the server's configuration files.

Set Permissions on All Configuration Files Inside /etc/httpd/conf.modules.d/xccdf_org.ssgproject.content_rule_file_permissions_httpd_server_modules_files low

Set Permissions on All Configuration Files Inside /etc/httpd/conf.modules.d/

Rule IDxccdf_org.ssgproject.content_rule_file_permissions_httpd_server_modules_files
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  CM-7

Description

To properly set the permissions of /etc/http/conf.modules.d/*, run the command:

$ sudo chmod 0640 /etc/http/conf.modules.d/*

Rationale

Access to the web server's configuration files may allow an unauthorized user or attacker to access information about the web server or to alter the server's configuration files.

Disable Dovecot Servicexccdf_org.ssgproject.content_rule_service_dovecot_disabled low

Disable Dovecot Service

Rule IDxccdf_org.ssgproject.content_rule_service_dovecot_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

The dovecot service can be disabled with the following command:

$ sudo systemctl disable dovecot.service

Rationale

Running an IMAP or POP3 server provides a network-based avenue of attack, and should be disabled if not needed.

Uninstall dovecot Packagexccdf_org.ssgproject.content_rule_package_dovecot_removed low

Uninstall dovecot Package

Rule IDxccdf_org.ssgproject.content_rule_package_dovecot_removed
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  3.12

Description

The dovecot package can be uninstalled with the following command:

$ sudo yum erase dovecot

Rationale

If there is no need to make the Dovecot software available, removing it provides a safeguard against its activation.

Enable the SSL flag in /etc/dovecot.confxccdf_org.ssgproject.content_rule_dovecot_enable_ssl low

Enable the SSL flag in /etc/dovecot.conf

Rule IDxccdf_org.ssgproject.content_rule_dovecot_enable_ssl
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

To allow clients to make encrypted connections the ssl flag in Dovecot's configuration file needs to be set to yes.

Edit /etc/dovecot/conf.d/10-ssl.conf and add or correct the following line:

ssl = yes

Rationale

SSL encrypt network traffic between the Dovecot server and its clients protecting user credentials, mail as it is downloaded, and clients may use SSL certificates to authenticate the server, preventing another system from impersonating the server.

Configure Dovecot to Use the SSL Certificate filexccdf_org.ssgproject.content_rule_dovecot_configure_ssl_cert low

Configure Dovecot to Use the SSL Certificate file

Rule IDxccdf_org.ssgproject.content_rule_dovecot_configure_ssl_cert
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

This option tells Dovecot where to find the the mail server's SSL Certificate.

Edit /etc/dovecot/conf.d/10-ssl.conf and add or correct the following line (note: the path below is the default path set by the Dovecot installation. If you are using a different path, ensure you reference the appropriate file):

ssl_cert = </etc/pki/dovecot/certs/dovecot.pem

Rationale

SSL certificates are used by the client to authenticate the identity of the server, as well as to encrypt credentials and message traffic. Not using SSL to encrypt mail server traffic could allow unauthorized access to credentials and mail messages since they are sent in plain text over the network.

Configure Dovecot to Use the SSL Key filexccdf_org.ssgproject.content_rule_dovecot_configure_ssl_key low

Configure Dovecot to Use the SSL Key file

Rule IDxccdf_org.ssgproject.content_rule_dovecot_configure_ssl_key
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

This option tells Dovecot where to find the the mail server's SSL Key.

Edit /etc/dovecot/conf.d/10-ssl.conf and add or correct the following line (note: the path below is the default path set by the Dovecot installation. If you are using a different path, ensure you reference the appropriate file):

ssl_key = </etc/pki/dovecot/private/dovecot.pem

Rationale

SSL certificates are used by the client to authenticate the identity of the server, as well as to encrypt credentials and message traffic. Not using SSL to encrypt mail server traffic could allow unauthorized access to credentials and mail messages since they are sent in plain text over the network.

Disable Plaintext Authenticationxccdf_org.ssgproject.content_rule_dovecot_disable_plaintext_auth low

Disable Plaintext Authentication

Rule IDxccdf_org.ssgproject.content_rule_dovecot_disable_plaintext_auth
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

To prevent Dovecot from attempting plaintext authentication of clients, edit /etc/dovecot/conf.d/10-auth.conf and add or correct the following line:

disable_plaintext_auth = yes

Rationale

Using plain text authentication to the mail server could allow an attacker access to credentials by monitoring network traffic.

Disable Quagga Servicexccdf_org.ssgproject.content_rule_service_zebra_disabled medium

Disable Quagga Service

Rule IDxccdf_org.ssgproject.content_rule_service_zebra_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  SC-32, 366, SRG-OS-000480-GPOS-00227

Description

The zebra service can be disabled with the following command:

$ sudo systemctl disable zebra.service

Rationale

Routing protocol daemons are typically used on routers to exchange network topology information with other routers. If routing daemons are used when not required, system network information may be unnecessarily transmitted across the network.

Uninstall quagga Packagexccdf_org.ssgproject.content_rule_package_quagga_removed medium

Uninstall quagga Package

Rule IDxccdf_org.ssgproject.content_rule_package_quagga_removed
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References

References:  SC-32, 366, SRG-OS-000480-GPOS-00227

Description

The quagga package can be removed with the following command:

$ sudo yum erase quagga

Rationale

Routing software is typically used on routers to exchange network topology information with other routers. If routing software is used when not required, system network information may be unnecessarily transmitted across the network.
If there is no need to make the router software available, removing it provides a safeguard against its activation.

Disable Sambaxccdf_org.ssgproject.content_rule_service_smb_disabled low

Disable Samba

Rule IDxccdf_org.ssgproject.content_rule_service_smb_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  1436

Description

The smb service can be disabled with the following command:

$ sudo systemctl disable smb.service

Rationale

Running a Samba server provides a network-based avenue of attack, and should be disabled if not needed.

Uninstall Samba Packagexccdf_org.ssgproject.content_rule_package_samba_removed low

Uninstall Samba Package

Rule IDxccdf_org.ssgproject.content_rule_package_samba_removed
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  3.13

Description

The samba package can be uninstalled with the following command:

$ sudo yum erase samba

Rationale

If there is no need to make the Samba software available, removing it provides a safeguard against its activation.

Install the Samba Common Packagexccdf_org.ssgproject.content_rule_package_samba-common_installed medium

Install the Samba Common Package

Rule IDxccdf_org.ssgproject.content_rule_package_samba-common_installed
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References
Description

The samba-common package should be installed. The samba-common package can be installed with the following command:

$ sudo yum install samba-common

Rationale

If the samba-common package is not installed, samba cannot be configured.

Disable Root Access to SMB Sharesxccdf_org.ssgproject.content_rule_smb_server_disable_root low

Disable Root Access to SMB Shares

Rule IDxccdf_org.ssgproject.content_rule_smb_server_disable_root
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

Administrators should not use administrator accounts to access Samba file and printer shares. Disable the root user and the wheel administrator group:

[share]
  invalid users = root @wheel
If administrator accounts cannot be disabled, ensure that local system passwords and Samba service passwords do not match.

Rationale

Typically, administrator access is required when Samba must create user and system accounts and shares. Domain member servers and standalone servers may not need administrator access at all. If that is the case, add the invalid users parameter to [global] instead.

Require Client SMB Packet Signing, if using smbclientxccdf_org.ssgproject.content_rule_require_smb_client_signing low

Require Client SMB Packet Signing, if using smbclient

Rule IDxccdf_org.ssgproject.content_rule_require_smb_client_signing
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

To require samba clients running smbclient to use packet signing, add the following to the [global] section of the Samba configuration file, /etc/samba/smb.conf:

client signing = mandatory
Requiring samba clients such as smbclient to use packet signing ensures they can only communicate with servers that support packet signing.

Rationale

Packet signing can prevent man-in-the-middle attacks which modify SMB packets in transit.

Require Client SMB Packet Signing, if using mount.cifsxccdf_org.ssgproject.content_rule_mount_option_smb_client_signing low

Require Client SMB Packet Signing, if using mount.cifs

Rule IDxccdf_org.ssgproject.content_rule_mount_option_smb_client_signing
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

Require packet signing of clients who mount Samba shares using the mount.cifs program (e.g., those who specify shares in /etc/fstab). To do so, ensure signing options (either sec=krb5i or sec=ntlmv2i) are used.

See the mount.cifs(8) man page for more information. A Samba client should only communicate with servers who can support SMB packet signing.

Rationale

Packet signing can prevent man-in-the-middle attacks which modify SMB packets in transit.

Disable Squidxccdf_org.ssgproject.content_rule_service_squid_disabled low

Disable Squid

Rule IDxccdf_org.ssgproject.content_rule_service_squid_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

The squid service can be disabled with the following command:

$ sudo systemctl disable squid.service

Rationale

Running proxy server software provides a network-based avenue of attack, and should be removed if not needed.

Uninstall squid Packagexccdf_org.ssgproject.content_rule_package_squid_removed low

Uninstall squid Package

Rule IDxccdf_org.ssgproject.content_rule_package_squid_removed
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  3.14

Description

The squid package can be removed with the following command:

$ sudo yum erase squid

Rationale

If there is no need to make the proxy server software available, removing it provides a safeguard against its activation.

Disable snmpd Servicexccdf_org.ssgproject.content_rule_service_snmpd_disabled low

Disable snmpd Service

Rule IDxccdf_org.ssgproject.content_rule_service_snmpd_disabled
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References
Description

The snmpd service can be disabled with the following command:

$ sudo systemctl disable snmpd.service

Rationale

Running SNMP software provides a network-based avenue of attack, and should be disabled if not needed.

Uninstall net-snmp Packagexccdf_org.ssgproject.content_rule_package_net-snmp_removed low

Uninstall net-snmp Package

Rule IDxccdf_org.ssgproject.content_rule_package_net-snmp_removed
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  3.15

Description

The net-snmp package provides the snmpd service. The net-snmp package can be removed with the following command:

$ sudo yum erase net-snmp

Rationale

If there is no need to run SNMP server software, removing the package provides a safeguard against its activation.

Configure SNMP Service to Use Only SNMPv3 or Newer xccdf_org.ssgproject.content_rule_snmpd_use_newer_protocol medium

Configure SNMP Service to Use Only SNMPv3 or Newer

Rule IDxccdf_org.ssgproject.content_rule_snmpd_use_newer_protocol
Result
notselected
Time2017-10-21T14:39:59
Severitymedium
Identifiers and References
Description

Edit /etc/snmp/snmpd.conf, removing any references to rocommunity, rwcommunity, or com2sec. Upon doing that, restart the SNMP service:

$ sudo service snmpd restart

Rationale

Earlier versions of SNMP are considered insecure, as they potentially allow unauthorized access to detailed system management information.

Ensure Default SNMP Password Is Not Usedxccdf_org.ssgproject.content_rule_snmpd_not_default_password high

Ensure Default SNMP Password Is Not Used

Rule IDxccdf_org.ssgproject.content_rule_snmpd_not_default_password
Result
pass
Time2017-10-21T14:39:59
Severityhigh
Identifiers and References

References:  IA-5.1(ii), 366, SRG-OS-000480-GPOS-00227

Description

Edit /etc/snmp/snmpd.conf, remove or change the default community strings of public and private. Once the default community strings have been changed, restart the SNMP service:

$ sudo service snmpd restart

Rationale

Whether active or not, default simple network management protocol (SNMP) community strings must be changed to maintain security. If the service is running with the default authenticators, then anyone can gather data about the system and the network and use the information to potentially compromise the integrity of the system and network(s).

OVAL details

Items not found satisfying Check snmpd configuration:

Object oval:ssg-object_snmp_default_communities:obj:1 of type textfilecontent54_object
FilepathPatternInstance
/etc/snmp/snmpd.conf^[\s]*(com2se|rocommunity|rwcommunity|createUser).*(public|private)1
Procedural Requirementxccdf_org.ssgproject.content_rule_c2s_procedural_requirement low

Procedural Requirement

Rule IDxccdf_org.ssgproject.content_rule_c2s_procedural_requirement
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf

Description

This requirement is procedural, and can not be met through automated means.

Rationale

This requirement is procedural, and can not be met through automated means.

Not Applicable to Operating Systemxccdf_org.ssgproject.content_rule_c2s_not_OS_applicable low

Not Applicable to Operating System

Rule IDxccdf_org.ssgproject.content_rule_c2s_not_OS_applicable
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf

Description

While this requirement is applicable at an information system level, implementation is not performed within the Operating System.

Rationale

This requirement is not applicable to an operating system.

Product Meets this Requirementxccdf_org.ssgproject.content_rule_c2s_met_inherently low

Product Meets this Requirement

Rule IDxccdf_org.ssgproject.content_rule_c2s_met_inherently
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf

Description

This requirement is permanent not a finding. No fix is required.

Rationale

Red Hat Enterprise Linux meets this requirement through design and implementation.

Requirement Applies to All Rulesxccdf_org.ssgproject.content_rule_apply_to_everything low

Requirement Applies to All Rules

Rule IDxccdf_org.ssgproject.content_rule_apply_to_everything
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf

Description

These are generic requirements, and apply to all rules

Rationale

The following requirements apply to all rules

Rule Compliance through Removal of xinetdxccdf_org.ssgproject.content_rule_cis_xinetd low

Rule Compliance through Removal of xinetd

Rule IDxccdf_org.ssgproject.content_rule_cis_xinetd
Result
notselected
Time2017-10-21T14:39:59
Severitylow
Identifiers and References

References:  2.1.12, 2.1.13, 2.1.14, 2.1.15, 2.1.16, 2.1.17, 2.1.18

Description

The upstream CIS guidance is incorrect, stating that xinetd services can be managed through systemctl. The proper way to disable xinetd services, such as chargen-dgram, is to create a /etc/xinetd.d/SERVICE file which disables the service. Regardless, these rules are inherently compliant with C2S/CIS policies through the removal of xinetd itself.

Rationale

These rules are inherently compliant when xinetd is removed from the system

Red Hat and Red Hat Enterprise Linux are either registered trademarks or trademarks of Red Hat, Inc. in the United States and other countries. All other names are registered trademarks or trademarks of their respective companies.