-
Notifications
You must be signed in to change notification settings - Fork 457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(SEC-944) Handle duplicate system rules #1030
Conversation
8acd01a
to
c05cdaa
Compare
c05cdaa
to
7f25c62
Compare
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.
7f25c62
to
91d4d48
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest adding a section to the README for duplicate rules/behavior.
Here we add a new parameter that determines how the puppet run will behave if a duplicate system rule is encountered. The default is to warn and continue.
91d4d48
to
1c9914f
Compare
This commit adds a new section to inform users about how the module will behave when it encounters duplicate rules. It also inclues a small bit of house keeping.
|
@michaeltlombardi README updated 👍 |
Co-authored-by: Michael T Lombardi (He/Him) <michael.lombardi@puppet.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving the documentation and code implementation, this still needs testing (unit and acceptance).
aff7a87
to
5487964
Compare
Prior to this commit there we no test cases to validate our changes to the module. This commit adds test cases for each of the configurations for onduplicaterulebehaviour.
5487964
to
30db99b
Compare
|
#1031 raised for unrelated failing tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Context
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.
What has changed?
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.