Skip to content
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

Firewall 7.0.0 doesnt handle integer port numbers. #1158

Closed
robertc99 opened this issue Sep 14, 2023 · 5 comments
Closed

Firewall 7.0.0 doesnt handle integer port numbers. #1158

robertc99 opened this issue Sep 14, 2023 · 5 comments

Comments

@robertc99
Copy link
Contributor

I get the following error out of firewall 7.0.0

Error: undefined method start_with?' for 22:Integer Error: /Stage[network]/Nci::Firewall::Ruleset::Ssh::Staged/Nci::Firewall::Ruleset[ssh]/Firewall[100 allow ssh]/dport: change from '22' to 22 failed: undefined method start_with?' for 22:Integer

I doesnt happen if you delete the iptables rule and rerun, it will create the firewall rule successfully.
But on a rerun of puppet when the rule exists, I get the error.

Its happy if I specify

dport => "22"

but not with

dport => 22

@david22swan
Copy link
Member

Have found the source of the issue, the dport and sport sections on the insync? function need to be converted to a string for the comparison.

@david22swan
Copy link
Member

Will have a fix up soon

david22swan added a commit to david22swan/puppetlabs-firewall that referenced this issue Sep 14, 2023
Values where being compared incorrectly when passed as integers or with multiple negated array values.
david22swan added a commit to david22swan/puppetlabs-firewall that referenced this issue Sep 14, 2023
Values are being compared incorrectly when multiple negated values are passed.
Simplest fix is to fold code into `dport/sport` comparison.
@david22swan
Copy link
Member

david22swan commented Sep 14, 2023

Fix up: #1160

Have rewritten the comparions for dport/sport/state/ctstate/ctstatus.

Ramesh7 added a commit that referenced this issue Sep 14, 2023
(GH-1158) Fix for `dport/sport/state/ctstate/ctstatus` comparisons
@david22swan
Copy link
Member

That's 7.0.2 released with the fix.

@robertc99
Copy link
Contributor Author

that was quick. Thanks, seems to work fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants