summaryrefslogtreecommitdiff
path: root/puppet/modules/site_shorewall/manifests/defaults.pp
blob: 6a40d501176d0c5b19bbd4a7f64db0929fbc3705 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
class site_shorewall::defaults {

  include shorewall
  include site_config::params

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

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

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

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

  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;
  }

  package { 'shorewall-init':
    ensure => installed
  }

  augeas {
    # stop instead of clear firewall on shutdown
    'shorewall_SAFESTOP':
      changes => 'set /files/etc/shorewall/shorewall.conf/SAFESTOP Yes',
      lens    => 'Shellvars.lns',
      incl    => '/etc/shorewall/shorewall.conf',
      require => Package['shorewall'],
      notify  => Service[shorewall];
    # require that the interface exist
    'shorewall_REQUIRE_INTERFACE':
      changes => 'set /files/etc/shorewall/shorewall.conf/REQUIRE_INTERFACE Yes',
      lens    => 'Shellvars.lns',
      incl    => '/etc/shorewall/shorewall.conf',
      require => Package['shorewall'],
      notify  => Service[shorewall];
    # configure shorewall-init
    'shorewall-init':
      changes => 'set /files/etc/default/shorewall-init/PRODUCTS shorewall',
      lens    => 'Shellvars.lns',
      incl    => '/etc/default/shorewall-init',
      require => [ Package['shorewall-init'], Service['shorewall'] ]
  }

  include site_shorewall::sshd
}