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

Cannot create rule when multiple icmp_type are defined #33

Closed
Daymarvi opened this issue Sep 2, 2024 · 1 comment · Fixed by #34
Closed

Cannot create rule when multiple icmp_type are defined #33

Daymarvi opened this issue Sep 2, 2024 · 1 comment · Fixed by #34
Assignees
Labels
bug Something isn't working

Comments

@Daymarvi
Copy link
Collaborator

Daymarvi commented Sep 2, 2024

Hello,

After updating the last puppet module to 1.5.1 i can see that the update of the icmp_type is working
Notice: [100 Allow icmpv4]/Windows_firewall_rule[100 Allow icmpv4]/icmp_type: icmp_type changed ['9', '10', '11'] to ['8', '10', '11'] (corrective)
But not the creation of the rule.
Error: [100 Allow icmpv4]/Windows_firewall_rule[100 Allow icmpv4]/ensure: change from 'absent' to 'present' failed: Execution of 'powershell.exe -ExecutionPolicy Bypass -File C:/ProgramData/PuppetLabs/puppet/cache/lib/ps/windows_firewall/ps-bridge.ps1 create -Name 100 Allow icmpv4 -Enabled True -DisplayName 100 Allow icmpv4 -Direction Inbound -Profile Any -LocalAddress Any -Protocol ICMPv4 -IcmpType 8,10,11 -LocalPort Rpc,Rpcepmap -RemotePort Any -EdgeTraversalPolicy Block -Action Allow -Program any -InterfaceType Any -Service any -Authentication Notrequired -Encryption Notrequired -RemoteMachine any -LocalUser any -RemoteUser any' returned 1: Creating 100 Allow icmpv4 New-NetFirewallRule : The ICMP type/code entry is invalid. When Protocol is ICMPv4 or ICMPv6, type:code pairs are allowed.

When there is a existing rule present for ICMP, the module updating it, but not when a new rule need to be created

In the Update fonction in the ps-bridge.ps1 we have this
if ($IcmpType) { $params.Add("IcmpType", ($IcmpType -split ','))
But it's not the same in the Create function.
if ($IcmpType) { $params.Add("IcmpType", $IcmpType) }

do you want me to do the MR ?
Regards
Alexandre

@webalexeu webalexeu self-assigned this Sep 2, 2024
@webalexeu webalexeu added the bug Something isn't working label Sep 2, 2024
@webalexeu
Copy link
Owner

Bug confirmed

@webalexeu webalexeu changed the title Icmp_type create rule is not working Cannot create rule when multiple icmp_type are defined Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants