Projet

Général

Profil

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

root / REFERENCE.md @ 2b1896c1

Historique | Voir | Annoter | Télécharger (41,5 ko)

1
# 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
* [`nftables::bridges`](#nftablesbridges): allow forwarding traffic on bridges
11
* [`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
* [`nftables::rules::activemq`](#nftablesrulesactivemq): Provides input rules for Apache ActiveMQ
14
* [`nftables::rules::afs3_callback`](#nftablesrulesafs3_callback): Open call back port for AFS clients
15
* [`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
* [`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
* [`nftables::rules::dns`](#nftablesrulesdns): manage in dns
20
* [`nftables::rules::docker_ce`](#nftablesrulesdocker_ce): Default firewall configuration for Docker-CE
21
* [`nftables::rules::http`](#nftablesruleshttp): manage in http
22
* [`nftables::rules::https`](#nftablesruleshttps): manage in https
23
* [`nftables::rules::icinga2`](#nftablesrulesicinga2): manage in icinga2
24
* [`nftables::rules::icmp`](#nftablesrulesicmp)
25
* [`nftables::rules::nfs`](#nftablesrulesnfs): manage in nfs4
26
* [`nftables::rules::nfs3`](#nftablesrulesnfs3): manage in nfs3
27
* [`nftables::rules::node_exporter`](#nftablesrulesnode_exporter): manage in node exporter
28
* [`nftables::rules::ospf`](#nftablesrulesospf): manage in ospf
29
* [`nftables::rules::ospf3`](#nftablesrulesospf3): manage in ospf3
30
* [`nftables::rules::out::all`](#nftablesrulesoutall): allow all outbound
31
* [`nftables::rules::out::ceph_client`](#nftablesrulesoutceph_client): Ceph is a distributed object store and file system.
32
Enable this to be a client of Ceph's Monitor (MON),
33
Object Storage Daemons (OSD), Metadata Server Daemons (MDS),
34
and Manager Daemons (MGR).
35
* [`nftables::rules::out::chrony`](#nftablesrulesoutchrony): manage out chrony
36
* [`nftables::rules::out::dhcp`](#nftablesrulesoutdhcp): manage out dhcp
37
* [`nftables::rules::out::dhcpv6_client`](#nftablesrulesoutdhcpv6_client): Allow DHCPv6 requests out of a host
38
* [`nftables::rules::out::dns`](#nftablesrulesoutdns): manage out dns
39
* [`nftables::rules::out::http`](#nftablesrulesouthttp): manage out http
40
* [`nftables::rules::out::https`](#nftablesrulesouthttps): manage out https
41
* [`nftables::rules::out::icmp`](#nftablesrulesouticmp): control outbound icmp packages
42
* [`nftables::rules::out::imap`](#nftablesrulesoutimap): allow outgoing imap
43
* [`nftables::rules::out::kerberos`](#nftablesrulesoutkerberos): allows outbound access for kerberos
44
* [`nftables::rules::out::mysql`](#nftablesrulesoutmysql): manage out mysql
45
* [`nftables::rules::out::nfs`](#nftablesrulesoutnfs): manage out nfs
46
* [`nftables::rules::out::nfs3`](#nftablesrulesoutnfs3): manage out nfs3
47
* [`nftables::rules::out::openafs_client`](#nftablesrulesoutopenafs_client): allows outbound access for afs clients
48
7000 - afs3-fileserver
49
7002 - afs3-ptserver
50
7003 - vlserver
51
* [`nftables::rules::out::ospf`](#nftablesrulesoutospf): manage out ospf
52
* [`nftables::rules::out::ospf3`](#nftablesrulesoutospf3): manage out ospf3
53
* [`nftables::rules::out::pop3`](#nftablesrulesoutpop3): allow outgoing pop3
54
* [`nftables::rules::out::postgres`](#nftablesrulesoutpostgres): manage out postgres
55
* [`nftables::rules::out::puppet`](#nftablesrulesoutpuppet): manage outgoing puppet
56
* [`nftables::rules::out::pxp_agent`](#nftablesrulesoutpxp_agent): manage outgoing pxp-agent
57
* [`nftables::rules::out::smtp`](#nftablesrulesoutsmtp): allow outgoing smtp
58
* [`nftables::rules::out::smtp_client`](#nftablesrulesoutsmtp_client): allow outgoing smtp client
59
* [`nftables::rules::out::ssh`](#nftablesrulesoutssh): manage out ssh
60
* [`nftables::rules::out::ssh::remove`](#nftablesrulesoutsshremove): disable outgoing ssh
61
* [`nftables::rules::out::tor`](#nftablesrulesouttor): manage out tor
62
* [`nftables::rules::out::whois`](#nftablesrulesoutwhois): allow clients to query remote whois server
63
* [`nftables::rules::out::wireguard`](#nftablesrulesoutwireguard): manage out wireguard
64
* [`nftables::rules::puppet`](#nftablesrulespuppet): manage in puppet
65
* [`nftables::rules::pxp_agent`](#nftablesrulespxp_agent): manage in pxp-agent
66
* [`nftables::rules::qemu`](#nftablesrulesqemu): Bridged network configuration for qemu/libvirt
67
* [`nftables::rules::samba`](#nftablesrulessamba): manage Samba, the suite to allow Windows file sharing on Linux resources.
68
* [`nftables::rules::smtp`](#nftablesrulessmtp): manage in smtp
69
* [`nftables::rules::smtp_submission`](#nftablesrulessmtp_submission): manage in smtp submission
70
* [`nftables::rules::smtps`](#nftablesrulessmtps): manage in smtps
71
* [`nftables::rules::ssh`](#nftablesrulesssh): manage in ssh
72
* [`nftables::rules::tor`](#nftablesrulestor): manage in tor
73
* [`nftables::rules::wireguard`](#nftablesruleswireguard): manage in wireguard
74
* [`nftables::services::dhcpv6_client`](#nftablesservicesdhcpv6_client): Allow in and outbound traffic for DHCPv6 server
75
* [`nftables::services::openafs_client`](#nftablesservicesopenafs_client): Open inbound and outbound ports for an AFS client
76

    
77
### Defined types
78

    
79
* [`nftables::chain`](#nftableschain): manage a chain
80
* [`nftables::config`](#nftablesconfig): manage a config snippet
81
* [`nftables::rule`](#nftablesrule): Provides an interface to create a firewall rule
82
* [`nftables::rules::dnat4`](#nftablesrulesdnat4): manage a ipv4 dnat rule
83
* [`nftables::rules::masquerade`](#nftablesrulesmasquerade): masquerade all outgoing traffic
84
* [`nftables::rules::snat4`](#nftablesrulessnat4): manage a ipv4 snat rule
85
* [`nftables::set`](#nftablesset): manage a named set
86
* [`nftables::simplerule`](#nftablessimplerule): Provides a simplified interface to nftables::rule
87

    
88
### Data types
89

    
90
* [`Nftables::Addr`](#nftablesaddr): Represents an address expression to be used within a rule.
91
* [`Nftables::Addr::Set`](#nftablesaddrset): Represents a set expression to be used within a rule.
92
* [`Nftables::Port`](#nftablesport): Represents a port expression to be used within a rule.
93
* [`Nftables::Port::Range`](#nftablesportrange): Represents a port range expression to be used within a rule.
94
* [`Nftables::RuleName`](#nftablesrulename): Represents a rule name to be used in a raw rule created via nftables::rule.
95
It's a dash separated string. The first component describes the chain to
96
add the rule to, the second the rule name and the (optional) third a number.
97
Ex: 'default_in-sshd', 'default_out-my_service-2'.
98
* [`Nftables::SimpleRuleName`](#nftablessimplerulename): Represents a simple rule name to be used in a rule created via nftables::simplerule
99

    
100
## Classes
101

    
102
### <a name="nftables"></a>`nftables`
103

    
104
Configure nftables
105

    
106
#### Examples
107

    
108
##### allow dns out and do not allow ntp out
109

    
110
```puppet
111
class{ 'nftables':
112
  out_ntp => false,
113
  out_dns => true,
114
}
115
```
116

    
117
##### do not flush particular tables, fail2ban in this case
118

    
119
```puppet
120
class{ 'nftables':
121
  noflush_tables => ['inet-f2b-table'],
122
}
123
```
124

    
125
#### Parameters
126

    
127
The following parameters are available in the `nftables` class:
128

    
129
* [`out_all`](#out_all)
130
* [`out_ntp`](#out_ntp)
131
* [`out_http`](#out_http)
132
* [`out_dns`](#out_dns)
133
* [`out_https`](#out_https)
134
* [`out_icmp`](#out_icmp)
135
* [`in_ssh`](#in_ssh)
136
* [`in_icmp`](#in_icmp)
137
* [`inet_filter`](#inet_filter)
138
* [`nat`](#nat)
139
* [`nat_table_name`](#nat_table_name)
140
* [`sets`](#sets)
141
* [`log_prefix`](#log_prefix)
142
* [`log_limit`](#log_limit)
143
* [`reject_with`](#reject_with)
144
* [`in_out_conntrack`](#in_out_conntrack)
145
* [`fwd_conntrack`](#fwd_conntrack)
146
* [`firewalld_enable`](#firewalld_enable)
147
* [`noflush_tables`](#noflush_tables)
148
* [`rules`](#rules)
149
* [`configuration_path`](#configuration_path)
150
* [`nft_path`](#nft_path)
151
* [`echo`](#echo)
152

    
153
##### <a name="out_all"></a>`out_all`
154

    
155
Data type: `Boolean`
156

    
157
Allow all outbound connections. If `true` then all other
158
out parameters `out_ntp`, `out_dns`, ... will be assuemed
159
false.
160

    
161
Default value: ``false``
162

    
163
##### <a name="out_ntp"></a>`out_ntp`
164

    
165
Data type: `Boolean`
166

    
167
Allow outbound to ntp servers.
168

    
169
Default value: ``true``
170

    
171
##### <a name="out_http"></a>`out_http`
172

    
173
Data type: `Boolean`
174

    
175
Allow outbound to http servers.
176

    
177
Default value: ``true``
178

    
179
##### <a name="out_dns"></a>`out_dns`
180

    
181
Data type: `Boolean`
182

    
183
Allow outbound to dns servers.
184

    
185
Default value: ``true``
186

    
187
##### <a name="out_https"></a>`out_https`
188

    
189
Data type: `Boolean`
190

    
191
Allow outbound to https servers.
192

    
193
Default value: ``true``
194

    
195
##### <a name="out_icmp"></a>`out_icmp`
196

    
197
Data type: `Boolean`
198

    
199
Allow outbound ICMPv4/v6 traffic.
200

    
201
Default value: ``true``
202

    
203
##### <a name="in_ssh"></a>`in_ssh`
204

    
205
Data type: `Boolean`
206

    
207
Allow inbound to ssh servers.
208

    
209
Default value: ``true``
210

    
211
##### <a name="in_icmp"></a>`in_icmp`
212

    
213
Data type: `Boolean`
214

    
215
Allow inbound ICMPv4/v6 traffic.
216

    
217
Default value: ``true``
218

    
219
##### <a name="inet_filter"></a>`inet_filter`
220

    
221
Data type: `Boolean`
222

    
223
Add default tables, chains and rules to process traffic.
224

    
225
Default value: ``true``
226

    
227
##### <a name="nat"></a>`nat`
228

    
229
Data type: `Boolean`
230

    
231
Add default tables and chains to process NAT traffic.
232

    
233
Default value: ``true``
234

    
235
##### <a name="nat_table_name"></a>`nat_table_name`
236

    
237
Data type: `String[1]`
238

    
239
The name of the 'nat' table.
240

    
241
Default value: `'nat'`
242

    
243
##### <a name="sets"></a>`sets`
244

    
245
Data type: `Hash`
246

    
247
Allows sourcing set definitions directly from Hiera.
248

    
249
Default value: `{}`
250

    
251
##### <a name="log_prefix"></a>`log_prefix`
252

    
253
Data type: `String`
254

    
255
String that will be used as prefix when logging packets. It can contain
256
two variables using standard sprintf() string-formatting:
257
 * chain: Will be replaced by the name of the chain.
258
 * comment: Allows chains to add extra comments.
259

    
260
Default value: `'[nftables] %<chain>s %<comment>s'`
261

    
262
##### <a name="log_limit"></a>`log_limit`
263

    
264
Data type: `Variant[Boolean[false], String]`
265

    
266
String with the content of a limit statement to be applied
267
to the rules that log discarded traffic. Set to false to
268
disable rate limiting.
269

    
270
Default value: `'3/minute burst 5 packets'`
271

    
272
##### <a name="reject_with"></a>`reject_with`
273

    
274
Data type: `Variant[Boolean[false], Pattern[/icmp(v6|x)? type .+|tcp reset/]]`
275

    
276
How to discard packets not matching any rule. If `false`, the
277
fate of the packet will be defined by the chain policy (normally
278
drop), otherwise the packet will be rejected with the REJECT_WITH
279
policy indicated by the value of this parameter.
280

    
281
Default value: `'icmpx type port-unreachable'`
282

    
283
##### <a name="in_out_conntrack"></a>`in_out_conntrack`
284

    
285
Data type: `Boolean`
286

    
287
Adds INPUT and OUTPUT rules to allow traffic that's part of an
288
established connection and also to drop invalid packets.
289

    
290
Default value: ``true``
291

    
292
##### <a name="fwd_conntrack"></a>`fwd_conntrack`
293

    
294
Data type: `Boolean`
295

    
296
Adds FORWARD rules to allow traffic that's part of an
297
established connection and also to drop invalid packets.
298

    
299
Default value: ``false``
300

    
301
##### <a name="firewalld_enable"></a>`firewalld_enable`
302

    
303
Data type: `Variant[Boolean[false], Enum['mask']]`
304

    
305
Configures how the firewalld systemd service unit is enabled. It might be
306
useful to set this to false if you're externaly removing firewalld from
307
the system completely.
308

    
309
Default value: `'mask'`
310

    
311
##### <a name="noflush_tables"></a>`noflush_tables`
312

    
313
Data type: `Optional[Array[Pattern[/^(ip|ip6|inet)-[-a-zA-Z0-9_]+$/],1]]`
314

    
315
If specified only other existings tables will be flushed.
316
If left unset all tables will be flushed via a `flush ruleset`
317

    
318
Default value: ``undef``
319

    
320
##### <a name="rules"></a>`rules`
321

    
322
Data type: `Hash`
323

    
324
Specify hashes of `nftables::rule`s via hiera
325

    
326
Default value: `{}`
327

    
328
##### <a name="configuration_path"></a>`configuration_path`
329

    
330
Data type: `Stdlib::Unixpath`
331

    
332
The absolute path to the principal nftables configuration file. The default
333
varies depending on the system, and is set in the module's data.
334

    
335
##### <a name="nft_path"></a>`nft_path`
336

    
337
Data type: `Stdlib::Unixpath`
338

    
339
Path to the nft binary
340

    
341
##### <a name="echo"></a>`echo`
342

    
343
Data type: `Stdlib::Unixpath`
344

    
345
Path to the echo binary
346

    
347
### <a name="nftablesbridges"></a>`nftables::bridges`
348

    
349
allow forwarding traffic on bridges
350

    
351
#### Parameters
352

    
353
The following parameters are available in the `nftables::bridges` class:
354

    
355
* [`ensure`](#ensure)
356
* [`bridgenames`](#bridgenames)
357

    
358
##### <a name="ensure"></a>`ensure`
359

    
360
Data type: `Enum['present','absent']`
361

    
362

    
363

    
364
Default value: `'present'`
365

    
366
##### <a name="bridgenames"></a>`bridgenames`
367

    
368
Data type: `Regexp`
369

    
370

    
371

    
372
Default value: `/^br.+/`
373

    
374
### <a name="nftablesinet_filter"></a>`nftables::inet_filter`
375

    
376
manage basic chains in table inet filter
377

    
378
### <a name="nftablesip_nat"></a>`nftables::ip_nat`
379

    
380
manage basic chains in table ip nat
381

    
382
### <a name="nftablesrulesactivemq"></a>`nftables::rules::activemq`
383

    
384
Provides input rules for Apache ActiveMQ
385

    
386
#### Parameters
387

    
388
The following parameters are available in the `nftables::rules::activemq` class:
389

    
390
* [`tcp`](#tcp)
391
* [`udp`](#udp)
392
* [`port`](#port)
393

    
394
##### <a name="tcp"></a>`tcp`
395

    
396
Data type: `Boolean`
397

    
398
Create the rule for TCP traffic.
399

    
400
Default value: ``true``
401

    
402
##### <a name="udp"></a>`udp`
403

    
404
Data type: `Boolean`
405

    
406
Create the rule for UDP traffic.
407

    
408
Default value: ``true``
409

    
410
##### <a name="port"></a>`port`
411

    
412
Data type: `Stdlib::Port`
413

    
414
The port number for the ActiveMQ daemon.
415

    
416
Default value: `61616`
417

    
418
### <a name="nftablesrulesafs3_callback"></a>`nftables::rules::afs3_callback`
419

    
420
Open call back port for AFS clients
421

    
422
#### Examples
423

    
424
##### allow call backs from particular hosts
425

    
426
```puppet
427
class{'nftables::rules::afs3_callback':
428
  saddr => ['192.168.0.0/16', '10.0.0.222']
429
}
430
```
431

    
432
#### Parameters
433

    
434
The following parameters are available in the `nftables::rules::afs3_callback` class:
435

    
436
* [`saddr`](#saddr)
437

    
438
##### <a name="saddr"></a>`saddr`
439

    
440
Data type: `Array[Stdlib::IP::Address::V4,1]`
441

    
442
list of source network ranges to a
443

    
444
Default value: `['0.0.0.0/0']`
445

    
446
### <a name="nftablesrulesceph"></a>`nftables::rules::ceph`
447

    
448
Ceph is a distributed object store and file system.
449
Enable this to support Ceph's Object Storage Daemons (OSD),
450
Metadata Server Daemons (MDS), or Manager Daemons (MGR).
451

    
452
### <a name="nftablesrulesceph_mon"></a>`nftables::rules::ceph_mon`
453

    
454
Ceph is a distributed object store and file system.
455
Enable this option to support Ceph's Monitor Daemon.
456

    
457
#### Parameters
458

    
459
The following parameters are available in the `nftables::rules::ceph_mon` class:
460

    
461
* [`ports`](#ports)
462

    
463
##### <a name="ports"></a>`ports`
464

    
465
Data type: `Array[Stdlib::Port,1]`
466

    
467
specify ports for ceph service
468

    
469
Default value: `[3300, 6789]`
470

    
471
### <a name="nftablesrulesdhcpv6_client"></a>`nftables::rules::dhcpv6_client`
472

    
473
allow DHCPv6 requests in to a host
474

    
475
### <a name="nftablesrulesdns"></a>`nftables::rules::dns`
476

    
477
manage in dns
478

    
479
#### Parameters
480

    
481
The following parameters are available in the `nftables::rules::dns` class:
482

    
483
* [`ports`](#ports)
484

    
485
##### <a name="ports"></a>`ports`
486

    
487
Data type: `Array[Stdlib::Port,1]`
488

    
489
Specify ports for dns.
490

    
491
Default value: `[53]`
492

    
493
### <a name="nftablesrulesdocker_ce"></a>`nftables::rules::docker_ce`
494

    
495
The configuration distributed in this class represents the default firewall
496
configuration done by docker-ce when the iptables integration is enabled.
497

    
498
This class is needed as the default docker-ce rules added to ip-filter conflict
499
with the inet-filter forward rules set by default in this module.
500

    
501
When using this class 'docker::iptables: false' should be set.
502

    
503
#### Parameters
504

    
505
The following parameters are available in the `nftables::rules::docker_ce` class:
506

    
507
* [`docker_interface`](#docker_interface)
508
* [`docker_prefix`](#docker_prefix)
509
* [`manage_docker_chains`](#manage_docker_chains)
510
* [`manage_base_chains`](#manage_base_chains)
511

    
512
##### <a name="docker_interface"></a>`docker_interface`
513

    
514
Data type: `String[1]`
515

    
516
Interface name used by docker.
517

    
518
Default value: `'docker0'`
519

    
520
##### <a name="docker_prefix"></a>`docker_prefix`
521

    
522
Data type: `Stdlib::IP::Address::V4::CIDR`
523

    
524
The address space used by docker.
525

    
526
Default value: `'172.17.0.0/16'`
527

    
528
##### <a name="manage_docker_chains"></a>`manage_docker_chains`
529

    
530
Data type: `Boolean`
531

    
532
Flag to control whether the class should create the docker related chains.
533

    
534
Default value: ``true``
535

    
536
##### <a name="manage_base_chains"></a>`manage_base_chains`
537

    
538
Data type: `Boolean`
539

    
540
Flag to control whether the class should create the base common chains.
541

    
542
Default value: ``true``
543

    
544
### <a name="nftablesruleshttp"></a>`nftables::rules::http`
545

    
546
manage in http
547

    
548
### <a name="nftablesruleshttps"></a>`nftables::rules::https`
549

    
550
manage in https
551

    
552
### <a name="nftablesrulesicinga2"></a>`nftables::rules::icinga2`
553

    
554
manage in icinga2
555

    
556
#### Parameters
557

    
558
The following parameters are available in the `nftables::rules::icinga2` class:
559

    
560
* [`ports`](#ports)
561

    
562
##### <a name="ports"></a>`ports`
563

    
564
Data type: `Array[Stdlib::Port,1]`
565

    
566
Specify ports for icinga1
567

    
568
Default value: `[5665]`
569

    
570
### <a name="nftablesrulesicmp"></a>`nftables::rules::icmp`
571

    
572
The nftables::rules::icmp class.
573

    
574
#### Parameters
575

    
576
The following parameters are available in the `nftables::rules::icmp` class:
577

    
578
* [`v4_types`](#v4_types)
579
* [`v6_types`](#v6_types)
580
* [`order`](#order)
581

    
582
##### <a name="v4_types"></a>`v4_types`
583

    
584
Data type: `Optional[Array[String]]`
585

    
586

    
587

    
588
Default value: ``undef``
589

    
590
##### <a name="v6_types"></a>`v6_types`
591

    
592
Data type: `Optional[Array[String]]`
593

    
594

    
595

    
596
Default value: ``undef``
597

    
598
##### <a name="order"></a>`order`
599

    
600
Data type: `String`
601

    
602

    
603

    
604
Default value: `'10'`
605

    
606
### <a name="nftablesrulesnfs"></a>`nftables::rules::nfs`
607

    
608
manage in nfs4
609

    
610
### <a name="nftablesrulesnfs3"></a>`nftables::rules::nfs3`
611

    
612
manage in nfs3
613

    
614
### <a name="nftablesrulesnode_exporter"></a>`nftables::rules::node_exporter`
615

    
616
manage in node exporter
617

    
618
#### Parameters
619

    
620
The following parameters are available in the `nftables::rules::node_exporter` class:
621

    
622
* [`prometheus_server`](#prometheus_server)
623
* [`port`](#port)
624

    
625
##### <a name="prometheus_server"></a>`prometheus_server`
626

    
627
Data type: `Optional[Variant[String,Array[String,1]]]`
628

    
629
Specify server name
630

    
631
Default value: ``undef``
632

    
633
##### <a name="port"></a>`port`
634

    
635
Data type: `Stdlib::Port`
636

    
637
Specify port to open
638

    
639
Default value: `9100`
640

    
641
### <a name="nftablesrulesospf"></a>`nftables::rules::ospf`
642

    
643
manage in ospf
644

    
645
### <a name="nftablesrulesospf3"></a>`nftables::rules::ospf3`
646

    
647
manage in ospf3
648

    
649
### <a name="nftablesrulesoutall"></a>`nftables::rules::out::all`
650

    
651
allow all outbound
652

    
653
### <a name="nftablesrulesoutceph_client"></a>`nftables::rules::out::ceph_client`
654

    
655
Ceph is a distributed object store and file system.
656
Enable this to be a client of Ceph's Monitor (MON),
657
Object Storage Daemons (OSD), Metadata Server Daemons (MDS),
658
and Manager Daemons (MGR).
659

    
660
#### Parameters
661

    
662
The following parameters are available in the `nftables::rules::out::ceph_client` class:
663

    
664
* [`ports`](#ports)
665

    
666
##### <a name="ports"></a>`ports`
667

    
668
Data type: `Array[Stdlib::Port,1]`
669

    
670
Specify ports to open
671

    
672
Default value: `[3300, 6789]`
673

    
674
### <a name="nftablesrulesoutchrony"></a>`nftables::rules::out::chrony`
675

    
676
manage out chrony
677

    
678
### <a name="nftablesrulesoutdhcp"></a>`nftables::rules::out::dhcp`
679

    
680
manage out dhcp
681

    
682
### <a name="nftablesrulesoutdhcpv6_client"></a>`nftables::rules::out::dhcpv6_client`
683

    
684
Allow DHCPv6 requests out of a host
685

    
686
### <a name="nftablesrulesoutdns"></a>`nftables::rules::out::dns`
687

    
688
manage out dns
689

    
690
#### Parameters
691

    
692
The following parameters are available in the `nftables::rules::out::dns` class:
693

    
694
* [`dns_server`](#dns_server)
695

    
696
##### <a name="dns_server"></a>`dns_server`
697

    
698
Data type: `Optional[Variant[String,Array[String,1]]]`
699

    
700
specify dns_server name
701

    
702
Default value: ``undef``
703

    
704
### <a name="nftablesrulesouthttp"></a>`nftables::rules::out::http`
705

    
706
manage out http
707

    
708
### <a name="nftablesrulesouthttps"></a>`nftables::rules::out::https`
709

    
710
manage out https
711

    
712
### <a name="nftablesrulesouticmp"></a>`nftables::rules::out::icmp`
713

    
714
control outbound icmp packages
715

    
716
#### Parameters
717

    
718
The following parameters are available in the `nftables::rules::out::icmp` class:
719

    
720
* [`v4_types`](#v4_types)
721
* [`v6_types`](#v6_types)
722
* [`order`](#order)
723

    
724
##### <a name="v4_types"></a>`v4_types`
725

    
726
Data type: `Optional[Array[String]]`
727

    
728

    
729

    
730
Default value: ``undef``
731

    
732
##### <a name="v6_types"></a>`v6_types`
733

    
734
Data type: `Optional[Array[String]]`
735

    
736

    
737

    
738
Default value: ``undef``
739

    
740
##### <a name="order"></a>`order`
741

    
742
Data type: `String`
743

    
744

    
745

    
746
Default value: `'10'`
747

    
748
### <a name="nftablesrulesoutimap"></a>`nftables::rules::out::imap`
749

    
750
allow outgoing imap
751

    
752
### <a name="nftablesrulesoutkerberos"></a>`nftables::rules::out::kerberos`
753

    
754
allows outbound access for kerberos
755

    
756
### <a name="nftablesrulesoutmysql"></a>`nftables::rules::out::mysql`
757

    
758
manage out mysql
759

    
760
### <a name="nftablesrulesoutnfs"></a>`nftables::rules::out::nfs`
761

    
762
manage out nfs
763

    
764
### <a name="nftablesrulesoutnfs3"></a>`nftables::rules::out::nfs3`
765

    
766
manage out nfs3
767

    
768
### <a name="nftablesrulesoutopenafs_client"></a>`nftables::rules::out::openafs_client`
769

    
770
allows outbound access for afs clients
771
7000 - afs3-fileserver
772
7002 - afs3-ptserver
773
7003 - vlserver
774

    
775
* **See also**
776
  * https://wiki.openafs.org/devel/AFSServicePorts/
777
    * AFS Service Ports
778

    
779
#### Parameters
780

    
781
The following parameters are available in the `nftables::rules::out::openafs_client` class:
782

    
783
* [`ports`](#ports)
784

    
785
##### <a name="ports"></a>`ports`
786

    
787
Data type: `Array[Stdlib::Port,1]`
788

    
789
port numbers to use
790

    
791
Default value: `[7000, 7002, 7003]`
792

    
793
### <a name="nftablesrulesoutospf"></a>`nftables::rules::out::ospf`
794

    
795
manage out ospf
796

    
797
### <a name="nftablesrulesoutospf3"></a>`nftables::rules::out::ospf3`
798

    
799
manage out ospf3
800

    
801
### <a name="nftablesrulesoutpop3"></a>`nftables::rules::out::pop3`
802

    
803
allow outgoing pop3
804

    
805
### <a name="nftablesrulesoutpostgres"></a>`nftables::rules::out::postgres`
806

    
807
manage out postgres
808

    
809
### <a name="nftablesrulesoutpuppet"></a>`nftables::rules::out::puppet`
810

    
811
manage outgoing puppet
812

    
813
#### Parameters
814

    
815
The following parameters are available in the `nftables::rules::out::puppet` class:
816

    
817
* [`puppetserver`](#puppetserver)
818
* [`puppetserver_port`](#puppetserver_port)
819

    
820
##### <a name="puppetserver"></a>`puppetserver`
821

    
822
Data type: `Variant[Stdlib::IP::Address,Array[Stdlib::IP::Address,1]]`
823

    
824
puppetserver hostname
825

    
826
##### <a name="puppetserver_port"></a>`puppetserver_port`
827

    
828
Data type: `Stdlib::Port`
829

    
830
puppetserver port
831

    
832
Default value: `8140`
833

    
834
### <a name="nftablesrulesoutpxp_agent"></a>`nftables::rules::out::pxp_agent`
835

    
836
manage outgoing pxp-agent
837

    
838
* **See also**
839
  * also
840
    * take a look at nftables::rules::out::puppet, because the PXP agent also connects to a Puppetserver
841

    
842
#### Parameters
843

    
844
The following parameters are available in the `nftables::rules::out::pxp_agent` class:
845

    
846
* [`broker`](#broker)
847
* [`broker_port`](#broker_port)
848

    
849
##### <a name="broker"></a>`broker`
850

    
851
Data type: `Variant[Stdlib::IP::Address,Array[Stdlib::IP::Address,1]]`
852

    
853
PXP broker IP(s)
854

    
855
##### <a name="broker_port"></a>`broker_port`
856

    
857
Data type: `Stdlib::Port`
858

    
859
PXP broker port
860

    
861
Default value: `8142`
862

    
863
### <a name="nftablesrulesoutsmtp"></a>`nftables::rules::out::smtp`
864

    
865
allow outgoing smtp
866

    
867
### <a name="nftablesrulesoutsmtp_client"></a>`nftables::rules::out::smtp_client`
868

    
869
allow outgoing smtp client
870

    
871
### <a name="nftablesrulesoutssh"></a>`nftables::rules::out::ssh`
872

    
873
manage out ssh
874

    
875
### <a name="nftablesrulesoutsshremove"></a>`nftables::rules::out::ssh::remove`
876

    
877
disable outgoing ssh
878

    
879
### <a name="nftablesrulesouttor"></a>`nftables::rules::out::tor`
880

    
881
manage out tor
882

    
883
### <a name="nftablesrulesoutwhois"></a>`nftables::rules::out::whois`
884

    
885
allow clients to query remote whois server
886

    
887
### <a name="nftablesrulesoutwireguard"></a>`nftables::rules::out::wireguard`
888

    
889
manage out wireguard
890

    
891
#### Parameters
892

    
893
The following parameters are available in the `nftables::rules::out::wireguard` class:
894

    
895
* [`ports`](#ports)
896

    
897
##### <a name="ports"></a>`ports`
898

    
899
Data type: `Array[Integer,1]`
900

    
901
specify wireguard ports
902

    
903
Default value: `[51820]`
904

    
905
### <a name="nftablesrulespuppet"></a>`nftables::rules::puppet`
906

    
907
manage in puppet
908

    
909
#### Parameters
910

    
911
The following parameters are available in the `nftables::rules::puppet` class:
912

    
913
* [`ports`](#ports)
914

    
915
##### <a name="ports"></a>`ports`
916

    
917
Data type: `Array[Integer,1]`
918

    
919
puppet server ports
920

    
921
Default value: `[8140]`
922

    
923
### <a name="nftablesrulespxp_agent"></a>`nftables::rules::pxp_agent`
924

    
925
manage in pxp-agent
926

    
927
#### Parameters
928

    
929
The following parameters are available in the `nftables::rules::pxp_agent` class:
930

    
931
* [`ports`](#ports)
932

    
933
##### <a name="ports"></a>`ports`
934

    
935
Data type: `Array[Stdlib::Port,1]`
936

    
937
pxp server ports
938

    
939
Default value: `[8142]`
940

    
941
### <a name="nftablesrulesqemu"></a>`nftables::rules::qemu`
942

    
943
This class configures the typical firewall setup that libvirt
944
creates. Depending on your requirements you can switch on and off
945
several aspects, for instance if you don't do DHCP to your guests
946
you can disable the rules that accept DHCP traffic on the host or if
947
you don't want your guests to talk to hosts outside you can disable
948
forwarding and/or masquerading for IPv4 traffic.
949

    
950
#### Parameters
951

    
952
The following parameters are available in the `nftables::rules::qemu` class:
953

    
954
* [`interface`](#interface)
955
* [`network_v4`](#network_v4)
956
* [`network_v6`](#network_v6)
957
* [`dns`](#dns)
958
* [`dhcpv4`](#dhcpv4)
959
* [`forward_traffic`](#forward_traffic)
960
* [`internal_traffic`](#internal_traffic)
961
* [`masquerade`](#masquerade)
962

    
963
##### <a name="interface"></a>`interface`
964

    
965
Data type: `String[1]`
966

    
967
Interface name used by the bridge.
968

    
969
Default value: `'virbr0'`
970

    
971
##### <a name="network_v4"></a>`network_v4`
972

    
973
Data type: `Stdlib::IP::Address::V4::CIDR`
974

    
975
The IPv4 network prefix used in the virtual network.
976

    
977
Default value: `'192.168.122.0/24'`
978

    
979
##### <a name="network_v6"></a>`network_v6`
980

    
981
Data type: `Optional[Stdlib::IP::Address::V6::CIDR]`
982

    
983
The IPv6 network prefix used in the virtual network.
984

    
985
Default value: ``undef``
986

    
987
##### <a name="dns"></a>`dns`
988

    
989
Data type: `Boolean`
990

    
991
Allow DNS traffic from the guests to the host.
992

    
993
Default value: ``true``
994

    
995
##### <a name="dhcpv4"></a>`dhcpv4`
996

    
997
Data type: `Boolean`
998

    
999
Allow DHCPv4 traffic from the guests to the host.
1000

    
1001
Default value: ``true``
1002

    
1003
##### <a name="forward_traffic"></a>`forward_traffic`
1004

    
1005
Data type: `Boolean`
1006

    
1007
Allow forwarded traffic (out all, in related/established)
1008
generated by the virtual network.
1009

    
1010
Default value: ``true``
1011

    
1012
##### <a name="internal_traffic"></a>`internal_traffic`
1013

    
1014
Data type: `Boolean`
1015

    
1016
Allow guests in the virtual network to talk to each other.
1017

    
1018
Default value: ``true``
1019

    
1020
##### <a name="masquerade"></a>`masquerade`
1021

    
1022
Data type: `Boolean`
1023

    
1024
Do NAT masquerade on all IPv4 traffic generated by guests
1025
to external networks.
1026

    
1027
Default value: ``true``
1028

    
1029
### <a name="nftablesrulessamba"></a>`nftables::rules::samba`
1030

    
1031
manage Samba, the suite to allow Windows file sharing on Linux resources.
1032

    
1033
#### Parameters
1034

    
1035
The following parameters are available in the `nftables::rules::samba` class:
1036

    
1037
* [`ctdb`](#ctdb)
1038

    
1039
##### <a name="ctdb"></a>`ctdb`
1040

    
1041
Data type: `Boolean`
1042

    
1043
Enable ctdb-driven clustered Samba setups.
1044

    
1045
Default value: ``false``
1046

    
1047
### <a name="nftablesrulessmtp"></a>`nftables::rules::smtp`
1048

    
1049
manage in smtp
1050

    
1051
### <a name="nftablesrulessmtp_submission"></a>`nftables::rules::smtp_submission`
1052

    
1053
manage in smtp submission
1054

    
1055
### <a name="nftablesrulessmtps"></a>`nftables::rules::smtps`
1056

    
1057
manage in smtps
1058

    
1059
### <a name="nftablesrulesssh"></a>`nftables::rules::ssh`
1060

    
1061
manage in ssh
1062

    
1063
#### Parameters
1064

    
1065
The following parameters are available in the `nftables::rules::ssh` class:
1066

    
1067
* [`ports`](#ports)
1068

    
1069
##### <a name="ports"></a>`ports`
1070

    
1071
Data type: `Array[Stdlib::Port,1]`
1072

    
1073
ssh ports
1074

    
1075
Default value: `[22]`
1076

    
1077
### <a name="nftablesrulestor"></a>`nftables::rules::tor`
1078

    
1079
manage in tor
1080

    
1081
#### Parameters
1082

    
1083
The following parameters are available in the `nftables::rules::tor` class:
1084

    
1085
* [`ports`](#ports)
1086

    
1087
##### <a name="ports"></a>`ports`
1088

    
1089
Data type: `Array[Stdlib::Port,1]`
1090

    
1091
ports for tor
1092

    
1093
Default value: `[9001]`
1094

    
1095
### <a name="nftablesruleswireguard"></a>`nftables::rules::wireguard`
1096

    
1097
manage in wireguard
1098

    
1099
#### Parameters
1100

    
1101
The following parameters are available in the `nftables::rules::wireguard` class:
1102

    
1103
* [`ports`](#ports)
1104

    
1105
##### <a name="ports"></a>`ports`
1106

    
1107
Data type: `Array[Stdlib::Port,1]`
1108

    
1109
wiregueard port
1110

    
1111
Default value: `[51820]`
1112

    
1113
### <a name="nftablesservicesdhcpv6_client"></a>`nftables::services::dhcpv6_client`
1114

    
1115
Allow in and outbound traffic for DHCPv6 server
1116

    
1117
### <a name="nftablesservicesopenafs_client"></a>`nftables::services::openafs_client`
1118

    
1119
Open inbound and outbound ports for an AFS client
1120

    
1121
## Defined types
1122

    
1123
### <a name="nftableschain"></a>`nftables::chain`
1124

    
1125
manage a chain
1126

    
1127
#### Parameters
1128

    
1129
The following parameters are available in the `nftables::chain` defined type:
1130

    
1131
* [`table`](#table)
1132
* [`chain`](#chain)
1133
* [`inject`](#inject)
1134
* [`inject_iif`](#inject_iif)
1135
* [`inject_oif`](#inject_oif)
1136

    
1137
##### <a name="table"></a>`table`
1138

    
1139
Data type: `Pattern[/^(ip|ip6|inet)-[a-zA-Z0-9_]+$/]`
1140

    
1141

    
1142

    
1143
Default value: `'inet-filter'`
1144

    
1145
##### <a name="chain"></a>`chain`
1146

    
1147
Data type: `Pattern[/^[a-zA-Z0-9_]+$/]`
1148

    
1149

    
1150

    
1151
Default value: `$title`
1152

    
1153
##### <a name="inject"></a>`inject`
1154

    
1155
Data type: `Optional[Pattern[/^\d\d-[a-zA-Z0-9_]+$/]]`
1156

    
1157

    
1158

    
1159
Default value: ``undef``
1160

    
1161
##### <a name="inject_iif"></a>`inject_iif`
1162

    
1163
Data type: `Optional[String]`
1164

    
1165

    
1166

    
1167
Default value: ``undef``
1168

    
1169
##### <a name="inject_oif"></a>`inject_oif`
1170

    
1171
Data type: `Optional[String]`
1172

    
1173

    
1174

    
1175
Default value: ``undef``
1176

    
1177
### <a name="nftablesconfig"></a>`nftables::config`
1178

    
1179
manage a config snippet
1180

    
1181
#### Parameters
1182

    
1183
The following parameters are available in the `nftables::config` defined type:
1184

    
1185
* [`tablespec`](#tablespec)
1186
* [`content`](#content)
1187
* [`source`](#source)
1188
* [`prefix`](#prefix)
1189

    
1190
##### <a name="tablespec"></a>`tablespec`
1191

    
1192
Data type: `Pattern[/^\w+-\w+$/]`
1193

    
1194

    
1195

    
1196
Default value: `$title`
1197

    
1198
##### <a name="content"></a>`content`
1199

    
1200
Data type: `Optional[String]`
1201

    
1202

    
1203

    
1204
Default value: ``undef``
1205

    
1206
##### <a name="source"></a>`source`
1207

    
1208
Data type: `Optional[Variant[String,Array[String,1]]]`
1209

    
1210

    
1211

    
1212
Default value: ``undef``
1213

    
1214
##### <a name="prefix"></a>`prefix`
1215

    
1216
Data type: `String`
1217

    
1218

    
1219

    
1220
Default value: `'custom-'`
1221

    
1222
### <a name="nftablesrule"></a>`nftables::rule`
1223

    
1224
Provides an interface to create a firewall rule
1225

    
1226
#### Examples
1227

    
1228
##### add a rule named 'myhttp' to the 'default_in' chain to allow incoming traffic to TCP port 80
1229

    
1230
```puppet
1231
nftables::rule {
1232
  'default_in-myhttp':
1233
    content => 'tcp dport 80 accept',
1234
}
1235
```
1236

    
1237
##### add a rule named 'count' to the 'PREROUTING6' chain in table 'ip6 nat' to count traffic
1238

    
1239
```puppet
1240
nftables::rule {
1241
  'PREROUTING6-count':
1242
    content => 'counter',
1243
    table   => 'ip6-nat'
1244
}
1245
```
1246

    
1247
#### Parameters
1248

    
1249
The following parameters are available in the `nftables::rule` defined type:
1250

    
1251
* [`ensure`](#ensure)
1252
* [`rulename`](#rulename)
1253
* [`order`](#order)
1254
* [`table`](#table)
1255
* [`content`](#content)
1256
* [`source`](#source)
1257

    
1258
##### <a name="ensure"></a>`ensure`
1259

    
1260
Data type: `Enum['present','absent']`
1261

    
1262
Should the rule be created.
1263

    
1264
Default value: `'present'`
1265

    
1266
##### <a name="rulename"></a>`rulename`
1267

    
1268
Data type: `Nftables::RuleName`
1269

    
1270
The symbolic name for the rule and to what chain to add it. The
1271
format is defined by the Nftables::RuleName type.
1272

    
1273
Default value: `$title`
1274

    
1275
##### <a name="order"></a>`order`
1276

    
1277
Data type: `Pattern[/^\d\d$/]`
1278

    
1279
A number representing the order of the rule.
1280

    
1281
Default value: `'50'`
1282

    
1283
##### <a name="table"></a>`table`
1284

    
1285
Data type: `String`
1286

    
1287
The name of the table to add this rule to.
1288

    
1289
Default value: `'inet-filter'`
1290

    
1291
##### <a name="content"></a>`content`
1292

    
1293
Data type: `Optional[String]`
1294

    
1295
The raw statements that compose the rule represented using the nftables
1296
language.
1297

    
1298
Default value: ``undef``
1299

    
1300
##### <a name="source"></a>`source`
1301

    
1302
Data type: `Optional[Variant[String,Array[String,1]]]`
1303

    
1304
Same goal as content but sourcing the value from a file.
1305

    
1306
Default value: ``undef``
1307

    
1308
### <a name="nftablesrulesdnat4"></a>`nftables::rules::dnat4`
1309

    
1310
manage a ipv4 dnat rule
1311

    
1312
#### Parameters
1313

    
1314
The following parameters are available in the `nftables::rules::dnat4` defined type:
1315

    
1316
* [`daddr`](#daddr)
1317
* [`port`](#port)
1318
* [`rulename`](#rulename)
1319
* [`order`](#order)
1320
* [`chain`](#chain)
1321
* [`iif`](#iif)
1322
* [`proto`](#proto)
1323
* [`dport`](#dport)
1324
* [`ensure`](#ensure)
1325

    
1326
##### <a name="daddr"></a>`daddr`
1327

    
1328
Data type: `Pattern[/^[12]?\d{1,2}\.[12]?\d{1,2}\.[12]?\d{1,2}\.[12]?\d{1,2}$/]`
1329

    
1330

    
1331

    
1332
##### <a name="port"></a>`port`
1333

    
1334
Data type: `Variant[String,Stdlib::Port]`
1335

    
1336

    
1337

    
1338
##### <a name="rulename"></a>`rulename`
1339

    
1340
Data type: `Pattern[/^[a-zA-Z0-9_]+$/]`
1341

    
1342

    
1343

    
1344
Default value: `$title`
1345

    
1346
##### <a name="order"></a>`order`
1347

    
1348
Data type: `Pattern[/^\d\d$/]`
1349

    
1350

    
1351

    
1352
Default value: `'50'`
1353

    
1354
##### <a name="chain"></a>`chain`
1355

    
1356
Data type: `String[1]`
1357

    
1358

    
1359

    
1360
Default value: `'default_fwd'`
1361

    
1362
##### <a name="iif"></a>`iif`
1363

    
1364
Data type: `Optional[String[1]]`
1365

    
1366

    
1367

    
1368
Default value: ``undef``
1369

    
1370
##### <a name="proto"></a>`proto`
1371

    
1372
Data type: `Enum['tcp','udp']`
1373

    
1374

    
1375

    
1376
Default value: `'tcp'`
1377

    
1378
##### <a name="dport"></a>`dport`
1379

    
1380
Data type: `Optional[Variant[String,Stdlib::Port]]`
1381

    
1382

    
1383

    
1384
Default value: ``undef``
1385

    
1386
##### <a name="ensure"></a>`ensure`
1387

    
1388
Data type: `Enum['present','absent']`
1389

    
1390

    
1391

    
1392
Default value: `'present'`
1393

    
1394
### <a name="nftablesrulesmasquerade"></a>`nftables::rules::masquerade`
1395

    
1396
masquerade all outgoing traffic
1397

    
1398
#### Parameters
1399

    
1400
The following parameters are available in the `nftables::rules::masquerade` defined type:
1401

    
1402
* [`rulename`](#rulename)
1403
* [`order`](#order)
1404
* [`chain`](#chain)
1405
* [`oif`](#oif)
1406
* [`saddr`](#saddr)
1407
* [`daddr`](#daddr)
1408
* [`proto`](#proto)
1409
* [`dport`](#dport)
1410
* [`ensure`](#ensure)
1411

    
1412
##### <a name="rulename"></a>`rulename`
1413

    
1414
Data type: `Pattern[/^[a-zA-Z0-9_]+$/]`
1415

    
1416

    
1417

    
1418
Default value: `$title`
1419

    
1420
##### <a name="order"></a>`order`
1421

    
1422
Data type: `Pattern[/^\d\d$/]`
1423

    
1424

    
1425

    
1426
Default value: `'70'`
1427

    
1428
##### <a name="chain"></a>`chain`
1429

    
1430
Data type: `String[1]`
1431

    
1432

    
1433

    
1434
Default value: `'POSTROUTING'`
1435

    
1436
##### <a name="oif"></a>`oif`
1437

    
1438
Data type: `Optional[String[1]]`
1439

    
1440

    
1441

    
1442
Default value: ``undef``
1443

    
1444
##### <a name="saddr"></a>`saddr`
1445

    
1446
Data type: `Optional[String[1]]`
1447

    
1448

    
1449

    
1450
Default value: ``undef``
1451

    
1452
##### <a name="daddr"></a>`daddr`
1453

    
1454
Data type: `Optional[String[1]]`
1455

    
1456

    
1457

    
1458
Default value: ``undef``
1459

    
1460
##### <a name="proto"></a>`proto`
1461

    
1462
Data type: `Optional[Enum['tcp','udp']]`
1463

    
1464

    
1465

    
1466
Default value: ``undef``
1467

    
1468
##### <a name="dport"></a>`dport`
1469

    
1470
Data type: `Optional[Variant[String,Stdlib::Port]]`
1471

    
1472

    
1473

    
1474
Default value: ``undef``
1475

    
1476
##### <a name="ensure"></a>`ensure`
1477

    
1478
Data type: `Enum['present','absent']`
1479

    
1480

    
1481

    
1482
Default value: `'present'`
1483

    
1484
### <a name="nftablesrulessnat4"></a>`nftables::rules::snat4`
1485

    
1486
manage a ipv4 snat rule
1487

    
1488
#### Parameters
1489

    
1490
The following parameters are available in the `nftables::rules::snat4` defined type:
1491

    
1492
* [`snat`](#snat)
1493
* [`rulename`](#rulename)
1494
* [`order`](#order)
1495
* [`chain`](#chain)
1496
* [`oif`](#oif)
1497
* [`saddr`](#saddr)
1498
* [`proto`](#proto)
1499
* [`dport`](#dport)
1500
* [`ensure`](#ensure)
1501

    
1502
##### <a name="snat"></a>`snat`
1503

    
1504
Data type: `String[1]`
1505

    
1506

    
1507

    
1508
##### <a name="rulename"></a>`rulename`
1509

    
1510
Data type: `Pattern[/^[a-zA-Z0-9_]+$/]`
1511

    
1512

    
1513

    
1514
Default value: `$title`
1515

    
1516
##### <a name="order"></a>`order`
1517

    
1518
Data type: `Pattern[/^\d\d$/]`
1519

    
1520

    
1521

    
1522
Default value: `'70'`
1523

    
1524
##### <a name="chain"></a>`chain`
1525

    
1526
Data type: `String[1]`
1527

    
1528

    
1529

    
1530
Default value: `'POSTROUTING'`
1531

    
1532
##### <a name="oif"></a>`oif`
1533

    
1534
Data type: `Optional[String[1]]`
1535

    
1536

    
1537

    
1538
Default value: ``undef``
1539

    
1540
##### <a name="saddr"></a>`saddr`
1541

    
1542
Data type: `Optional[String[1]]`
1543

    
1544

    
1545

    
1546
Default value: ``undef``
1547

    
1548
##### <a name="proto"></a>`proto`
1549

    
1550
Data type: `Optional[Enum['tcp','udp']]`
1551

    
1552

    
1553

    
1554
Default value: ``undef``
1555

    
1556
##### <a name="dport"></a>`dport`
1557

    
1558
Data type: `Optional[Variant[String,Stdlib::Port]]`
1559

    
1560

    
1561

    
1562
Default value: ``undef``
1563

    
1564
##### <a name="ensure"></a>`ensure`
1565

    
1566
Data type: `Enum['present','absent']`
1567

    
1568

    
1569

    
1570
Default value: `'present'`
1571

    
1572
### <a name="nftablesset"></a>`nftables::set`
1573

    
1574
manage a named set
1575

    
1576
#### Examples
1577

    
1578
##### simple set
1579

    
1580
```puppet
1581
nftables::set{'my_set':
1582
  type       => 'ipv4_addr',
1583
  flags      => ['interval'],
1584
  elements   => ['192.168.0.1/24', '10.0.0.2'],
1585
  auto_merge => true,
1586
}
1587
```
1588

    
1589
#### Parameters
1590

    
1591
The following parameters are available in the `nftables::set` defined type:
1592

    
1593
* [`ensure`](#ensure)
1594
* [`setname`](#setname)
1595
* [`order`](#order)
1596
* [`type`](#type)
1597
* [`table`](#table)
1598
* [`flags`](#flags)
1599
* [`timeout`](#timeout)
1600
* [`gc_interval`](#gc_interval)
1601
* [`elements`](#elements)
1602
* [`size`](#size)
1603
* [`policy`](#policy)
1604
* [`auto_merge`](#auto_merge)
1605
* [`content`](#content)
1606
* [`source`](#source)
1607

    
1608
##### <a name="ensure"></a>`ensure`
1609

    
1610
Data type: `Enum['present','absent']`
1611

    
1612
should the set be created.
1613

    
1614
Default value: `'present'`
1615

    
1616
##### <a name="setname"></a>`setname`
1617

    
1618
Data type: `Pattern[/^[-a-zA-Z0-9_]+$/]`
1619

    
1620
name of set, equal to to title.
1621

    
1622
Default value: `$title`
1623

    
1624
##### <a name="order"></a>`order`
1625

    
1626
Data type: `Pattern[/^\d\d$/]`
1627

    
1628
concat ordering.
1629

    
1630
Default value: `'10'`
1631

    
1632
##### <a name="type"></a>`type`
1633

    
1634
Data type: `Optional[Enum['ipv4_addr', 'ipv6_addr', 'ether_addr', 'inet_proto', 'inet_service', 'mark']]`
1635

    
1636
type of set.
1637

    
1638
Default value: ``undef``
1639

    
1640
##### <a name="table"></a>`table`
1641

    
1642
Data type: `Variant[String, Array[String, 1]]`
1643

    
1644
table or array of tables to add the set to.
1645

    
1646
Default value: `'inet-filter'`
1647

    
1648
##### <a name="flags"></a>`flags`
1649

    
1650
Data type: `Array[Enum['constant', 'dynamic', 'interval', 'timeout'], 0, 4]`
1651

    
1652
specify flags for set
1653

    
1654
Default value: `[]`
1655

    
1656
##### <a name="timeout"></a>`timeout`
1657

    
1658
Data type: `Optional[Integer]`
1659

    
1660
timeout in seconds
1661

    
1662
Default value: ``undef``
1663

    
1664
##### <a name="gc_interval"></a>`gc_interval`
1665

    
1666
Data type: `Optional[Integer]`
1667

    
1668
garbage collection interval.
1669

    
1670
Default value: ``undef``
1671

    
1672
##### <a name="elements"></a>`elements`
1673

    
1674
Data type: `Optional[Array[String]]`
1675

    
1676
initialize the set with some elements in it.
1677

    
1678
Default value: ``undef``
1679

    
1680
##### <a name="size"></a>`size`
1681

    
1682
Data type: `Optional[Integer]`
1683

    
1684
limits the maximum number of elements of the set.
1685

    
1686
Default value: ``undef``
1687

    
1688
##### <a name="policy"></a>`policy`
1689

    
1690
Data type: `Optional[Enum['performance', 'memory']]`
1691

    
1692
determines set selection policy.
1693

    
1694
Default value: ``undef``
1695

    
1696
##### <a name="auto_merge"></a>`auto_merge`
1697

    
1698
Data type: `Boolean`
1699

    
1700
?
1701

    
1702
Default value: ``false``
1703

    
1704
##### <a name="content"></a>`content`
1705

    
1706
Data type: `Optional[String]`
1707

    
1708
specify content of set.
1709

    
1710
Default value: ``undef``
1711

    
1712
##### <a name="source"></a>`source`
1713

    
1714
Data type: `Optional[Variant[String,Array[String,1]]]`
1715

    
1716
specify source of set.
1717

    
1718
Default value: ``undef``
1719

    
1720
### <a name="nftablessimplerule"></a>`nftables::simplerule`
1721

    
1722
Provides a simplified interface to nftables::rule
1723

    
1724
#### Examples
1725

    
1726
##### allow incoming traffic from port 541 on port 543 TCP to a given IP range and count packets
1727

    
1728
```puppet
1729
nftables::simplerule{'my_service_in':
1730
  action  => 'accept',
1731
  comment => 'allow traffic to port 543',
1732
  counter => true,
1733
  proto   => 'tcp',
1734
  dport   => 543,
1735
  daddr   => '2001:1458::/32',
1736
  sport   => 541,
1737
}
1738
```
1739

    
1740
#### Parameters
1741

    
1742
The following parameters are available in the `nftables::simplerule` defined type:
1743

    
1744
* [`ensure`](#ensure)
1745
* [`rulename`](#rulename)
1746
* [`order`](#order)
1747
* [`chain`](#chain)
1748
* [`table`](#table)
1749
* [`action`](#action)
1750
* [`comment`](#comment)
1751
* [`dport`](#dport)
1752
* [`proto`](#proto)
1753
* [`daddr`](#daddr)
1754
* [`set_type`](#set_type)
1755
* [`sport`](#sport)
1756
* [`saddr`](#saddr)
1757
* [`counter`](#counter)
1758

    
1759
##### <a name="ensure"></a>`ensure`
1760

    
1761
Data type: `Enum['present','absent']`
1762

    
1763
Should the rule be created.
1764

    
1765
Default value: `'present'`
1766

    
1767
##### <a name="rulename"></a>`rulename`
1768

    
1769
Data type: `Nftables::SimpleRuleName`
1770

    
1771
The symbolic name for the rule to add. Defaults to the resource's title.
1772

    
1773
Default value: `$title`
1774

    
1775
##### <a name="order"></a>`order`
1776

    
1777
Data type: `Pattern[/^\d\d$/]`
1778

    
1779
A number representing the order of the rule.
1780

    
1781
Default value: `'50'`
1782

    
1783
##### <a name="chain"></a>`chain`
1784

    
1785
Data type: `String`
1786

    
1787
The name of the chain to add this rule to.
1788

    
1789
Default value: `'default_in'`
1790

    
1791
##### <a name="table"></a>`table`
1792

    
1793
Data type: `String`
1794

    
1795
The name of the table to add this rule to.
1796

    
1797
Default value: `'inet-filter'`
1798

    
1799
##### <a name="action"></a>`action`
1800

    
1801
Data type: `Enum['accept', 'continue', 'drop', 'queue', 'return']`
1802

    
1803
The verdict for the matched traffic.
1804

    
1805
Default value: `'accept'`
1806

    
1807
##### <a name="comment"></a>`comment`
1808

    
1809
Data type: `Optional[String]`
1810

    
1811
A typically human-readable comment for the rule.
1812

    
1813
Default value: ``undef``
1814

    
1815
##### <a name="dport"></a>`dport`
1816

    
1817
Data type: `Optional[Nftables::Port]`
1818

    
1819
The destination port, ports or port range.
1820

    
1821
Default value: ``undef``
1822

    
1823
##### <a name="proto"></a>`proto`
1824

    
1825
Data type: `Optional[Enum['tcp', 'tcp4', 'tcp6', 'udp', 'udp4', 'udp6']]`
1826

    
1827
The transport-layer protocol to match.
1828

    
1829
Default value: ``undef``
1830

    
1831
##### <a name="daddr"></a>`daddr`
1832

    
1833
Data type: `Optional[Nftables::Addr]`
1834

    
1835
The destination address, CIDR or set to match.
1836

    
1837
Default value: ``undef``
1838

    
1839
##### <a name="set_type"></a>`set_type`
1840

    
1841
Data type: `Enum['ip', 'ip6']`
1842

    
1843
When using sets as saddr or daddr, the type of the set.
1844
Use `ip` for sets of type `ipv4_addr`.
1845

    
1846
Default value: `'ip6'`
1847

    
1848
##### <a name="sport"></a>`sport`
1849

    
1850
Data type: `Optional[Nftables::Port]`
1851

    
1852
The source port, ports or port range.
1853

    
1854
Default value: ``undef``
1855

    
1856
##### <a name="saddr"></a>`saddr`
1857

    
1858
Data type: `Optional[Nftables::Addr]`
1859

    
1860
The source address, CIDR or set to match.
1861

    
1862
Default value: ``undef``
1863

    
1864
##### <a name="counter"></a>`counter`
1865

    
1866
Data type: `Boolean`
1867

    
1868
Enable traffic counters for the matched traffic.
1869

    
1870
Default value: ``false``
1871

    
1872
## Data types
1873

    
1874
### <a name="nftablesaddr"></a>`Nftables::Addr`
1875

    
1876
Represents an address expression to be used within a rule.
1877

    
1878
Alias of
1879

    
1880
```puppet
1881
Variant[Stdlib::IP::Address::V6, Stdlib::IP::Address::V4, Nftables::Addr::Set]
1882
```
1883

    
1884
### <a name="nftablesaddrset"></a>`Nftables::Addr::Set`
1885

    
1886
Represents a set expression to be used within a rule.
1887

    
1888
Alias of
1889

    
1890
```puppet
1891
Pattern[/^@[-a-zA-Z0-9_]+$/]
1892
```
1893

    
1894
### <a name="nftablesport"></a>`Nftables::Port`
1895

    
1896
Represents a port expression to be used within a rule.
1897

    
1898
Alias of
1899

    
1900
```puppet
1901
Variant[Array[Stdlib::Port, 1], Stdlib::Port, Nftables::Port::Range]
1902
```
1903

    
1904
### <a name="nftablesportrange"></a>`Nftables::Port::Range`
1905

    
1906
Represents a port range expression to be used within a rule.
1907

    
1908
Alias of
1909

    
1910
```puppet
1911
Pattern[/^\d+-\d+$/]
1912
```
1913

    
1914
### <a name="nftablesrulename"></a>`Nftables::RuleName`
1915

    
1916
Represents a rule name to be used in a raw rule created via nftables::rule.
1917
It's a dash separated string. The first component describes the chain to
1918
add the rule to, the second the rule name and the (optional) third a number.
1919
Ex: 'default_in-sshd', 'default_out-my_service-2'.
1920

    
1921
Alias of
1922

    
1923
```puppet
1924
Pattern[/^[a-zA-Z0-9_]+-[a-zA-Z0-9_]+(-\d+)?$/]
1925
```
1926

    
1927
### <a name="nftablessimplerulename"></a>`Nftables::SimpleRuleName`
1928

    
1929
Represents a simple rule name to be used in a rule created via nftables::simplerule
1930

    
1931
Alias of
1932

    
1933
```puppet
1934
Pattern[/^[a-zA-Z0-9_]+(-\d+)?$/]
1935
```
1936