{"id":264,"date":"2021-09-16T10:48:23","date_gmt":"2021-09-16T14:48:23","guid":{"rendered":"https:\/\/www.anthonyfontanez.com\/?p=264"},"modified":"2021-09-16T10:48:24","modified_gmt":"2021-09-16T14:48:24","slug":"windows-firewall-part-4-identity-based-access-control-via-kerberos","status":"publish","type":"post","link":"https:\/\/anthonyfontanez.com\/index.php\/2021\/09\/16\/windows-firewall-part-4-identity-based-access-control-via-kerberos\/","title":{"rendered":"Windows Firewall Part 4: Identity-based access control via Kerberos"},"content":{"rendered":"\n<p>Part 4 of this series will go over utilizing the previously configured domain-wide IPSec baseline by configuring secure firewall rules along with connection security rules to secure access to servers\/services via user identity. In the Microsoft ecosystem, this is part of a concept known as &#8220;<a rel=\"noreferrer noopener\" href=\"https:\/\/docs.microsoft.com\/windows\/security\/threat-protection\/windows-firewall\/domain-isolation-policy-design\" data-type=\"URL\" data-id=\"https:\/\/docs.microsoft.com\/windows\/security\/threat-protection\/windows-firewall\/domain-isolation-policy-design\" target=\"_blank\">domain isolation<\/a>&#8220;. Utilizing these features can be useful for a number of reasons, including ensuring that connections must originate from a domain-joined device, and providing additional access control on top of an application, such as an application running on a server that does not support centrally managed authentication.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Server-side Firewall Configuration<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>Starting with a server running services that should require authentication, create a new GPO or use an existing GPO already linked to it, and go to the Windows Firewall section. For this example, I am using a server named &#8220;APPS&#8221;, running IIS, with two web sites. The Default Web Site is running on ports 80 (HTTP) and 443 (HTTPS), and the second web site is running on port 8080 (HTTPS). I&#8217;ll be leaving the Default Web Site open for anyone to access, while securing the second web site.<\/p>\n\n\n\n<p>First, add the builtin rules for HTTP and HTTPS.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"787\" height=\"565\" src=\"https:\/\/www.anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-26.png\" alt=\"\" class=\"wp-image-280\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-26.png 787w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-26-300x215.png 300w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-26-768x551.png 768w\" sizes=\"auto, (max-width: 787px) 100vw, 787px\" \/><figcaption>Builtin HTTP\/HTTPS Rules<\/figcaption><\/figure><\/div>\n\n\n\n<p>Next, create a custom rule for secure traffic to port 8080. In the wizard, select a custom rule, for all programs, for local TCP port 8080, with a scope of any source address, and a destination address of the server IP address. On the Action screen, select &#8220;Allow the connection if it is secure&#8221;, and click Customize. In the Customization dialog, leave it at the default of &#8220;Allow the connection if it is authenticated and integrity-protected&#8221;. This setting ensures that the connection is authenticated, but does not require it to be encrypted. Since the underlying traffic is already encrypted via the application protocol, requiring encryption at the transport layer is just extra overhead.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"467\" height=\"581\" src=\"https:\/\/www.anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-62.png\" alt=\"\" class=\"wp-image-350\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-62.png 467w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-62-241x300.png 241w\" sizes=\"auto, (max-width: 467px) 100vw, 467px\" \/><figcaption>Customize Allow if Secure Settings<\/figcaption><\/figure><\/div>\n\n\n\n<p>Next, configure Allowed Users to reference a previously created AD group containing only the user accounts that should be allowed access.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"714\" height=\"581\" src=\"https:\/\/www.anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-28.png\" alt=\"\" class=\"wp-image-282\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-28.png 714w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-28-300x244.png 300w\" sizes=\"auto, (max-width: 714px) 100vw, 714px\" \/><figcaption>Authorized Users Configuration<\/figcaption><\/figure><\/div>\n\n\n\n<p>On the next page, leave the computers section unchanged, as in this example, I only want to control access via user identity. I&#8217;ll also leave the Profiles section unchanged, and then give the firewall rule a useful name, such as &#8220;Inbound TCP 8080 (Secure)&#8221;. After finishing the wizard, the new rule will be present, with a padlock icon, and the action column listing &#8220;Secure&#8221; instead of &#8220;Allow&#8221;.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"787\" height=\"565\" src=\"https:\/\/www.anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-29.png\" alt=\"\" class=\"wp-image-283\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-29.png 787w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-29-300x215.png 300w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-29-768x551.png 768w\" sizes=\"auto, (max-width: 787px) 100vw, 787px\" \/><figcaption>New Secure Firewall Rule Addition<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Server-side Connection Security Rule Configuration<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>Next, create a Connection Security Rule to require authentication for port 8080. Start by right-clicking the Connection Security Rules section, clicking New Rule, and selecting Custom.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"714\" height=\"581\" src=\"https:\/\/www.anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-30.png\" alt=\"\" class=\"wp-image-284\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-30.png 714w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-30-300x244.png 300w\" sizes=\"auto, (max-width: 714px) 100vw, 714px\" \/><figcaption>New Connection Security Rule Wizard &#8211; Rule Type<\/figcaption><\/figure><\/div>\n\n\n\n<p>Since this should apply to all endpoints connecting to this server, configure endpoint 1 as the server IP address, and leave endpoint 2 set to Any.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"714\" height=\"581\" src=\"https:\/\/www.anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-63.png\" alt=\"\" class=\"wp-image-351\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-63.png 714w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-63-300x244.png 300w\" sizes=\"auto, (max-width: 714px) 100vw, 714px\" \/><figcaption>New Connection Security Rule Wizard &#8211; Endpoints<\/figcaption><\/figure><\/div>\n\n\n\n<p>Next, configure the Requirements to require authentication for both inbound and outbound connections. This will require that both endpoints can successfully authenticate to each other to allow the connection.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"714\" height=\"581\" src=\"https:\/\/www.anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-32.png\" alt=\"\" class=\"wp-image-286\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-32.png 714w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-32-300x244.png 300w\" sizes=\"auto, (max-width: 714px) 100vw, 714px\" \/><figcaption>New Connection Security Rule Wizard &#8211; Requirements<\/figcaption><\/figure><\/div>\n\n\n\n<p>In the Authentication Method section, leave it as Default, as this will utilize the configuration set as default in the domain-wide IPSec configuration baseline policy, Computer Kerberos + User Kerberos. By utilizing Default here, this takes advantage of being able to easily make changes later; by updating what the &#8220;default&#8221; is in the top level IPSec configuration policy, later policies no longer need to updated if changes need to be made.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"714\" height=\"581\" src=\"https:\/\/www.anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-33.png\" alt=\"\" class=\"wp-image-287\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-33.png 714w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-33-300x244.png 300w\" sizes=\"auto, (max-width: 714px) 100vw, 714px\" \/><figcaption>New Connection Security Rule &#8211; Authentication Method<\/figcaption><\/figure><\/div>\n\n\n\n<p>In the Protocol and Ports section, define endpoint 1 port as TCP 8080, and leave endpoint 2 port set to Any.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"714\" height=\"581\" src=\"https:\/\/www.anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-34.png\" alt=\"\" class=\"wp-image-288\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-34.png 714w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-34-300x244.png 300w\" sizes=\"auto, (max-width: 714px) 100vw, 714px\" \/><figcaption>New Connection Security Rule &#8211; Protocol and Ports<\/figcaption><\/figure><\/div>\n\n\n\n<p>Finally, leave the Profile section as default, and give the rule a useful name, such as &#8220;Inbound TCP 8080 &#8211; Require Authentication&#8221;.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Client-side Connection Security Rule Configuration<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>Now that the server-side configuration is complete, a matching Connection Security Rule for traffic to this server\/port needs to be configured on the client-side. In a top-level Client GPO, create a new Connection Security Rule, similar to the above configuration, except reversing the IP address and port specified in endpoint 1 and 2.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"423\" src=\"https:\/\/www.anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-35-1024x423.png\" alt=\"\" class=\"wp-image-289\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-35-1024x423.png 1024w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-35-300x124.png 300w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-35-768x317.png 768w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-35.png 1322w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Client-side Connection Security Rule<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Testing\/Verification<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>Now that both the server and client side configurations are complete, perform a gpupdate on both the server and a client, and log in to the client with a user account that is not in the group defined in the server-side firewall rule.<\/p>\n\n\n\n<p>On the client, open the firewall management console (wf.msc) to verify the new Connection Security Rule is listed and applied, and test connectivity to ports 80, 443, and 8080.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"861\" height=\"582\" src=\"https:\/\/www.anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-37.png\" alt=\"\" class=\"wp-image-292\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-37.png 861w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-37-300x203.png 300w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-37-768x519.png 768w\" sizes=\"auto, (max-width: 861px) 100vw, 861px\" \/><figcaption>Testing Connectivity<\/figcaption><\/figure><\/div>\n\n\n\n<p>As you can see in the above screenshot, I was able to connect to ports 80 and 443, but not 8080, as my user account is not a member of the group defined in the firewall rule. I can view the firewall management console (wf.msc) and view the current main mode and quick mode associations to verify that sessions were started, using the computer and user Kerberos identities. Even though I could not successfully access the port, an IPSec session was still negotiated, which is expected behavior.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-38.png\" alt=\"\" class=\"wp-image-293\" width=\"400\" height=\"455\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-38.png 400w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-38-264x300.png 264w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><figcaption>Main Mode Association<\/figcaption><\/figure><\/div>\n\n\n\n<p>If I log out and log back in with an account that is a member of the defined security group, I can perform the same test, and see that I am able to connect to port 8080 this time.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"859\" height=\"515\" src=\"https:\/\/www.anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-39.png\" alt=\"\" class=\"wp-image-294\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-39.png 859w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-39-300x180.png 300w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-39-768x460.png 768w\" sizes=\"auto, (max-width: 859px) 100vw, 859px\" \/><figcaption>Connection Test<\/figcaption><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"455\" src=\"https:\/\/www.anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-40.png\" alt=\"\" class=\"wp-image-295\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-40.png 400w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-40-264x300.png 264w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><figcaption>Main Mode Association<\/figcaption><\/figure><\/div>\n\n\n\n<p>Finally, accessing the sites directly in a web browser verifies that access is working as expected. Now you know why access to port 8080 requires identity-based access control!<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"787\" height=\"504\" src=\"https:\/\/www.anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-41.png\" alt=\"\" class=\"wp-image-296\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-41.png 787w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-41-300x192.png 300w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2021\/09\/image-41-768x492.png 768w\" sizes=\"auto, (max-width: 787px) 100vw, 787px\" \/><figcaption>Successful Website Access!<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>At this point, a service has been secured to require authentication, and utilized a security group to define who is allowed to connect. This is a much stronger configuration than simply allowing access by IP address, as we&#8217;ve now tied the access back to a user identity. If the authorized user logs into a different computer, or from a different location, they&#8217;ll still be able to access resources. This configuration can be expanded to other servers as necessary, using varying levels of authorized users or computers as deemed fit. If the goal is to only allow access from domain-joined endpoints, simply leave both of these options as default.<\/p>\n\n\n\n<p>This configuration can also be utilized in the reverse of the above, to secure and authenticate remote client access from management servers.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Part 4 of this series will go over utilizing the previously configured domain-wide IPSec baseline by configuring secure firewall rules along with connection security rules<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6,7],"tags":[2,3],"class_list":["post-264","post","type-post","status-publish","format-standard","hentry","category-active-directory","category-security","tag-active-directory","tag-security"],"jetpack_featured_media_url":"","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/anthonyfontanez.com\/index.php\/wp-json\/wp\/v2\/posts\/264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/anthonyfontanez.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/anthonyfontanez.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/anthonyfontanez.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/anthonyfontanez.com\/index.php\/wp-json\/wp\/v2\/comments?post=264"}],"version-history":[{"count":10,"href":"https:\/\/anthonyfontanez.com\/index.php\/wp-json\/wp\/v2\/posts\/264\/revisions"}],"predecessor-version":[{"id":398,"href":"https:\/\/anthonyfontanez.com\/index.php\/wp-json\/wp\/v2\/posts\/264\/revisions\/398"}],"wp:attachment":[{"href":"https:\/\/anthonyfontanez.com\/index.php\/wp-json\/wp\/v2\/media?parent=264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anthonyfontanez.com\/index.php\/wp-json\/wp\/v2\/categories?post=264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anthonyfontanez.com\/index.php\/wp-json\/wp\/v2\/tags?post=264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}