Skip to content

Add firewall application along with other small improvements.#3353

Open
labre-rdc wants to merge 85 commits intoBornToBeRoot:mainfrom
labre-rdc:firewall-pr
Open

Add firewall application along with other small improvements.#3353
labre-rdc wants to merge 85 commits intoBornToBeRoot:mainfrom
labre-rdc:firewall-pr

Conversation

@labre-rdc
Copy link
Contributor

@labre-rdc labre-rdc commented Mar 2, 2026

Changes proposed in this pull request

  • Add firewall application.
  • Fix a few potential null dereferences in some validators and converters.
  • Add ValidationErrorTemplate for checkboxes.
  • Allow ValidationError to be clicked out of the way (restores on hovering/keyboard focus).
  • Fix ChildWindowStyle restricting the window size to 500 height instead of setting a default height.
  • Reuse existing validators in empty variants where applicable.
  • Make ListHelper.Modify generic. Avoid duplicates.
  • PowershellHelper: Support commands exceeding command line length limit.
  • NetworkInterfaceView: Fix all XAML warnings.
  • ProfileChildWindow: Always scale to 85% of main window width. Required for wider content.
  • Localized enum conversion (to/from int/string)
  • Fixed 2 warnings in ProfileView while being at it.

Related issue(s)

Copilot generated summary

Provide a Copilot generated summary of the changes in this pull request.

Copilot summary

{generated summary}

To-Do

  • Update documentation to reflect this changes
  • Update changelog to reflect this changes
  • Replace PR number placeholders in changelog.

Contributing

By submitting this pull request, I confirm the following:

labre-rdc added 21 commits March 2, 2026 12:58
…ratedRegex.

Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
…o 500.

Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
…Remove duplicates.

Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
…f Int16.MaxValue by creating temporary scripts when necessary.

Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
…ace.

Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
…ences and for typed binding proxies.

Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
…ties passed as parameter for null, empty strings or empty enumerables.

Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
…anges.

Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
… simplify merge conflicts.

Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
@BornToBeRoot
Copy link
Owner

@labre-rdc thanks, i will review it when i have some time 😄

@labre-rdc
Copy link
Contributor Author

Sorry for the reference error. I’ll handle it tomorrow.

@BornToBeRoot
Copy link
Owner

No worries. I don't think I'll be able to review it until next week.

Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
labre-rdc and others added 4 commits March 10, 2026 22:31
… simplify merge conflicts.

Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
@BornToBeRoot
Copy link
Owner

OK - after some rebasing fun, i will start to review 😄

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new Firewall application/module to manage Windows Defender Firewall rules (including profile integration), alongside a set of UI/validation improvements and some refactoring in helpers/converters/validators across the codebase.

Changes:

  • Adds Firewall application UI (rule grid + settings) and profile support for storing/applying firewall rules.
  • Introduces new validators/converters (incl. localized enum conversion) and improves validation UX (error templates, dismissable popups).
  • Refactors utilities (generic ListHelper.Modify) and improves PowerShell command execution for long commands.

Reviewed changes

