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

single quotes in rule comments produces errors #1215

Open
capull0 opened this issue Apr 24, 2024 · 4 comments
Open

single quotes in rule comments produces errors #1215

capull0 opened this issue Apr 24, 2024 · 4 comments

Comments

@capull0
Copy link

capull0 commented Apr 24, 2024

Describe the Bug

If you add a rule with single quotes in the comment or if you use
resources { 'firewall': purge => true, }
to get rid of unmanaged rules, but with single quotes you will get an error
Example:
Error: firewall[100 allow SSH gateway \'10.79.251.5/32\']: Deleting: Failed after 0.016324 seconds: Execution of 'iptables -t filter -D INPUT -s 10.79.251.5/32 -p tcp -m comment --comment "100 allow SSH gateway \'10.79.251.5/32\'" -j ACCEPT' returned 1: iptables: Bad rule (does a matching rule exist in that chain?). Error: /Stage[main]/Poma_profiles::Firewall/Firewall[100 allow SSH gateway \'10.79.251.5/32\']: Could not evaluate: Execution encountered an error

Expected Behavior

the firewall module should be able to handle single quotes

Steps to Reproduce

Steps to reproduce the behavior:

  1. create manually a rule with single quotes in the comment
  2. let the puppet module purge unmanaged rules
  3. get the error

Environment

  • Version: 8.0.1
  • Platform: don't know, Puppetmaster is running somewhere in Kubernetes, but a new version of Puppet :-)

Additional Context

I updated the module version from a very old version 3.3.0 to 8.0.1.
With 3.3.0 single quotes were no problem.
I removed all single quotes from our rules.
Right know i have to run a iptables -F with puppet exec once, to get rid of unwanted rules, else i would have duplicated rules, because purge => true will throw errors

@2fa
Copy link
Contributor

2fa commented Apr 24, 2024

It should be fixed in #1210

@capull0
Copy link
Author

capull0 commented Apr 24, 2024

thank you, for the quick answer.

@capull0 capull0 closed this as completed Apr 24, 2024
@2fa
Copy link
Contributor

2fa commented Apr 24, 2024

I'm not the author of the module, just a contributor, but thank you.

I recently too upgraded from 3.3.0 and found a lot of problems with the latest version. I recommend to downgrade to the latest 6.X for a time being @capull0

@capull0 capull0 reopened this Apr 24, 2024
@capull0
Copy link
Author

capull0 commented Apr 24, 2024

better to keep the issue open :)

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