Projet

Général

Profil

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

root / REFERENCE.md @ a1f09048

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