Skip to content

(MODULE-11463): Fix rule parsing when iptables chains with '-A' in the name #1248

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

Closed

Conversation

span786
Copy link
Contributor

@span786 span786 commented Nov 21, 2024

Summary

Commits cherry-picked from #1210

This PR fixes a couple of issues, related to iptables-save output parsing:

  1. Double quotes in the comment breaks rule parsing (part after the first " will be ignored)
  2. Rule parser thinks that custom chains with -A in the name (NOMAD-ADMIN, for example) is a start of the rule
  3. Single quotes in the comments generates invalid iptables-save output that will then be processed by the rule parser.
  4. For some parameters iptables-save return multiple spaces between flag and actual value (--nflog--prefix)

Additional Context

I've added additional spec test that will be helpful with iptables-save output parsing in the future.

Related Issues (if any)

#1182
#1170

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified. (For example puppet apply)

@span786 span786 requested a review from a team as a code owner November 21, 2024 11:25
@span786
Copy link
Contributor Author

span786 commented Nov 21, 2024

This will be merged as a part of #1210

@span786 span786 closed this Nov 21, 2024
@span786 span786 added bugfix and removed bugfix labels Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant