Puppet Class: ssh::server::config

Defined in:
manifests/server/config.pp

Overview

Class: ssh::server::config

Provide the configuration parameters necessary to configure sshd(8) through sshd_config(5) from a template.

Parameters:

  • acceptenv (Any) (defaults to: undef)
  • addressfamily (Any) (defaults to: undef)
  • allowagentforwarding (Any) (defaults to: undef)
  • allowtcpforwarding (Any) (defaults to: undef)
  • allowusers (Any) (defaults to: undef)
  • authenticationmethods (Any) (defaults to: undef)
  • authorizedkeyscommand (Any) (defaults to: undef)
  • authorizedkeyscommanduser (Any) (defaults to: undef)
  • authorizedkeysfile (Any) (defaults to: undef)
  • authorizedprincipalsfile (Any) (defaults to: undef)
  • banner (Any) (defaults to: undef)
  • challengeresponseauthentication (Any) (defaults to: undef)
  • chrootdirectory (Any) (defaults to: undef)
  • ciphers (Any) (defaults to: undef)
  • clientalivecountmax (Any) (defaults to: undef)
  • clientaliveinterval (Any) (defaults to: undef)
  • compression (Any) (defaults to: undef)
  • denygroups (Any) (defaults to: undef)
  • denyusers (Any) (defaults to: undef)
  • exposeauthinfo (Any) (defaults to: undef)
  • forcecommand (Any) (defaults to: undef)
  • gatewayports (Any) (defaults to: undef)
  • gssapiauthentication (Any) (defaults to: undef)
  • gssapikeyexchange (Any) (defaults to: undef)
  • gssapicleanupcredentials (Any) (defaults to: undef)
  • gssapistorecredentialsonrekey (Any) (defaults to: undef)
  • gssapistrictacceptorcheck (Any) (defaults to: undef)
  • hostbasedauthentication (Any) (defaults to: undef)
  • hostbasedusesnamefrompacketonly (Any) (defaults to: undef)
  • hostcertificate (Any) (defaults to: undef)
  • hostkeyalgorithms (Any) (defaults to: undef)
  • hostkey (Any) (defaults to: undef)
  • ignorerhosts (Any) (defaults to: undef)
  • ignoreuserknownhosts (Any) (defaults to: undef)
  • ipqos (Any) (defaults to: undef)
  • kerberosauthentication (Any) (defaults to: undef)
  • kerberosorlocalpasswd (Any) (defaults to: undef)
  • kerberosticketcleanup (Any) (defaults to: undef)
  • kexalgorithms (Any) (defaults to: undef)
  • keyregenerationinterval (Any) (defaults to: undef)
  • listenaddress (Any) (defaults to: undef)
  • logingracetime (Any) (defaults to: undef)
  • macs (Any) (defaults to: undef)
  • maxauthtries (Any) (defaults to: undef)
  • maxsessions (Any) (defaults to: undef)
  • maxstartups (Any) (defaults to: undef)
  • passwordauthentication (Any) (defaults to: undef)
  • permitemptypasswords (Any) (defaults to: undef)
  • permitopen (Any) (defaults to: undef)
  • permitrootlogin (Any) (defaults to: 'no')
  • permittunnel (Any) (defaults to: undef)
  • permituserenvironment (Any) (defaults to: undef)
  • pidfile (Any) (defaults to: undef)
  • port (Any) (defaults to: '22')
  • printlastlog (Any) (defaults to: undef)
  • printmotd (Any) (defaults to: undef)
  • protocol (Any) (defaults to: '2')
  • pubkeyacceptedkeytypes (Any) (defaults to: undef)
  • pubkeyauthentication (Any) (defaults to: undef)
  • rdomain (Any) (defaults to: undef)
  • revokedkeys (Any) (defaults to: undef)
  • rhostsrsaauthentication (Any) (defaults to: undef)
  • rsaauthentication (Any) (defaults to: undef)
  • saclsupport (Any) (defaults to: undef)
  • serverkeybits (Any) (defaults to: undef)
  • strictmodes (Any) (defaults to: undef)
  • syslogfacility (Any) (defaults to: 'AUTH')
  • tcpkeepalive (Any) (defaults to: undef)
  • trustedusercakeys (Any) (defaults to: undef)
  • usedns (Any) (defaults to: undef)
  • uselogin (Any) (defaults to: undef)
  • usepam (Any) (defaults to: undef)
  • versionaddendum (Any) (defaults to: undef)
  • x11displayoffset (Any) (defaults to: undef)
  • x11forwarding (Any) (defaults to: undef)
  • x11uselocalhost (Any) (defaults to: undef)
  • xauthlocation (Any) (defaults to: undef)
  • log_level (Any) (defaults to: 'INFO')
  • has_pam (Any) (defaults to: false)
  • has_gssapi (Any) (defaults to: false)


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# File 'manifests/server/config.pp', line 6

