Puppet Class: cis_security_hardening::rules::sshd_kerberos

Defined in:
manifests/rules/sshd_kerberos.pp

Summary

Ensure SSH does not permit Kerberos authentication

Overview

The operating system must be configured so that the SSH daemon does not permit Kerberos authentication unless needed.

Rationale: Kerberos authentication for SSH is often implemented using Generic Security Service Application Program Interface (GSSAPI). If Kerberos is enabled through SSH, the SSH daemon provides a means of access to the system’s Kerberos implementation. Vulnerabilities in the system’s Kerberos implementation may then be subject to exploitation. To reduce the attack surface of the system, the Kerberos authentication mechanism within SSH must be disabled for systems not using this capability.

Examples:

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

Parameters:

  • enforce (Boolean) (defaults to: false)

    Enforce the rule.



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

class cis_security_hardening::rules::sshd_kerberos (
  Boolean $enforce = false,
) {
  if $enforce {
    $path = ($facts['os']['name'] == 'SLES' and $facts['os']['release']['major'] == '12') ? {
      true    => '/usr/etc/ssh/sshd_config',
      default => '/etc/ssh/sshd_config',
    }
    file_line { 'sshd-kerberos':
      ensure             => present,
      path               => $path,
      line               => 'KerberosAuthentication no',
      match              => '^#?KerberosAuthentication.*',
      append_on_no_match => true,
      notify             => Exec['reload-sshd'],
    }
  }
}