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