Skip to content

Commit 5d94d77

Browse files
committed
(CAT-1260) Addition of tests for firewall provider private set methods
- Further clarification of validation errors - Type doc clarification clarification - REFERENCE.md update to match current types README.md corrections made
1 parent 1305aaf commit 5d94d77

File tree

8 files changed

+1490
-728
lines changed

8 files changed

+1490
-728
lines changed

README.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,7 @@ resources { 'firewallchain':
170170
Internal chains can not be deleted. In order to avoid all the confusing
171171
Warning/Notice messages when using `purge => true`, like these ones:
172172

173-
Notice: Compiled catalog for blonde-height.delivery.puppetlabs.net in environment production in 0.05 seconds
174-
Warning: Firewallchain[INPUT:mangle:IPv4](provider=iptables_chain): Attempting to destroy internal chain INPUT:mangle:IPv4
175-
Notice: /Stage[main]/Main/Firewallchain[INPUT:mangle:IPv4]/ensure: removed
176-
Warning: Firewallchain[FORWARD:mangle:IPv4](provider=iptables_chain): Attempting to destroy internal chain FORWARD:mangle:IPv4
177-
Notice: /Stage[main]/Main/Firewallchain[FORWARD:mangle:IPv4]/ensure: removed
178-
Warning: Firewallchain[OUTPUT:mangle:IPv4](provider=iptables_chain): Attempting to destroy internal chain OUTPUT:mangle:IPv4
179-
Notice: /Stage[main]/Main/Firewallchain[OUTPUT:mangle:IPv4]/ensure: removed
180-
Warning: Firewallchain[POSTROUTING:mangle:IPv4](provider=iptables_chain): Attempting to destroy internal chain POSTROUTING:mangle:IPv4
181-
Notice: /Stage[main]/Main/Firewallchain[POSTROUTING:mangle:IPv4]/ensure: removed
173+
Warning: Inbuilt Chains may not be deleted. Chain `POSTROUTING:mangle:IPv6` will be flushed and have it's policy reverted to default.
182174

183175
Please create firewallchains for every internal chain. Here is an example:
184176

@@ -248,7 +240,7 @@ firewall { '006 Allow inbound SSH (v6)':
248240
dport => 22,
249241
proto => 'tcp',
250242
action => 'accept',
251-
provider => 'ip6tables',
243+
protocol => 'ip6tables',
252244
}
253245
```
254246

@@ -280,7 +272,7 @@ class profile::apache {
280272

281273
### Rule inversion
282274

283-
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.
275+
Firewall rules may be inverted by prefixing the value of a parameter by "! ". If the value is an array, then the first value of the array must be prefixed in order to invert them all.
284276

285277
Parameters that understand inversion are: connmark, ctstate, destination, dport, dst\_range, dst\_type, iniface, outiface, port, proto, source, sport, src\_range and src\_type.
286278

@@ -297,12 +289,23 @@ firewall { '002 drop NEW external website packets with FIN/RST/ACK set and SYN u
297289
state => 'NEW',
298290
action => 'drop',
299291
proto => 'tcp',
300-
sport => ['! http', '! 443'],
292+
sport => ['! http', '443'],
301293
source => '! 10.0.0.0/8',
302294
tcp_flags => '! FIN,SYN,RST,ACK SYN',
303295
}
304296
```
305297

298+
There are exceptions to this however, with attributes such as src\_type, dst\_type and ipset allowing the user to negate any passed values seperately.
299+
300+
Examples:
301+
302+
```puppet
303+
firewall { '001 allow local disallow anycast':
304+
action => 'accept',
305+
src_type => ['LOCAL', '! ANYCAST'],
306+
}
307+
```
308+
306309
### Additional uses for the firewall module
307310

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

0 commit comments

Comments
 (0)