summaryrefslogtreecommitdiff
path: root/puppet/modules/site_shorewall/manifests/sshd.pp
blob: ba1290022f780edbfd58302fb6c2583d61ea78eb (plain)
1
2
3
4
5
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
# configure shorewall for sshd
class site_shorewall::sshd {

  $ssh_config     = hiera('ssh')
  $ssh_port       = $ssh_config['port']

  include shorewall

  # define macro for incoming sshd
  file { '/etc/shorewall/macro.leap_sshd':
    content => "PARAM   -       -       tcp    ${ssh_port}",
    notify  => Exec['shorewall_check'],
    require => Package['shorewall']
  }


  shorewall::rule {
      # outside to server
      'net2fw-ssh':
        source      => 'net',
        destination => '$FW',
        action      => 'leap_sshd(ACCEPT)',
        order       => 200;
  }

  # setup a routestopped rule to allow ssh when shorewall is stopped
  shorewall::routestopped { $site_config::params::interface:
    options => "-   tcp   ${ssh_port}"
  }

}