Puppet Class: security_baseline::rules::common::sec_dovecot

Defined in:
manifests/rules/common/sec_dovecot.pp

Summary

Ensure IMAP and POP3 server is not enabled (Scored)

Overview

dovecot is an open source IMAP and POP3 server for Linux based systems.

Rationale: Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the service be disabled to reduce the potential attack surface.

Examples:

class security_baseline::rules::common::sec_dhcpd {
    enforce => true,
    message => 'Test',
    log_level => 'info'
}

Parameters:

  • enforce (Boolean) (defaults to: true)

    Enforce the rule or just test and log

  • message (String) (defaults to: '')

    Message to print into the log

  • log_level (String) (defaults to: '')

    The log_level for the above message



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'manifests/rules/common/sec_dovecot.pp', line 27

class security_baseline::rules::common::sec_dovecot (
  Boolean $enforce = true,
  String $message = '',
  String $log_level = ''
) {
  if($enforce) {

    ensure_resource('service', ['dovecot'], {
      ensure => 'stopped',
      enable => false
    })

  } else {

    if($facts['security_baseline']['services_enabled']['srv_dovecot'] == 'enabled') {
      echo { 'dovecot':
        message  => $message,
        loglevel => $log_level,
        withpath => false,
      }
    }
  }
}