Projet

Général

Profil

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

root / manifests / rules / out / icmp.pp @ 020842af

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

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