Puppet Class: confdroid_ssh::params

Summary

Class contains all class parameters for confdroid_ssh

Overview

confdroid_ssh::params.pp Module name: confdroid_ssh Author: 12ww1160 (12ww1160@confdroid.com)

Parameters:

  • ssh_reqpackages (Array) (defaults to: ['openssh','openssh-clients','openssh-server'])

    packages to install

  • pkg_ensure (String) (defaults to: 'present')

    version to install: ‘present’ or ‘latest’

  • ssh_fw_rule (String) (defaults to: 'present')

    whether set the fw rule to present or absent.

  • ssh_fw_port (String) (defaults to: '22')

    port to use for SSHD and in fw

  • ssh_fw_order (String) (defaults to: '50')

    order of firewall rule

  • ssh_source_range (String) (defaults to: '0.0.0.0/0')

    source range for firewall rule

  • ssh_manage_config (Boolean) (defaults to: true)

    whether to manage the configuration

  • ssh_address_family (String) (defaults to: 'any')

    AddressFamily setting for sshd_config

  • ssh_listen_address (String) (defaults to: '0.0.0.0')

    ListenAddress setting for sshd_config

  • ssh_root_login (String) (defaults to: 'prohibit-password')

    PermitRootLogin setting for sshd_config

  • ssh_strict_modes (String) (defaults to: 'yes')

    StrictModes setting for sshd_config

  • ssh_max_auth_tries (String) (defaults to: '6')

    MaxAuthTries setting for sshd_config

  • ssh_max_sessions (String) (defaults to: '10')

    MaxSessions setting for sshd_config

  • ssh_pubkey_auth (String) (defaults to: 'yes')

    PubkeyAuthentication setting for sshd_config

  • ssh_auth_key_files (String) (defaults to: '.ssh/authorized_keys')

    AuthorizedKeysFile setting for sshd_config

  • ssh_authorized_principals_file (String) (defaults to: 'none')

    AuthorizedPrincipalsFile setting for sshd_config. Default is ‘none’ to disable this setting.

  • ssh_authorized_keys_command (String) (defaults to: 'none')

    AuthorizedKeysCommand setting for sshd_config. Default is ‘none’ to disable this setting.

  • ssh_authorized_keys_command_user (String) (defaults to: 'nobody')

    AuthorizedKeysCommandUser setting for sshd_config. Default is ‘nobody’ to use an unpriviledged user.

  • ssh_use_specific_hostkey (Boolean) (defaults to: false)

    whether to use a specific host key

  • ssh_hostkey_type (String) (defaults to: 'rsa')

    type of host key to use if ssh_use_specific_hostkey is true

  • ssh_rekeylimit (String) (defaults to: 'default none')

    RekeyLimit setting for sshd_config. Default is ‘default none’.

  • ssh_syslog_facility (String) (defaults to: 'AUTH')

    SyslogFacility setting for sshd_config. Default is ‘AUTH’.

  • ssh_log_level (String) (defaults to: 'INFO')

    LogLevel setting for sshd_config. Default is ‘INFO’.

  • ssh_password_authentication (String) (defaults to: 'no')

    PasswordAuthentication setting for sshd_config. Default is ‘no’, which requires key-based authentication. This is a recommended security setting, so passwords do not show up in logs, but can be set to ‘yes’ if password authentication is desired.

  • ssh_permit_empty_passwords (String) (defaults to: 'no')

    PermitEmptyPasswords setting for sshd_config. Default is ‘no’, which is a recommended security setting and works in connection with key-based authentication, but can be set to ‘yes’ if password authentication should be allowed and empty passwords should be allowed. Again, this should be used with caution if enabled.

  • ssh_kbd_interactive_auth (String) (defaults to: 'no')

    setting for sshd_config. Default is ‘no’, which is a recommended security setting together with password authentication, but can be set to ‘yes’ if keyboard-interactive authentication should be allowed. (not recommended)

  • ssh_kerberos_authentication (String) (defaults to: 'yes')

    setting for sshd_config. Default is ‘no’. Kerberos authentication is not commonly used and requires a lot of other settings, so it is disabled by default, but can be set to ‘yes’ if desired.

  • ssh_kerberos_or_local_passwd (String) (defaults to: 'yes')

    setting for sshd_config. Default is ‘no’. This setting is only relevant if Kerberos authentication is enabled, and should be set to ‘yes’ if you want to allow local password authentication as a fallback if Kerberos authentication fails, but can be set to ‘no’ if you want to only allow Kerberos authentication.

  • ssh_kerberos_ticket_cleanup (String) (defaults to: 'yes')

    setting for sshd_config. Default is ‘no’. This setting is only relevant if Kerberos authentication is enabled, and should be set to ‘yes’ if you want to enable ticket cleanup, but can be set to ‘no’ if you want to disable it.

  • ssh_kerberos_get_afstoken (String) (defaults to: 'no')

    setting for sshd_config. Default is ‘no’. This setting is only relevant if Kerberos authentication is enabled, and should be set to ‘yes’ if you want to enable AFS token retrieval, but can be set to ‘no’ if you want to disable it.

  • ssh_kerberos_use_kuserok (String) (defaults to: 'yes')

    setting for sshd_config. Default is ‘no’. This setting is only relevant if Kerberos authentication is enabled, and should be set to ‘yes’ if you want to enable userok with Kerberos, but can be set to ‘no’ if you want to disable it.

  • ssh_use_kerberos (Boolean) (defaults to: false)

    whether to use Kerberos authentication. If true, the relevant Kerberos settings will be included in the sshd_config, otherwise they will be ignored.

  • ssh_use_gssapi (Boolean) (defaults to: false)

    whether to use GSSAPI authentication. If true, GSSAPI authentication will be enabled in sshd_config, otherwise it will be disabled. GSSAPI authentication is not commonly used and requires a lot of other settings, so it is disabled by default, but can be set to true if desired.

  • ssh_gssapi_authentication (String) (defaults to: 'yes')

    setting for sshd_config. Default is ‘no’. This setting is only relevant if GSSAPI authentication is enabled, and should be set to ‘yes’ if you want to enable GSS authentication, but can be set to ‘no’ if you want to disable it.

  • ssh_gssapi_cleanup_credentials (String) (defaults to: 'yes')

    setting for sshd_config. Default is ‘no’. This setting is only relevant if GSSAPI authentication is enabled, and should be set to ‘yes’ if you want to enable GSS credential cleanup, but can be set to ‘no’ if you want to disable it.

  • ssh_gssapi_key_exchange (String) (defaults to: 'no')

    setting for sshd_config. Default is ‘no’. This setting is only relevant if GSSAPI authentication is enabled, and should be set to ‘yes’ if you want to enable GSS key exchange.

  • ssh_gssapi_enablek5users (String) (defaults to: 'no')

    setting for sshd_config. Default is ‘no’. This setting is only relevant if GSSAPI authentication is enabled, and should be set to ‘yes’ if you want to enable GSSAPI for k5users.

  • ssh_use_pam (String) (defaults to: 'no')

    setting for sshd_config. Default is ‘no’. PAM is not commonly used for SSH authentication and can introduce security risks if not configured properly, so it is disabled by default. Thi setting is related to PasswordAuthentication and KbdInteractiveAuthentication, and should be set to ‘yes’ only if you want to use PAM for authentication together with those settings.

  • ssh_allow_agent_forwarding (String) (defaults to: 'yes')

    setting for sshd_config. Default is ‘yes’, which allows SSH agent forwarding, but can be set to ‘no’ if you want to disable this feature for security reasons.

  • ssh_allow_tcp_forwarding (String) (defaults to: 'yes')

    setting for sshd_config. Default is ‘yes’, which allows TCP forwarding, but can be set to ‘no’ if you want to disable this feature for security reasons.

  • ssh_gateway_ports (String) (defaults to: 'no')

    setting for sshd_config. Default is ‘no’, which means that remote hosts cannot connect to forwarded ports, but can be set to ‘yes’ or ‘clientspecified’ if you want to allow remote hosts to connect to forwarded ports. This setting should be used with caution if enabled, as it can introduce security risks.

  • ssh_x11_forwarding (String) (defaults to: 'no')

    setting for sshd_config. Default is ‘no’, which disables X11 forwarding, but can be set to ‘yes’ if you want to allow X11 forwarding. This setting should be used with caution if enabled.

  • ssh_x11_display_offset (String) (defaults to: '10')

    setting for sshd_config. Default is ‘10’. This setting is only relevant if X11 forwarding is enabled, and specifies the first display number available for X11 forwarding. The default of ‘10’ means that the first forwarded display will be :10, the second will be :11, and so on. This setting can be adjusted if you want to use a different range of display numbers for X11 forwarding.

  • ssh_x11_use_localhost (String) (defaults to: 'yes')

    setting for sshd_config. Default is ‘yes’, which means that X11 forwarding will only be available on the loopback interface, but can be set to ‘no’ if you want to allow X11 forwarding on all network interfaces.

  • ssh_permit_tty (String) (defaults to: 'yes')

    setting for sshd_config. Default is ‘yes’, which allows TTY allocation, but can be set to ‘no’ if you want to disable TTY allocation.

  • ssh_print_motd (String) (defaults to: 'yes')

    setting for sshd_config. Default is ‘yes’, which means that the message of the day will be printed when users log in, but can be set to ‘no’ if you want to disable this feature.

  • ssh_print_lastlog (String) (defaults to: 'yes')

    setting for sshd_config. Default is ‘yes’, which means that the last login information will be printed when users log in, but can be set to ‘no’ if you want to disable this feature.

  • ssh_tcp_keepalive (String) (defaults to: 'yes')

    setting for sshd_config. Default is ‘yes’, which means that TCP keepalive messages will be sent, but can be set to ‘no’ if you want to disable this feature. This setting can be useful to disable if you have issues with dropped connections, but in general it is recommended to keep it enabled.

  • ssh_permit_user_environment (String) (defaults to: 'no')

    setting for sshd_config. Default is ‘no’, which means that user environment variables will not be processed, but can be set to ‘yes’ if you want to allow users to specify environment variables in their ~/.ssh/environment file.

  • ssh_compression (String) (defaults to: 'delayed')

    setting for sshd_config. Default is ‘delayed’, which means that compression will be enabled after successful authentication, but can be set to ‘yes’ if you want to enable compression from the start of the connection. The ‘delayed’ setting is a good compromise that allows for faster authentication while still providing the benefits of compression for the rest of the session.

  • ssh_client_alive_interval (String) (defaults to: '0')

    setting for sshd_config. Default is ‘0’, which means that no keepalive messages will be sent by the server, but can be set to a positive integer to specify the interval in seconds between keepalive messages sent by the server to the client. This can be useful to detect and close stale connections, but should be used with caution as it can cause unexpected disconnections if set too aggressively.

  • ssh_client_alive_count_max (String) (defaults to: '3')

    setting for sshd_config. Default is ‘3’. This setting is only relevant if ssh_client_alive_interval is set to a positive integer, and specifies the number of consecutive keepalive messages that can be sent without receiving a response from the client before the server considers the connection to be stale and disconnects it.

  • ssh_use_dns (String) (defaults to: 'no')

    setting for sshd_config. Default is ‘no’, which means that the server will not perform DNS lookups on connecting clients, but can be set to ‘yes’ if you want the server to perform DNS lookups. Disabling DNS lookups can improve connection times and reduce the risk of DNS spoofing attacks, so it is generally recommended to keep this setting disabled unless you have a specific need for it.

  • ssh_pid_file (String) (defaults to: '/var/run/sshd.pid')

    setting for sshd_config. Default is ‘/var/run/sshd.pid’, which is the common location for the sshd PID file, but can be set to a different path if desired. This setting specifies the location of the sshd PID file.

  • ssh_max_startups (String) (defaults to: '10:30:100')

    setting for sshd_config. Default is ‘10:30:100’, which means that the server will allow up to 10 concurrent unauthenticated connections, and will start dropping connections with a probability that increases linearly.

  • ssh_permit_tunnel (String) (defaults to: 'no')

    setting for sshd_config. Default is ‘no’, which means that tunneling is not allowed, but can be set to ‘yes’ if you want to allow tunneling, or ‘point-to-point’ to allow only point-to-point tunneling. This setting should be used with caution if enabled.

  • ssh_chroot_directory (String) (defaults to: 'none')

    setting for sshd_config. Default is ‘none’, which means that no chroot directory will be used, but can be set to a valid directory path if you want to use chroot for SSH sessions.

  • ssh_version_addendum (String) (defaults to: 'none')

    setting for sshd_config. Default is ‘none’, which means that no version addendum will be included in the SSH banner, but can be set to a custom string if you want to include additional information in the SSH version banner. This can be used for branding purposes, but should be used with caution as it can potentially leak information about the server that could be useful to attackers.



