Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / manifests / rules / out / icmp.pp @ 5d554e75

Historique | Voir | Annoter | Télécharger (1,06 ko)

1
# @summary control outbound icmp packages
2
#
3
# @param v4_types ICMP v4 types that should be allowed
4
# @param v6_types ICMP v6 types that should be allowed
5
# @param order the ordering of the rules
6
#
7
class nftables::rules::out::icmp (
8
  Optional[Array[String]] $v4_types = undef,
9
  Optional[Array[String]] $v6_types = undef,
10
  String $order = '10',
11
) {
12
  if $v4_types {
13
    $v4_types.each | String $icmp_type | {
14
      nftables::rule { 'default_out-accept_icmpv4':
15
        content => "ip protocol icmp icmp type ${icmp_type} accept",
16
        order   => $order,
17
      }
18
    }
19
  } else {
20
    nftables::rule { 'default_out-accept_icmpv4':
21
      content => 'ip protocol icmp accept',
22
      order   => $order,
23
    }
24
  }
25

    
26
  if $v6_types {
27
    $v6_types.each | String $icmp_type | {
28
      nftables::rule { '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 { 'default_out-accept_icmpv6':
35
      content => 'ip6 nexthdr ipv6-icmp accept',
36
      order   => $order,
37
    }
38
  }
39
}