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

Use of any protocol in rule description #123

Open
sch-it opened this issue Nov 27, 2021 · 1 comment
Open

Use of any protocol in rule description #123

sch-it opened this issue Nov 27, 2021 · 1 comment

Comments

@sch-it
Copy link

sch-it commented Nov 27, 2021

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7
  • Ruby:
  • Distribution:
  • Module version: 4.0.0

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

windows_firewall::exception { "trusted $description":
ensure => $rulestate,
direction => 'in',
action => 'allow',
enabled => true,
protocol => 'any',
remote_ip => $hostip,
description => "allow all for $description",
}

What are you seeing

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Windows_firewall::Exception[trusted bg-01]: parameter 'protocol' expects an undef value or a match for Enum['ICMPv4', 'ICMPv6', 'TCP', 'UDP'], got 'any'

What behaviour did you expect instead

Notice: /Stage[main]/Fw_trusted/Windows_firewall::Exception[trusted bg-01]/Exec[set rule trusted bg-01]/returns: executed successfully

Output log

Any additional information you'd like to impart

The abilities of exception.pp could be expanded if the value 'any' will be added in Enum in line 84
Optional[Enum['any', 'TCP', 'UDP', 'ICMPv4', 'ICMPv6']] $protocol = undef,

This modification allows creating a generic allow rule for fully trusted host without needing to specify several rules with different protocols and ports.

@JCW-USDA
Copy link

Good day all!

I am looking for the same resolution so we can use this module in our environment.
Change:
Optional[Enum['TCP', 'UDP', 'ICMPv4', 'ICMPv6']] $protocol = undef,
To:
Optional[Enum['Any', 'TCP', 'UDP', 'ICMPv4', 'ICMPv6']] $protocol = undef,

The command supports Any from what I see and tested.
Thank you,
Jeff

ola-pt added a commit to ola-pt/puppet-windows_firewall that referenced this issue Sep 10, 2022
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

2 participants