class ssh::server::config (
  $acceptenv                       = undef,
  $addressfamily                   = undef,
  $allowagentforwarding            = undef,
  $allowtcpforwarding              = undef,
  $allowusers                      = undef,
  $authenticationmethods           = undef,
  $authorizedkeyscommand           = undef,
  $authorizedkeyscommanduser       = undef,
  $authorizedkeysfile              = undef,
  $authorizedprincipalsfile        = undef,
  $banner                          = undef,
  $challengeresponseauthentication = undef,
  $chrootdirectory                 = undef,
  $ciphers                         = undef,
  $clientalivecountmax             = undef,
  $clientaliveinterval             = undef,
  $compression                     = undef,
  $denygroups                      = undef,
  $denyusers                       = undef,
  $exposeauthinfo                  = undef,
  $forcecommand                    = undef,
  $gatewayports                    = undef,
  $gssapiauthentication            = undef,
  $gssapikeyexchange               = undef,
  $gssapicleanupcredentials        = undef,
  $gssapistorecredentialsonrekey   = undef,
  $gssapistrictacceptorcheck       = undef,
  $hostbasedauthentication         = undef,
  $hostbasedusesnamefrompacketonly = undef,
  $hostcertificate                 = undef,
  $hostkeyalgorithms               = undef,
  $hostkey                         = undef,
  $ignorerhosts                    = undef,
  $ignoreuserknownhosts            = undef,
  $ipqos                           = undef,
  $kerberosauthentication          = undef,
  $kerberosorlocalpasswd           = undef,
  $kerberosticketcleanup           = undef,
  $kexalgorithms                   = undef,
  $keyregenerationinterval         = undef,
  $listenaddress                   = undef,
  $logingracetime                  = undef,
  $macs                            = undef,
  $maxauthtries                    = undef,
  $maxsessions                     = undef,
  $maxstartups                     = undef,
  $passwordauthentication          = undef,
  $permitemptypasswords            = undef,
  $permitopen                      = undef,
  $permitrootlogin                 = 'no',
  $permittunnel                    = undef,
  $permituserenvironment           = undef,
  $pidfile                         = undef,
  $port                            = '22',
  $printlastlog                    = undef,
  $printmotd                       = undef,
  $protocol                        = '2',
  $pubkeyacceptedkeytypes          = undef,
  $pubkeyauthentication            = undef,
  $rdomain                         = undef,
  $revokedkeys                     = undef,
  $rhostsrsaauthentication         = undef,
  $rsaauthentication               = undef,
  $saclsupport                     = undef,
  $serverkeybits                   = undef,
  $strictmodes                     = undef,
  $syslogfacility                  = 'AUTH',
  $tcpkeepalive                    = undef,
  $trustedusercakeys               = undef,
  $usedns                          = undef,
  $uselogin                        = undef,
  $usepam                          = undef,
  $versionaddendum                 = undef,
  $x11displayoffset                = undef,
  $x11forwarding                   = undef,
  $x11uselocalhost                 = undef,
  $xauthlocation                   = undef,

  $log_level                = 'INFO', # underscore here because puppet
  $has_pam                  = false,
  $has_gssapi               = false,
) {

  include ssh

  $valid_keywords = [
    'AcceptEnv',
    'AddressFamily',
    'AllowAgentForwarding',
    'AllowTcpForwarding',
    'AllowUsers',
    'AuthenticationMethods',
    'AuthorizedKeysCommand',
    'AuthorizedKeysCommandUser',
    'AuthorizedKeysFile',
    'AuthorizedPrincipalsFile',
    'Banner',
    'ChallengeResponseAuthentication',
    'ChrootDirectory',
    'Ciphers',
    'ClientAliveCountMax',
    'ClientAliveInterval',
    'Compression',
    'DenyGroups',
    'DenyUsers',
    'ForceCommand',
    'ExposeAuthInfo',
    'GatewayPorts',
    'GSSAPIAuthentication',
    'GSSAPIKeyExchange',
    'GSSAPICleanupCredentials',
    'GSSAPIStrictAcceptorCheck',
    'GSSAPIStoreCredentialsOnRekey',
    'HostbasedAuthentication',
    'HostbasedUsesNameFromPacketOnly',
    'HostCertificate',
    'HostKey',
    'HostKeyAlgorithms',
    'IgnoreRhosts',
    'IgnoreUserKnownHosts',
    'IPQoS',
    'KerberosAuthentication',
    'KerberosOrLocalPasswd',
    'KerberosTicketCleanup',
    'KexAlgorithms',
    'KeyRegenerationInterval',
    'ListenAddress',
    'LoginGraceTime',
    #'LogLevel',
    'MACs',
    'MaxAuthTries',
    'MaxSessions',
    'MaxStartups',
    'PasswordAuthentication',
    'PermitEmptyPasswords',
    'PermitOpen',
    'PermitRootLogin',
    'PermitTunnel',
    'PermitUserEnvironment',
    'PidFile',
    'Port',
    'PrintLastLog',
    'PrintMotd',
    'Protocol',
    'PubkeyAcceptedKeyTypes',
    'PubkeyAuthentication',
    'RDomain',
    'RevokedKeys',
    'RhostsRSAAuthentication',
    'RSAAuthentication',
    'SACLSupport',
    'ServerKeyBits',
    'StrictModes',
    'SyslogFacility',
    'TCPKeepAlive',
    'TrustedUserCAKeys',
    'UseDNS',
    'UseLogin',
    'UsePAM',
    'VersionAddendum',
    'X11DisplayOffset',
    'X11Forwarding',
    'X11UseLocalhost',
    'XAuthLocation',
  ]


  # Keywords that are joined by spaces in the presence of multiple
  # values
  $space_separated_keywords = [
    'AcceptEnv',
    'AuthorizedKeysFile',
    'DenyGroups',
    'DenyUsers',
  ]

  # Keywords that are configured with their own defined type.
  $defined_keywords = [
    'Match',
    'AllowGroups',
    'Subsystem',
  ]

  concat::fragment { 'sshd_config':
    order   => '10',
    target  => $ssh::sshd_config,
    content => template('ssh/sshd_config.erb'),
  }
}