summaryrefslogtreecommitdiff
path: root/manifests/implementations/shorewall/virtual/tor.pp
blob: 2e96cbe1008fc69aee7f099b960943df73f3b575 (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
73
74
75
76
77
78
79
80
81
82
83
84
85
class firewall::implementations::shorewall::virtual::tor($destination, $zone = 'vm') {
  shorewall::rule { 'tor-0':
    action          => 'DNAT',
    source          => 'net',
    destination     => "$zone:$destination:9000",
    proto           => 'tcp',
    destinationport => '9000',
    ratelimit       => '-',
    order           => 2100,
  }

  shorewall::rule { 'tor-1':
    action          => 'DNAT',
    source          => '$FW',
    destination     => "fw:$destination:9000",
    proto           => 'tcp',
    destinationport => '9000',
    originaldest    => lookup('firewall::external_ip', undef, undef, $::ipaddress),
    ratelimit       => '-',
    order           => 2101,
  }

  shorewall::rule { 'tor-2':
    action          => 'DNAT',
    source          => 'net',
    destination     => "$zone:$destination:9001",
    proto           => 'tcp',
    destinationport => '9001',
    ratelimit       => '-',
    order           => 2102,
  }

  shorewall::rule { 'tor-3':
    action          => 'DNAT',
    source          => '$FW',
    destination     => "fw:$destination:9001",
    proto           => 'tcp',
    destinationport => '9001',
    originaldest    => lookup('firewall::external_ip', undef, undef, $::ipaddress),
    ratelimit       => '-',
    order           => 2103,
  }

  shorewall::rule { 'tor-4':
    action          => 'DNAT',
    source          => 'net',
    destination     => "$zone:$destination:9100",
    proto           => 'tcp',
    destinationport => '9100',
    ratelimit       => '-',
    order           => 2104,
  }

  shorewall::rule { 'tor-5':
    action          => 'DNAT',
    source          => '$FW',
    destination     => "fw:$destination:9100",
    proto           => 'tcp',
    destinationport => '9100',
    originaldest    => lookup('firewall::external_ip', undef, undef, $::ipaddress),
    ratelimit       => '-',
    order           => 2105,
  }

  shorewall::rule { 'tor-6':
    action          => 'DNAT',
    source          => 'net',
    destination     => "$zone:$destination:9101",
    proto           => 'tcp',
    destinationport => '9101',
    ratelimit       => '-',
    order           => 2106,
  }

  shorewall::rule { 'tor-7':
    action          => 'DNAT',
    source          => '$FW',
    destination     => "fw:$destination:9101",
    proto           => 'tcp',
    destinationport => '9101',
    originaldest    => lookup('firewall::external_ip', undef, undef, $::ipaddress),
    ratelimit       => '-',
    order           => 2107,
  }
}