188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# File 'manifests/params.pp', line 188

class confdroid_ssh::params (

  Array $ssh_reqpackages                    = ['openssh','openssh-clients','openssh-server'],
  String $pkg_ensure                        = 'present',

  # firewall settings
  String $ssh_fw_rule                       = 'present',
  String $ssh_fw_port                       = '22',
  String $ssh_fw_order                      = '50',
  String $ssh_source_range                  = '0.0.0.0/0',

  # sshd configuration 
  Boolean $ssh_manage_config                = true,
  String  $ssh_address_family               = 'any',
  String  $ssh_listen_address               = '0.0.0.0',
  String  $ssh_root_login                   = 'prohibit-password',
  String  $ssh_strict_modes                 = 'yes',
  String  $ssh_max_auth_tries               = '6',
  String  $ssh_max_sessions                 = '10',
  String  $ssh_pubkey_auth                  = 'yes',
  String  $ssh_auth_key_files               = '.ssh/authorized_keys',
  String  $ssh_authorized_principals_file   = 'none',
  String  $ssh_authorized_keys_command      = 'none',
  String  $ssh_authorized_keys_command_user = 'nobody',
  Boolean $ssh_use_specific_hostkey         = false,
  String  $ssh_hostkey_type                 = 'rsa',
  String  $ssh_rekeylimit                   = 'default none',
  String  $ssh_syslog_facility              = 'AUTH',
  String  $ssh_log_level                    = 'INFO',
  String  $ssh_password_authentication      = 'no',
  String  $ssh_permit_empty_passwords       = 'no',
  String  $ssh_kbd_interactive_auth         = 'no',
  Boolean $ssh_use_kerberos                 = false,
  String  $ssh_kerberos_authentication      = 'yes',
  String  $ssh_kerberos_or_local_passwd     = 'yes',
  String  $ssh_kerberos_ticket_cleanup      = 'yes',
  String  $ssh_kerberos_get_afstoken        = 'no',
  String  $ssh_kerberos_use_kuserok         = 'yes',
  Boolean $ssh_use_gssapi                   = false,
  String  $ssh_gssapi_authentication        = 'yes',
  String  $ssh_gssapi_cleanup_credentials   = 'yes',
  String  $ssh_gssapi_key_exchange          = 'no',
  String  $ssh_gssapi_enablek5users         = 'no',
  String  $ssh_use_pam                      = 'no',
  String  $ssh_allow_agent_forwarding       = 'yes',
  String  $ssh_allow_tcp_forwarding         = 'yes',
  String  $ssh_gateway_ports                = 'no',
  String  $ssh_x11_forwarding               = 'no',
  String  $ssh_x11_display_offset           = '10',
  String  $ssh_x11_use_localhost            = 'yes',
  String  $ssh_permit_tty                   = 'yes',
  String  $ssh_print_motd                   = 'yes',
  String  $ssh_print_lastlog                = 'yes',
  String  $ssh_tcp_keepalive                = 'yes',
  String  $ssh_permit_user_environment      = 'no',
  String  $ssh_compression                  = 'delayed',
  String  $ssh_client_alive_interval        = '0',
  String  $ssh_client_alive_count_max       = '3',
  String  $ssh_use_dns                      = 'no',
  String  $ssh_pid_file                     = '/var/run/sshd.pid',
  String  $ssh_max_startups                 = '10:30:100',
  String  $ssh_permit_tunnel                = 'no',
  String  $ssh_chroot_directory             = 'none',
  String  $ssh_version_addendum             = 'none',

) {
# default facts
  $fqdn                     = $facts['networking']['fqdn']
  $hostname                 = $facts['networking']['hostname']
  $domain                   = $facts['networking']['domain']
  $os_name                  = $facts['os']['name']
  $os_release               = $facts['os']['release']['major']

  $sshd_user                = 'root'
  $ssh_etc_path             = '/etc/ssh'
  $sshd_service             = 'sshd'
  $sshd_config_path         = "${ssh_etc_path}/sshd_config"
  $sshd_custom_path         = "${ssh_etc_path}/sshd_config.d"
  $sshd_custom_conf         = "${sshd_custom_path}/10-custom.conf"
  $sshd_custom_erb          = 'confdroid_ssh/sshd_custom_conf.erb'
  $sshd_config_erb          = 'confdroid_ssh/sshd_config.erb'
  $sshd_root_login_file     = "${sshd_custom_path}/01-permitrootlogin.conf"

  # includes must be last
  include confdroid_ssh::main::config
}