{"id":1549,"date":"2018-11-12T01:00:00","date_gmt":"2018-11-12T01:00:00","guid":{"rendered":"http:\/\/inswwdev.azurewebsites.net\/au\/insights\/uncategorized\/windows-firewall-behaviour-in-windows-10-vdi-and-windows-server-2016-w-citrix-xenapp\/"},"modified":"2024-12-17T03:19:49","modified_gmt":"2024-12-17T03:19:49","slug":"windows-firewall-behaviour-in-windows-10-vdi-and-windows-server-2016-w-citrix-xenapp","status":"publish","type":"post","link":"https:\/\/www.insentragroup.com\/nz\/insights\/geek-speak\/secure-workplace\/windows-firewall-behaviour-in-windows-10-vdi-and-windows-server-2016-w-citrix-xenapp\/","title":{"rendered":"Windows Firewall Behaviour in Windows 10 VDI and Windows Server 2016 w\/ Citrix XenApp"},"content":{"rendered":"<h3 style=\"padding-bottom: 15px; margin-bottom: 30px; margin-top: 40px; border-bottom: 1px solid #f16020;\">Persistent firewall rules in Server 2016 &amp; Windows 10<\/h3>\n<p style=\"text-align: justify;\">Firewalls are implemented in an attempt to reduce the impact of malicious attacks across an organisation, but they always come at a price.\u00a0 This can be from significantly increasing the configuration requirements across an environment to the point where everything is locked down so tight it makes implementing solutions cumbersome and troubleshooting even harder, to impacting performance of the systems where it is enabled.<\/p>\n<p style=\"text-align: justify;\">In the many deployments we deliver each year, we recommend the Windows Firewall (now known as \u2018Windows Defender\u2019) service is enabled and active with rules on the machines to allow communication between them and the other services they interact with, although not so locked down there can be absolutely no other communications.<\/p>\n<p style=\"text-align: justify;\">With the latest release of Microsoft Operating systems platforms, a key feature has been introduced called \u2018App packages\u2019, or \u2018Modern Apps\u2019, which come bundled with the O\/S and are part of the Microsoft Modern App strategy.\u00a0 These new applications have introduced an issue within the Windows Defender service that can cause significant performance impact to the hosting systems, or connecting users, as well as impacting any troubleshooting of the firewall service.<\/p>\n<p style=\"text-align: justify;\">Every App Package has a unique identifier (SID) which is used by Windows defender to filter the modern apps. This \u00a0can be on done based on UserID, Protocol or other conditions. This sounds logical and the package by package feature allows for great targeting of the firewall rules, and the App Packages automatically write their own rules to the firewall for each application at the start of the user session.<\/p>\n<p style=\"text-align: justify;\">The issue is that the App packages don\u2019t remove the rules that they placed in to the firewall at the end of a user session, nor do they reuse the rules on a second login of the same user.\u00a0 This can result in a single user creating hundreds of rules in the firewall for applications that are not required, worse still is that they are Any\/Any rules.<\/p>\n<p style=\"text-align: justify;\"><img decoding=\"async\" style=\"width: 577px; height: 433px;\" src=\"https:\/\/www.insentragroup.com\/wp-content\/uploads\/sites\/18\/2021\/02\/windowsfirewallbehaviour_img_1.jpg\" alt=\"\" data-udi=\"umb:\/\/media\/714b9d43ac4e41b4b727d275b07e0d4e\" \/><\/p>\n<p style=\"text-align: justify;\">Running the Xbox live services on a Windows 2016 server is unnecessary, unless your gaming laptop has just died the night before a Fortnight friend battle so removing these seems sensible.\u00a0 On all deployments of Citrix we implement, we use the Citrix optimiser toolkit (<a rel=\"noopener nofollow\" href=\"https:\/\/support.citrix.com\/article\/CTX224676\" target=\"_blank\">https:\/\/support.citrix.com\/article\/CTX224676<\/a>) on the target servers and disable a number of the services that don\u2019t need to be active in Enterprise environments, but there are a number that need to be there which include individual user-based firewall rules for the app package.<\/p>\n<p style=\"text-align: justify;\">For most systems, the optimisation is enough to limit the impact of the user rules, but in some instances this is not the case.\u00a0 In Citrix XenApp or Microsoft RDS systems, where a high number of users connect to single server, the number of rules created can get out of control and impact performance.<\/p>\n<p style=\"text-align: justify;\">This may not result in a major performance impact straight away on a system but has the potential to impact systems over time as well as impact troubleshooting issues as the rules are not removed by the OS when the user\u2019s logout, or if the same user logs in to the server again.<\/p>\n<p style=\"text-align: justify;\"><img decoding=\"async\" style=\"width: 970px; height: 485px;\" src=\"https:\/\/www.insentragroup.com\/wp-content\/uploads\/sites\/18\/2021\/02\/windowsfirewallbehaviour_img_2.jpg\" alt=\"\" data-udi=\"umb:\/\/media\/8c3a723ffcd94119b5401d978cc73a5e\" \/><\/p>\n<p style=\"text-align: justify;\">An example of the potential impact is that the svchost.exe process consumes an excessive amount of compute on the server in dealing with all the rules it has to process.<\/p>\n<p style=\"text-align: justify;\">Microsoft have not announced a \u2018patch\u2019 for Windows 10 and Windows Server 2016, but we are monitoring the blogs and feeds and hopefully they will release something later this year. For environments needing to clean up the rules now, there is little option other than running a scheduled task with a PowerShell script.<\/p>\n<p style=\"text-align: justify;\">To get a picture of what apps are automatically creating firewall rules , open \u201cC:WindowsSystemApps\u201d<\/p>\n<p style=\"text-align: justify;\"><img decoding=\"async\" style=\"width: 630px; height: 507px;\" src=\"https:\/\/www.insentragroup.com\/wp-content\/uploads\/sites\/18\/2021\/02\/windowsfirewallbehaviour_img_3.jpg\" alt=\"\" data-udi=\"umb:\/\/media\/fd2a2eb6711c471b8993952f3657badb\" \/><\/p>\n<p style=\"text-align: justify;\">Four of the main culprits for the bloat of rules are:<\/p>\n<ul>\n<li>\u201cContact Support\u201d: related to the Metro app \u201cContact Support which could be used to ask for help from Microsoft directly. If disabled, this app may not work<\/li>\n<li>\u201cSearch\u201d: related to the Cortana app. If disabled, Cortana may not<\/li>\n<li>\u201cWork or school account\u201d: related to the Azure AD account. If disabled, the Azure AD accounts may not work<\/li>\n<li>\u201cYour account\u201d: related to the cloud service of your account (Microsoft account sync settings between machines)<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">Based on the above example, each time a user logs in they will have 11 firewall App rules created which will not be deleted once the user logs out. \u00a0So, what do you do?<\/p>\n<p style=\"text-align: justify;\">Determine the installed services from the SystemApps folder and edit your script to find and delete rules as required.\u00a0 Here is an example script:<\/p>\n<p style=\"text-align: justify;\">Get-NetFirewallRule -DisplayName \u201c*Microsoft*\u201d | Remove-Netfirewallrule<\/p>\n<p style=\"text-align: justify;\">Get-NetFirewallRule -DisplayName \u201c*xbox*\u201d | Remove-Netfirewallrule<\/p>\n<p style=\"text-align: justify;\">Get-NetFirewallRule -DisplayName \u201c*Parental*\u201d | Remove-Netfirewallrule<\/p>\n<p style=\"text-align: justify;\">Get-NetFirewallRule -DisplayName \u201c*ShellExperience*\u201d | Remove-Netfirewallrule<\/p>\n<p style=\"text-align: justify;\">Get-NetFirewallRule -DisplayName \u201c*Windows*\u201d | Remove-Netfirewallrule<\/p>\n<p style=\"text-align: justify;\">Feel free to use the above code if you want to, and you can\u2019t wait for a fix from Microsoft, but please ensure you test this thoroughly in your environment to make sure it doesn\u2019t impact anything critical.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Persistent firewall rules in Server 2016 &amp; Windows 10 Firewalls are implemented in an attempt to reduce the impact of malicious attacks across an organisation, but they always come at a price.\u00a0 This can be from significantly increasing the configuration requirements across an environment to the point where everything is locked down so tight it&hellip; <a class=\"more-link\" href=\"https:\/\/www.insentragroup.com\/nz\/insights\/geek-speak\/secure-workplace\/windows-firewall-behaviour-in-windows-10-vdi-and-windows-server-2016-w-citrix-xenapp\/\">Continue reading <span class=\"screen-reader-text\">Windows Firewall Behaviour in Windows 10 VDI and Windows Server 2016 w\/ Citrix XenApp<\/span><\/a><\/p>\n","protected":false},"author":9,"featured_media":1550,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[20],"tags":[],"class_list":["post-1549","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-secure-workplace","entry"],"_links":{"self":[{"href":"https:\/\/www.insentragroup.com\/nz\/wp-json\/wp\/v2\/posts\/1549","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.insentragroup.com\/nz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.insentragroup.com\/nz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.insentragroup.com\/nz\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.insentragroup.com\/nz\/wp-json\/wp\/v2\/comments?post=1549"}],"version-history":[{"count":1,"href":"https:\/\/www.insentragroup.com\/nz\/wp-json\/wp\/v2\/posts\/1549\/revisions"}],"predecessor-version":[{"id":35468,"href":"https:\/\/www.insentragroup.com\/nz\/wp-json\/wp\/v2\/posts\/1549\/revisions\/35468"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.insentragroup.com\/nz\/wp-json\/wp\/v2\/media\/1550"}],"wp:attachment":[{"href":"https:\/\/www.insentragroup.com\/nz\/wp-json\/wp\/v2\/media?parent=1549"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.insentragroup.com\/nz\/wp-json\/wp\/v2\/categories?post=1549"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.insentragroup.com\/nz\/wp-json\/wp\/v2\/tags?post=1549"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}