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

firewalld_rich_rule should not permit both masqerade true and action parameters #322

Open
qha opened this issue Mar 30, 2022 · 0 comments
Open

Comments

@qha
Copy link
Contributor

qha commented Mar 30, 2022

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: any
  • Ruby: any
  • Distribution: el8
  • Module version: 4.4.0

How to reproduce (e.g Puppet code you use)

firewalld_rich_rule { 'Demo':
  ensure     => present,
  zone       => 'fudge,
  masquerade => true,
  dest       => {
    'address' => '192.0.2.0/24'
  },
  action     => 'accept',
}

What are you seeing

Applying the catalog fails and when trying the command manually firewall-cmd notes that masqerade and action is not valid in the same rule:

Error: Execution of '/bin/firewall-cmd --permanent --zone fudge --add-rich-rule rule family="ipv4" destination address="192.0.2.0/24" masquerade accept' returned 122: 
Error: /Stage[main]/Demo/Firewalld_rich_rule[Demo]/ensure: change from 'absent' to 'present' failed: Execution of '/bin/firewall-cmd --permanent --zone fudge --add-rich-rule rule family="ipv4" destination address="192.0.2.0/24"" masquerade accept' returned 122:  (corrective)

# /bin/firewall-cmd --permanent --zone fudge --add-rich-rule 'rule family="ipv4" destination  address="192.0.2.0/24" masquerade accept'
Error: INVALID_RULE: masquerade and action

What behaviour did you expect instead

I expected the validate function of firewalld_rich_rule to make catalog compilation fail with some informative message.

Output log

See above.

Any additional information you'd like to impart

firewalld.richlanguage(5) notes under the "Masquerade" heading "It is not allowed to specify an action here."

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

No branches or pull requests

1 participant