Skip to content

Verify Group Who Owns cron.weekly

An XCCDF Rule

Description

To properly set the group owner of /etc/cron.weekly, run the command:
$ sudo chgrp root /etc/cron.weekly

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 group to prevent unauthorized changes.

ID
xccdf_org.ssgproject.content_rule_file_groupowner_cron_weekly
Severity
Medium
References
Updated

Remediation Templates

An Ansible Snippet

- name: Gather the package facts
  package_facts:
    manager: auto
  tags:
  - CCE-92270-8
  - NIST-800-53-AC-6(1)

A Shell Script

# Remediation is applicable only in certain platforms
if rpm --quiet -q kernel-default; then
find -H /etc/cron.weekly/ -maxdepth 1 -type d -exec chgrp -L 0 {} \;

else
    >&2 echo 'Remediation is not applicable, nothing was done'
fi