Skip to content

Commit 35d2e40

Browse files
committed
Merge pull request #534 from puppetlabs/1.6.x
1.6.0 back to master
2 parents dbcfba0 + 2fd4e70 commit 35d2e40

File tree

3 files changed

+82
-53
lines changed

3 files changed

+82
-53
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
##2015-05-19 - Supported Release 1.6.0
2+
###Summary
3+
4+
This release includes support for TEE, MSS, the time ipt module, Debian 8 support, and a number of test fixes and other improvements.
5+
6+
####Features
7+
- Add TEE support
8+
- Add MSS support (including clamp-mss-to-pmtu support)
9+
- Add support for the time ipt module (-m time)
10+
- Add support for Debian 8
11+
- Add support for ICMPv6 types 'neighbour-{solicitation,advertisement}'
12+
- Add support for ICMPv6 type 'too-big'
13+
- Add support for new 'match_mark' property
14+
- Added 'ipv4' and 'ipv6' options to 'proto' property
15+
16+
####Bugfixes
17+
- Fix for Systemd-based OSes where systemd needs restarted before being able to pick up new services (MODULES-1984)
18+
- Arch Linux package management fix
19+
120
##2015-03-31 - Supported Release 1.5.0
221
###Summary
322

README.markdown

Lines changed: 61 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Therefore, the run order is:
7070
The rules in the `pre` and `post` classes are fairly general. These two classes ensure that you retain connectivity and that you drop unmatched packets appropriately. The rules you define in your manifests are likely specific to the applications you run.
7171

7272
1.) Add the `pre` class to my_fw/manifests/pre.pp. Your pre.pp file should contain any default rules to be applied first. The rules in this class should be added in the order you want them to run.2.
73-
```puppet
73+
~~~puppet
7474
class my_fw::pre {
7575
Firewall {
7676
require => undef,
@@ -98,30 +98,31 @@ The rules in the `pre` and `post` classes are fairly general. These two classes
9898
action => 'accept',
9999
}
100100
}
101-
```
101+
~~~
102102

103103
The rules in `pre` should allow basic networking (such as ICMP and TCP) and ensure that existing connections are not closed.
104104

105105
2.) Add the `post` class to my_fw/manifests/post.pp and include any default rules to be applied last.
106-
```puppet
106+
107+
~~~puppet
107108
class my_fw::post {
108109
firewall { '999 drop all':
109110
proto => 'all',
110111
action => 'drop',
111112
before => undef,
112113
}
113114
}
114-
```
115+
~~~
115116

116117
Alternatively, the [firewallchain](#type-firewallchain) type can be used to set the default policy:
117118

118-
```puppet
119+
~~~puppet
119120
firewallchain { 'INPUT:filter:IPv4':
120121
ensure => present,
121122
policy => drop,
122123
before => undef,
123124
}
124-
```
125+
~~~
125126

126127
####Create Firewall Rules
127128

@@ -132,41 +133,43 @@ Rules are persisted automatically between reboots, although there are known issu
132133
1.) In site.pp or another top-scope file, add the following code to set up a metatype to purge unmanaged firewall resources. This will clear any existing rules and make sure that only rules defined in Puppet exist on the machine.
133134

134135
**Note** - This only purges IPv4 rules.
135-
```puppet
136+
137+
~~~puppet
136138
resources { 'firewall':
137139
purge => true
138140
}
139-
```
141+
~~~
140142

141143
To purge unmanaged firewall chains, also add:
142144

143-
```puppet
145+
~~~puppet
144146
resources { 'firewallchain':
145147
purge => true
146148
}
147-
```
148-
**Note** - If there are unmanaged rules in unmanaged chains it will take two Puppet runs before the firewall chain is purged. This is different than the `purge` parameter available in `firewallchain`.
149+
~~~
150+
151+
**Note** - If there are unmanaged rules in unmanaged chains, it will take two Puppet runs before the firewall chain is purged. This is different than the `purge` parameter available in `firewallchain`.
149152

150153
2.) Use the following code to set up the default parameters for all of the firewall rules you will establish later. These defaults will ensure that the `pre` and `post` classes are run in the correct order to avoid locking you out of your box during the first Puppet run.
151154

