puppetlabs / puppetlabs-firewall

Puppet Firewall Module
http://forge.puppetlabs.com/puppetlabs/firewall
Apache License 2.0
271 stars 455 forks source link

The jump parameter should not be converted to uppercase #1164

Open sbraz opened 1 year ago

sbraz commented 1 year ago

Describe the Bug

Hi, I noticed a discrepancy between the behaviour of the chain and jump parameters. According to https://www.netfilter.org/documentation/HOWTO/packet-filtering-HOWTO-7.html, user-defined chains should use lowercase names.

By convention, user-defined chains are lower-case to distinguish them (we'll describe how to create new user-defined chains below in Operations on an Entire Chain).

If I follow this convention, it works when passed to chain but jump forcefully converts my chain name to uppercase.

Expected Behavior

The value of the jump parameter should not be forced to uppercase.

Steps to Reproduce

Steps to reproduce the behaviour:

Environment

Additional Context

This line should be removed: https://github.com/puppetlabs/puppetlabs-firewall/blame/v7.0.2/lib/puppet/provider/firewall/firewall.rb#L867

david22swan commented 1 year ago

This upcase was put in place due to the merge with action, which had allowed required the ACCEPT, REJECT and DROP values to be passed as lowercase. The upcase was an attempt to keep the code as compliant as possible but had not considered the custom values. Will clean it up now.