root / manifests / rules / out / icmp.pp @ 09cba182
Historique | Voir | Annoter | Télécharger (1,01 ko)
1 |
# @summary control outbound icmp packages |
---|---|
2 |
class nftables::rules::out::icmp ( |
3 |
# lint:ignore:parameter_documentation |
4 |
Optional[Array[String]] $v4_types = undef, |
5 |
Optional[Array[String]] $v6_types = undef, |
6 |
String $order = '10', |
7 |
# lint:endignore |
8 |
) { |
9 |
if $v4_types { |
10 |
$v4_types.each | String $icmp_type | { |
11 |
nftables::rule { |
12 |
'default_out-accept_icmpv4': |
13 |
content => "ip protocol icmp icmp type ${icmp_type} accept", |
14 |
order => $order, |
15 |
} |
16 |
} |
17 |
} else { |
18 |
nftables::rule { |
19 |
'default_out-accept_icmpv4': |
20 |
content => 'ip protocol icmp accept', |
21 |
order => $order, |
22 |
} |
23 |
} |
24 |
|
25 |
if $v6_types { |
26 |
$v6_types.each | String $icmp_type | { |
27 |
nftables::rule { |
28 |
'default_out-accept_icmpv6': |
29 |
content => "ip6 nexthdr ipv6-icmp icmpv6 type ${icmp_type} accept", |
30 |
order => $order, |
31 |
} |
32 |
} |
33 |
} else { |
34 |
nftables::rule { |
35 |
'default_out-accept_icmpv6': |
36 |
content => 'ip6 nexthdr ipv6-icmp accept', |
37 |
order => $order, |
38 |
} |
39 |
} |
40 |
} |