# Firewall definitions for physical servers
class firewall(
- $device = hiera('firewall::device', 'eth0'),
- $zone = hiera('firewall::zone', '-'),
- $local_net = hiera('firewall::local_net', false),
- $device_options = hiera('firewall::device_options', 'tcpflags,blacklist,routefilter,nosmurfs,logmartians'),
- $vm_address = hiera('firewall::vm_address', '192.168.0.0/24'),
- $vm_device = hiera('firewall::vm_device', false),
- $ssh = hiera('firewall::ssh', 'ACCEPT'),
+ $device = lookup('firewall::device', undef, undef, 'eth0'),
+ $zone = lookup('firewall::zone', undef, undef, '-'),
+ $local_net = lookup('firewall::local_net', undef, undef, false),
+ $device_options = lookup('firewall::device_options', undef, undef, 'tcpflags,blacklist,routefilter,nosmurfs,logmartians'),
+ $vm_address = lookup('firewall::vm_address', undef, undef, '192.168.0.0/24'),
+ $vm_device = lookup('firewall::vm_device', undef, undef, false),
+ $ssh = lookup('firewall::ssh', undef, undef, 'ACCEPT'),
) {
class { 'shorewall': }
destination => '$FW',
proto => '-',
destinationport => '-',
- ratelimit => hiera("firewall::ssl_ratelimit", '-'),
+ ratelimit => lookup("firewall::ssl_ratelimit", undef, undef, '-'),
order => 103,
}
class firewall::local(
- $network = hiera('firewall::local::network', '192.168.1.0/24'),
- $interface = hiera('firewall::local::interface', 'eth0'),
- $manage_host = hiera('firewall::local::manage_host', true),
- $manage_interface = hiera('firewall::local::manage_iface', false)
+ $network = lookup('firewall::local::network', undef, undef, '192.168.1.0/24'),
+ $interface = lookup('firewall::local::interface', undef, undef, 'eth0'),
+ $manage_host = lookup('firewall::local::manage_host', undef, undef, true),
+ $manage_interface = lookup('firewall::local::manage_iface', undef, undef, false)
) {
if $manage_host {
# When the box is in an internal network and we want to provide
# and external access through a shared real IP, we have to
# redirect requests coming from another port to port 22.
- $ip = hiera('firewall::external_ip', $::ipaddress)
+ $ip = lookup('firewall::external_ip', undef, undef, $::ipaddress)
shorewall::rule { "ssh-redirect-1":
action => 'DNAT',
$destination,
$zone = 'loc',
$originaldest = $ipaddress,
- $range = hiera('firewall::torrent::range', '6881:6999')
+ $range = lookup('firewall::torrent::range', undef, undef, '6881:6999')
) {
shorewall::rule { "torrent-tcp-1":
action => 'DNAT',
class firewall::shaping(
- $device = hiera('firewall::device', 'eth0'),
- $in_bandwidth = hiera('firewall::in_bandwidth', '1000mbps'),
- $out_bandwidth = hiera('firewall::out_bandwidth', '1000mbps')
+ $device = lookup('firewall::device', undef, undef, 'eth0'),
+ $in_bandwidth = lookup('firewall::in_bandwidth', undef, undef, '1000mbps'),
+ $out_bandwidth = lookup('firewall::out_bandwidth', undef, undef, '1000mbps')
) {
#
# Traffic shaping
class firewall::torrent(
- $range = hiera('firewall::torrent::range', '6881:6999')
+ $range = lookup('firewall::torrent::range', undef, undef, '6881:6999')
) {
shorewall::rule { "torrent-tcp":
action => 'ACCEPT',
destination => "fw:$destination:53",
proto => 'tcp',
destinationport => '53',
- originaldest => hiera('firewall::external_ip', $::ipaddress),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
ratelimit => '-',
order => 2002,
}
destination => "fw:$destination:53",
proto => 'udp',
destinationport => '53',
- originaldest => hiera('firewall::external_ip', $::ipaddress),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
ratelimit => '-',
order => 2004,
}
destination => "vm:$destination:9418",
proto => 'tcp',
destinationport => '9418',
- originaldest => hiera('firewall::external_ip', $::ipaddress),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
ratelimit => '-',
order => 800,
}
destination => "fw:$destination:9418",
proto => 'tcp',
destinationport => '9418',
- originaldest => hiera('firewall::external_ip', $::ipaddress),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
ratelimit => '-',
order => 801,
}
destination => "fw:$destination:6523",
proto => 'tcp',
destinationport => '6523',
- originaldest => hiera('firewall::external_ip', $::ipaddress),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
ratelimit => '-',
order => 2400,
}
destination => "vm:$destination:6523",
proto => 'tcp',
destinationport => '6523',
- originaldest => hiera('firewall::external_ip', $::ipaddress),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
ratelimit => '-',
order => 2400,
}
destination => "fw:$destination:80",
proto => 'tcp',
destinationport => '80',
- originaldest => hiera('firewall::external_ip', $::ipaddress),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
ratelimit => '-',
order => 600,
}
destination => "vm:$destination:80",
proto => 'tcp',
destinationport => '80',
- originaldest => hiera('firewall::external_ip', $::ipaddress),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
ratelimit => '-',
order => 601,
}
destination => "fw:$destination:443",
proto => 'tcp',
destinationport => '443',
- originaldest => hiera('firewall::external_ip', $::ipaddress),
- ratelimit => hiera("firewall::ssl_ratelimit", '-'),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
+ ratelimit => lookup("firewall::ssl_ratelimit", undef, undef, '-'),
order => 602,
}
destination => "vm:$destination:443",
proto => 'tcp',
destinationport => '443',
- originaldest => hiera('firewall::external_ip', $::ipaddress),
- ratelimit => hiera("firewall::ssl_ratelimit", '-'),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
+ ratelimit => lookup("firewall::ssl_ratelimit", undef, undef, '-'),
order => 602,
}
}
destination => "$zone:$destination:8000",
proto => 'tcp',
destinationport => '8000',
- originaldest => hiera('firewall::external_ip', $::ipaddress),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
ratelimit => '-',
order => 901,
}
destination => "$zone:$destination:5223",
proto => 'tcp',
destinationport => '5223',
- originaldest => hiera('firewall::external_ip', $::ipaddress),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
ratelimit => '-',
order => 2201,
}
destination => "$zone:$destination:4369",
proto => 'tcp',
destinationport => '4369',
- originaldest => hiera('firewall::external_ip', $::ipaddress),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
ratelimit => '-',
order => 2203,
}
destination => "$zone:$destination:4370",
proto => 'tcp',
destinationport => '4370:4375',
- originaldest => hiera('firewall::external_ip', $::ipaddress),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
ratelimit => '-',
order => 2204,
}
destination => "fw:$destination:25",
proto => 'tcp',
destinationport => '25',
- originaldest => hiera('firewall::external_ip', $::ipaddress),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
ratelimit => '-',
order => 1000,
}
destination => "vm:$destination:25",
proto => 'tcp',
destinationport => '25',
- originaldest => hiera('firewall::external_ip', $::ipaddress),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
ratelimit => '-',
order => 1001,
}
destination => "fw:$destination:993",
proto => 'tcp',
destinationport => '993',
- originaldest => hiera('firewall::external_ip', $::ipaddress),
- ratelimit => hiera("firewall::ssl_ratelimit", '-'),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
+ ratelimit => lookup("firewall::ssl_ratelimit", undef, undef, '-'),
order => 1002,
}
destination => "vm:$destination:993",
proto => 'tcp',
destinationport => '993',
- originaldest => hiera('firewall::external_ip', $::ipaddress),
- ratelimit => hiera("firewall::ssl_ratelimit", '-'),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
+ ratelimit => lookup("firewall::ssl_ratelimit", undef, undef, '-'),
order => 1003,
}
destination => "fw:$destination:587",
proto => 'tcp',
destinationport => '587',
- originaldest => hiera('firewall::external_ip', $::ipaddress),
- ratelimit => hiera("firewall::ssl_ratelimit", '-'),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
+ ratelimit => lookup("firewall::ssl_ratelimit", undef, undef, '-'),
order => 1004,
}
destination => "vm:$destination:587",
proto => 'tcp',
destinationport => '587',
- originaldest => hiera('firewall::external_ip', $::ipaddress),
- ratelimit => hiera("firewall::ssl_ratelimit", '-'),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
+ ratelimit => lookup("firewall::ssl_ratelimit", undef, undef, '-'),
order => 1005,
}
}
destination => "$zone:$destination:64738",
proto => 'udp',
destinationport => '64738',
- originaldest => hiera('firewall::external_ip', $::ipaddress),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
ratelimit => '-',
order => 2301,
}
},
proto => 'tcp',
destinationport => "$port_orig",
- originaldest => hiera('firewall::external_ip', $::ipaddress),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
ratelimit => '-',
order => $order,
}
},
proto => 'tcp',
destinationport => "$port_orig",
- originaldest => hiera('firewall::external_ip', $::ipaddress),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
ratelimit => '-',
order => "2$port_orig",
}
destination => "fw:$destination:9000",
proto => 'tcp',
destinationport => '9000',
- originaldest => hiera('firewall::external_ip', $::ipaddress),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
ratelimit => '-',
order => 2101,
}
destination => "fw:$destination:9001",
proto => 'tcp',
destinationport => '9001',
- originaldest => hiera('firewall::external_ip', $::ipaddress),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
ratelimit => '-',
order => 2103,
}
destination => "fw:$destination:9100",
proto => 'tcp',
destinationport => '9100',
- originaldest => hiera('firewall::external_ip', $::ipaddress),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
ratelimit => '-',
order => 2105,
}
destination => "fw:$destination:9101",
proto => 'tcp',
destinationport => '9101',
- originaldest => hiera('firewall::external_ip', $::ipaddress),
+ originaldest => lookup('firewall::external_ip', undef, undef, $::ipaddress),
ratelimit => '-',
order => 2107,
}