Projet

Général

Profil

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

root / REFERENCE.md @ b46c9ce9

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