]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commit
(SEC-944) Identify duplicate system rules
authorCraig Gumbley <craiggumbley@gmail.com>
Tue, 22 Feb 2022 12:33:01 +0000 (12:33 +0000)
committerCraig Gumbley <craiggumbley@gmail.com>
Tue, 22 Feb 2022 14:22:41 +0000 (14:22 +0000)
commit2c0047e09be82dd9e1aa4d93c0cb103f83d2a01e
tree99546dbe4822f343e1296073fe5094b5903d1c1b
parentdc4d38c6431f4bad6330a1d9583f32d55c8224bb
(SEC-944) Identify duplicate system rules

In certain situations it is possible for an unmanaged rule to exist on
the target system that has the same comment as the rule specified in
the manifest.

When this condition is true puppet will ignore the the unmanaged rule
and continue to apply the rule in the manifest. This is because the
firewall module uses the comment field in IPT as it's namevar and
therefore expects it to be a unique identifier. In the case of IPT this
is not true given that you can have multiple rules with the same
comment.

This commit adds a check that will identify system rules that have their
comment field set to the same value as a rule in the manifest. If we
enter a situation where any of the duplicate counts are greater than 1
then we will respond with a configurable action. The behaviour of this
can be configured via the onduplicaterulebehaviour parameter.
lib/puppet/provider/firewall/iptables.rb