152-
```puppet
155+
~~~puppet
153156
Firewall {
154157
before => Class['my_fw::post'],
155158
require => Class['my_fw::pre'],
156159
}
157-
```
160+
~~~
158161

159162
3.) Then, declare the `my_fw::pre` and `my_fw::post` classes to satisfy dependencies. You can declare these classes using an External Node Classifier or the following code:
160163

161-
```puppet
164+
~~~puppet
162165
class { ['my_fw::pre', 'my_fw::post']: }
163-
```
166+
~~~
164167

165168
4.) Include the `firewall` class to ensure the correct packages are installed.
166169

167-
```puppet
170+
~~~puppet
168171
class { 'firewall': }
169-
```
172+
~~~
170173

171174
###Upgrading
172175

@@ -194,32 +197,33 @@ In iptables, the title of the rule is stored using the comment feature of the un
194197

195198
Basic accept ICMP request example:
196199

197-
```puppet
200+
~~~puppet
198201
firewall { "000 accept all icmp requests":
199202
proto => "icmp",
200203
action => "accept",
201204
}
202-
```
205+
~~~
206+
203207
Drop all:
204208

205-
```puppet
209+
~~~puppet
206210
firewall { "999 drop all other requests":
207211
action => "drop",
208212
}
209-
```
213+
~~~
210214

211215
#### Example of an IPv6 rule
212216

213217
IPv6 rules can be specified using the _ip6tables_ provider:
214218

215-
```puppet
219+
~~~puppet
216220
firewall { "006 Allow inbound SSH (v6)":
217221
port => 22,
218222
proto => tcp,
219223
action => accept,
220224
provider => 'ip6tables',
221225
}
222-
```
226+
~~~
223227

224228
###Application-Specific Rules
225229

@@ -232,7 +236,7 @@ remain close to the services managed by the profile.
232236

233237
This is an example of firewall rules in a profile:
234238

235-
```puppet
239+
~~~puppet
236240
class profile::apache {
237241
include apache
238242
apache::vhost { 'mysite': ensure => present }
@@ -243,7 +247,7 @@ class profile::apache {
243247
action => accept,
244248
}
245249
}
246-
```
250+
~~~
247251

248252
###Rule inversion
249253
Firewall rules may be inverted by prefixing the value of a parameter by "! ". If the value is an array, then every item in the array must be prefixed as iptables does not understand inverting a single value.
@@ -252,7 +256,7 @@ Parameters that understand inversion are: connmark, ctstate, destination, dport,
252256

253257
Examples:
254258

255-
```puppet
259+
~~~puppet
256260
firewall { '001 disallow esp protocol':
257261
action => 'accept',
258262
proto => '! esp',
@@ -266,22 +270,23 @@ firewall { '002 drop NEW external website packets with FIN/RST/ACK set and SYN u
266270
source => '! 10.0.0.0/8',
267271
tcp_flags => '! FIN,SYN,RST,ACK SYN',
268272
}
269-
```
273+
~~~
270274

271275
###Additional Uses for the Firewall Module
272276

273277
You can apply firewall rules to specific nodes. Usually, you will want to put the firewall rule in another class and apply that class to a node. Apply a rule to a node as follows:
274278

275-
```puppet
279+
~~~puppet
276280
node 'some.node.com' {
277281
firewall { '111 open port 111':
278282
dport => 111
279283
}
280284
}
281-
```
285+
~~~
282286

283287
You can also do more complex things with the `firewall` resource. This example sets up static NAT for the source network 10.1.2.0/24:
284-
```puppet
288+
289+
~~~puppet
285290
firewall { '100 snat for network foo2':
286291
chain => 'POSTROUTING',
287292
jump => 'MASQUERADE',
@@ -290,12 +295,12 @@ firewall { '100 snat for network foo2':
290295
source => '10.1.2.0/24',
291296
table => 'nat',
292297
}
293-
```
298+
~~~
294299

295300

296301
You can also change the TCP MSS value for VPN client traffic:
297302

