Puppet Class: cis_security_hardening::rules::nfs_nodev

Defined in:
manifests/rules/nfs_nodev.pp

Summary

Ensure file systems being imported via NFS are mounted with the "nosuid" option.

Overview

The operating system must prevent files with the setuid and setgid bit set from being executed on file systems that are imported via Network File System (NFS).

Rationale: The “nosuid” mount option causes the system not to execute “setuid” and “setgid” files with owner privileges. This option must be used for mounting any file system not containing approved “setuid” and “setguid” files. Executing files from untrusted file systems increases the opportunity for unprivileged users to attain unauthorized administrative access.

Examples:

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

Parameters:

  • enforce (Boolean) (defaults to: false)

    Enforce the rule.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'manifests/rules/nfs_nodev.pp', line 21

class cis_security_hardening::rules::nfs_nodev (
  Boolean $enforce = false,
) {
  if $enforce {
    $nfs = fact('cis_security_hardening.nfs_file_systems') ? {
      undef   => {},
      default => fact('cis_security_hardening.nfs_file_systems'),
    }

    $nfs.each |$fs, $data| {
      cis_security_hardening::set_mount_options { "${fs}-nodev":
        mountpoint   => $fs,
        mountoptions => 'nodev',
      }
    }
  }
}