summaryrefslogtreecommitdiff
path: root/puppet/modules/site_shorewall/manifests/defaults.pp
blob: d5639a900f1a4dc587ced97bb9db7b2ddd0594e8 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
class site_shorewall::defaults {
  include shorewall

  # be safe for development
  #if ( $::virtual == 'virtualbox') { $shorewall_startup='0' }

  $ip_address     = hiera('ip_address')
  # a special case for vagrant interfaces
  $interface      = $::virtual ? {
    virtualbox => [ 'eth0', 'eth1' ],
    default    => getvar("interface_${ip_address}")
  }


  # If you want logging:
  shorewall::params {
    'LOG': value => 'debug';
  }

  shorewall::zone {'net': type => 'ipv4'; }


  # define interfaces
  shorewall::interface { $interface:
    zone      => 'net',
    options   => 'tcpflags,blacklist,nosmurfs';
  }

  shorewall::routestopped { $interface: }

  shorewall::policy {
    'fw-to-all':
      sourcezone      => 'fw',
      destinationzone => 'all',
      policy          => 'ACCEPT',
      order           => 100;
    'all-to-all':
      sourcezone      => 'all',
      destinationzone => 'all',
      policy          => 'DROP',
      order           => 200;
  }

  shorewall::rule {
      # ping party
      'all2all-ping':
        source      => 'all',
        destination => 'all',
        action      => 'Ping(ACCEPT)',
        order       => 200;
  }

  include site_shorewall::sshd
}