Puppet Class: cis_security_hardening::rules::home_noexec

Defined in:
manifests/rules/home_noexec.pp

Summary

Ensure file systems that contain user home directories are mounted with the "noexec" option

Overview

The operating system must prevent code from being executed on file systems that contain user home directories.

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.

Examples:

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

Parameters:

  • enforce (Boolean) (defaults to: false)

    Enforce the rule.



20
21
22
23
24
25
26
27
28
29
# File 'manifests/rules/home_noexec.pp', line 20

class cis_security_hardening::rules::home_noexec (
  Boolean $enforce = false,
) {
  if ($enforce) and cis_security_hardening::hash_key($facts['mountpoints'], '/home') {
    cis_security_hardening::set_mount_options { '/home-noexec':
      mountpoint   => '/home',
      mountoptions => 'noexec',
    }
  }
}