Projet

Général

Profil

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

root / REFERENCE.md @ 6824a5a3

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

    
80
### Defined types
81

    
82
* [`nftables::chain`](#nftableschain): manage a chain
83
* [`nftables::config`](#nftablesconfig): manage a config snippet
84
* [`nftables::file`](#nftablesfile): Insert a file into the nftables configuration
85
* [`nftables::rule`](#nftablesrule): Provides an interface to create a firewall rule
86
* [`nftables::rules::dnat4`](#nftablesrulesdnat4): manage a ipv4 dnat rule
87
* [`nftables::rules::masquerade`](#nftablesrulesmasquerade): masquerade all outgoing traffic
88
* [`nftables::rules::snat4`](#nftablesrulessnat4): manage a ipv4 snat rule
89
* [`nftables::set`](#nftablesset): manage a named set
90
* [`nftables::simplerule`](#nftablessimplerule): Provides a simplified interface to nftables::rule
91

    
92
### Data types
93

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

    
104
## Classes
105

    
106
### <a name="nftables"></a>`nftables`
107

    
108
Configure nftables
109

    
110
#### Examples
111

    
112
##### allow dns out and do not allow ntp out
113

    
114
```puppet
115
class{ 'nftables':
116
  out_ntp => false,
117
  out_dns => true,
118
}
119
```
120

    
121
##### do not flush particular tables, fail2ban in this case
122

    
123
```puppet
124
class{ 'nftables':
125
  noflush_tables => ['inet-f2b-table'],
126
}
127
```
128

    
129
#### Parameters
130

    
131
The following parameters are available in the `nftables` class:
132

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

    
157
##### <a name="out_all"></a>`out_all`
158

    
159
Data type: `Boolean`
160

    
161
Allow all outbound connections. If `true` then all other
162
out parameters `out_ntp`, `out_dns`, ... will be assuemed
163
false.
164

    
165
Default value: ``false``
166

    
167
##### <a name="out_ntp"></a>`out_ntp`
168

    
169
Data type: `Boolean`
170

    
171
Allow outbound to ntp servers.
172

    
173
Default value: ``true``
174

    
175
##### <a name="out_http"></a>`out_http`
176

    
177
Data type: `Boolean`
178

    
179
Allow outbound to http servers.
180

    
181
Default value: ``true``
182

    
183
##### <a name="out_dns"></a>`out_dns`
184

    
185
Data type: `Boolean`
186

    
187
Allow outbound to dns servers.
188

    
189
Default value: ``true``
190

    
191
##### <a name="out_https"></a>`out_https`
192

    
193
Data type: `Boolean`
194

    
195
Allow outbound to https servers.
196

    
197
Default value: ``true``
198

    
199
##### <a name="out_icmp"></a>`out_icmp`
200

    
201
Data type: `Boolean`
202

    
203
Allow outbound ICMPv4/v6 traffic.
204

    
205
Default value: ``true``
206

    
207
##### <a name="in_ssh"></a>`in_ssh`
208

    
209
Data type: `Boolean`
210

    
211
Allow inbound to ssh servers.
212

    
213
Default value: ``true``
214

    
215
##### <a name="in_icmp"></a>`in_icmp`
216

    
217
Data type: `Boolean`
218

    
219
Allow inbound ICMPv4/v6 traffic.
220

    
221
Default value: ``true``
222

    
223
##### <a name="inet_filter"></a>`inet_filter`
224

    
225
Data type: `Boolean`
226

    
227
Add default tables, chains and rules to process traffic.
228

    
229
Default value: ``true``
230

    
231
##### <a name="nat"></a>`nat`
232

    
233
Data type: `Boolean`
234

    
235
Add default tables and chains to process NAT traffic.
236

    
237
Default value: ``true``
238

    
239
##### <a name="nat_table_name"></a>`nat_table_name`
240

    
241
Data type: `String[1]`
242

    
243
The name of the 'nat' table.
244

    
245
Default value: `'nat'`
246

    
247
##### <a name="sets"></a>`sets`
248

    
249
Data type: `Hash`
250

    
251
Allows sourcing set definitions directly from Hiera.
252

    
253
Default value: `{}`
254

    
255
##### <a name="log_prefix"></a>`log_prefix`
256

    
257
Data type: `String`
258

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

    
264
Default value: `'[nftables] %<chain>s %<comment>s'`
265

    
266
##### <a name="log_limit"></a>`log_limit`
267

    
268
Data type: `Variant[Boolean[false], String]`
269

    
270
String with the content of a limit statement to be applied
271
to the rules that log discarded traffic. Set to false to
272
disable rate limiting.
273

    
274
Default value: `'3/minute burst 5 packets'`
275

    
276
##### <a name="reject_with"></a>`reject_with`
277

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

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

    
285
Default value: `'icmpx type port-unreachable'`
286

    
287
##### <a name="in_out_conntrack"></a>`in_out_conntrack`
288

    
289
Data type: `Boolean`
290

    
291
Adds INPUT and OUTPUT rules to allow traffic that's part of an
292
established connection and also to drop invalid packets.
293

    
294
Default value: ``true``
295

    
296
##### <a name="fwd_conntrack"></a>`fwd_conntrack`
297

    
298
Data type: `Boolean`
299

    
300
Adds FORWARD rules to allow traffic that's part of an
301
established connection and also to drop invalid packets.
302

    
303
Default value: ``false``
304

    
305
##### <a name="firewalld_enable"></a>`firewalld_enable`
306

    
307
Data type: `Variant[Boolean[false], Enum['mask']]`
308

    
309
Configures how the firewalld systemd service unit is enabled. It might be
310
useful to set this to false if you're externaly removing firewalld from
311
the system completely.
312

    
313
Default value: `'mask'`
314

    
315
##### <a name="noflush_tables"></a>`noflush_tables`
316

    
317
Data type: `Optional[Array[Pattern[/^(ip|ip6|inet|arp|bridge|netdev)-[-a-zA-Z0-9_]+$/],1]]`
318

    
319
If specified only other existings tables will be flushed.
320
If left unset all tables will be flushed via a `flush ruleset`
321

    
322
Default value: ``undef``
323

    
324
##### <a name="rules"></a>`rules`
325

    
326
Data type: `Hash`
327

    
328
Specify hashes of `nftables::rule`s via hiera
329

    
330
Default value: `{}`
331

    
332
##### <a name="configuration_path"></a>`configuration_path`
333

    
334
Data type: `Stdlib::Unixpath`
335

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

    
339
##### <a name="nft_path"></a>`nft_path`
340

    
341
Data type: `Stdlib::Unixpath`
342

    
343
Path to the nft binary
344

    
345
##### <a name="echo"></a>`echo`
346

    
347
Data type: `Stdlib::Unixpath`
348

    
349
Path to the echo binary
350

    
351
### <a name="nftablesbridges"></a>`nftables::bridges`
352

    
353
allow forwarding traffic on bridges
354

    
355
#### Parameters
356

    
357
The following parameters are available in the `nftables::bridges` class:
358

    
359
* [`ensure`](#ensure)
360
* [`bridgenames`](#bridgenames)
361

    
362
##### <a name="ensure"></a>`ensure`
363

    
364
Data type: `Enum['present','absent']`
365

    
366

    
367

    
368
Default value: `'present'`
369

    
370
##### <a name="bridgenames"></a>`bridgenames`
371

    
372
Data type: `Regexp`
373

    
374

    
375

    
376
Default value: `/^br.+/`
377

    
378
### <a name="nftablesinet_filter"></a>`nftables::inet_filter`
379

    
380
manage basic chains in table inet filter
381

    
382
### <a name="nftablesinet_filterfwd_conntrack"></a>`nftables::inet_filter::fwd_conntrack`
383

    
384
enable conntrack for fwd
385

    
386
### <a name="nftablesinet_filterin_out_conntrack"></a>`nftables::inet_filter::in_out_conntrack`
387

    
388
manage input & output conntrack
389

    
390
### <a name="nftablesip_nat"></a>`nftables::ip_nat`
391

    
392
manage basic chains in table ip nat
393

    
394
### <a name="nftablesrulesactivemq"></a>`nftables::rules::activemq`
395

    
396
Provides input rules for Apache ActiveMQ
397

    
398
#### Parameters
399

    
400
The following parameters are available in the `nftables::rules::activemq` class:
401

    
402
* [`tcp`](#tcp)
403
* [`udp`](#udp)
404
* [`port`](#port)
405

    
406
##### <a name="tcp"></a>`tcp`
407

    
408
Data type: `Boolean`
409

    
410
Create the rule for TCP traffic.
411

    
412
Default value: ``true``
413

    
414
##### <a name="udp"></a>`udp`
415

    
416
Data type: `Boolean`
417

    
418
Create the rule for UDP traffic.
419

    
420
Default value: ``true``
421

    
422
##### <a name="port"></a>`port`
423

    
424
Data type: `Stdlib::Port`
425

    
426
The port number for the ActiveMQ daemon.
427

    
428
Default value: `61616`
429

    
430
### <a name="nftablesrulesafs3_callback"></a>`nftables::rules::afs3_callback`
431

    
432
Open call back port for AFS clients
433

    
434
#### Examples
435

    
436
##### allow call backs from particular hosts
437

    
438
```puppet
439
class{'nftables::rules::afs3_callback':
440
  saddr => ['192.168.0.0/16', '10.0.0.222']
441
}
442
```
443

    
444
#### Parameters
445

    
446
The following parameters are available in the `nftables::rules::afs3_callback` class:
447

    
448
* [`saddr`](#saddr)
449

    
450
##### <a name="saddr"></a>`saddr`
451

    
452
Data type: `Array[Stdlib::IP::Address::V4,1]`
453

    
454
list of source network ranges to a
455

    
456
Default value: `['0.0.0.0/0']`
457

    
458
### <a name="nftablesrulesceph"></a>`nftables::rules::ceph`
459

    
460
Ceph is a distributed object store and file system.
461
Enable this to support Ceph's Object Storage Daemons (OSD),
462
Metadata Server Daemons (MDS), or Manager Daemons (MGR).
463

    
464
### <a name="nftablesrulesceph_mon"></a>`nftables::rules::ceph_mon`
465

    
466
Ceph is a distributed object store and file system.
467
Enable this option to support Ceph's Monitor Daemon.
468

    
469
#### Parameters
470

    
471
The following parameters are available in the `nftables::rules::ceph_mon` class:
472

    
473
* [`ports`](#ports)
474

    
475
##### <a name="ports"></a>`ports`
476

    
477
Data type: `Array[Stdlib::Port,1]`
478

    
479
specify ports for ceph service
480

    
481
Default value: `[3300, 6789]`
482

    
483
### <a name="nftablesrulesdhcpv6_client"></a>`nftables::rules::dhcpv6_client`
484

    
485
allow DHCPv6 requests in to a host
486

    
487
### <a name="nftablesrulesdns"></a>`nftables::rules::dns`
488

    
489
manage in dns
490

    
491
#### Parameters
492

    
493
The following parameters are available in the `nftables::rules::dns` class:
494

    
495
* [`ports`](#ports)
496

    
497
##### <a name="ports"></a>`ports`
498

    
499
Data type: `Array[Stdlib::Port,1]`
500

    
501
Specify ports for dns.
502

    
503
Default value: `[53]`
504

    
505
### <a name="nftablesrulesdocker_ce"></a>`nftables::rules::docker_ce`
506

    
507
The configuration distributed in this class represents the default firewall
508
configuration done by docker-ce when the iptables integration is enabled.
509

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

    
513
When using this class 'docker::iptables: false' should be set.
514

    
515
#### Parameters
516

    
517
The following parameters are available in the `nftables::rules::docker_ce` class:
518

    
519
* [`docker_interface`](#docker_interface)
520
* [`docker_prefix`](#docker_prefix)
521
* [`manage_docker_chains`](#manage_docker_chains)
522
* [`manage_base_chains`](#manage_base_chains)
523

    
524
##### <a name="docker_interface"></a>`docker_interface`
525

    
526
Data type: `String[1]`
527

    
528
Interface name used by docker.
529

    
530
Default value: `'docker0'`
531

    
532
##### <a name="docker_prefix"></a>`docker_prefix`
533

    
534
Data type: `Stdlib::IP::Address::V4::CIDR`
535

    
536
The address space used by docker.
537

    
538
Default value: `'172.17.0.0/16'`
539

    
540
##### <a name="manage_docker_chains"></a>`manage_docker_chains`
541

    
542
Data type: `Boolean`
543

    
544
Flag to control whether the class should create the docker related chains.
545

    
546
Default value: ``true``
547

    
548
##### <a name="manage_base_chains"></a>`manage_base_chains`
549

    
550
Data type: `Boolean`
551

    
552
Flag to control whether the class should create the base common chains.
553

    
554
Default value: ``true``
555

    
556
### <a name="nftablesruleshttp"></a>`nftables::rules::http`
557

    
558
manage in http
559

    
560
### <a name="nftablesruleshttps"></a>`nftables::rules::https`
561

    
562
manage in https
563

    
564
### <a name="nftablesrulesicinga2"></a>`nftables::rules::icinga2`
565

    
566
manage in icinga2
567

    
568
#### Parameters
569

    
570
The following parameters are available in the `nftables::rules::icinga2` class:
571

    
572
* [`ports`](#ports)
573

    
574
##### <a name="ports"></a>`ports`
575

    
576
Data type: `Array[Stdlib::Port,1]`
577

    
578
Specify ports for icinga1
579

    
580
Default value: `[5665]`
581

    
582
### <a name="nftablesrulesicmp"></a>`nftables::rules::icmp`
583

    
584
The nftables::rules::icmp class.
585

    
586
#### Parameters
587

    
588
The following parameters are available in the `nftables::rules::icmp` class:
589

    
590
* [`v4_types`](#v4_types)
591
* [`v6_types`](#v6_types)
592
* [`order`](#order)
593

    
594
##### <a name="v4_types"></a>`v4_types`
595

    
596
Data type: `Optional[Array[String]]`
597

    
598

    
599

    
600
Default value: ``undef``
601

    
602
##### <a name="v6_types"></a>`v6_types`
603

    
604
Data type: `Optional[Array[String]]`
605

    
606

    
607

    
608
Default value: ``undef``
609

    
610
##### <a name="order"></a>`order`
611

    
612
Data type: `String`
613

    
614

    
615

    
616
Default value: `'10'`
617

    
618
### <a name="nftablesrulesnfs"></a>`nftables::rules::nfs`
619

    
620
manage in nfs4
621

    
622
### <a name="nftablesrulesnfs3"></a>`nftables::rules::nfs3`
623

    
624
manage in nfs3
625

    
626
### <a name="nftablesrulesnode_exporter"></a>`nftables::rules::node_exporter`
627

    
628
manage in node exporter
629

    
630
#### Parameters
631

    
632
The following parameters are available in the `nftables::rules::node_exporter` class:
633

    
634
* [`prometheus_server`](#prometheus_server)
635
* [`port`](#port)
636

    
637
##### <a name="prometheus_server"></a>`prometheus_server`
638

    
639
Data type: `Optional[Variant[String,Array[String,1]]]`
640

    
641
Specify server name
642

    
643
Default value: ``undef``
644

    
645
##### <a name="port"></a>`port`
646

    
647
Data type: `Stdlib::Port`
648

    
649
Specify port to open
650

    
651
Default value: `9100`
652

    
653
### <a name="nftablesrulesospf"></a>`nftables::rules::ospf`
654

    
655
manage in ospf
656

    
657
### <a name="nftablesrulesospf3"></a>`nftables::rules::ospf3`
658

    
659
manage in ospf3
660

    
661
### <a name="nftablesrulesoutall"></a>`nftables::rules::out::all`
662

    
663
allow all outbound
664

    
665
### <a name="nftablesrulesoutceph_client"></a>`nftables::rules::out::ceph_client`
666

    
667
Ceph is a distributed object store and file system.
668
Enable this to be a client of Ceph's Monitor (MON),
669
Object Storage Daemons (OSD), Metadata Server Daemons (MDS),
670
and Manager Daemons (MGR).
671

    
672
#### Parameters
673

    
674
The following parameters are available in the `nftables::rules::out::ceph_client` class:
675

    
676
* [`ports`](#ports)
677

    
678
##### <a name="ports"></a>`ports`
679

    
680
Data type: `Array[Stdlib::Port,1]`
681

    
682
Specify ports to open
683

    
684
Default value: `[3300, 6789]`
685

    
686
### <a name="nftablesrulesoutchrony"></a>`nftables::rules::out::chrony`
687

    
688
manage out chrony
689

    
690
#### Parameters
691

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

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

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

    
698
Data type: `Array[Stdlib::IP::Address]`
699

    
700
single IP-Address or array of IP-addresses from NTP servers
701

    
702
Default value: `[]`
703

    
704
### <a name="nftablesrulesoutdhcp"></a>`nftables::rules::out::dhcp`
705

    
706
manage out dhcp
707

    
708
### <a name="nftablesrulesoutdhcpv6_client"></a>`nftables::rules::out::dhcpv6_client`
709

    
710
Allow DHCPv6 requests out of a host
711

    
712
### <a name="nftablesrulesoutdns"></a>`nftables::rules::out::dns`
713

    
714
manage out dns
715

    
716
#### Parameters
717

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

    
720
* [`dns_server`](#dns_server)
721

    
722
##### <a name="dns_server"></a>`dns_server`
723

    
724
Data type: `Optional[Variant[String,Array[String,1]]]`
725

    
726
specify dns_server name
727

    
728
Default value: ``undef``
729

    
730
### <a name="nftablesrulesouthkp"></a>`nftables::rules::out::hkp`
731

    
732
allow outgoing hkp connections to gpg keyservers
733

    
734
### <a name="nftablesrulesouthttp"></a>`nftables::rules::out::http`
735

    
736
manage out http
737

    
738
### <a name="nftablesrulesouthttps"></a>`nftables::rules::out::https`
739

    
740
manage out https
741

    
742
### <a name="nftablesrulesouticmp"></a>`nftables::rules::out::icmp`
743

    
744
control outbound icmp packages
745

    
746
#### Parameters
747

    
748
The following parameters are available in the `nftables::rules::out::icmp` class:
749

    
750
* [`v4_types`](#v4_types)
751
* [`v6_types`](#v6_types)
752
* [`order`](#order)
753

    
754
##### <a name="v4_types"></a>`v4_types`
755

    
756
Data type: `Optional[Array[String]]`
757

    
758

    
759

    
760
Default value: ``undef``
761

    
762
##### <a name="v6_types"></a>`v6_types`
763

    
764
Data type: `Optional[Array[String]]`
765

    
766

    
767

    
768
Default value: ``undef``
769

    
770
##### <a name="order"></a>`order`
771

    
772
Data type: `String`
773

    
774

    
775

    
776
Default value: `'10'`
777

    
778
### <a name="nftablesrulesoutimap"></a>`nftables::rules::out::imap`
779

    
780
allow outgoing imap
781

    
782
### <a name="nftablesrulesoutkerberos"></a>`nftables::rules::out::kerberos`
783

    
784
allows outbound access for kerberos
785

    
786
### <a name="nftablesrulesoutmysql"></a>`nftables::rules::out::mysql`
787

    
788
manage out mysql
789

    
790
### <a name="nftablesrulesoutnfs"></a>`nftables::rules::out::nfs`
791

    
792
manage out nfs
793

    
794
### <a name="nftablesrulesoutnfs3"></a>`nftables::rules::out::nfs3`
795

    
796
manage out nfs3
797

    
798
### <a name="nftablesrulesoutopenafs_client"></a>`nftables::rules::out::openafs_client`
799

    
800
allows outbound access for afs clients
801
7000 - afs3-fileserver
802
7002 - afs3-ptserver
803
7003 - vlserver
804

    
805
* **See also**
806
  * https://wiki.openafs.org/devel/AFSServicePorts/
807
    * AFS Service Ports
808

    
809
#### Parameters
810

    
811
The following parameters are available in the `nftables::rules::out::openafs_client` class:
812

    
813
* [`ports`](#ports)
814

    
815
##### <a name="ports"></a>`ports`
816

    
817
Data type: `Array[Stdlib::Port,1]`
818

    
819
port numbers to use
820

    
821
Default value: `[7000, 7002, 7003]`
822

    
823
### <a name="nftablesrulesoutospf"></a>`nftables::rules::out::ospf`
824

    
825
manage out ospf
826

    
827
### <a name="nftablesrulesoutospf3"></a>`nftables::rules::out::ospf3`
828

    
829
manage out ospf3
830

    
831
### <a name="nftablesrulesoutpop3"></a>`nftables::rules::out::pop3`
832

    
833
allow outgoing pop3
834

    
835
### <a name="nftablesrulesoutpostgres"></a>`nftables::rules::out::postgres`
836

    
837
manage out postgres
838

    
839
### <a name="nftablesrulesoutpuppet"></a>`nftables::rules::out::puppet`
840

    
841
manage outgoing puppet
842

    
843
#### Parameters
844

    
845
The following parameters are available in the `nftables::rules::out::puppet` class:
846

    
847
* [`puppetserver`](#puppetserver)
848
* [`puppetserver_port`](#puppetserver_port)
849

    
850
##### <a name="puppetserver"></a>`puppetserver`
851

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

    
854
puppetserver hostname
855

    
856
##### <a name="puppetserver_port"></a>`puppetserver_port`
857

    
858
Data type: `Stdlib::Port`
859

    
860
puppetserver port
861

    
862
Default value: `8140`
863

    
864
### <a name="nftablesrulesoutpxp_agent"></a>`nftables::rules::out::pxp_agent`
865

    
866
manage outgoing pxp-agent
867

    
868
* **See also**
869
  * also
870
    * take a look at nftables::rules::out::puppet, because the PXP agent also connects to a Puppetserver
871

    
872
#### Parameters
873

    
874
The following parameters are available in the `nftables::rules::out::pxp_agent` class:
875

    
876
* [`broker`](#broker)
877
* [`broker_port`](#broker_port)
878

    
879
##### <a name="broker"></a>`broker`
880

    
881
Data type: `Variant[Stdlib::IP::Address,Array[Stdlib::IP::Address,1]]`
882

    
883
PXP broker IP(s)
884

    
885
##### <a name="broker_port"></a>`broker_port`
886

    
887
Data type: `Stdlib::Port`
888

    
889
PXP broker port
890

    
891
Default value: `8142`
892

    
893
### <a name="nftablesrulesoutsmtp"></a>`nftables::rules::out::smtp`
894

    
895
allow outgoing smtp
896

    
897
### <a name="nftablesrulesoutsmtp_client"></a>`nftables::rules::out::smtp_client`
898

    
899
allow outgoing smtp client
900

    
901
### <a name="nftablesrulesoutssh"></a>`nftables::rules::out::ssh`
902

    
903
manage out ssh
904

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

    
907
disable outgoing ssh
908

    
909
### <a name="nftablesrulesouttor"></a>`nftables::rules::out::tor`
910

    
911
manage out tor
912

    
913
### <a name="nftablesrulesoutwhois"></a>`nftables::rules::out::whois`
914

    
915
allow clients to query remote whois server
916

    
917
### <a name="nftablesrulesoutwireguard"></a>`nftables::rules::out::wireguard`
918

    
919
manage out wireguard
920

    
921
#### Parameters
922

    
923
The following parameters are available in the `nftables::rules::out::wireguard` class:
924

    
925
* [`ports`](#ports)
926

    
927
##### <a name="ports"></a>`ports`
928

    
929
Data type: `Array[Integer,1]`
930

    
931
specify wireguard ports
932

    
933
Default value: `[51820]`
934

    
935
### <a name="nftablesrulespuppet"></a>`nftables::rules::puppet`
936

    
937
manage in puppet
938

    
939
#### Parameters
940

    
941
The following parameters are available in the `nftables::rules::puppet` class:
942

    
943
* [`ports`](#ports)
944

    
945
##### <a name="ports"></a>`ports`
946

    
947
Data type: `Array[Integer,1]`
948

    
949
puppet server ports
950

    
951
Default value: `[8140]`
952

    
953
### <a name="nftablesrulespxp_agent"></a>`nftables::rules::pxp_agent`
954

    
955
manage in pxp-agent
956

    
957
#### Parameters
958

    
959
The following parameters are available in the `nftables::rules::pxp_agent` class:
960

    
961
* [`ports`](#ports)
962

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

    
965
Data type: `Array[Stdlib::Port,1]`
966

    
967
pxp server ports
968

    
969
Default value: `[8142]`
970

    
971
### <a name="nftablesrulesqemu"></a>`nftables::rules::qemu`
972

    
973
This class configures the typical firewall setup that libvirt
974
creates. Depending on your requirements you can switch on and off
975
several aspects, for instance if you don't do DHCP to your guests
976
you can disable the rules that accept DHCP traffic on the host or if
977
you don't want your guests to talk to hosts outside you can disable
978
forwarding and/or masquerading for IPv4 traffic.
979

    
980
#### Parameters
981

    
982
The following parameters are available in the `nftables::rules::qemu` class:
983

    
984
* [`interface`](#interface)
985
* [`network_v4`](#network_v4)
986
* [`network_v6`](#network_v6)
987
* [`dns`](#dns)
988
* [`dhcpv4`](#dhcpv4)
989
* [`forward_traffic`](#forward_traffic)
990
* [`internal_traffic`](#internal_traffic)
991
* [`masquerade`](#masquerade)
992

    
993
##### <a name="interface"></a>`interface`
994

    
995
Data type: `String[1]`
996

    
997
Interface name used by the bridge.
998

    
999
Default value: `'virbr0'`
1000

    
1001
##### <a name="network_v4"></a>`network_v4`
1002

    
1003
Data type: `Stdlib::IP::Address::V4::CIDR`
1004

    
1005
The IPv4 network prefix used in the virtual network.
1006

    
1007
Default value: `'192.168.122.0/24'`
1008

    
1009
##### <a name="network_v6"></a>`network_v6`
1010

    
1011
Data type: `Optional[Stdlib::IP::Address::V6::CIDR]`
1012

    
1013
The IPv6 network prefix used in the virtual network.
1014

    
1015
Default value: ``undef``
1016

    
1017
##### <a name="dns"></a>`dns`
1018

    
1019
Data type: `Boolean`
1020

    
1021
Allow DNS traffic from the guests to the host.
1022

    
1023
Default value: ``true``
1024

    
1025
##### <a name="dhcpv4"></a>`dhcpv4`
1026

    
1027
Data type: `Boolean`
1028

    
1029
Allow DHCPv4 traffic from the guests to the host.
1030

    
1031
Default value: ``true``
1032

    
1033
##### <a name="forward_traffic"></a>`forward_traffic`
1034

    
1035
Data type: `Boolean`
1036

    
1037
Allow forwarded traffic (out all, in related/established)
1038
generated by the virtual network.
1039

    
1040
Default value: ``true``
1041

    
1042
##### <a name="internal_traffic"></a>`internal_traffic`
1043

    
1044
Data type: `Boolean`
1045

    
1046
Allow guests in the virtual network to talk to each other.
1047

    
1048
Default value: ``true``
1049

    
1050
##### <a name="masquerade"></a>`masquerade`
1051

    
1052
Data type: `Boolean`
1053

    
1054
Do NAT masquerade on all IPv4 traffic generated by guests
1055
to external networks.
1056

    
1057
Default value: ``true``
1058

    
1059
### <a name="nftablesrulessamba"></a>`nftables::rules::samba`
1060

    
1061
manage Samba, the suite to allow Windows file sharing on Linux resources.
1062

    
1063
#### Parameters
1064

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

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

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

    
1071
Data type: `Boolean`
1072

    
1073
Enable ctdb-driven clustered Samba setups.
1074

    
1075
Default value: ``false``
1076

    
1077
### <a name="nftablesrulessmtp"></a>`nftables::rules::smtp`
1078

    
1079
manage in smtp
1080

    
1081
### <a name="nftablesrulessmtp_submission"></a>`nftables::rules::smtp_submission`
1082

    
1083
manage in smtp submission
1084

    
1085
### <a name="nftablesrulessmtps"></a>`nftables::rules::smtps`
1086

    
1087
manage in smtps
1088

    
1089
### <a name="nftablesrulesssh"></a>`nftables::rules::ssh`
1090

    
1091
manage in ssh
1092

    
1093
#### Parameters
1094

    
1095
The following parameters are available in the `nftables::rules::ssh` class:
1096

    
1097
* [`ports`](#ports)
1098

    
1099
##### <a name="ports"></a>`ports`
1100

    
1101
Data type: `Array[Stdlib::Port,1]`
1102

    
1103
ssh ports
1104

    
1105
Default value: `[22]`
1106

    
1107
### <a name="nftablesrulestor"></a>`nftables::rules::tor`
1108

    
1109
manage in tor
1110

    
1111
#### Parameters
1112

    
1113
The following parameters are available in the `nftables::rules::tor` class:
1114

    
1115
* [`ports`](#ports)
1116

    
1117
##### <a name="ports"></a>`ports`
1118

    
1119
Data type: `Array[Stdlib::Port,1]`
1120

    
1121
ports for tor
1122

    
1123
Default value: `[9001]`
1124

    
1125
### <a name="nftablesruleswireguard"></a>`nftables::rules::wireguard`
1126

    
1127
manage in wireguard
1128

    
1129
#### Parameters
1130

    
1131
The following parameters are available in the `nftables::rules::wireguard` class:
1132

    
1133
* [`ports`](#ports)
1134

    
1135
##### <a name="ports"></a>`ports`
1136

    
1137
Data type: `Array[Stdlib::Port,1]`
1138

    
1139
wiregueard port
1140

    
1141
Default value: `[51820]`
1142

    
1143
### <a name="nftablesservicesdhcpv6_client"></a>`nftables::services::dhcpv6_client`
1144

    
1145
Allow in and outbound traffic for DHCPv6 server
1146

    
1147
### <a name="nftablesservicesopenafs_client"></a>`nftables::services::openafs_client`
1148

    
1149
Open inbound and outbound ports for an AFS client
1150

    
1151
## Defined types
1152

    
1153
### <a name="nftableschain"></a>`nftables::chain`
1154

    
1155
manage a chain
1156

    
1157
#### Parameters
1158

    
1159
The following parameters are available in the `nftables::chain` defined type:
1160

    
1161
* [`table`](#table)
1162
* [`chain`](#chain)
1163
* [`inject`](#inject)
1164
* [`inject_iif`](#inject_iif)
1165
* [`inject_oif`](#inject_oif)
1166

    
1167
##### <a name="table"></a>`table`
1168

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

    
1171

    
1172

    
1173
Default value: `'inet-filter'`
1174

    
1175
##### <a name="chain"></a>`chain`
1176

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

    
1179

    
1180

    
1181
Default value: `$title`
1182

    
1183
##### <a name="inject"></a>`inject`
1184

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

    
1187

    
1188

    
1189
Default value: ``undef``
1190

    
1191
##### <a name="inject_iif"></a>`inject_iif`
1192

    
1193
Data type: `Optional[String]`
1194

    
1195

    
1196

    
1197
Default value: ``undef``
1198

    
1199
##### <a name="inject_oif"></a>`inject_oif`
1200

    
1201
Data type: `Optional[String]`
1202

    
1203

    
1204

    
1205
Default value: ``undef``
1206

    
1207
### <a name="nftablesconfig"></a>`nftables::config`
1208

    
1209
manage a config snippet
1210

    
1211
#### Parameters
1212

    
1213
The following parameters are available in the `nftables::config` defined type:
1214

    
1215
* [`tablespec`](#tablespec)
1216
* [`content`](#content)
1217
* [`source`](#source)
1218
* [`prefix`](#prefix)
1219

    
1220
##### <a name="tablespec"></a>`tablespec`
1221

    
1222
Data type: `Pattern[/^\w+-\w+$/]`
1223

    
1224

    
1225

    
1226
Default value: `$title`
1227

    
1228
##### <a name="content"></a>`content`
1229

    
1230
Data type: `Optional[String]`
1231

    
1232

    
1233

    
1234
Default value: ``undef``
1235

    
1236
##### <a name="source"></a>`source`
1237

    
1238
Data type: `Optional[Variant[String,Array[String,1]]]`
1239

    
1240

    
1241

    
1242
Default value: ``undef``
1243

    
1244
##### <a name="prefix"></a>`prefix`
1245

    
1246
Data type: `String`
1247

    
1248

    
1249

    
1250
Default value: `'custom-'`
1251

    
1252
### <a name="nftablesfile"></a>`nftables::file`
1253

    
1254
Insert a file into the nftables configuration
1255

    
1256
#### Examples
1257

    
1258
##### Include a file that includes other files
1259

    
1260
```puppet
1261
nftables::file{'geoip':
1262
  content => @(EOT)
1263
    include "/var/local/geoipsets/dbip/nftset/ipv4/*.ipv4"
1264
    include "/var/local/geoipsets/dbip/nftset/ipv6/*.ipv6"
1265
    |EOT,
1266
}
1267
```
1268

    
1269
#### Parameters
1270

    
1271
The following parameters are available in the `nftables::file` defined type:
1272

    
1273
* [`label`](#label)
1274
* [`content`](#content)
1275
* [`source`](#source)
1276
* [`prefix`](#prefix)
1277

    
1278
##### <a name="label"></a>`label`
1279

    
1280
Data type: `String[1]`
1281

    
1282
Unique name to include in filename.
1283

    
1284
Default value: `$title`
1285

    
1286
##### <a name="content"></a>`content`
1287

    
1288
Data type: `Optional[String]`
1289

    
1290
The content to place in the file.
1291

    
1292
Default value: ``undef``
1293

    
1294
##### <a name="source"></a>`source`
1295

    
1296
Data type: `Optional[Variant[String,Array[String,1]]]`
1297

    
1298
A source to obtain the file content from.
1299

    
1300
Default value: ``undef``
1301

    
1302
##### <a name="prefix"></a>`prefix`
1303

    
1304
Data type: `String`
1305

    
1306
Prefix of file name to be created, if left as `file-` it will be
1307
auto included in the main nft configuration
1308

    
1309
Default value: `'file-'`
1310

    
1311
### <a name="nftablesrule"></a>`nftables::rule`
1312

    
1313
Provides an interface to create a firewall rule
1314

    
1315
#### Examples
1316

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

    
1319
```puppet
1320
nftables::rule {
1321
  'default_in-myhttp':
1322
    content => 'tcp dport 80 accept',
1323
}
1324
```
1325

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

    
1328
```puppet
1329
nftables::rule {
1330
  'PREROUTING6-count':
1331
    content => 'counter',
1332
    table   => 'ip6-nat'
1333
}
1334
```
1335

    
1336
#### Parameters
1337

    
1338
The following parameters are available in the `nftables::rule` defined type:
1339

    
1340
* [`ensure`](#ensure)
1341
* [`rulename`](#rulename)
1342
* [`order`](#order)
1343
* [`table`](#table)
1344
* [`content`](#content)
1345
* [`source`](#source)
1346

    
1347
##### <a name="ensure"></a>`ensure`
1348

    
1349
Data type: `Enum['present','absent']`
1350

    
1351
Should the rule be created.
1352

    
1353
Default value: `'present'`
1354

    
1355
##### <a name="rulename"></a>`rulename`
1356

    
1357
Data type: `Nftables::RuleName`
1358

    
1359
The symbolic name for the rule and to what chain to add it. The
1360
format is defined by the Nftables::RuleName type.
1361

    
1362
Default value: `$title`
1363

    
1364
##### <a name="order"></a>`order`
1365

    
1366
Data type: `Pattern[/^\d\d$/]`
1367

    
1368
A number representing the order of the rule.
1369

    
1370
Default value: `'50'`
1371

    
1372
##### <a name="table"></a>`table`
1373

    
1374
Data type: `String`
1375

    
1376
The name of the table to add this rule to.
1377

    
1378
Default value: `'inet-filter'`
1379

    
1380
##### <a name="content"></a>`content`
1381

    
1382
Data type: `Optional[String]`
1383

    
1384
The raw statements that compose the rule represented using the nftables
1385
language.
1386

    
1387
Default value: ``undef``
1388

    
1389
##### <a name="source"></a>`source`
1390

    
1391
Data type: `Optional[Variant[String,Array[String,1]]]`
1392

    
1393
Same goal as content but sourcing the value from a file.
1394

    
1395
Default value: ``undef``
1396

    
1397
### <a name="nftablesrulesdnat4"></a>`nftables::rules::dnat4`
1398

    
1399
manage a ipv4 dnat rule
1400

    
1401
#### Parameters
1402

    
1403
The following parameters are available in the `nftables::rules::dnat4` defined type:
1404

    
1405
* [`daddr`](#daddr)
1406
* [`port`](#port)
1407
* [`rulename`](#rulename)
1408
* [`order`](#order)
1409
* [`chain`](#chain)
1410
* [`iif`](#iif)
1411
* [`proto`](#proto)
1412
* [`dport`](#dport)
1413
* [`ensure`](#ensure)
1414

    
1415
##### <a name="daddr"></a>`daddr`
1416

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

    
1419

    
1420

    
1421
##### <a name="port"></a>`port`
1422

    
1423
Data type: `Variant[String,Stdlib::Port]`
1424

    
1425

    
1426

    
1427
##### <a name="rulename"></a>`rulename`
1428

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

    
1431

    
1432

    
1433
Default value: `$title`
1434

    
1435
##### <a name="order"></a>`order`
1436

    
1437
Data type: `Pattern[/^\d\d$/]`
1438

    
1439

    
1440

    
1441
Default value: `'50'`
1442

    
1443
##### <a name="chain"></a>`chain`
1444

    
1445
Data type: `String[1]`
1446

    
1447

    
1448

    
1449
Default value: `'default_fwd'`
1450

    
1451
##### <a name="iif"></a>`iif`
1452

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

    
1455

    
1456

    
1457
Default value: ``undef``
1458

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

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

    
1463

    
1464

    
1465
Default value: `'tcp'`
1466

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

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

    
1471

    
1472

    
1473
Default value: ``undef``
1474

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

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

    
1479

    
1480

    
1481
Default value: `'present'`
1482

    
1483
### <a name="nftablesrulesmasquerade"></a>`nftables::rules::masquerade`
1484

    
1485
masquerade all outgoing traffic
1486

    
1487
#### Parameters
1488

    
1489
The following parameters are available in the `nftables::rules::masquerade` defined type:
1490

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

    
1501
##### <a name="rulename"></a>`rulename`
1502

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

    
1505

    
1506

    
1507
Default value: `$title`
1508

    
1509
##### <a name="order"></a>`order`
1510

    
1511
Data type: `Pattern[/^\d\d$/]`
1512

    
1513

    
1514

    
1515
Default value: `'70'`
1516

    
1517
##### <a name="chain"></a>`chain`
1518

    
1519
Data type: `String[1]`
1520

    
1521

    
1522

    
1523
Default value: `'POSTROUTING'`
1524

    
1525
##### <a name="oif"></a>`oif`
1526

    
1527
Data type: `Optional[String[1]]`
1528

    
1529

    
1530

    
1531
Default value: ``undef``
1532

    
1533
##### <a name="saddr"></a>`saddr`
1534

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

    
1537

    
1538

    
1539
Default value: ``undef``
1540

    
1541
##### <a name="daddr"></a>`daddr`
1542

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

    
1545

    
1546

    
1547
Default value: ``undef``
1548

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

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

    
1553

    
1554

    
1555
Default value: ``undef``
1556

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

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

    
1561

    
1562

    
1563
Default value: ``undef``
1564

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

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

    
1569

    
1570

    
1571
Default value: `'present'`
1572

    
1573
### <a name="nftablesrulessnat4"></a>`nftables::rules::snat4`
1574

    
1575
manage a ipv4 snat rule
1576

    
1577
#### Parameters
1578

    
1579
The following parameters are available in the `nftables::rules::snat4` defined type:
1580

    
1581
* [`snat`](#snat)
1582
* [`rulename`](#rulename)
1583
* [`order`](#order)
1584
* [`chain`](#chain)
1585
* [`oif`](#oif)
1586
* [`saddr`](#saddr)
1587
* [`proto`](#proto)
1588
* [`dport`](#dport)
1589
* [`ensure`](#ensure)
1590

    
1591
##### <a name="snat"></a>`snat`
1592

    
1593
Data type: `String[1]`
1594

    
1595

    
1596

    
1597
##### <a name="rulename"></a>`rulename`
1598

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

    
1601

    
1602

    
1603
Default value: `$title`
1604

    
1605
##### <a name="order"></a>`order`
1606

    
1607
Data type: `Pattern[/^\d\d$/]`
1608

    
1609

    
1610

    
1611
Default value: `'70'`
1612

    
1613
##### <a name="chain"></a>`chain`
1614

    
1615
Data type: `String[1]`
1616

    
1617

    
1618

    
1619
Default value: `'POSTROUTING'`
1620

    
1621
##### <a name="oif"></a>`oif`
1622

    
1623
Data type: `Optional[String[1]]`
1624

    
1625

    
1626

    
1627
Default value: ``undef``
1628

    
1629
##### <a name="saddr"></a>`saddr`
1630

    
1631
Data type: `Optional[String[1]]`
1632

    
1633

    
1634

    
1635
Default value: ``undef``
1636

    
1637
##### <a name="proto"></a>`proto`
1638

    
1639
Data type: `Optional[Enum['tcp','udp']]`
1640

    
1641

    
1642

    
1643
Default value: ``undef``
1644

    
1645
##### <a name="dport"></a>`dport`
1646

    
1647
Data type: `Optional[Variant[String,Stdlib::Port]]`
1648

    
1649

    
1650

    
1651
Default value: ``undef``
1652

    
1653
##### <a name="ensure"></a>`ensure`
1654

    
1655
Data type: `Enum['present','absent']`
1656

    
1657

    
1658

    
1659
Default value: `'present'`
1660

    
1661
### <a name="nftablesset"></a>`nftables::set`
1662

    
1663
manage a named set
1664

    
1665
#### Examples
1666

    
1667
##### simple set
1668

    
1669
```puppet
1670
nftables::set{'my_set':
1671
  type       => 'ipv4_addr',
1672
  flags      => ['interval'],
1673
  elements   => ['192.168.0.1/24', '10.0.0.2'],
1674
  auto_merge => true,
1675
}
1676
```
1677

    
1678
#### Parameters
1679

    
1680
The following parameters are available in the `nftables::set` defined type:
1681

    
1682
* [`ensure`](#ensure)
1683
* [`setname`](#setname)
1684
* [`order`](#order)
1685
* [`type`](#type)
1686
* [`table`](#table)
1687
* [`flags`](#flags)
1688
* [`timeout`](#timeout)
1689
* [`gc_interval`](#gc_interval)
1690
* [`elements`](#elements)
1691
* [`size`](#size)
1692
* [`policy`](#policy)
1693
* [`auto_merge`](#auto_merge)
1694
* [`content`](#content)
1695
* [`source`](#source)
1696

    
1697
##### <a name="ensure"></a>`ensure`
1698

    
1699
Data type: `Enum['present','absent']`
1700

    
1701
should the set be created.
1702

    
1703
Default value: `'present'`
1704

    
1705
##### <a name="setname"></a>`setname`
1706

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

    
1709
name of set, equal to to title.
1710

    
1711
Default value: `$title`
1712

    
1713
##### <a name="order"></a>`order`
1714

    
1715
Data type: `Pattern[/^\d\d$/]`
1716

    
1717
concat ordering.
1718

    
1719
Default value: `'10'`
1720

    
1721
##### <a name="type"></a>`type`
1722

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

    
1725
type of set.
1726

    
1727
Default value: ``undef``
1728

    
1729
##### <a name="table"></a>`table`
1730

    
1731
Data type: `Variant[String, Array[String, 1]]`
1732

    
1733
table or array of tables to add the set to.
1734

    
1735
Default value: `'inet-filter'`
1736

    
1737
##### <a name="flags"></a>`flags`
1738

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

    
1741
specify flags for set
1742

    
1743
Default value: `[]`
1744

    
1745
##### <a name="timeout"></a>`timeout`
1746

    
1747
Data type: `Optional[Integer]`
1748

    
1749
timeout in seconds
1750

    
1751
Default value: ``undef``
1752

    
1753
##### <a name="gc_interval"></a>`gc_interval`
1754

    
1755
Data type: `Optional[Integer]`
1756

    
1757
garbage collection interval.
1758

    
1759
Default value: ``undef``
1760

    
1761
##### <a name="elements"></a>`elements`
1762

    
1763
Data type: `Optional[Array[String]]`
1764

    
1765
initialize the set with some elements in it.
1766

    
1767
Default value: ``undef``
1768

    
1769
##### <a name="size"></a>`size`
1770

    
1771
Data type: `Optional[Integer]`
1772

    
1773
limits the maximum number of elements of the set.
1774

    
1775
Default value: ``undef``
1776

    
1777
##### <a name="policy"></a>`policy`
1778

    
1779
Data type: `Optional[Enum['performance', 'memory']]`
1780

    
1781
determines set selection policy.
1782

    
1783
Default value: ``undef``
1784

    
1785
##### <a name="auto_merge"></a>`auto_merge`
1786

    
1787
Data type: `Boolean`
1788

    
1789
?
1790

    
1791
Default value: ``false``
1792

    
1793
##### <a name="content"></a>`content`
1794

    
1795
Data type: `Optional[String]`
1796

    
1797
specify content of set.
1798

    
1799
Default value: ``undef``
1800

    
1801
##### <a name="source"></a>`source`
1802

    
1803
Data type: `Optional[Variant[String,Array[String,1]]]`
1804

    
1805
specify source of set.
1806

    
1807
Default value: ``undef``
1808

    
1809
### <a name="nftablessimplerule"></a>`nftables::simplerule`
1810

    
1811
Provides a simplified interface to nftables::rule
1812

    
1813
#### Examples
1814

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

    
1817
```puppet
1818
nftables::simplerule{'my_service_in':
1819
  action  => 'accept',
1820
  comment => 'allow traffic to port 543',
1821
  counter => true,
1822
  proto   => 'tcp',
1823
  dport   => 543,
1824
  daddr   => '2001:1458::/32',
1825
  sport   => 541,
1826
}
1827
```
1828

    
1829
#### Parameters
1830

    
1831
The following parameters are available in the `nftables::simplerule` defined type:
1832

    
1833
* [`ensure`](#ensure)
1834
* [`rulename`](#rulename)
1835
* [`order`](#order)
1836
* [`chain`](#chain)
1837
* [`table`](#table)
1838
* [`action`](#action)
1839
* [`comment`](#comment)
1840
* [`dport`](#dport)
1841
* [`proto`](#proto)
1842
* [`daddr`](#daddr)
1843
* [`set_type`](#set_type)
1844
* [`sport`](#sport)
1845
* [`saddr`](#saddr)
1846
* [`counter`](#counter)
1847

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

    
1850
Data type: `Enum['present','absent']`
1851

    
1852
Should the rule be created.
1853

    
1854
Default value: `'present'`
1855

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

    
1858
Data type: `Nftables::SimpleRuleName`
1859

    
1860
The symbolic name for the rule to add. Defaults to the resource's title.
1861

    
1862
Default value: `$title`
1863

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

    
1866
Data type: `Pattern[/^\d\d$/]`
1867

    
1868
A number representing the order of the rule.
1869

    
1870
Default value: `'50'`
1871

    
1872
##### <a name="chain"></a>`chain`
1873

    
1874
Data type: `String`
1875

    
1876
The name of the chain to add this rule to.
1877

    
1878
Default value: `'default_in'`
1879

    
1880
##### <a name="table"></a>`table`
1881

    
1882
Data type: `String`
1883

    
1884
The name of the table to add this rule to.
1885

    
1886
Default value: `'inet-filter'`
1887

    
1888
##### <a name="action"></a>`action`
1889

    
1890
Data type: `Enum['accept', 'continue', 'drop', 'queue', 'return']`
1891

    
1892
The verdict for the matched traffic.
1893

    
1894
Default value: `'accept'`
1895

    
1896
##### <a name="comment"></a>`comment`
1897

    
1898
Data type: `Optional[String]`
1899

    
1900
A typically human-readable comment for the rule.
1901

    
1902
Default value: ``undef``
1903

    
1904
##### <a name="dport"></a>`dport`
1905

    
1906
Data type: `Optional[Nftables::Port]`
1907

    
1908
The destination port, ports or port range.
1909

    
1910
Default value: ``undef``
1911

    
1912
##### <a name="proto"></a>`proto`
1913

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

    
1916
The transport-layer protocol to match.
1917

    
1918
Default value: ``undef``
1919

    
1920
##### <a name="daddr"></a>`daddr`
1921

    
1922
Data type: `Optional[Nftables::Addr]`
1923

    
1924
The destination address, CIDR or set to match.
1925

    
1926
Default value: ``undef``
1927

    
1928
##### <a name="set_type"></a>`set_type`
1929

    
1930
Data type: `Enum['ip', 'ip6']`
1931

    
1932
When using sets as saddr or daddr, the type of the set.
1933
Use `ip` for sets of type `ipv4_addr`.
1934

    
1935
Default value: `'ip6'`
1936

    
1937
##### <a name="sport"></a>`sport`
1938

    
1939
Data type: `Optional[Nftables::Port]`
1940

    
1941
The source port, ports or port range.
1942

    
1943
Default value: ``undef``
1944

    
1945
##### <a name="saddr"></a>`saddr`
1946

    
1947
Data type: `Optional[Nftables::Addr]`
1948

    
1949
The source address, CIDR or set to match.
1950

    
1951
Default value: ``undef``
1952

    
1953
##### <a name="counter"></a>`counter`
1954

    
1955
Data type: `Boolean`
1956

    
1957
Enable traffic counters for the matched traffic.
1958

    
1959
Default value: ``false``
1960

    
1961
## Data types
1962

    
1963
### <a name="nftablesaddr"></a>`Nftables::Addr`
1964

    
1965
Represents an address expression to be used within a rule.
1966

    
1967
Alias of
1968

    
1969
```puppet
1970
Variant[Stdlib::IP::Address::V6, Stdlib::IP::Address::V4, Nftables::Addr::Set]
1971
```
1972

    
1973
### <a name="nftablesaddrset"></a>`Nftables::Addr::Set`
1974

    
1975
Represents a set expression to be used within a rule.
1976

    
1977
Alias of
1978

    
1979
```puppet
1980
Pattern[/^@[-a-zA-Z0-9_]+$/]
1981
```
1982

    
1983
### <a name="nftablesport"></a>`Nftables::Port`
1984

    
1985
Represents a port expression to be used within a rule.
1986

    
1987
Alias of
1988

    
1989
```puppet
1990
Variant[Array[Stdlib::Port, 1], Stdlib::Port, Nftables::Port::Range]
1991
```
1992

    
1993
### <a name="nftablesportrange"></a>`Nftables::Port::Range`
1994

    
1995
Represents a port range expression to be used within a rule.
1996

    
1997
Alias of
1998

    
1999
```puppet
2000
Pattern[/^\d+-\d+$/]
2001
```
2002

    
2003
### <a name="nftablesrulename"></a>`Nftables::RuleName`
2004

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

    
2010
Alias of
2011

    
2012
```puppet
2013
Pattern[/^[a-zA-Z0-9_]+-[a-zA-Z0-9_]+(-\d+)?$/]
2014
```
2015

    
2016
### <a name="nftablessimplerulename"></a>`Nftables::SimpleRuleName`
2017

    
2018
Represents a simple rule name to be used in a rule created via nftables::simplerule
2019

    
2020
Alias of
2021

    
2022
```puppet
2023
Pattern[/^[a-zA-Z0-9_]+(-\d+)?$/]
2024
```
2025