Projet

Général

Profil

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

root / REFERENCE.md @ 3b8f5945

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