298-
```puppet
303+
~~~puppet
299304
firewall { '110 TCPMSS for VPN clients':
300305
chain => 'FORWARD',
301306
table => 'mangle',
@@ -306,22 +311,22 @@ firewall { '110 TCPMSS for VPN clients':
306311
set_mss => '1360',
307312
jump => 'TCPMSS',
308313
}
309-
```
314+
~~~
310315

311316
The following will mirror all traffic sent to the server to a secondary host on the LAN with the TEE target:
312317

313-
```puppet
318+
~~~puppet
314319
firewall { '503 Mirror traffic to IDS':
315320
proto => all,
316321
jump => 'TEE',
317322
gateway => '10.0.0.2',
318323
chain => 'PREROUTING',
319324
table => 'mangle',
320325
}
321-
```
326+
~~~
322327

323328
The following example creates a new chain and forwards any port 5000 access to it.
324-
```puppet
329+
~~~puppet
325330
firewall { '100 forward to MY_CHAIN':
326331
chain => 'INPUT',
327332
jump => 'MY_CHAIN',
@@ -336,7 +341,7 @@ firewall { '100 my rule':
336341
proto => 'tcp',
337342
dport => 5000,
338343
}
339-
```
344+
~~~
340345

341346
###Additional Information
342347

@@ -487,9 +492,9 @@ If Puppet is managing the iptables or iptables-persistent packages, and the prov
487492

488493
* `chain`: Name of the chain to use. You can provide a user-based chain or use one of the following built-in chains:'INPUT','FORWARD','OUTPUT','PREROUTING', or 'POSTROUTING'. The default value is 'INPUT'. Values must match '/^[a-zA-Z0-9\-_]+$/'. Requires the `iptables` feature.
489494

490-
* `checksum_fill`: When using a `jump` value of 'CHECKSUM' this boolean will make sure that a checksum is calculated and filled in a packet that lacks a checksum. Valid values are true or false. Requires the `iptables` feature.
495+
* `checksum_fill`: When using a `jump` value of 'CHECKSUM', this boolean makes sure that a checksum is calculated and filled in a packet that lacks a checksum. Valid values are 'true' or 'false'. Requires the `iptables` feature.
491496

492-
* `clamp_mss_to_pmtu`: Enables PMTU Clamping support when using a jump target of 'TCPMSS'. Valid values are true or false.
497+
* `clamp_mss_to_pmtu`: Enables PMTU Clamping support when using a jump target of 'TCPMSS'. Valid values are 'true' or 'false'.
493498

494499
* `connlimit_above`: Connection limiting value for matched connections above n. Values must match '/^\d+$/'. Requires the `connection_limiting` feature.
495500

@@ -575,22 +580,22 @@ If Puppet is managing the iptables or iptables-persistent packages, and the prov
575580

576581
* `mask`: Sets the mask to use when `recent` is enabled. Requires the `mask` feature.
577582

578-
* `month_days`: Only match on the given days of the month. Possible values are '1' to '31'. Note that specifying 31 will of course not match on months which do not have a 31st day; the same goes for 28- or 29-day February.
583+
* `month_days`: Only match on the given days of the month. Possible values are '1' to '31'. Note that specifying '31' will not match on months that do not have a 31st day; the same goes for 28- or 29-day February.
579584

580-
* `match_mark`: Match the Netfilter mark value associated with the packet. Accepts either of mark/mask or mark. These will be converted to hex if they are not already. Requires the `mark` feature.
585+
* `match_mark`: Match the Netfilter mark value associated with the packet. Accepts either of mark/mask or mark. These will be converted to hex if they are not already. Requires the `mark` feature.
581586

582587
* `mss`: Sets a given TCP MSS value or range to match.
583588

584589
* `name`: The canonical name of the rule. This name is also used for ordering, so make sure you prefix the rule with a number. For example:
585590

586-
```puppet
591+
~~~puppet
587592
firewall { '000 this runs first':
588593
# this rule will run first
589594
}
590595
firewall { '999 this runs last':
591596
# this rule will run last
592597
}
593-
```
598+
~~~
594599

595600
Depending on the provider, the name of the rule can be stored using the comment feature of the underlying firewall subsystem. Values must match '/^\d+[[:alpha:][:digit:][:punct:][:space:]]+$/'.
596601

