Puppet Class: cis_security_hardening::rules::crontab

Defined in:
manifests/rules/crontab.pp

Summary

Ensure permissions on /etc/crontab are configured

Overview

The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file.

Rationale: This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access.

Examples:

class { 'cis_security_hardening::rules::crontab':
    enforce => true,
}

Parameters:

  • enforce (Boolean) (defaults to: false)

    Enforce the rule



22
23
24
25
26
27
28
29
30
31
32
33
# File 'manifests/rules/crontab.pp', line 22

class cis_security_hardening::rules::crontab (
  Boolean $enforce = false,
) {
  if $enforce {
    file { '/etc/crontab':
      ensure => file,
      owner  => 'root',
      group  => 'root',
      mode   => '0600',
    }
  }
}