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