Repository navigation
Feature: Option to show all Windows Firewall rules - #3630
mergify[bot] merged 9 commits into
Conversation
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
|
@omrzgit Thanks! I added some more features and guards to this PR. We need to block Edit rule for rules not managed by NETworkManager, because the Edit dialog and the logic behind it can't handle every case yet (e.g. services). Enable, disable and delete aren't a problem, and Copy as works as well: the copy just doesn't include the unsupported properties, and a warning is shown in that case. |
There was a problem hiding this comment.
🟡 Changes recommended
Copying an interface-restricted Allow rule can silently discard its adapter restriction and broaden network access.
1 open issue
1 file not reviewed
Source/NETworkManager.Localization/Resources/Strings.Designer.cs: Generated file
What changed in this PR
Adds optional system-wide firewall rule visibility to NETworkManager while retaining the managed-only default.
Changes:
- Adds Firewall settings, bulk rule loading, source indicators and loading feedback.
- Preserves unsupported properties during edits and adds safeguards for external rules.
- Updates exports, validation, localization and documentation.
| File | Description |
|---|---|
| Website/docs/changelog/next-release.md | Documents features and fixes. |
| Website/docs/application/firewall.md | Explains settings and rule restrictions. |
| Source/NETworkManager/Views/FirewallView.xaml.cs | Adds double-click editing. |
| Source/NETworkManager/Views/FirewallView.xaml | Adds rule indicators, safeguards and loading states. |
| Source/NETworkManager/Views/FirewallSettingsView.xaml.cs | Connects the settings view model. |
| Source/NETworkManager/Views/FirewallSettingsView.xaml | Adds the visibility toggle. |
| Source/NETworkManager/Views/FirewallRuleChildWindow.xaml | Improves scrolling and path validation. |
| Source/NETworkManager/ViewModels/SettingsViewModel.cs | Routes to Firewall settings. |
| Source/NETworkManager/ViewModels/HostsFileEditorViewModel.cs | Aligns confirmation list formatting. |
| Source/NETworkManager/ViewModels/FirewallViewModel.cs | Coordinates loading, editing and warnings. |
| Source/NETworkManager/ViewModels/FirewallSettingsViewModel.cs | Manages the visibility preference. |
| Source/NETworkManager/ViewModels/FirewallRuleViewModel.cs | Shares supported protocol definitions. |
| Source/NETworkManager/DialogHelper.cs | Formats bulleted confirmation lists. |
| Source/NETworkManager.Validators/EmptyOrFileExistsValidator.cs | Supports environment-variable expansion. |
| Source/NETworkManager.Settings/SettingsViewManager.cs | Registers Firewall settings. |
| Source/NETworkManager.Settings/SettingsInfo.cs | Stores the visibility preference. |
| Source/NETworkManager.Settings/GlobalStaticConfiguration.cs | Keeps managed-only visibility as default. |
| Source/NETworkManager.Models/Firewall/FirewallRuleSource.cs | Defines rule origins. |
| Source/NETworkManager.Models/Firewall/FirewallRuleProgram.cs | Preserves program paths and keywords. |
| Source/NETworkManager.Models/Firewall/FirewallRuleNotFoundException.cs | Identifies missing-rule failures. |
| Source/NETworkManager.Models/Firewall/FirewallRuleHiddenProperties.cs | Tracks unsupported traffic restrictions. |
| Source/NETworkManager.Models/Firewall/FirewallRule.cs | Adds source and compatibility metadata. |
| Source/NETworkManager.Models/Firewall/Firewall.cs | Implements bulk loading and in-place updates. |
| Source/NETworkManager.Models/Export/ExportManager.FirewallRule.cs | Preserves interface-type display values. |
| Source/NETworkManager.Localization/Resources/Strings.resx | Adds labels and warnings. |
| Source/NETworkManager.Localization/Resources/Strings.Designer.cs | Exposes new localized resources. |
| Source/NETworkManager.Documentation/DocumentationManager.cs | Maps Firewall settings to documentation. |
| Source/NETworkManager.Controls/ObservableRangeCollection.cs | Batches collection replacement notifications. |
Review effort: Balanced
| HiddenProperties = ParseHiddenProperties( | ||
| result.Properties["IcmpType"]?.Value?.ToString(), | ||
| result.Properties["Service"]?.Value?.ToString(), | ||
| result.Properties["Package"]?.Value?.ToString()), |

Changes proposed in this pull request
Firewall.csusing bulk filter retrieval with hashtable mapping across port, address, application, and interface filters to query entire system rulesets in a single pass (~18s for 800+ rules instead of individual per-rule queries)Firewall_ShowAllRulessetting property inSettingsInfo.csandGlobalStaticConfiguration.cs(defaults tofalse, preserving existing behavior and sub-second startup load time)FirewallView.xamltoolbar beside the Search box and Refresh buttonShowAllRulesinStrings.resx/Strings.Designer.csSummary
Previously, the Firewall tool only displayed rules whose display name started with
NETworkManager_. While this isolated rules managed directly by NETworkManager, users were unable to view or inspect the system's full firewall configuration. This PR introduces an optional "Show all rules" toggle in the toolbar. When unchecked (default), it preserves the fast, scoped behavior. When checked, it loads and maps all Windows Firewall rules on the system.Contributing
By submitting this pull request, I confirm the following: