Projet

Général

Profil

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

root / REFERENCE.md @ 242df534

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