Copilot reviewed 83 out of 88 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
Website/docs/changelog/next-release.md Updates upcoming release notes (currently includes duplicate entries).
Website/docs/application/firewall.md Adds documentation for the new Firewall module.
Source/NETworkManager/Views/ProfilesView.xaml Adds Firewall-enabled column and adjusts empty-collection triggers.
Source/NETworkManager/Views/ProfileChildWindow.xaml.cs Adds firewall focus handling + tab-selection focus logic.
Source/NETworkManager/Views/ProfileChildWindow.xaml Adds Firewall tab and validation wiring for profile editor.
Source/NETworkManager/Views/NetworkInterfaceView.xaml Cleans up XAML warnings and resource usage.
Source/NETworkManager/Views/FirewallView.xaml.cs Adds code-behind wiring for Firewall view focus and events.
Source/NETworkManager/Views/FirewallView.xaml Adds main Firewall application view layout.
Source/NETworkManager/Views/FirewallSettingsView.xaml.cs Adds code-behind for Firewall settings view.
Source/NETworkManager/Views/FirewallSettingsView.xaml Adds Firewall settings UI (history, max length, syntax).
Source/NETworkManager/ViewModels/SettingsViewModel.cs Hooks Firewall settings view into settings navigation.
Source/NETworkManager/ViewModels/ProfileViewModel.cs Adds firewall profile integration + rules extraction.
Source/NETworkManager/ViewModels/FirewallSettingsViewModel.cs Implements Firewall settings state and commands.
Source/NETworkManager/ViewModels/FirewallRuleViewModel.cs Adds firewall rule view-model with validation/history behavior.
Source/NETworkManager/Resources/Templates/ValidationErrorTemplates.xaml Updates validation popup behavior and adds outer-offset template.
Source/NETworkManager/Resources/Styles/ChildWindowStyles.xaml Fixes child window style default sizing behavior.
Source/NETworkManager/Resources/Styles/CheckBoxStyles.xaml Applies validation error template to checkboxes.
Source/NETworkManager/ProfileDialogManager.cs Persists firewall profile settings and rules.
Source/NETworkManager/NETworkManager.csproj Adds new XAML/control compile items and references Interfaces project.
Source/NETworkManager/MainWindow.xaml.cs Adds Firewall view routing (show/hide) and profile load callback.
Source/NETworkManager/Controls/FirewallRuleGrid.xaml.cs Adds rule-grid behaviors: hotkeys, focus restore, history updates.
Source/NETworkManager/Controls/FirewallRuleGrid.xaml Adds rule grid UI with details panel and validation bindings.
Source/NETworkManager/Controls/FirewallRuleEnumTranslations.cs Adds enum translation helpers for Firewall rule comboboxes.
Source/NETworkManager.sln Adds NETworkManager.Interfaces project to solution.
Source/NETworkManager.Validators/ProgramNameLengthValidator.cs Adds program path length validator.
Source/NETworkManager.Validators/NETworkManager.Validators.csproj Adds reference to Interfaces project.
Source/NETworkManager.Validators/FirewallRuleNoPipeValidator.cs Adds validator to block `
Source/NETworkManager.Validators/FirewallRuleNameValidator.cs Adds length validator for user-defined firewall rule names.
Source/NETworkManager.Validators/FileNameValidator.cs Refactors regex validation using GeneratedRegex.
Source/NETworkManager.Validators/EmptyOrInt32Validator.cs Adds “empty or int32” validator wrapper.
Source/NETworkManager.Validators/EmptyOrFirewallPortRangeValidator.cs Adds firewall port range validator (currently has logic issues).
Source/NETworkManager.Validators/EmptyOrFilePathValidator.cs Adds “empty or file path” validator wrapper.
Source/NETworkManager.Validators/EmptyOrFileIsExeValidator.cs Adds “empty or exe path” validator wrapper.
Source/NETworkManager.Validators/EmptyOrFileExistsValidator.cs Refactors file-exists validation to reuse existing validator.
Source/NETworkManager.Validators/AnyNetworkProfileValidator.cs Adds validator ensuring at least one network profile is selected.
Source/NETworkManager.Utilities/PowerShellHelper.cs Supports long PowerShell commands by writing a temp script.
Source/NETworkManager.Utilities/ListHelper.cs Refactors history list modifier into a generic method.
Source/NETworkManager.Utilities.WPF/ValidationHelper.cs Adds attached-property helper to propagate validation state to VM.
Source/NETworkManager.Utilities.WPF/TypedBindingProxies/ProfileViewModelProxy.cs Adds typed binding proxy (currently returns wrong Freezable type).
Source/NETworkManager.Utilities.WPF/TypedBindingProxies/FrameworkElementProxy.cs Adds typed binding proxy (currently returns wrong Freezable type).
Source/NETworkManager.Utilities.WPF/TypedBindingProxies/FirewallViewModelProxy.cs Adds typed binding proxy (currently returns wrong Freezable type).
Source/NETworkManager.Utilities.WPF/NETworkManager.Utilities.WPF.csproj Adds reference to Interfaces project.
Source/NETworkManager.Utilities.WPF/BindingProxy.cs Improves docs and uses nameof(Data) for DP registration.
Source/NETworkManager.Settings/SettingsViewManager.cs Adds Firewall settings entry to settings list.
Source/NETworkManager.Settings/SettingsName.cs Adds Firewall settings enum entry.
Source/NETworkManager.Settings/SettingsManager.cs Inserts Firewall app into application list during upgrade (needs dedupe guard).
Source/NETworkManager.Settings/SettingsInfo.cs Adds Firewall settings persistence fields.
Source/NETworkManager.Profiles/ProfileViewManager.cs Adds Firewall to profile views list.
Source/NETworkManager.Profiles/ProfileName.cs Adds Firewall profile name enum entry.
Source/NETworkManager.Profiles/ProfileInfo.cs Adds firewall-enabled flag and rules storage to profiles.
Source/NETworkManager.Models/Network/NetworkProfiles.cs Adds Windows network profile enum.
Source/NETworkManager.Models/Network/NetworkInterfaceInfo.cs Adds Profiles (network profile/category) to interface info.
Source/NETworkManager.Models/Firewall/FirewallRuleProgram.cs Adds program model for firewall rules (currently has persistence issue).
Source/NETworkManager.Models/Firewall/FirewallRuleDirection.cs Adds firewall direction enum.
Source/NETworkManager.Models/Firewall/FirewallRuleAction.cs Adds firewall action enum.
Source/NETworkManager.Models/Firewall/FirewallRule.cs Adds core firewall rule model + ports string formatter.
Source/NETworkManager.Models/Firewall/FirewallProtocol.cs Adds firewall protocol enum (incl. numeric protocol IDs).
Source/NETworkManager.Models/Firewall/FirewallPortSpecification.cs Adds port/range model.
Source/NETworkManager.Models/Firewall/FirewallPortLocation.cs Adds local/remote port location enum.
Source/NETworkManager.Models/Firewall/FirewallInterfaceType.cs Adds interface-type enum for firewall rules.
Source/NETworkManager.Models/Firewall/Firewall.cs Adds PowerShell-based apply/clear logic for NwM_* rules.
Source/NETworkManager.Models/ApplicationName.cs Adds Firewall application enum value.
Source/NETworkManager.Models/ApplicationManager.cs Adds Firewall icon mapping.
Source/NETworkManager.Localization/Resources/Strings.resx Adds localization strings for Firewall UI/validation.
Source/NETworkManager.Interfaces/ViewModels/IProfileViewModel.cs Adds interface used by validators/converters for profile VMs.
Source/NETworkManager.Interfaces/ViewModels/IFirewallViewModel.cs Adds firewall VM interface (currently uses invalid static instance pattern).
Source/NETworkManager.Interfaces/ViewModels/IFirewallRuleViewModel.cs Adds rule VM interface for validators/converters.
Source/NETworkManager.Interfaces/NETworkManager.Interfaces.csproj Adds new Interfaces project.
Source/NETworkManager.Documentation/DocumentationManager.cs Adds firewall doc page mapping (also adds an unused using).
Source/NETworkManager.Documentation/DocumentationIdentifier.cs Adds firewall documentation identifier.
Source/NETworkManager.Converters/SizeFactorConverter.cs Adds converter to scale sizes by factor.
Source/NETworkManager.Converters/PortRangeToPortSpecificationConverter.cs Adds converter for port range text ⇄ structured ports (needs trimming fix).
Source/NETworkManager.Converters/NETworkManager.Converters.csproj Adds reference to Interfaces project.
Source/NETworkManager.Converters/IntZeroToFalseConverter.cs Adds converter for enabling/disabling buttons based on counts.
Source/NETworkManager.Converters/FirewallRuleProgramConverter.cs Adds converter between program model and string path.
Source/NETworkManager.Converters/EnumToStringConverter.cs Adds localized enum ⇄ string converter.
Source/NETworkManager.Converters/EnumToIntConverter.cs Adds enum ⇄ index converter for comboboxes.
Source/NETworkManager.Converters/EmptyToIntMaxValueConverter.cs Adds converter mapping empty to int.MaxValue and back.
Source/NETworkManager.Converters/CollectionPropertyVisibilityConverter.cs Adds collection-property visibility converter for rule grid columns.
Source/NETworkManager.Converters/CollectionPropertyBooleanOrConverter.cs Adds collection-property boolean “any-true” converter.
Source/NETworkManager.Converters/BooleansOrConverter.cs Makes OR multi-converter null-safe.
Source/NETworkManager.Converters/BoolArrayToFwRuleCategoriesConverter.cs Adds converter for translating selected network profiles to display text.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@labre
Copy link

labre commented Mar 11, 2026

Thanks for the review. I'm currently in vacation until excluding Friday.

Regarding localization: I assumed, that I can (at least) add keys as required, but apparently they are supposed to be added within Transifex. Reverting that commit was not enough, because I already tried to rebase/merge as required to stay out of merge conflicts. I will remove the keys and try to provide something importable for Transifex. Can you point me to some documentation on supported formats for key imports? I can provide them with German localization or without it. Just state your preference.

Since real testing (and screenshots) was not really possible without language changes, the commit was at least temporarily required.

@BornToBeRoot
Copy link
Owner

The default strings (English) must be added to “Strings.resx” (and “Strings.Designer.cs”). Transifex regularly checks for changes in this file in the repository. When changes are made, Transifex is updated and the new strings can be translated.
When a language is fully translated (or during a manual synchronization), Transifex sends a PR with the file Strings..resx, which is automatically validated by AppVeyor and then merged by Mergify.

I only commit these two files and discard the rest (Visual Studio automatically updates them with an empty string...).


But I restored it and pushed it to this branch, so you don't need to make any changes to the language 😄 I'll try to review the rest over the weekend. I think i will make some minor changes to the UI to align it with the other tools (like moving the buttons to the bottom so it will also resize correct)

@labre-rdc
Copy link
Contributor Author

The default strings (English) must be added to “Strings.resx” (and “Strings.Designer.cs”). Transifex regularly checks for changes in this file in the repository. When changes are made, Transifex is updated and the new strings can be translated. When a language is fully translated (or during a manual synchronization), Transifex sends a PR with the file Strings..resx, which is automatically validated by AppVeyor and then merged by Mergify.

I only commit these two files and discard the rest (Visual Studio automatically updates them with an empty string...).

I see. Well I considered it unreliable for testing, because the empty strings did apparently not fall back to the default culture for me in WPF (maybe I missed something), which means I was presented with empty buttons and headers when a non-English display language was used. For that reason I added the English translation and translated to German while being at it. This was also reasonable, because the UI elements would scale/wrap differently with other string lengths etc. As a side note, I think, you use Visual Studio in German language, because Strings.Designer.cs contains auto-generated german comments. This causes merge conflicts, when other contributors use IDEs in different languages.

But I restored it and pushed it to this branch, so you don't need to make any changes to the language 😄 I'll try to review the rest over the weekend. I think i will make some minor changes to the UI to align it with the other tools (like moving the buttons to the bottom so it will also resize correct)

Okay, fine for me, if you want to handle that. I might process a few of the Copilot review notes today or in the next few days.

Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
Signed-off-by: Manuel Ullmann <manuel.ullmann@rediecon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[New App] Firewall module/application

4 participants