Windows installer sets all erl.exe and epmd.exe firewall rules to block #8609
-
Describe the bugOn install of RabbitMQ v3.11.17 all firewall rules created to allow Erlang components to be available on the network are set to block, which causes the Management UI/Api and AMQP to only be available on localhost or the local machine. Reproduction steps
Expected behaviorIt's easy enough to set the rules to 'allow', but I expected that the firewall rules would be set to 'allow' by default. Additional contextTo confirm the issue, run the following in PowerShell: Get-NetFirewallRule | Where-Object {$_.DisplayName -in @("erl", "epmd","erlang")} | Select-Object Name, DisplayName, Enabled, Action and you'll get the following output (or at least something similar):
|
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 3 replies
-
Note that Neither the Erlang nor the RabbitMQ NSIS installers do anything with the Windows Firewall, meaning that it is up to system administrators to open the appropriate ports after installation. If we were to add code to automatically open ports, we would get many requests to stop messing with the firewall. When I install and run RabbitMQ locally in my Windows environment, I always have to modify the firewall (via an automatic popup) the first time the |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
While it may not necessarily be the installers specifically, here's more evidence that there's something in RabbitMQ (or maybe Windows too) that's setting the rules: When I run |
Beta Was this translation helpful? Give feedback.
-
I realize all of this seems to point to the RabbitMQ installer, but we have no code in the installer or in RabbitMQ to do anything with the firewall: https://github.com/rabbitmq/rabbitmq-packaging/blob/main/windows-exe/rabbitmq_nsi.in Nor does it appear that the Erlang installer does anything with the firewall: https://github.com/erlang/otp/blob/master/erts/etc/win32/nsis/erlang20.nsi Here is the NSIS plugin that could be used to configure the firewall: https://nsis.sourceforge.io/NSIS_Simple_Firewall_Plugin I see no occurrence of the string Like you I have installed Erlang many, many times on my work laptop so I can't really trust any test that I do, especially since my employer manages the laptop. If I have time I will bring up a fresh Windows VM to see what the behavior is by default, though even then VM packagers usually change policies around the firewall. Here is the source for both the Erlang and RabbitMQ chocolatey packages: |
Beta Was this translation helpful? Give feedback.
-
I attempted the install on a fresh install of Windows Server Core. All of the firewall rules showed up as I expected, except for the rules relating to Looking back at my other servers, it looks like the rules for Seems like this might be Windows "helping us out" by making firewall rules for newly installed programs, but having issues with it since there's no UI to pop up the message about whether to enable/allow the rules or not. |
Beta Was this translation helpful? Give feedback.
-
@Vacant0mens I removed all firewall rules for the various Erlang programs, installed OTP 26.0.1, and then ran this Powershell command in an admin context:
Then, I installed RabbitMQ 3.12.1, and ran this command in the same admin shell:
I did NOT get any popups from the Windows Firewall service, so I'm assuming that by adding the inbound rules the issue is fixed. Of course, Let me know if this works in your environment! |
Beta Was this translation helpful? Give feedback.
-
I super-appreciate your answer! 👍 It would probably be slightly better for non-development/non-home use to filter the exe's that get a firewall rule, just to be a little safer. Something like: Get-ChildItem -Recurse -Path 'C:\Program Files\Erlang OTP\' | Where-Object {$_.Name -in @("erl.exe", "epmd.exe", "werl.exe")} In my testing, only Also, it seems like and for future readers, here's a PowerShell script example (using parameter splatting): $AllowedExes = @("erl.exe", "epmd.exe", "werl.exe")
$ErlangExes = Get-ChildItem -Filter '*.exe' -Recurse -Path 'C:\Program Files\Erlang OTP\' | Where-Object {$_.Name -in $AllowedExes}
foreach ($Exe in $ErlangExes.FullName) {
Write-Verbose "Updating or creating firewall rule for $Exe"
$FwRuleName = "RabbitMQ and Erlang - Allow - $Exe"
$FwParams = @{
'Name' = $FwRuleName
'DisplayName' = $FwRuleName
'Direction' = 'In'
'Program' = "$Exe"
'Profile' = 'any'
'Enabled' = $true
'Action' = 'Allow'
}
if ($null -eq (Get-NetFirewallRule -Name $FwRuleName)) {
New-NetFirewallRule @FwParams
}
else {
Set-NetFirewallRule @FwParams
}
} |
Beta Was this translation helpful? Give feedback.
@Vacant0mens I removed all firewall rules for the various Erlang programs, installed OTP 26.0.1, and then ran this Powershell command in an admin context:
Then, I installed RabbitMQ 3.12.1, and ran this command in the same admin shell:
I did NOT get any popups from the…