Skip to content

Commit fad716d

Browse files
committed
Allow multiple matches to specified per rule
1 parent 7851cef commit fad716d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This file is used to list changes made in each version of the iptables cookbook.
88
- Remove legacy code
99
- Refactor chain and rule resources
1010
- Complex logic moved to helper libraries
11+
- Allow multiple matches per rule
1112
- Refactor service resource
1213
- Add the full set of service actions
1314
- Create a default configuration to ensure starting on Redhat platform families

resources/rule.rb

+4-3
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,11 @@
4747
description: 'The name of the Chain to put this rule on'
4848

4949
property :protocol, [Symbol, String, Integer],
50-
description: 'The protocol of the rule or of the packet to check. The specified protocol can be one of :tcp, :udp, :icmp, or :all, or it can be a numeric value, representing one of these protocols or a different one. A protocol name from /etc/protocols is also allowed. A "!" argument before the protocol inverts the test. The number zero is equivalent to all. Protocol all will match with all protocols and is taken as default when this option is omitted. '
50+
description: 'The protocol of the rule or of the packet to check. The specified protocol can be one of :tcp, :udp, :icmp, or :all, or it can be a numeric value, representing one of these protocols or a different one. A protocol name from /etc/protocols is also allowed. A "!" argument before the protocol inverts the test. The number zero is equivalent to all. Protocol all will match with all protocols and is taken as default when this option is omitted.'
5151

52-
property :match, String,
53-
description: 'Extended packet matching module to use'
52+
property :match, [String, Array],
53+
description: 'Extended packet matching module to use',
54+
coerce: proc { |p| p.is_a?(Array) ? p.join(' -m ') : p }
5455

5556
property :source, String,
5657
description: "Source specification. Address can be either a network name, a hostname (please note that specifying any name to be resolved with a remote query such as DNS is a really bad idea), a network IP address (with /mask), or a plain IP address. The mask can be either a network mask or a plain number, specifying the number of 1's at the left side of the network mask. Thus, a mask of 24 is equivalent to 255.255.255.0. A \"!\" argument before the address specification inverts the sense of the address. The flag --src is an alias for this option. "

0 commit comments

Comments
 (0)