Projet

Général

Profil

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

root / REFERENCE.md @ 7030bde0

Historique | Voir | Annoter | Télécharger (43,9 ko)

1 e17693e3 Steve Traylen
# Reference
2
3
<!-- DO NOT EDIT: This document was generated by Puppet Strings -->
4
5
## Table of Contents
6
7
### Classes
8
9
* [`nftables`](#nftables): Configure nftables
10 7f6cacc5 Steve Traylen
* [`nftables::bridges`](#nftablesbridges): allow forwarding traffic on bridges
11 e17693e3 Steve Traylen
* [`nftables::inet_filter`](#nftablesinet_filter): manage basic chains in table inet filter
12 a1f09048 Tim Meusel
* [`nftables::inet_filter::fwd_conntrack`](#nftablesinet_filterfwd_conntrack): enable conntrack for fwd
13
* [`nftables::inet_filter::in_out_conntrack`](#nftablesinet_filterin_out_conntrack): manage input & output conntrack
14 e17693e3 Steve Traylen
* [`nftables::ip_nat`](#nftablesip_nat): manage basic chains in table ip nat
15 771b3256 Nacho Barrientos
* [`nftables::rules::activemq`](#nftablesrulesactivemq): Provides input rules for Apache ActiveMQ
16 7f6cacc5 Steve Traylen
* [`nftables::rules::afs3_callback`](#nftablesrulesafs3_callback): Open call back port for AFS clients
17 b9785000 Steve Traylen
* [`nftables::rules::ceph`](#nftablesrulesceph): Ceph is a distributed object store and file system. Enable this to support Ceph's Object Storage Daemons (OSD), Metadata Server Daemons (MDS)
18 09cba182 Steve Traylen
* [`nftables::rules::ceph_mon`](#nftablesrulesceph_mon): Ceph is a distributed object store and file system.
19
Enable this option to support Ceph's Monitor Daemon.
20
* [`nftables::rules::dhcpv6_client`](#nftablesrulesdhcpv6_client): allow DHCPv6 requests in to a host
21 7f6cacc5 Steve Traylen
* [`nftables::rules::dns`](#nftablesrulesdns): manage in dns
22 804b96e4 Nacho Barrientos
* [`nftables::rules::docker_ce`](#nftablesrulesdocker_ce): Default firewall configuration for Docker-CE
23 e17693e3 Steve Traylen
* [`nftables::rules::http`](#nftablesruleshttp): manage in http
24
* [`nftables::rules::https`](#nftablesruleshttps): manage in https
25
* [`nftables::rules::icinga2`](#nftablesrulesicinga2): manage in icinga2
26 7f6cacc5 Steve Traylen
* [`nftables::rules::icmp`](#nftablesrulesicmp)
27 b9785000 Steve Traylen
* [`nftables::rules::nfs`](#nftablesrulesnfs): manage in nfs4
28
* [`nftables::rules::nfs3`](#nftablesrulesnfs3): manage in nfs3
29 7f6cacc5 Steve Traylen
* [`nftables::rules::node_exporter`](#nftablesrulesnode_exporter): manage in node exporter
30 e17693e3 Steve Traylen
* [`nftables::rules::ospf`](#nftablesrulesospf): manage in ospf
31
* [`nftables::rules::ospf3`](#nftablesrulesospf3): manage in ospf3
32
* [`nftables::rules::out::all`](#nftablesrulesoutall): allow all outbound
33 09cba182 Steve Traylen
* [`nftables::rules::out::ceph_client`](#nftablesrulesoutceph_client): Ceph is a distributed object store and file system.
34
Enable this to be a client of Ceph's Monitor (MON),
35
Object Storage Daemons (OSD), Metadata Server Daemons (MDS),
36
and Manager Daemons (MGR).
37 e17693e3 Steve Traylen
* [`nftables::rules::out::chrony`](#nftablesrulesoutchrony): manage out chrony
38
* [`nftables::rules::out::dhcp`](#nftablesrulesoutdhcp): manage out dhcp
39 09cba182 Steve Traylen
* [`nftables::rules::out::dhcpv6_client`](#nftablesrulesoutdhcpv6_client): Allow DHCPv6 requests out of a host
40 e17693e3 Steve Traylen
* [`nftables::rules::out::dns`](#nftablesrulesoutdns): manage out dns
41 a1f09048 Tim Meusel
* [`nftables::rules::out::hkp`](#nftablesrulesouthkp): allow outgoing hkp connections to gpg keyservers
42 e17693e3 Steve Traylen
* [`nftables::rules::out::http`](#nftablesrulesouthttp): manage out http
43
* [`nftables::rules::out::https`](#nftablesrulesouthttps): manage out https
44 09cba182 Steve Traylen
* [`nftables::rules::out::icmp`](#nftablesrulesouticmp): control outbound icmp packages
45 19908f41 mh
* [`nftables::rules::out::imap`](#nftablesrulesoutimap): allow outgoing imap
46 7f6cacc5 Steve Traylen
* [`nftables::rules::out::kerberos`](#nftablesrulesoutkerberos): allows outbound access for kerberos
47 e17693e3 Steve Traylen
* [`nftables::rules::out::mysql`](#nftablesrulesoutmysql): manage out mysql
48 b9785000 Steve Traylen
* [`nftables::rules::out::nfs`](#nftablesrulesoutnfs): manage out nfs
49
* [`nftables::rules::out::nfs3`](#nftablesrulesoutnfs3): manage out nfs3
50 7f6cacc5 Steve Traylen
* [`nftables::rules::out::openafs_client`](#nftablesrulesoutopenafs_client): allows outbound access for afs clients
51 09cba182 Steve Traylen
7000 - afs3-fileserver
52
7002 - afs3-ptserver
53
7003 - vlserver
54 e17693e3 Steve Traylen
* [`nftables::rules::out::ospf`](#nftablesrulesoutospf): manage out ospf
55
* [`nftables::rules::out::ospf3`](#nftablesrulesoutospf3): manage out ospf3
56 19908f41 mh
* [`nftables::rules::out::pop3`](#nftablesrulesoutpop3): allow outgoing pop3
57 e17693e3 Steve Traylen
* [`nftables::rules::out::postgres`](#nftablesrulesoutpostgres): manage out postgres
58
* [`nftables::rules::out::puppet`](#nftablesrulesoutpuppet): manage outgoing puppet
59 194e05d5 Tim Meusel
* [`nftables::rules::out::pxp_agent`](#nftablesrulesoutpxp_agent): manage outgoing pxp-agent
60 19908f41 mh
* [`nftables::rules::out::smtp`](#nftablesrulesoutsmtp): allow outgoing smtp
61
* [`nftables::rules::out::smtp_client`](#nftablesrulesoutsmtp_client): allow outgoing smtp client
62 e17693e3 Steve Traylen
* [`nftables::rules::out::ssh`](#nftablesrulesoutssh): manage out ssh
63
* [`nftables::rules::out::ssh::remove`](#nftablesrulesoutsshremove): disable outgoing ssh
64
* [`nftables::rules::out::tor`](#nftablesrulesouttor): manage out tor
65 2b1896c1 Tim Meusel
* [`nftables::rules::out::whois`](#nftablesrulesoutwhois): allow clients to query remote whois server
66 e17693e3 Steve Traylen
* [`nftables::rules::out::wireguard`](#nftablesrulesoutwireguard): manage out wireguard
67
* [`nftables::rules::puppet`](#nftablesrulespuppet): manage in puppet
68 7f74df2e Tim Meusel
* [`nftables::rules::pxp_agent`](#nftablesrulespxp_agent): manage in pxp-agent
69 cd2a3cbf Nacho Barrientos
* [`nftables::rules::qemu`](#nftablesrulesqemu): Bridged network configuration for qemu/libvirt
70 19908f41 mh
* [`nftables::rules::samba`](#nftablesrulessamba): manage Samba, the suite to allow Windows file sharing on Linux resources.
71 e17693e3 Steve Traylen
* [`nftables::rules::smtp`](#nftablesrulessmtp): manage in smtp
72
* [`nftables::rules::smtp_submission`](#nftablesrulessmtp_submission): manage in smtp submission
73
* [`nftables::rules::smtps`](#nftablesrulessmtps): manage in smtps
74
* [`nftables::rules::ssh`](#nftablesrulesssh): manage in ssh
75
* [`nftables::rules::tor`](#nftablesrulestor): manage in tor
76
* [`nftables::rules::wireguard`](#nftablesruleswireguard): manage in wireguard
77 09cba182 Steve Traylen
* [`nftables::services::dhcpv6_client`](#nftablesservicesdhcpv6_client): Allow in and outbound traffic for DHCPv6 server
78
* [`nftables::services::openafs_client`](#nftablesservicesopenafs_client): Open inbound and outbound ports for an AFS client
79 e17693e3 Steve Traylen
80
### Defined types
81
82
* [`nftables::chain`](#nftableschain): manage a chain
83
* [`nftables::config`](#nftablesconfig): manage a config snippet
84 331b8d85 Steve Traylen
* [`nftables::file`](#nftablesfile): Insert a file into the nftables configuration
85 13f26dfc Nacho Barrientos
* [`nftables::rule`](#nftablesrule): Provides an interface to create a firewall rule
86 e17693e3 Steve Traylen
* [`nftables::rules::dnat4`](#nftablesrulesdnat4): manage a ipv4 dnat rule
87
* [`nftables::rules::masquerade`](#nftablesrulesmasquerade): masquerade all outgoing traffic
88
* [`nftables::rules::snat4`](#nftablesrulessnat4): manage a ipv4 snat rule
89 7f6cacc5 Steve Traylen
* [`nftables::set`](#nftablesset): manage a named set
90 b46c9ce9 Nacho Barrientos
* [`nftables::simplerule`](#nftablessimplerule): Provides a simplified interface to nftables::rule
91 4d63adda Nacho Barrientos
92
### Data types
93
94
* [`Nftables::Addr`](#nftablesaddr): Represents an address expression to be used within a rule.
95
* [`Nftables::Addr::Set`](#nftablesaddrset): Represents a set expression to be used within a rule.
96
* [`Nftables::Port`](#nftablesport): Represents a port expression to be used within a rule.
97
* [`Nftables::Port::Range`](#nftablesportrange): Represents a port range expression to be used within a rule.
98 8c00b818 Nacho Barrientos
* [`Nftables::RuleName`](#nftablesrulename): Represents a rule name to be used in a raw rule created via nftables::rule.
99
It's a dash separated string. The first component describes the chain to
100
add the rule to, the second the rule name and the (optional) third a number.
101
Ex: 'default_in-sshd', 'default_out-my_service-2'.
102
* [`Nftables::SimpleRuleName`](#nftablessimplerulename): Represents a simple rule name to be used in a rule created via nftables::simplerule
103 e17693e3 Steve Traylen
104
## Classes
105
106 09cba182 Steve Traylen
### <a name="nftables"></a>`nftables`
107 e17693e3 Steve Traylen
108
Configure nftables
109
110
#### Examples
111
112 b9785000 Steve Traylen
##### allow dns out and do not allow ntp out
113 e17693e3 Steve Traylen
114
```puppet
115 2063deaf hashworks
class{ 'nftables':
116
  out_ntp => false,
117
  out_dns => true,
118 e17693e3 Steve Traylen
}
119
```
120
121 b9785000 Steve Traylen
##### do not flush particular tables, fail2ban in this case
122
123
```puppet
124 2063deaf hashworks
class{ 'nftables':
125
  noflush_tables => ['inet-f2b-table'],
126 b9785000 Steve Traylen
}
127
```
128
129 e17693e3 Steve Traylen
#### Parameters
130
131 09cba182 Steve Traylen
The following parameters are available in the `nftables` class:
132
133
* [`out_all`](#out_all)
134
* [`out_ntp`](#out_ntp)
135
* [`out_http`](#out_http)
136
* [`out_dns`](#out_dns)
137
* [`out_https`](#out_https)
138
* [`out_icmp`](#out_icmp)
139
* [`in_ssh`](#in_ssh)
140
* [`in_icmp`](#in_icmp)
141 7b9d6ffc Nacho Barrientos
* [`inet_filter`](#inet_filter)
142 09cba182 Steve Traylen
* [`nat`](#nat)
143 b02d6ea9 Nacho Barrientos
* [`nat_table_name`](#nat_table_name)
144 09cba182 Steve Traylen
* [`sets`](#sets)
145
* [`log_prefix`](#log_prefix)
146
* [`log_limit`](#log_limit)
147
* [`reject_with`](#reject_with)
148
* [`in_out_conntrack`](#in_out_conntrack)
149
* [`fwd_conntrack`](#fwd_conntrack)
150
* [`firewalld_enable`](#firewalld_enable)
151
* [`noflush_tables`](#noflush_tables)
152
* [`rules`](#rules)
153 d0a1ffef hashworks
* [`configuration_path`](#configuration_path)
154 8842a597 Tim Meusel
* [`nft_path`](#nft_path)
155 821ec83a Tim Meusel
* [`echo`](#echo)
156 7030bde0 Luis Fernández Álvarez
* [`default_config_mode`](#default_config_mode)
157 09cba182 Steve Traylen
158
##### <a name="out_all"></a>`out_all`
159 e17693e3 Steve Traylen
160
Data type: `Boolean`
161
162
Allow all outbound connections. If `true` then all other
163
out parameters `out_ntp`, `out_dns`, ... will be assuemed
164
false.
165
166
Default value: ``false``
167
168 09cba182 Steve Traylen
##### <a name="out_ntp"></a>`out_ntp`
169 e17693e3 Steve Traylen
170
Data type: `Boolean`
171
172
Allow outbound to ntp servers.
173
174
Default value: ``true``
175
176 09cba182 Steve Traylen
##### <a name="out_http"></a>`out_http`
177 e17693e3 Steve Traylen
178
Data type: `Boolean`
179
180
Allow outbound to http servers.
181
182
Default value: ``true``
183
184 09cba182 Steve Traylen
##### <a name="out_dns"></a>`out_dns`
185 e17693e3 Steve Traylen
186
Data type: `Boolean`
187
188 09cba182 Steve Traylen
Allow outbound to dns servers.
189 e17693e3 Steve Traylen
190
Default value: ``true``
191
192 09cba182 Steve Traylen
##### <a name="out_https"></a>`out_https`
193
194
Data type: `Boolean`
195 e17693e3 Steve Traylen
196
Allow outbound to https servers.
197
198
Default value: ``true``
199
200 09cba182 Steve Traylen
##### <a name="out_icmp"></a>`out_icmp`
201 7f6cacc5 Steve Traylen
202
Data type: `Boolean`
203
204
Allow outbound ICMPv4/v6 traffic.
205
206
Default value: ``true``
207
208 09cba182 Steve Traylen
##### <a name="in_ssh"></a>`in_ssh`
209 e17693e3 Steve Traylen
210
Data type: `Boolean`
211
212
Allow inbound to ssh servers.
213
214
Default value: ``true``
215
216 09cba182 Steve Traylen
##### <a name="in_icmp"></a>`in_icmp`
217 7f6cacc5 Steve Traylen
218
Data type: `Boolean`
219
220
Allow inbound ICMPv4/v6 traffic.
221
222
Default value: ``true``
223
224 7b9d6ffc Nacho Barrientos
##### <a name="inet_filter"></a>`inet_filter`
225
226
Data type: `Boolean`
227
228
Add default tables, chains and rules to process traffic.
229
230
Default value: ``true``
231
232 09cba182 Steve Traylen
##### <a name="nat"></a>`nat`
233 7f6cacc5 Steve Traylen
234
Data type: `Boolean`
235
236
Add default tables and chains to process NAT traffic.
237
238
Default value: ``true``
239
240 b02d6ea9 Nacho Barrientos
##### <a name="nat_table_name"></a>`nat_table_name`
241
242
Data type: `String[1]`
243
244
The name of the 'nat' table.
245
246
Default value: `'nat'`
247
248 09cba182 Steve Traylen
##### <a name="sets"></a>`sets`
249 b9785000 Steve Traylen
250
Data type: `Hash`
251
252
Allows sourcing set definitions directly from Hiera.
253
254
Default value: `{}`
255
256 09cba182 Steve Traylen
##### <a name="log_prefix"></a>`log_prefix`
257 7f6cacc5 Steve Traylen
258
Data type: `String`
259
260
String that will be used as prefix when logging packets. It can contain
261
two variables using standard sprintf() string-formatting:
262
 * chain: Will be replaced by the name of the chain.
263
 * comment: Allows chains to add extra comments.
264
265
Default value: `'[nftables] %<chain>s %<comment>s'`
266
267 09cba182 Steve Traylen
##### <a name="log_limit"></a>`log_limit`
268 b9785000 Steve Traylen
269
Data type: `Variant[Boolean[false], String]`
270
271
String with the content of a limit statement to be applied
272
to the rules that log discarded traffic. Set to false to
273
disable rate limiting.
274
275
Default value: `'3/minute burst 5 packets'`
276
277 09cba182 Steve Traylen
##### <a name="reject_with"></a>`reject_with`
278 7f6cacc5 Steve Traylen
279 b9785000 Steve Traylen
Data type: `Variant[Boolean[false], Pattern[/icmp(v6|x)? type .+|tcp reset/]]`
280 7f6cacc5 Steve Traylen
281
How to discard packets not matching any rule. If `false`, the
282
fate of the packet will be defined by the chain policy (normally
283
drop), otherwise the packet will be rejected with the REJECT_WITH
284
policy indicated by the value of this parameter.
285
286
Default value: `'icmpx type port-unreachable'`
287
288 09cba182 Steve Traylen
##### <a name="in_out_conntrack"></a>`in_out_conntrack`
289 7f6cacc5 Steve Traylen
290
Data type: `Boolean`
291
292
Adds INPUT and OUTPUT rules to allow traffic that's part of an
293
established connection and also to drop invalid packets.
294
295
Default value: ``true``
296
297 09cba182 Steve Traylen
##### <a name="fwd_conntrack"></a>`fwd_conntrack`
298 b9785000 Steve Traylen
299
Data type: `Boolean`
300
301
Adds FORWARD rules to allow traffic that's part of an
302
established connection and also to drop invalid packets.
303
304
Default value: ``false``
305
306 09cba182 Steve Traylen
##### <a name="firewalld_enable"></a>`firewalld_enable`
307 7f6cacc5 Steve Traylen
308
Data type: `Variant[Boolean[false], Enum['mask']]`
309
310
Configures how the firewalld systemd service unit is enabled. It might be
311
useful to set this to false if you're externaly removing firewalld from
312
the system completely.
313
314
Default value: `'mask'`
315
316 09cba182 Steve Traylen
##### <a name="noflush_tables"></a>`noflush_tables`
317 b9785000 Steve Traylen
318 3b8f5945 Steve Traylen
Data type: `Optional[Array[Pattern[/^(ip|ip6|inet|arp|bridge|netdev)-[-a-zA-Z0-9_]+$/],1]]`
319 b9785000 Steve Traylen
320
If specified only other existings tables will be flushed.
321
If left unset all tables will be flushed via a `flush ruleset`
322
323
Default value: ``undef``
324
325 09cba182 Steve Traylen
##### <a name="rules"></a>`rules`
326 7f6cacc5 Steve Traylen
327
Data type: `Hash`
328
329 09cba182 Steve Traylen
Specify hashes of `nftables::rule`s via hiera
330 7f6cacc5 Steve Traylen
331
Default value: `{}`
332
333 d0a1ffef hashworks
##### <a name="configuration_path"></a>`configuration_path`
334
335
Data type: `Stdlib::Unixpath`
336
337
The absolute path to the principal nftables configuration file. The default
338
varies depending on the system, and is set in the module's data.
339
340 8842a597 Tim Meusel
##### <a name="nft_path"></a>`nft_path`
341
342
Data type: `Stdlib::Unixpath`
343
344
Path to the nft binary
345
346 821ec83a Tim Meusel
##### <a name="echo"></a>`echo`
347
348
Data type: `Stdlib::Unixpath`
349
350
Path to the echo binary
351
352 7030bde0 Luis Fernández Álvarez
##### <a name="default_config_mode"></a>`default_config_mode`
353
354
Data type: `Stdlib::Filemode`
355
356
The default file & dir mode for configuration files and directories. The
357
default varies depending on the system, and is set in the module's data.
358
359 09cba182 Steve Traylen
### <a name="nftablesbridges"></a>`nftables::bridges`
360 7f6cacc5 Steve Traylen
361
allow forwarding traffic on bridges
362
363
#### Parameters
364
365 09cba182 Steve Traylen
The following parameters are available in the `nftables::bridges` class:
366 7f6cacc5 Steve Traylen
367 09cba182 Steve Traylen
* [`ensure`](#ensure)
368
* [`bridgenames`](#bridgenames)
369
370
##### <a name="ensure"></a>`ensure`
371 7f6cacc5 Steve Traylen
372
Data type: `Enum['present','absent']`
373
374
375
376
Default value: `'present'`
377
378 09cba182 Steve Traylen
##### <a name="bridgenames"></a>`bridgenames`
379 7f6cacc5 Steve Traylen
380
Data type: `Regexp`
381
382
383
384
Default value: `/^br.+/`
385
386 09cba182 Steve Traylen
### <a name="nftablesinet_filter"></a>`nftables::inet_filter`
387 e17693e3 Steve Traylen
388
manage basic chains in table inet filter
389
390 a1f09048 Tim Meusel
### <a name="nftablesinet_filterfwd_conntrack"></a>`nftables::inet_filter::fwd_conntrack`
391
392
enable conntrack for fwd
393
394
### <a name="nftablesinet_filterin_out_conntrack"></a>`nftables::inet_filter::in_out_conntrack`
395
396
manage input & output conntrack
397
398 09cba182 Steve Traylen
### <a name="nftablesip_nat"></a>`nftables::ip_nat`
399 e17693e3 Steve Traylen
400
manage basic chains in table ip nat
401
402 771b3256 Nacho Barrientos
### <a name="nftablesrulesactivemq"></a>`nftables::rules::activemq`
403
404
Provides input rules for Apache ActiveMQ
405
406
#### Parameters
407
408
The following parameters are available in the `nftables::rules::activemq` class:
409
410
* [`tcp`](#tcp)
411
* [`udp`](#udp)
412
* [`port`](#port)
413
414
##### <a name="tcp"></a>`tcp`
415
416
Data type: `Boolean`
417
418
Create the rule for TCP traffic.
419
420
Default value: ``true``
421
422
##### <a name="udp"></a>`udp`
423
424
Data type: `Boolean`
425
426
Create the rule for UDP traffic.
427
428
Default value: ``true``
429
430
##### <a name="port"></a>`port`
431
432
Data type: `Stdlib::Port`
433
434
The port number for the ActiveMQ daemon.
435
436
Default value: `61616`
437
438 09cba182 Steve Traylen
### <a name="nftablesrulesafs3_callback"></a>`nftables::rules::afs3_callback`
439
440
Open call back port for AFS clients
441 7f6cacc5 Steve Traylen
442 09cba182 Steve Traylen
#### Examples
443
444
##### allow call backs from particular hosts
445
446
```puppet
447 7f6cacc5 Steve Traylen
class{'nftables::rules::afs3_callback':
448
  saddr => ['192.168.0.0/16', '10.0.0.222']
449
}
450 09cba182 Steve Traylen
```
451 7f6cacc5 Steve Traylen
452
#### Parameters
453
454 09cba182 Steve Traylen
The following parameters are available in the `nftables::rules::afs3_callback` class:
455
456
* [`saddr`](#saddr)
457 7f6cacc5 Steve Traylen
458 09cba182 Steve Traylen
##### <a name="saddr"></a>`saddr`
459 7f6cacc5 Steve Traylen
460
Data type: `Array[Stdlib::IP::Address::V4,1]`
461
462
list of source network ranges to a
463
464
Default value: `['0.0.0.0/0']`
465
466 09cba182 Steve Traylen
### <a name="nftablesrulesceph"></a>`nftables::rules::ceph`
467 b9785000 Steve Traylen
468
Ceph is a distributed object store and file system.
469
Enable this to support Ceph's Object Storage Daemons (OSD),
470
Metadata Server Daemons (MDS), or Manager Daemons (MGR).
471
472 09cba182 Steve Traylen
### <a name="nftablesrulesceph_mon"></a>`nftables::rules::ceph_mon`
473 b9785000 Steve Traylen
474
Ceph is a distributed object store and file system.
475
Enable this option to support Ceph's Monitor Daemon.
476
477
#### Parameters
478
479 09cba182 Steve Traylen
The following parameters are available in the `nftables::rules::ceph_mon` class:
480 b9785000 Steve Traylen
481 09cba182 Steve Traylen
* [`ports`](#ports)
482 b9785000 Steve Traylen
483 09cba182 Steve Traylen
##### <a name="ports"></a>`ports`
484 b9785000 Steve Traylen
485 09cba182 Steve Traylen
Data type: `Array[Stdlib::Port,1]`
486 b9785000 Steve Traylen
487 09cba182 Steve Traylen
specify ports for ceph service
488 b9785000 Steve Traylen
489
Default value: `[3300, 6789]`
490
491 09cba182 Steve Traylen
### <a name="nftablesrulesdhcpv6_client"></a>`nftables::rules::dhcpv6_client`
492 7f6cacc5 Steve Traylen
493 09cba182 Steve Traylen
allow DHCPv6 requests in to a host
494 7f6cacc5 Steve Traylen
495 09cba182 Steve Traylen
### <a name="nftablesrulesdns"></a>`nftables::rules::dns`
496 7f6cacc5 Steve Traylen
497
manage in dns
498
499
#### Parameters
500
501 09cba182 Steve Traylen
The following parameters are available in the `nftables::rules::dns` class:
502 7f6cacc5 Steve Traylen
503 09cba182 Steve Traylen
* [`ports`](#ports)
504 7f6cacc5 Steve Traylen
505 09cba182 Steve Traylen
##### <a name="ports"></a>`ports`
506 7f6cacc5 Steve Traylen
507 09cba182 Steve Traylen
Data type: `Array[Stdlib::Port,1]`
508 7f6cacc5 Steve Traylen
509 09cba182 Steve Traylen
Specify ports for dns.
510 7f6cacc5 Steve Traylen
511
Default value: `[53]`
512
513 804b96e4 Nacho Barrientos
### <a name="nftablesrulesdocker_ce"></a>`nftables::rules::docker_ce`
514
515
The configuration distributed in this class represents the default firewall
516
configuration done by docker-ce when the iptables integration is enabled.
517
518
This class is needed as the default docker-ce rules added to ip-filter conflict
519
with the inet-filter forward rules set by default in this module.
520
521
When using this class 'docker::iptables: false' should be set.
522
523
#### Parameters
524
525
The following parameters are available in the `nftables::rules::docker_ce` class:
526
527
* [`docker_interface`](#docker_interface)
528
* [`docker_prefix`](#docker_prefix)
529
* [`manage_docker_chains`](#manage_docker_chains)
530
* [`manage_base_chains`](#manage_base_chains)
531
532
##### <a name="docker_interface"></a>`docker_interface`
533
534
Data type: `String[1]`
535
536
Interface name used by docker.
537
538
Default value: `'docker0'`
539
540
##### <a name="docker_prefix"></a>`docker_prefix`
541
542
Data type: `Stdlib::IP::Address::V4::CIDR`
543
544
The address space used by docker.
545
546
Default value: `'172.17.0.0/16'`
547
548
##### <a name="manage_docker_chains"></a>`manage_docker_chains`
549
550
Data type: `Boolean`
551
552
Flag to control whether the class should create the docker related chains.
553
554
Default value: ``true``
555
556
##### <a name="manage_base_chains"></a>`manage_base_chains`
557
558
Data type: `Boolean`
559
560
Flag to control whether the class should create the base common chains.
561
562
Default value: ``true``
563
564 09cba182 Steve Traylen
### <a name="nftablesruleshttp"></a>`nftables::rules::http`
565 e17693e3 Steve Traylen
566
manage in http
567
568 09cba182 Steve Traylen
### <a name="nftablesruleshttps"></a>`nftables::rules::https`
569 e17693e3 Steve Traylen
570
manage in https
571
572 09cba182 Steve Traylen
### <a name="nftablesrulesicinga2"></a>`nftables::rules::icinga2`
573 e17693e3 Steve Traylen
574
manage in icinga2
575
576
#### Parameters
577
578 09cba182 Steve Traylen
The following parameters are available in the `nftables::rules::icinga2` class:
579 e17693e3 Steve Traylen
580 09cba182 Steve Traylen
* [`ports`](#ports)
581 e17693e3 Steve Traylen
582 09cba182 Steve Traylen
##### <a name="ports"></a>`ports`
583 e17693e3 Steve Traylen
584 09cba182 Steve Traylen
Data type: `Array[Stdlib::Port,1]`
585 e17693e3 Steve Traylen
586 09cba182 Steve Traylen
Specify ports for icinga1
587 e17693e3 Steve Traylen
588
Default value: `[5665]`
589
590 09cba182 Steve Traylen
### <a name="nftablesrulesicmp"></a>`nftables::rules::icmp`
591 7f6cacc5 Steve Traylen
592
The nftables::rules::icmp class.
593
594
#### Parameters
595
596 09cba182 Steve Traylen
The following parameters are available in the `nftables::rules::icmp` class:
597
598
* [`v4_types`](#v4_types)
599
* [`v6_types`](#v6_types)
600
* [`order`](#order)
601 7f6cacc5 Steve Traylen
602 09cba182 Steve Traylen
##### <a name="v4_types"></a>`v4_types`
603 7f6cacc5 Steve Traylen
604
Data type: `Optional[Array[String]]`
605
606
607
608
Default value: ``undef``
609
610 09cba182 Steve Traylen
##### <a name="v6_types"></a>`v6_types`
611 7f6cacc5 Steve Traylen
612
Data type: `Optional[Array[String]]`
613
614
615
616
Default value: ``undef``
617
618 09cba182 Steve Traylen
##### <a name="order"></a>`order`
619 7f6cacc5 Steve Traylen
620
Data type: `String`
621
622
623
624
Default value: `'10'`
625
626 09cba182 Steve Traylen
### <a name="nftablesrulesnfs"></a>`nftables::rules::nfs`
627 b9785000 Steve Traylen
628
manage in nfs4
629
630 09cba182 Steve Traylen
### <a name="nftablesrulesnfs3"></a>`nftables::rules::nfs3`
631 b9785000 Steve Traylen
632
manage in nfs3
633
634 09cba182 Steve Traylen
### <a name="nftablesrulesnode_exporter"></a>`nftables::rules::node_exporter`
635 7f6cacc5 Steve Traylen
636
manage in node exporter
637
638
#### Parameters
639
640 09cba182 Steve Traylen
The following parameters are available in the `nftables::rules::node_exporter` class:
641 7f6cacc5 Steve Traylen
642 09cba182 Steve Traylen
* [`prometheus_server`](#prometheus_server)
643
* [`port`](#port)
644 7f6cacc5 Steve Traylen
645 09cba182 Steve Traylen
##### <a name="prometheus_server"></a>`prometheus_server`
646 7f6cacc5 Steve Traylen
647 09cba182 Steve Traylen
Data type: `Optional[Variant[String,Array[String,1]]]`
648 7f6cacc5 Steve Traylen
649 09cba182 Steve Traylen
Specify server name
650 7f6cacc5 Steve Traylen
651
Default value: ``undef``
652
653 09cba182 Steve Traylen
##### <a name="port"></a>`port`
654 7f6cacc5 Steve Traylen
655 bc1b0f1a Steve Traylen
Data type: `Stdlib::Port`
656 7f6cacc5 Steve Traylen
657 09cba182 Steve Traylen
Specify port to open
658 7f6cacc5 Steve Traylen
659
Default value: `9100`
660
661 09cba182 Steve Traylen
### <a name="nftablesrulesospf"></a>`nftables::rules::ospf`
662 e17693e3 Steve Traylen
663
manage in ospf
664
665 09cba182 Steve Traylen
### <a name="nftablesrulesospf3"></a>`nftables::rules::ospf3`
666 e17693e3 Steve Traylen
667
manage in ospf3
668
669 09cba182 Steve Traylen
### <a name="nftablesrulesoutall"></a>`nftables::rules::out::all`
670 e17693e3 Steve Traylen
671
allow all outbound
672
673 09cba182 Steve Traylen
### <a name="nftablesrulesoutceph_client"></a>`nftables::rules::out::ceph_client`
674 b9785000 Steve Traylen
675
Ceph is a distributed object store and file system.
676
Enable this to be a client of Ceph's Monitor (MON),
677
Object Storage Daemons (OSD), Metadata Server Daemons (MDS),
678
and Manager Daemons (MGR).
679
680
#### Parameters
681
682 09cba182 Steve Traylen
The following parameters are available in the `nftables::rules::out::ceph_client` class:
683 b9785000 Steve Traylen
684 09cba182 Steve Traylen
* [`ports`](#ports)
685 b9785000 Steve Traylen
686 09cba182 Steve Traylen
##### <a name="ports"></a>`ports`
687 b9785000 Steve Traylen
688 09cba182 Steve Traylen
Data type: `Array[Stdlib::Port,1]`
689 b9785000 Steve Traylen
690 09cba182 Steve Traylen
Specify ports to open
691 b9785000 Steve Traylen
692
Default value: `[3300, 6789]`
693
694 09cba182 Steve Traylen
### <a name="nftablesrulesoutchrony"></a>`nftables::rules::out::chrony`
695 e17693e3 Steve Traylen
696
manage out chrony
697
698 7937a13b Tim Meusel
#### Parameters
699
700
The following parameters are available in the `nftables::rules::out::chrony` class:
701
702
* [`servers`](#servers)
703
704
##### <a name="servers"></a>`servers`
705
706
Data type: `Array[Stdlib::IP::Address]`
707
708
single IP-Address or array of IP-addresses from NTP servers
709
710
Default value: `[]`
711
712 09cba182 Steve Traylen
### <a name="nftablesrulesoutdhcp"></a>`nftables::rules::out::dhcp`
713 e17693e3 Steve Traylen
714
manage out dhcp
715
716 09cba182 Steve Traylen
### <a name="nftablesrulesoutdhcpv6_client"></a>`nftables::rules::out::dhcpv6_client`
717 7f6cacc5 Steve Traylen
718 09cba182 Steve Traylen
Allow DHCPv6 requests out of a host
719 7f6cacc5 Steve Traylen
720 09cba182 Steve Traylen
### <a name="nftablesrulesoutdns"></a>`nftables::rules::out::dns`
721 e17693e3 Steve Traylen
722
manage out dns
723
724
#### Parameters
725
726 09cba182 Steve Traylen
The following parameters are available in the `nftables::rules::out::dns` class:
727 e17693e3 Steve Traylen
728 09cba182 Steve Traylen
* [`dns_server`](#dns_server)
729 e17693e3 Steve Traylen
730 09cba182 Steve Traylen
##### <a name="dns_server"></a>`dns_server`
731 e17693e3 Steve Traylen
732 09cba182 Steve Traylen
Data type: `Optional[Variant[String,Array[String,1]]]`
733 e17693e3 Steve Traylen
734 09cba182 Steve Traylen
specify dns_server name
735 e17693e3 Steve Traylen
736
Default value: ``undef``
737
738 a1f09048 Tim Meusel
### <a name="nftablesrulesouthkp"></a>`nftables::rules::out::hkp`
739
740
allow outgoing hkp connections to gpg keyservers
741
742 09cba182 Steve Traylen
### <a name="nftablesrulesouthttp"></a>`nftables::rules::out::http`
743 e17693e3 Steve Traylen
744
manage out http
745
746 09cba182 Steve Traylen
### <a name="nftablesrulesouthttps"></a>`nftables::rules::out::https`
747 e17693e3 Steve Traylen
748
manage out https
749
750 09cba182 Steve Traylen
### <a name="nftablesrulesouticmp"></a>`nftables::rules::out::icmp`
751 7f6cacc5 Steve Traylen
752 09cba182 Steve Traylen
control outbound icmp packages
753 7f6cacc5 Steve Traylen
754
#### Parameters
755
756 09cba182 Steve Traylen
The following parameters are available in the `nftables::rules::out::icmp` class:
757
758
* [`v4_types`](#v4_types)
759
* [`v6_types`](#v6_types)
760
* [`order`](#order)
761 7f6cacc5 Steve Traylen
762 09cba182 Steve Traylen
##### <a name="v4_types"></a>`v4_types`
763 7f6cacc5 Steve Traylen
764
Data type: `Optional[Array[String]]`
765
766
767
768
Default value: ``undef``
769
770 09cba182 Steve Traylen
##### <a name="v6_types"></a>`v6_types`
771 7f6cacc5 Steve Traylen
772
Data type: `Optional[Array[String]]`
773
774
775
776
Default value: ``undef``
777
778 09cba182 Steve Traylen
##### <a name="order"></a>`order`
779 7f6cacc5 Steve Traylen
780
Data type: `String`
781
782
783
784
Default value: `'10'`
785
786 19908f41 mh
### <a name="nftablesrulesoutimap"></a>`nftables::rules::out::imap`
787
788
allow outgoing imap
789
790 09cba182 Steve Traylen
### <a name="nftablesrulesoutkerberos"></a>`nftables::rules::out::kerberos`
791 7f6cacc5 Steve Traylen
792
allows outbound access for kerberos
793
794 09cba182 Steve Traylen
### <a name="nftablesrulesoutmysql"></a>`nftables::rules::out::mysql`
795 e17693e3 Steve Traylen
796
manage out mysql
797
798 09cba182 Steve Traylen
### <a name="nftablesrulesoutnfs"></a>`nftables::rules::out::nfs`
799 b9785000 Steve Traylen
800
manage out nfs
801
802 09cba182 Steve Traylen
### <a name="nftablesrulesoutnfs3"></a>`nftables::rules::out::nfs3`
803 b9785000 Steve Traylen
804
manage out nfs3
805
806 09cba182 Steve Traylen
### <a name="nftablesrulesoutopenafs_client"></a>`nftables::rules::out::openafs_client`
807 7f6cacc5 Steve Traylen
808 09cba182 Steve Traylen
allows outbound access for afs clients
809 7f6cacc5 Steve Traylen
7000 - afs3-fileserver
810
7002 - afs3-ptserver
811
7003 - vlserver
812
813
* **See also**
814
  * https://wiki.openafs.org/devel/AFSServicePorts/
815
    * AFS Service Ports
816
817
#### Parameters
818
819 09cba182 Steve Traylen
The following parameters are available in the `nftables::rules::out::openafs_client` class:
820 7f6cacc5 Steve Traylen
821 09cba182 Steve Traylen
* [`ports`](#ports)
822 7f6cacc5 Steve Traylen
823 09cba182 Steve Traylen
##### <a name="ports"></a>`ports`
824 7f6cacc5 Steve Traylen
825 09cba182 Steve Traylen
Data type: `Array[Stdlib::Port,1]`
826 7f6cacc5 Steve Traylen
827 09cba182 Steve Traylen
port numbers to use
828 7f6cacc5 Steve Traylen
829
Default value: `[7000, 7002, 7003]`
830
831 09cba182 Steve Traylen
### <a name="nftablesrulesoutospf"></a>`nftables::rules::out::ospf`
832 e17693e3 Steve Traylen
833
manage out ospf
834
835 09cba182 Steve Traylen
### <a name="nftablesrulesoutospf3"></a>`nftables::rules::out::ospf3`
836 e17693e3 Steve Traylen
837
manage out ospf3
838
839 19908f41 mh
### <a name="nftablesrulesoutpop3"></a>`nftables::rules::out::pop3`
840
841
allow outgoing pop3
842
843 09cba182 Steve Traylen
### <a name="nftablesrulesoutpostgres"></a>`nftables::rules::out::postgres`
844 e17693e3 Steve Traylen
845
manage out postgres
846
847 09cba182 Steve Traylen
### <a name="nftablesrulesoutpuppet"></a>`nftables::rules::out::puppet`
848 e17693e3 Steve Traylen
849
manage outgoing puppet
850
851
#### Parameters
852
853 09cba182 Steve Traylen
The following parameters are available in the `nftables::rules::out::puppet` class:
854 e17693e3 Steve Traylen
855 09cba182 Steve Traylen
* [`puppetserver`](#puppetserver)
856
* [`puppetserver_port`](#puppetserver_port)
857 e17693e3 Steve Traylen
858 09cba182 Steve Traylen
##### <a name="puppetserver"></a>`puppetserver`
859 e17693e3 Steve Traylen
860 09cba182 Steve Traylen
Data type: `Variant[Stdlib::IP::Address,Array[Stdlib::IP::Address,1]]`
861 e17693e3 Steve Traylen
862 09cba182 Steve Traylen
puppetserver hostname
863 e17693e3 Steve Traylen
864 09cba182 Steve Traylen
##### <a name="puppetserver_port"></a>`puppetserver_port`
865 e17693e3 Steve Traylen
866 bc1b0f1a Steve Traylen
Data type: `Stdlib::Port`
867 e17693e3 Steve Traylen
868 09cba182 Steve Traylen
puppetserver port
869 e17693e3 Steve Traylen
870
Default value: `8140`
871
872 194e05d5 Tim Meusel
### <a name="nftablesrulesoutpxp_agent"></a>`nftables::rules::out::pxp_agent`
873
874
manage outgoing pxp-agent
875
876
* **See also**
877
  * also
878
    * take a look at nftables::rules::out::puppet, because the PXP agent also connects to a Puppetserver
879
880
#### Parameters
881
882
The following parameters are available in the `nftables::rules::out::pxp_agent` class:
883
884
* [`broker`](#broker)
885
* [`broker_port`](#broker_port)
886
887
##### <a name="broker"></a>`broker`
888
889
Data type: `Variant[Stdlib::IP::Address,Array[Stdlib::IP::Address,1]]`
890
891
PXP broker IP(s)
892
893
##### <a name="broker_port"></a>`broker_port`
894
895
Data type: `Stdlib::Port`
896
897
PXP broker port
898
899
Default value: `8142`
900
901 09cba182 Steve Traylen
### <a name="nftablesrulesoutsmtp"></a>`nftables::rules::out::smtp`
902 e17693e3 Steve Traylen
903 19908f41 mh
allow outgoing smtp
904
905
### <a name="nftablesrulesoutsmtp_client"></a>`nftables::rules::out::smtp_client`
906
907
allow outgoing smtp client
908 e17693e3 Steve Traylen
909 09cba182 Steve Traylen
### <a name="nftablesrulesoutssh"></a>`nftables::rules::out::ssh`
910 e17693e3 Steve Traylen
911
manage out ssh
912
913 09cba182 Steve Traylen
### <a name="nftablesrulesoutsshremove"></a>`nftables::rules::out::ssh::remove`
914 e17693e3 Steve Traylen
915
disable outgoing ssh
916
917 09cba182 Steve Traylen
### <a name="nftablesrulesouttor"></a>`nftables::rules::out::tor`
918 e17693e3 Steve Traylen
919
manage out tor
920
921 2b1896c1 Tim Meusel
### <a name="nftablesrulesoutwhois"></a>`nftables::rules::out::whois`
922
923
allow clients to query remote whois server
924
925 09cba182 Steve Traylen
### <a name="nftablesrulesoutwireguard"></a>`nftables::rules::out::wireguard`
926 e17693e3 Steve Traylen
927
manage out wireguard
928
929
#### Parameters
930
931 09cba182 Steve Traylen
The following parameters are available in the `nftables::rules::out::wireguard` class:
932 e17693e3 Steve Traylen
933 09cba182 Steve Traylen
* [`ports`](#ports)
934 e17693e3 Steve Traylen
935 09cba182 Steve Traylen
##### <a name="ports"></a>`ports`
936 e17693e3 Steve Traylen
937 09cba182 Steve Traylen
Data type: `Array[Integer,1]`
938 e17693e3 Steve Traylen
939 09cba182 Steve Traylen
specify wireguard ports
940 e17693e3 Steve Traylen
941
Default value: `[51820]`
942
943 09cba182 Steve Traylen
### <a name="nftablesrulespuppet"></a>`nftables::rules::puppet`
944 e17693e3 Steve Traylen
945
manage in puppet
946
947
#### Parameters
948
949 09cba182 Steve Traylen
The following parameters are available in the `nftables::rules::puppet` class:
950 e17693e3 Steve Traylen
951 09cba182 Steve Traylen
* [`ports`](#ports)
952 e17693e3 Steve Traylen
953 09cba182 Steve Traylen
##### <a name="ports"></a>`ports`
954 e17693e3 Steve Traylen
955 09cba182 Steve Traylen
Data type: `Array[Integer,1]`
956 e17693e3 Steve Traylen
957 09cba182 Steve Traylen
puppet server ports
958 e17693e3 Steve Traylen
959
Default value: `[8140]`
960
961 7f74df2e Tim Meusel
### <a name="nftablesrulespxp_agent"></a>`nftables::rules::pxp_agent`
962
963
manage in pxp-agent
964
965
#### Parameters
966
967
The following parameters are available in the `nftables::rules::pxp_agent` class:
968
969
* [`ports`](#ports)
970
971
##### <a name="ports"></a>`ports`
972
973 2b1896c1 Tim Meusel
Data type: `Array[Stdlib::Port,1]`
974 7f74df2e Tim Meusel
975
pxp server ports
976
977
Default value: `[8142]`
978
979 cd2a3cbf Nacho Barrientos
### <a name="nftablesrulesqemu"></a>`nftables::rules::qemu`
980
981
This class configures the typical firewall setup that libvirt
982
creates. Depending on your requirements you can switch on and off
983
several aspects, for instance if you don't do DHCP to your guests
984
you can disable the rules that accept DHCP traffic on the host or if
985
you don't want your guests to talk to hosts outside you can disable
986
forwarding and/or masquerading for IPv4 traffic.
987
988
#### Parameters
989
990
The following parameters are available in the `nftables::rules::qemu` class:
991
992
* [`interface`](#interface)
993
* [`network_v4`](#network_v4)
994
* [`network_v6`](#network_v6)
995
* [`dns`](#dns)
996
* [`dhcpv4`](#dhcpv4)
997
* [`forward_traffic`](#forward_traffic)
998
* [`internal_traffic`](#internal_traffic)
999
* [`masquerade`](#masquerade)
1000
1001
##### <a name="interface"></a>`interface`
1002
1003
Data type: `String[1]`
1004
1005
Interface name used by the bridge.
1006
1007
Default value: `'virbr0'`
1008
1009
##### <a name="network_v4"></a>`network_v4`
1010
1011
Data type: `Stdlib::IP::Address::V4::CIDR`
1012
1013
The IPv4 network prefix used in the virtual network.
1014
1015
Default value: `'192.168.122.0/24'`
1016
1017
##### <a name="network_v6"></a>`network_v6`
1018
1019
Data type: `Optional[Stdlib::IP::Address::V6::CIDR]`
1020
1021
The IPv6 network prefix used in the virtual network.
1022
1023
Default value: ``undef``
1024
1025
##### <a name="dns"></a>`dns`
1026
1027
Data type: `Boolean`
1028
1029
Allow DNS traffic from the guests to the host.
1030
1031
Default value: ``true``
1032
1033
##### <a name="dhcpv4"></a>`dhcpv4`
1034
1035
Data type: `Boolean`
1036
1037
Allow DHCPv4 traffic from the guests to the host.
1038
1039
Default value: ``true``
1040
1041
##### <a name="forward_traffic"></a>`forward_traffic`
1042
1043
Data type: `Boolean`
1044
1045
Allow forwarded traffic (out all, in related/established)
1046
generated by the virtual network.
1047
1048
Default value: ``true``
1049
1050
##### <a name="internal_traffic"></a>`internal_traffic`
1051
1052
Data type: `Boolean`
1053
1054
Allow guests in the virtual network to talk to each other.
1055
1056
Default value: ``true``
1057
1058
##### <a name="masquerade"></a>`masquerade`
1059
1060
Data type: `Boolean`
1061
1062
Do NAT masquerade on all IPv4 traffic generated by guests
1063
to external networks.
1064
1065
Default value: ``true``
1066
1067 19908f41 mh
### <a name="nftablesrulessamba"></a>`nftables::rules::samba`
1068
1069
manage Samba, the suite to allow Windows file sharing on Linux resources.
1070
1071
#### Parameters
1072
1073
The following parameters are available in the `nftables::rules::samba` class:
1074
1075
* [`ctdb`](#ctdb)
1076
1077
##### <a name="ctdb"></a>`ctdb`
1078
1079
Data type: `Boolean`
1080
1081
Enable ctdb-driven clustered Samba setups.
1082
1083
Default value: ``false``
1084
1085 09cba182 Steve Traylen
### <a name="nftablesrulessmtp"></a>`nftables::rules::smtp`
1086 e17693e3 Steve Traylen
1087
manage in smtp
1088
1089 09cba182 Steve Traylen
### <a name="nftablesrulessmtp_submission"></a>`nftables::rules::smtp_submission`
1090 e17693e3 Steve Traylen
1091
manage in smtp submission
1092
1093 09cba182 Steve Traylen
### <a name="nftablesrulessmtps"></a>`nftables::rules::smtps`
1094 e17693e3 Steve Traylen
1095
manage in smtps
1096
1097 09cba182 Steve Traylen
### <a name="nftablesrulesssh"></a>`nftables::rules::ssh`
1098 e17693e3 Steve Traylen
1099
manage in ssh
1100
1101
#### Parameters
1102
1103 09cba182 Steve Traylen
The following parameters are available in the `nftables::rules::ssh` class:
1104 e17693e3 Steve Traylen
1105 09cba182 Steve Traylen
* [`ports`](#ports)
1106 e17693e3 Steve Traylen
1107 09cba182 Steve Traylen
##### <a name="ports"></a>`ports`
1108 e17693e3 Steve Traylen
1109 09cba182 Steve Traylen
Data type: `Array[Stdlib::Port,1]`
1110 e17693e3 Steve Traylen
1111 09cba182 Steve Traylen
ssh ports
1112 e17693e3 Steve Traylen
1113
Default value: `[22]`
1114
1115 09cba182 Steve Traylen
### <a name="nftablesrulestor"></a>`nftables::rules::tor`
1116 e17693e3 Steve Traylen
1117
manage in tor
1118
1119
#### Parameters
1120
1121 09cba182 Steve Traylen
The following parameters are available in the `nftables::rules::tor` class:
1122 e17693e3 Steve Traylen
1123 09cba182 Steve Traylen
* [`ports`](#ports)
1124 e17693e3 Steve Traylen
1125 09cba182 Steve Traylen
##### <a name="ports"></a>`ports`
1126 e17693e3 Steve Traylen
1127 09cba182 Steve Traylen
Data type: `Array[Stdlib::Port,1]`
1128 e17693e3 Steve Traylen
1129 09cba182 Steve Traylen
ports for tor
1130 e17693e3 Steve Traylen
1131
Default value: `[9001]`
1132
1133 09cba182 Steve Traylen
### <a name="nftablesruleswireguard"></a>`nftables::rules::wireguard`
1134 e17693e3 Steve Traylen
1135
manage in wireguard
1136
1137
#### Parameters
1138
1139 09cba182 Steve Traylen
The following parameters are available in the `nftables::rules::wireguard` class:
1140 e17693e3 Steve Traylen
1141 09cba182 Steve Traylen
* [`ports`](#ports)
1142 e17693e3 Steve Traylen
1143 09cba182 Steve Traylen
##### <a name="ports"></a>`ports`
1144 e17693e3 Steve Traylen
1145 09cba182 Steve Traylen
Data type: `Array[Stdlib::Port,1]`
1146 e17693e3 Steve Traylen
1147 09cba182 Steve Traylen
wiregueard port
1148 e17693e3 Steve Traylen
1149
Default value: `[51820]`
1150
1151 09cba182 Steve Traylen
### <a name="nftablesservicesdhcpv6_client"></a>`nftables::services::dhcpv6_client`
1152 7f6cacc5 Steve Traylen
1153 09cba182 Steve Traylen
Allow in and outbound traffic for DHCPv6 server
1154 7f6cacc5 Steve Traylen
1155 09cba182 Steve Traylen
### <a name="nftablesservicesopenafs_client"></a>`nftables::services::openafs_client`
1156 7f6cacc5 Steve Traylen
1157 09cba182 Steve Traylen
Open inbound and outbound ports for an AFS client
1158 7f6cacc5 Steve Traylen
1159 e17693e3 Steve Traylen
## Defined types
1160
1161 09cba182 Steve Traylen
### <a name="nftableschain"></a>`nftables::chain`
1162 e17693e3 Steve Traylen
1163
manage a chain
1164
1165
#### Parameters
1166
1167 09cba182 Steve Traylen
The following parameters are available in the `nftables::chain` defined type:
1168
1169
* [`table`](#table)
1170
* [`chain`](#chain)
1171
* [`inject`](#inject)
1172
* [`inject_iif`](#inject_iif)
1173
* [`inject_oif`](#inject_oif)
1174 e17693e3 Steve Traylen
1175 09cba182 Steve Traylen
##### <a name="table"></a>`table`
1176 e17693e3 Steve Traylen
1177 7030bde0 Luis Fernández Álvarez
Data type: `Pattern[/^(ip|ip6|inet|netdev|bridge)-[a-zA-Z0-9_]+$/]`
1178 e17693e3 Steve Traylen
1179
1180
1181
Default value: `'inet-filter'`
1182
1183 09cba182 Steve Traylen
##### <a name="chain"></a>`chain`
1184 e17693e3 Steve Traylen
1185
Data type: `Pattern[/^[a-zA-Z0-9_]+$/]`
1186
1187
1188
1189
Default value: `$title`
1190
1191 09cba182 Steve Traylen
##### <a name="inject"></a>`inject`
1192 e17693e3 Steve Traylen
1193
Data type: `Optional[Pattern[/^\d\d-[a-zA-Z0-9_]+$/]]`
1194
1195
1196
1197
Default value: ``undef``
1198
1199 09cba182 Steve Traylen
##### <a name="inject_iif"></a>`inject_iif`
1200 e17693e3 Steve Traylen
1201
Data type: `Optional[String]`
1202
1203
1204
1205
Default value: ``undef``
1206
1207 09cba182 Steve Traylen
##### <a name="inject_oif"></a>`inject_oif`
1208 e17693e3 Steve Traylen
1209
Data type: `Optional[String]`
1210
1211
1212
1213
Default value: ``undef``
1214
1215 09cba182 Steve Traylen
### <a name="nftablesconfig"></a>`nftables::config`
1216 e17693e3 Steve Traylen
1217
manage a config snippet
1218
1219
#### Parameters
1220
1221 09cba182 Steve Traylen
The following parameters are available in the `nftables::config` defined type:
1222 e17693e3 Steve Traylen
1223 09cba182 Steve Traylen
* [`tablespec`](#tablespec)
1224
* [`content`](#content)
1225
* [`source`](#source)
1226
* [`prefix`](#prefix)
1227
1228
##### <a name="tablespec"></a>`tablespec`
1229 13f4e4c6 Steve Traylen
1230
Data type: `Pattern[/^\w+-\w+$/]`
1231
1232
1233
1234
Default value: `$title`
1235
1236 09cba182 Steve Traylen
##### <a name="content"></a>`content`
1237 e17693e3 Steve Traylen
1238
Data type: `Optional[String]`
1239
1240
1241
1242
Default value: ``undef``
1243
1244 09cba182 Steve Traylen
##### <a name="source"></a>`source`
1245 e17693e3 Steve Traylen
1246
Data type: `Optional[Variant[String,Array[String,1]]]`
1247
1248
1249
1250
Default value: ``undef``
1251
1252 09cba182 Steve Traylen
##### <a name="prefix"></a>`prefix`
1253 13f4e4c6 Steve Traylen
1254
Data type: `String`
1255
1256
1257
1258
Default value: `'custom-'`
1259
1260 331b8d85 Steve Traylen
### <a name="nftablesfile"></a>`nftables::file`
1261
1262
Insert a file into the nftables configuration
1263
1264
#### Examples
1265
1266
##### Include a file that includes other files
1267
1268
```puppet
1269
nftables::file{'geoip':
1270
  content => @(EOT)
1271
    include "/var/local/geoipsets/dbip/nftset/ipv4/*.ipv4"
1272
    include "/var/local/geoipsets/dbip/nftset/ipv6/*.ipv6"
1273
    |EOT,
1274
}
1275
```
1276
1277
#### Parameters
1278
1279
The following parameters are available in the `nftables::file` defined type:
1280
1281
* [`label`](#label)
1282
* [`content`](#content)
1283
* [`source`](#source)
1284
* [`prefix`](#prefix)
1285
1286
##### <a name="label"></a>`label`
1287
1288
Data type: `String[1]`
1289
1290
Unique name to include in filename.
1291
1292
Default value: `$title`
1293
1294
##### <a name="content"></a>`content`
1295
1296
Data type: `Optional[String]`
1297
1298
The content to place in the file.
1299
1300
Default value: ``undef``
1301
1302
##### <a name="source"></a>`source`
1303
1304
Data type: `Optional[Variant[String,Array[String,1]]]`
1305
1306
A source to obtain the file content from.
1307
1308
Default value: ``undef``
1309
1310
##### <a name="prefix"></a>`prefix`
1311
1312
Data type: `String`
1313
1314
Prefix of file name to be created, if left as `file-` it will be
1315
auto included in the main nft configuration
1316
1317
Default value: `'file-'`
1318
1319 09cba182 Steve Traylen
### <a name="nftablesrule"></a>`nftables::rule`
1320 e17693e3 Steve Traylen
1321 13f26dfc Nacho Barrientos
Provides an interface to create a firewall rule
1322
1323
#### Examples
1324
1325
##### add a rule named 'myhttp' to the 'default_in' chain to allow incoming traffic to TCP port 80
1326
1327
```puppet
1328
nftables::rule {
1329
  'default_in-myhttp':
1330
    content => 'tcp dport 80 accept',
1331
}
1332
```
1333
1334
##### add a rule named 'count' to the 'PREROUTING6' chain in table 'ip6 nat' to count traffic
1335
1336
```puppet
1337
nftables::rule {
1338
  'PREROUTING6-count':
1339
    content => 'counter',
1340
    table   => 'ip6-nat'
1341
}
1342
```
1343 e17693e3 Steve Traylen
1344
#### Parameters
1345
1346 09cba182 Steve Traylen
The following parameters are available in the `nftables::rule` defined type:
1347
1348
* [`ensure`](#ensure)
1349
* [`rulename`](#rulename)
1350
* [`order`](#order)
1351
* [`table`](#table)
1352
* [`content`](#content)
1353
* [`source`](#source)
1354 e17693e3 Steve Traylen
1355 09cba182 Steve Traylen
##### <a name="ensure"></a>`ensure`
1356 e17693e3 Steve Traylen
1357
Data type: `Enum['present','absent']`
1358
1359 13f26dfc Nacho Barrientos
Should the rule be created.
1360 e17693e3 Steve Traylen
1361
Default value: `'present'`
1362
1363 09cba182 Steve Traylen
##### <a name="rulename"></a>`rulename`
1364 e17693e3 Steve Traylen
1365 8c00b818 Nacho Barrientos
Data type: `Nftables::RuleName`
1366 e17693e3 Steve Traylen
1367 13f26dfc Nacho Barrientos
The symbolic name for the rule and to what chain to add it. The
1368
format is defined by the Nftables::RuleName type.
1369 e17693e3 Steve Traylen
1370
Default value: `$title`
1371
1372 09cba182 Steve Traylen
##### <a name="order"></a>`order`
1373 e17693e3 Steve Traylen
1374
Data type: `Pattern[/^\d\d$/]`
1375
1376 13f26dfc Nacho Barrientos
A number representing the order of the rule.
1377 e17693e3 Steve Traylen
1378
Default value: `'50'`
1379
1380 09cba182 Steve Traylen
##### <a name="table"></a>`table`
1381 e17693e3 Steve Traylen
1382 b02d6ea9 Nacho Barrientos
Data type: `String`
1383 e17693e3 Steve Traylen
1384 13f26dfc Nacho Barrientos
The name of the table to add this rule to.
1385 e17693e3 Steve Traylen
1386
Default value: `'inet-filter'`
1387
1388 09cba182 Steve Traylen
##### <a name="content"></a>`content`
1389 e17693e3 Steve Traylen
1390
Data type: `Optional[String]`
1391
1392 13f26dfc Nacho Barrientos
The raw statements that compose the rule represented using the nftables
1393
language.
1394 e17693e3 Steve Traylen
1395
Default value: ``undef``
1396
1397 09cba182 Steve Traylen
##### <a name="source"></a>`source`
1398 e17693e3 Steve Traylen
1399
Data type: `Optional[Variant[String,Array[String,1]]]`
1400
1401 13f26dfc Nacho Barrientos
Same goal as content but sourcing the value from a file.
1402 e17693e3 Steve Traylen
1403
Default value: ``undef``
1404
1405 09cba182 Steve Traylen
### <a name="nftablesrulesdnat4"></a>`nftables::rules::dnat4`
1406 e17693e3 Steve Traylen
1407
manage a ipv4 dnat rule
1408
1409
#### Parameters
1410
1411 09cba182 Steve Traylen
The following parameters are available in the `nftables::rules::dnat4` defined type:
1412
1413
* [`daddr`](#daddr)
1414
* [`port`](#port)
1415
* [`rulename`](#rulename)
1416
* [`order`](#order)
1417
* [`chain`](#chain)
1418
* [`iif`](#iif)
1419
* [`proto`](#proto)
1420
* [`dport`](#dport)
1421
* [`ensure`](#ensure)
1422 e17693e3 Steve Traylen
1423 09cba182 Steve Traylen
##### <a name="daddr"></a>`daddr`
1424 e17693e3 Steve Traylen
1425
Data type: `Pattern[/^[12]?\d{1,2}\.[12]?\d{1,2}\.[12]?\d{1,2}\.[12]?\d{1,2}$/]`
1426
1427
1428
1429 09cba182 Steve Traylen
##### <a name="port"></a>`port`
1430 e17693e3 Steve Traylen
1431 bc1b0f1a Steve Traylen
Data type: `Variant[String,Stdlib::Port]`
1432 e17693e3 Steve Traylen
1433
1434
1435 09cba182 Steve Traylen
##### <a name="rulename"></a>`rulename`
1436 e17693e3 Steve Traylen
1437
Data type: `Pattern[/^[a-zA-Z0-9_]+$/]`
1438
1439
1440
1441
Default value: `$title`
1442
1443 09cba182 Steve Traylen
##### <a name="order"></a>`order`
1444 e17693e3 Steve Traylen
1445
Data type: `Pattern[/^\d\d$/]`
1446
1447
1448
1449
Default value: `'50'`
1450
1451 09cba182 Steve Traylen
##### <a name="chain"></a>`chain`
1452 e17693e3 Steve Traylen
1453
Data type: `String[1]`
1454
1455
1456
1457
Default value: `'default_fwd'`
1458
1459 09cba182 Steve Traylen
##### <a name="iif"></a>`iif`
1460 e17693e3 Steve Traylen
1461
Data type: `Optional[String[1]]`
1462
1463
1464
1465
Default value: ``undef``
1466
1467 09cba182 Steve Traylen
##### <a name="proto"></a>`proto`
1468 e17693e3 Steve Traylen
1469
Data type: `Enum['tcp','udp']`
1470
1471
1472
1473
Default value: `'tcp'`
1474
1475 09cba182 Steve Traylen
##### <a name="dport"></a>`dport`
1476 e17693e3 Steve Traylen
1477 bc1b0f1a Steve Traylen
Data type: `Optional[Variant[String,Stdlib::Port]]`
1478 e17693e3 Steve Traylen
1479
1480
1481 b02d6ea9 Nacho Barrientos
Default value: ``undef``
1482 e17693e3 Steve Traylen
1483 09cba182 Steve Traylen
##### <a name="ensure"></a>`ensure`
1484 e17693e3 Steve Traylen
1485
Data type: `Enum['present','absent']`
1486
1487
1488
1489
Default value: `'present'`
1490
1491 09cba182 Steve Traylen
### <a name="nftablesrulesmasquerade"></a>`nftables::rules::masquerade`
1492 e17693e3 Steve Traylen
1493
masquerade all outgoing traffic
1494
1495
#### Parameters
1496
1497 09cba182 Steve Traylen
The following parameters are available in the `nftables::rules::masquerade` defined type:
1498 e17693e3 Steve Traylen
1499 09cba182 Steve Traylen
* [`rulename`](#rulename)
1500
* [`order`](#order)
1501
* [`chain`](#chain)
1502
* [`oif`](#oif)
1503
* [`saddr`](#saddr)
1504
* [`daddr`](#daddr)
1505
* [`proto`](#proto)
1506
* [`dport`](#dport)
1507
* [`ensure`](#ensure)
1508
1509
##### <a name="rulename"></a>`rulename`
1510 e17693e3 Steve Traylen
1511
Data type: `Pattern[/^[a-zA-Z0-9_]+$/]`
1512
1513
1514
1515
Default value: `$title`
1516
1517 09cba182 Steve Traylen
##### <a name="order"></a>`order`
1518 e17693e3 Steve Traylen
1519
Data type: `Pattern[/^\d\d$/]`
1520
1521
1522
1523
Default value: `'70'`
1524
1525 09cba182 Steve Traylen
##### <a name="chain"></a>`chain`
1526 e17693e3 Steve Traylen
1527
Data type: `String[1]`
1528
1529
1530
1531
Default value: `'POSTROUTING'`
1532
1533 09cba182 Steve Traylen
##### <a name="oif"></a>`oif`
1534 e17693e3 Steve Traylen
1535
Data type: `Optional[String[1]]`
1536
1537
1538
1539
Default value: ``undef``
1540
1541 09cba182 Steve Traylen
##### <a name="saddr"></a>`saddr`
1542 e17693e3 Steve Traylen
1543
Data type: `Optional[String[1]]`
1544
1545
1546
1547
Default value: ``undef``
1548
1549 09cba182 Steve Traylen
##### <a name="daddr"></a>`daddr`
1550 e17693e3 Steve Traylen
1551
Data type: `Optional[String[1]]`
1552
1553
1554
1555
Default value: ``undef``
1556
1557 09cba182 Steve Traylen
##### <a name="proto"></a>`proto`
1558 e17693e3 Steve Traylen
1559
Data type: `Optional[Enum['tcp','udp']]`
1560
1561
1562
1563
Default value: ``undef``
1564
1565 09cba182 Steve Traylen
##### <a name="dport"></a>`dport`
1566 e17693e3 Steve Traylen
1567 bc1b0f1a Steve Traylen
Data type: `Optional[Variant[String,Stdlib::Port]]`
1568 e17693e3 Steve Traylen
1569
1570
1571
Default value: ``undef``
1572
1573 09cba182 Steve Traylen
##### <a name="ensure"></a>`ensure`
1574 e17693e3 Steve Traylen
1575
Data type: `Enum['present','absent']`
1576
1577
1578
1579
Default value: `'present'`
1580
1581 09cba182 Steve Traylen
### <a name="nftablesrulessnat4"></a>`nftables::rules::snat4`
1582 e17693e3 Steve Traylen
1583
manage a ipv4 snat rule
1584
1585
#### Parameters
1586
1587 09cba182 Steve Traylen
The following parameters are available in the `nftables::rules::snat4` defined type:
1588
1589
* [`snat`](#snat)
1590
* [`rulename`](#rulename)
1591
* [`order`](#order)
1592
* [`chain`](#chain)
1593
* [`oif`](#oif)
1594
* [`saddr`](#saddr)
1595
* [`proto`](#proto)
1596
* [`dport`](#dport)
1597
* [`ensure`](#ensure)
1598 e17693e3 Steve Traylen
1599 09cba182 Steve Traylen
##### <a name="snat"></a>`snat`
1600 e17693e3 Steve Traylen
1601
Data type: `String[1]`
1602
1603
1604
1605 09cba182 Steve Traylen
##### <a name="rulename"></a>`rulename`
1606 e17693e3 Steve Traylen
1607
Data type: `Pattern[/^[a-zA-Z0-9_]+$/]`
1608
1609
1610
1611
Default value: `$title`
1612
1613 09cba182 Steve Traylen
##### <a name="order"></a>`order`
1614 e17693e3 Steve Traylen
1615
Data type: `Pattern[/^\d\d$/]`
1616
1617
1618
1619
Default value: `'70'`
1620
1621 09cba182 Steve Traylen
##### <a name="chain"></a>`chain`
1622 e17693e3 Steve Traylen
1623
Data type: `String[1]`
1624
1625
1626
1627
Default value: `'POSTROUTING'`
1628
1629 09cba182 Steve Traylen
##### <a name="oif"></a>`oif`
1630 e17693e3 Steve Traylen
1631
Data type: `Optional[String[1]]`
1632
1633
1634
1635
Default value: ``undef``
1636
1637 09cba182 Steve Traylen
##### <a name="saddr"></a>`saddr`
1638 e17693e3 Steve Traylen
1639
Data type: `Optional[String[1]]`
1640
1641
1642
1643
Default value: ``undef``
1644
1645 09cba182 Steve Traylen
##### <a name="proto"></a>`proto`
1646 e17693e3 Steve Traylen
1647
Data type: `Optional[Enum['tcp','udp']]`
1648
1649
1650
1651
Default value: ``undef``
1652
1653 09cba182 Steve Traylen
##### <a name="dport"></a>`dport`
1654 e17693e3 Steve Traylen
1655 bc1b0f1a Steve Traylen
Data type: `Optional[Variant[String,Stdlib::Port]]`
1656 e17693e3 Steve Traylen
1657
1658
1659
Default value: ``undef``
1660
1661 09cba182 Steve Traylen
##### <a name="ensure"></a>`ensure`
1662 e17693e3 Steve Traylen
1663
Data type: `Enum['present','absent']`
1664
1665
1666
1667
Default value: `'present'`
1668
1669 09cba182 Steve Traylen
### <a name="nftablesset"></a>`nftables::set`
1670 7f6cacc5 Steve Traylen
1671
manage a named set
1672
1673 13f4e4c6 Steve Traylen
#### Examples
1674
1675
##### simple set
1676
1677
```puppet
1678
nftables::set{'my_set':
1679
  type       => 'ipv4_addr',
1680
  flags      => ['interval'],
1681
  elements   => ['192.168.0.1/24', '10.0.0.2'],
1682
  auto_merge => true,
1683
}
1684
```
1685
1686 7f6cacc5 Steve Traylen
#### Parameters
1687
1688 09cba182 Steve Traylen
The following parameters are available in the `nftables::set` defined type:
1689
1690
* [`ensure`](#ensure)
1691
* [`setname`](#setname)
1692
* [`order`](#order)
1693
* [`type`](#type)
1694
* [`table`](#table)
1695
* [`flags`](#flags)
1696
* [`timeout`](#timeout)
1697
* [`gc_interval`](#gc_interval)
1698
* [`elements`](#elements)
1699
* [`size`](#size)
1700
* [`policy`](#policy)
1701
* [`auto_merge`](#auto_merge)
1702
* [`content`](#content)
1703
* [`source`](#source)
1704
1705
##### <a name="ensure"></a>`ensure`
1706 7f6cacc5 Steve Traylen
1707
Data type: `Enum['present','absent']`
1708
1709 13f4e4c6 Steve Traylen
should the set be created.
1710 7f6cacc5 Steve Traylen
1711
Default value: `'present'`
1712
1713 09cba182 Steve Traylen
##### <a name="setname"></a>`setname`
1714 7f6cacc5 Steve Traylen
1715
Data type: `Pattern[/^[-a-zA-Z0-9_]+$/]`
1716
1717 13f4e4c6 Steve Traylen
name of set, equal to to title.
1718 7f6cacc5 Steve Traylen
1719
Default value: `$title`
1720
1721 09cba182 Steve Traylen
##### <a name="order"></a>`order`
1722 7f6cacc5 Steve Traylen
1723
Data type: `Pattern[/^\d\d$/]`
1724
1725 13f4e4c6 Steve Traylen
concat ordering.
1726 7f6cacc5 Steve Traylen
1727
Default value: `'10'`
1728
1729 09cba182 Steve Traylen
##### <a name="type"></a>`type`
1730 7f6cacc5 Steve Traylen
1731
Data type: `Optional[Enum['ipv4_addr', 'ipv6_addr', 'ether_addr', 'inet_proto', 'inet_service', 'mark']]`
1732
1733 13f4e4c6 Steve Traylen
type of set.
1734 7f6cacc5 Steve Traylen
1735
Default value: ``undef``
1736
1737 09cba182 Steve Traylen
##### <a name="table"></a>`table`
1738 7f6cacc5 Steve Traylen
1739 c94658e1 Nacho Barrientos
Data type: `Variant[String, Array[String, 1]]`
1740 7f6cacc5 Steve Traylen
1741 c94658e1 Nacho Barrientos
table or array of tables to add the set to.
1742 7f6cacc5 Steve Traylen
1743
Default value: `'inet-filter'`
1744
1745 09cba182 Steve Traylen
##### <a name="flags"></a>`flags`
1746 7f6cacc5 Steve Traylen
1747
Data type: `Array[Enum['constant', 'dynamic', 'interval', 'timeout'], 0, 4]`
1748
1749 13f4e4c6 Steve Traylen
specify flags for set
1750 7f6cacc5 Steve Traylen
1751
Default value: `[]`
1752
1753 09cba182 Steve Traylen
##### <a name="timeout"></a>`timeout`
1754 7f6cacc5 Steve Traylen
1755
Data type: `Optional[Integer]`
1756
1757 13f4e4c6 Steve Traylen
timeout in seconds
1758 7f6cacc5 Steve Traylen
1759
Default value: ``undef``
1760
1761 09cba182 Steve Traylen
##### <a name="gc_interval"></a>`gc_interval`
1762 7f6cacc5 Steve Traylen
1763
Data type: `Optional[Integer]`
1764
1765 13f4e4c6 Steve Traylen
garbage collection interval.
1766 7f6cacc5 Steve Traylen
1767
Default value: ``undef``
1768
1769 09cba182 Steve Traylen
##### <a name="elements"></a>`elements`
1770 7f6cacc5 Steve Traylen
1771
Data type: `Optional[Array[String]]`
1772
1773 13f4e4c6 Steve Traylen
initialize the set with some elements in it.
1774 7f6cacc5 Steve Traylen
1775
Default value: ``undef``
1776
1777 09cba182 Steve Traylen
##### <a name="size"></a>`size`
1778 7f6cacc5 Steve Traylen
1779
Data type: `Optional[Integer]`
1780
1781 13f4e4c6 Steve Traylen
limits the maximum number of elements of the set.
1782 7f6cacc5 Steve Traylen
1783
Default value: ``undef``
1784
1785 09cba182 Steve Traylen
##### <a name="policy"></a>`policy`
1786 7f6cacc5 Steve Traylen
1787
Data type: `Optional[Enum['performance', 'memory']]`
1788
1789 13f4e4c6 Steve Traylen
determines set selection policy.
1790 7f6cacc5 Steve Traylen
1791
Default value: ``undef``
1792
1793 09cba182 Steve Traylen
##### <a name="auto_merge"></a>`auto_merge`
1794 7f6cacc5 Steve Traylen
1795
Data type: `Boolean`
1796
1797 13f4e4c6 Steve Traylen
?
1798 7f6cacc5 Steve Traylen
1799
Default value: ``false``
1800
1801 09cba182 Steve Traylen
##### <a name="content"></a>`content`
1802 7f6cacc5 Steve Traylen
1803
Data type: `Optional[String]`
1804
1805 13f4e4c6 Steve Traylen
specify content of set.
1806 7f6cacc5 Steve Traylen
1807
Default value: ``undef``
1808
1809 09cba182 Steve Traylen
##### <a name="source"></a>`source`
1810 7f6cacc5 Steve Traylen
1811
Data type: `Optional[Variant[String,Array[String,1]]]`
1812
1813 13f4e4c6 Steve Traylen
specify source of set.
1814 7f6cacc5 Steve Traylen
1815
Default value: ``undef``
1816
1817 09cba182 Steve Traylen
### <a name="nftablessimplerule"></a>`nftables::simplerule`
1818 4d63adda Nacho Barrientos
1819 b46c9ce9 Nacho Barrientos
Provides a simplified interface to nftables::rule
1820 4d63adda Nacho Barrientos
1821 b46c9ce9 Nacho Barrientos
#### Examples
1822 4d63adda Nacho Barrientos
1823 b46c9ce9 Nacho Barrientos
##### allow incoming traffic from port 541 on port 543 TCP to a given IP range and count packets
1824 4d63adda Nacho Barrientos
1825 b46c9ce9 Nacho Barrientos
```puppet
1826
nftables::simplerule{'my_service_in':
1827
  action  => 'accept',
1828
  comment => 'allow traffic to port 543',
1829
  counter => true,
1830
  proto   => 'tcp',
1831
  dport   => 543,
1832
  daddr   => '2001:1458::/32',
1833
  sport   => 541,
1834
}
1835
```
1836 4d63adda Nacho Barrientos
1837 b46c9ce9 Nacho Barrientos
#### Parameters
1838 4d63adda Nacho Barrientos
1839 09cba182 Steve Traylen
The following parameters are available in the `nftables::simplerule` defined type:
1840
1841
* [`ensure`](#ensure)
1842
* [`rulename`](#rulename)
1843
* [`order`](#order)
1844
* [`chain`](#chain)
1845
* [`table`](#table)
1846
* [`action`](#action)
1847
* [`comment`](#comment)
1848
* [`dport`](#dport)
1849
* [`proto`](#proto)
1850
* [`daddr`](#daddr)
1851
* [`set_type`](#set_type)
1852
* [`sport`](#sport)
1853
* [`saddr`](#saddr)
1854
* [`counter`](#counter)
1855
1856
##### <a name="ensure"></a>`ensure`
1857 13f4e4c6 Steve Traylen
1858
Data type: `Enum['present','absent']`
1859
1860
Should the rule be created.
1861
1862
Default value: `'present'`
1863
1864 09cba182 Steve Traylen
##### <a name="rulename"></a>`rulename`
1865 4d63adda Nacho Barrientos
1866 8c00b818 Nacho Barrientos
Data type: `Nftables::SimpleRuleName`
1867 4d63adda Nacho Barrientos
1868 b46c9ce9 Nacho Barrientos
The symbolic name for the rule to add. Defaults to the resource's title.
1869 4d63adda Nacho Barrientos
1870
Default value: `$title`
1871
1872 09cba182 Steve Traylen
##### <a name="order"></a>`order`
1873 4d63adda Nacho Barrientos
1874
Data type: `Pattern[/^\d\d$/]`
1875
1876 b46c9ce9 Nacho Barrientos
A number representing the order of the rule.
1877 4d63adda Nacho Barrientos
1878
Default value: `'50'`
1879
1880 09cba182 Steve Traylen
##### <a name="chain"></a>`chain`
1881 4d63adda Nacho Barrientos
1882
Data type: `String`
1883
1884 b46c9ce9 Nacho Barrientos
The name of the chain to add this rule to.
1885 4d63adda Nacho Barrientos
1886
Default value: `'default_in'`
1887
1888 09cba182 Steve Traylen
##### <a name="table"></a>`table`
1889 4d63adda Nacho Barrientos
1890
Data type: `String`
1891
1892 b46c9ce9 Nacho Barrientos
The name of the table to add this rule to.
1893 4d63adda Nacho Barrientos
1894
Default value: `'inet-filter'`
1895
1896 09cba182 Steve Traylen
##### <a name="action"></a>`action`
1897 4d63adda Nacho Barrientos
1898
Data type: `Enum['accept', 'continue', 'drop', 'queue', 'return']`
1899
1900 b46c9ce9 Nacho Barrientos
The verdict for the matched traffic.
1901 4d63adda Nacho Barrientos
1902
Default value: `'accept'`
1903
1904 09cba182 Steve Traylen
##### <a name="comment"></a>`comment`
1905 4d63adda Nacho Barrientos
1906
Data type: `Optional[String]`
1907
1908 b46c9ce9 Nacho Barrientos
A typically human-readable comment for the rule.
1909 4d63adda Nacho Barrientos
1910
Default value: ``undef``
1911
1912 09cba182 Steve Traylen
##### <a name="dport"></a>`dport`
1913 4d63adda Nacho Barrientos
1914
Data type: `Optional[Nftables::Port]`
1915
1916 b46c9ce9 Nacho Barrientos
The destination port, ports or port range.
1917 4d63adda Nacho Barrientos
1918
Default value: ``undef``
1919
1920 09cba182 Steve Traylen
##### <a name="proto"></a>`proto`
1921 4d63adda Nacho Barrientos
1922
Data type: `Optional[Enum['tcp', 'tcp4', 'tcp6', 'udp', 'udp4', 'udp6']]`
1923
1924 b46c9ce9 Nacho Barrientos
The transport-layer protocol to match.
1925 4d63adda Nacho Barrientos
1926
Default value: ``undef``
1927
1928 09cba182 Steve Traylen
##### <a name="daddr"></a>`daddr`
1929 4d63adda Nacho Barrientos
1930
Data type: `Optional[Nftables::Addr]`
1931
1932 b46c9ce9 Nacho Barrientos
The destination address, CIDR or set to match.
1933 4d63adda Nacho Barrientos
1934
Default value: ``undef``
1935
1936 09cba182 Steve Traylen
##### <a name="set_type"></a>`set_type`
1937 4d63adda Nacho Barrientos
1938
Data type: `Enum['ip', 'ip6']`
1939
1940 b46c9ce9 Nacho Barrientos
When using sets as saddr or daddr, the type of the set.
1941
Use `ip` for sets of type `ipv4_addr`.
1942 4d63adda Nacho Barrientos
1943
Default value: `'ip6'`
1944
1945 09cba182 Steve Traylen
##### <a name="sport"></a>`sport`
1946 4d63adda Nacho Barrientos
1947
Data type: `Optional[Nftables::Port]`
1948
1949 b46c9ce9 Nacho Barrientos
The source port, ports or port range.
1950 4d63adda Nacho Barrientos
1951
Default value: ``undef``
1952
1953 09cba182 Steve Traylen
##### <a name="saddr"></a>`saddr`
1954 4d63adda Nacho Barrientos
1955
Data type: `Optional[Nftables::Addr]`
1956
1957 b46c9ce9 Nacho Barrientos
The source address, CIDR or set to match.
1958 4d63adda Nacho Barrientos
1959
Default value: ``undef``
1960
1961 09cba182 Steve Traylen
##### <a name="counter"></a>`counter`
1962 4d63adda Nacho Barrientos
1963
Data type: `Boolean`
1964
1965 b46c9ce9 Nacho Barrientos
Enable traffic counters for the matched traffic.
1966 4d63adda Nacho Barrientos
1967
Default value: ``false``
1968
1969
## Data types
1970
1971 09cba182 Steve Traylen
### <a name="nftablesaddr"></a>`Nftables::Addr`
1972 4d63adda Nacho Barrientos
1973
Represents an address expression to be used within a rule.
1974
1975 09cba182 Steve Traylen
Alias of
1976
1977
```puppet
1978
Variant[Stdlib::IP::Address::V6, Stdlib::IP::Address::V4, Nftables::Addr::Set]
1979
```
1980 4d63adda Nacho Barrientos
1981 09cba182 Steve Traylen
### <a name="nftablesaddrset"></a>`Nftables::Addr::Set`
1982 4d63adda Nacho Barrientos
1983
Represents a set expression to be used within a rule.
1984
1985 09cba182 Steve Traylen
Alias of
1986 4d63adda Nacho Barrientos
1987 09cba182 Steve Traylen
```puppet
1988
Pattern[/^@[-a-zA-Z0-9_]+$/]
1989
```
1990
1991
### <a name="nftablesport"></a>`Nftables::Port`
1992 4d63adda Nacho Barrientos
1993
Represents a port expression to be used within a rule.
1994
1995 09cba182 Steve Traylen
Alias of
1996
1997
```puppet
1998
Variant[Array[Stdlib::Port, 1], Stdlib::Port, Nftables::Port::Range]
1999
```
2000 4d63adda Nacho Barrientos
2001 09cba182 Steve Traylen
### <a name="nftablesportrange"></a>`Nftables::Port::Range`
2002 4d63adda Nacho Barrientos
2003
Represents a port range expression to be used within a rule.
2004
2005 09cba182 Steve Traylen
Alias of
2006 4d63adda Nacho Barrientos
2007 09cba182 Steve Traylen
```puppet
2008
Pattern[/^\d+-\d+$/]
2009
```
2010
2011
### <a name="nftablesrulename"></a>`Nftables::RuleName`
2012 8c00b818 Nacho Barrientos
2013
Represents a rule name to be used in a raw rule created via nftables::rule.
2014
It's a dash separated string. The first component describes the chain to
2015
add the rule to, the second the rule name and the (optional) third a number.
2016
Ex: 'default_in-sshd', 'default_out-my_service-2'.
2017
2018 09cba182 Steve Traylen
Alias of
2019
2020
```puppet
2021
Pattern[/^[a-zA-Z0-9_]+-[a-zA-Z0-9_]+(-\d+)?$/]
2022
```
2023 8c00b818 Nacho Barrientos
2024 09cba182 Steve Traylen
### <a name="nftablessimplerulename"></a>`Nftables::SimpleRuleName`
2025 8c00b818 Nacho Barrientos
2026
Represents a simple rule name to be used in a rule created via nftables::simplerule
2027
2028 09cba182 Steve Traylen
Alias of
2029
2030
```puppet
2031
Pattern[/^[a-zA-Z0-9_]+(-\d+)?$/]
2032
```