Projet

Général

Profil

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

root / REFERENCE.md @ c94658e1

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

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