@@ -632,7 +637,7 @@ firewall { '999 this runs last':
632637

633638
* `recent`: Enable the recent module. Valid values are: 'set', 'update', 'rcheck', or 'remove'. For example:
634639

635-
```puppet
640+
~~~puppet
636641
# If anyone's appeared on the 'badguy' blacklist within
637642
# the last 60 seconds, drop their traffic, and update the timestamp.
638643
firewall { '100 Drop badguy traffic':
@@ -654,7 +659,7 @@ firewall { '101 blacklist strange traffic':
654659
action => 'DROP',
655660
chain => 'FORWARD',
656661
}
657-
```
662+
~~~
658663

659664
Requires the `recent_limiting` feature.
660665

@@ -716,7 +721,7 @@ firewall { '101 blacklist strange traffic':
716721

717722
Note that you specify flags in the order that iptables `--list` rules would list them to avoid having Puppet think you changed the flags. For example, 'FIN,SYN,RST,ACK SYN' matches packets with the SYN bit set and the ACK, RST and FIN bits cleared. Such packets are used to request TCP connection initiation. Requires the `tcp_flags` feature.
718723

719-
* `time_contiguous`: When time_stop is smaller than time_start value, match this as a single time period instead distinct intervals.
724+
* `time_contiguous`: When the `time_stop` value is smaller than the `time_start` value, match this as a single time period instead of distinct intervals.
720725

721726
* `time_start`: Start time for the rule to match. The possible time range is '00:00:00' to '23:59:59'. Leading zeroes are allowed (e.g. '06:03') and correctly interpreted as base-10.
722727

@@ -758,7 +763,7 @@ Currently this type supports only iptables, ip6tables, and ebtables on Linux. It
758763
* `ignore`: Regex to perform on firewall rules to exempt unmanaged rules from purging (when enabled). This is matched against the output of iptables-save. This can be a single regex or an array of them. To support flags, use the ruby inline flag mechanism: a regex such as '/foo/i' can be written as '(?i)foo' or '(?i:foo)'. Only when purge is 'true'.
759764

760765
Full example:
761-
```puppet
766+
~~~puppet
762767
firewallchain { 'INPUT:filter:IPv4':
763768
purge => true,
764769
ignore => [
@@ -768,7 +773,7 @@ firewallchain { 'INPUT:filter:IPv4':
768773
'--comment "[^"](?i:ignore)[^"]"',
769774
],
770775
}
771-
```
776+
~~~
772777

773778
* `name`: Specify the canonical name of the chain. For iptables the format must be {chain}:{table}:{protocol}.
774779

@@ -791,11 +796,11 @@ firewallchain { 'INPUT:filter:IPv4':
791796

792797
**Note** This `purge` is purging unmanaged rules in a firewall chain, not unmanaged firewall chains. To purge unmanaged firewall chains, use the following instead.
793798

794-
```puppet
799+
~~~puppet
795800
resources { 'firewallchain':
796801
purge => true
797802
}
798-
```
803+
~~~
799804

800805
###Fact: ip6tables_version
801806

@@ -824,9 +829,14 @@ when the "Unbreakable" kernel is used. These may function correctly when using
824829
the stock RedHat kernel instead. Declaring either of these parameters on an
825830
unsupported system will result in iptable rules failing to apply.
826831

832+
### Debian 8 Support
833+
834+
As Puppet Enterprise itself does not yet support Debian 8, use of this module with Puppet Enterprise under a Debian 8
835+
system should be regarded as experimental.
836+
827837
###Other
828838

829-
Bugs can be reported using JIRA issues
839+
Bugs can be reported in JIRA:
830840

831841
<http://tickets.puppetlabs.com>
832842

metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "puppetlabs-firewall",
3-
"version": "1.5.0",
3+
"version": "1.6.0",
44
"author": "Puppet Labs",
55
"summary": "Manages Firewalls such as iptables",
66
"license": "Apache-2.0",
@@ -80,6 +80,6 @@
8080
}
8181
],
8282
"dependencies": [
83-
83+
8484
]
8585
}

0 commit comments

Comments
 (0)