Verify Owner on cron.d
An XCCDF Rule
Description
To properly set the owner of /etc/cron.d
, run the command:
$ sudo chown root /etc/cron.d
Rationale
Service configuration files enable or disable features of their respective services that if configured incorrectly can lead to insecure and vulnerable configurations. Therefore, service configuration files should be owned by the correct user to prevent unauthorized changes.
- ID
- xccdf_org.ssgproject.content_rule_file_owner_cron_d
- Severity
- Medium
- References
- Updated
Remediation - Shell Script
# Remediation is applicable only in certain platforms
if dpkg-query --show --showformat='${db:Status-Status}
' 'kernel' 2>/dev/null | grep -q installed; then
find -H /etc/cron.d/ -maxdepth 1 -type d -exec chown -L 0 {} \;
Remediation - Ansible
- name: Gather the package facts
package_facts:
manager: auto
tags:
- NIST-800-53-AC-6(1)
- NIST-800-53-CM-6(a)