Projet

Général

Profil

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

root / REFERENCE.md @ 13f26dfc

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