{"id":12724,"date":"2020-06-22T08:36:26","date_gmt":"2020-06-22T08:36:26","guid":{"rendered":"https:\/\/www.gmass.co\/blog\/?p=12724"},"modified":"2020-07-09T16:22:19","modified_gmt":"2020-07-09T16:22:19","slug":"block-ip-addresses-aws-windows-iis","status":"publish","type":"post","link":"https:\/\/www.gmass.co\/blog\/block-ip-addresses-aws-windows-iis\/","title":{"rendered":"How to block IP Addresses in an AWS\/Windows\/IIS environment"},"content":{"rendered":"<p>Here&#8217;s the problem \u2014 you&#8217;re hosting a Windows server running <strong>IIS<\/strong> on <strong>AWS<\/strong>, and your web app is getting hammered with requests that look like this:<\/p>\n<pre><span style=\"color: #ff0000;\"> https:\/\/www.mywebsite.com\/?q=%23Hcker%3Cbody%20oninput%3Djavascript%3Aalert(1)%3EHcker<\/span><\/pre>\n<p>These are clearly <strong>malicious<\/strong>. You want to <strong>block the IP easily<\/strong> and <strong>programatically<\/strong>. My website fields <em>thousands<\/em> of requests just like this <em>daily<\/em>, ever since we made it onto <a href=\"https:\/\/hackerone.com\/googleapi\">HackerOne&#8217;s list of apps using Google APIs that have more than 50,000 active users<\/a>.<\/p>\n<p>You have a few options, but I argue you only have <em>one<\/em> good option.<\/p>\n<h2>Various options to block an IP in AWS<\/h2>\n<ol>\n<li>You might think to use AWS <strong>Security Groups<\/strong>, but you&#8217;ll quickly realize that <strong>Inbound Rules<\/strong> in AWS Security Groups can only be used to <em>whitelist<\/em> traffic, not <em>block<\/em> traffic.<\/li>\n<li>When you dig further into what AWS offers, you&#8217;ll come across the ability to <a href=\"http:\/\/chopmo.dk\/posts\/2015\/06\/13\/blocking-traffic-in-aws.html\">block individual IPs<\/a>, and even ranges of IPs, using a Network ACL (Network Access Control List). Specifically, you can set ALLOW and DENY rules. That&#8217;s actually a decent solution, but there are two issues: 1) If you want to do this programmatically, you&#8217;ll need to learn the AWS <a href=\"https:\/\/docs.aws.amazon.com\/vpc\/latest\/userguide\/vpc-network-acls.html#nacl-api-cli\">Network ACL API<\/a>; and 2) You are limited to <strong>20 total rules<\/strong>, including <strong>Inbound<\/strong> and <strong>Outbound<\/strong>. So if you have 1 Outbound rule, which is normal, and 1 default Inbound rule, you&#8217;re left with <strong>only 18 IPs or ranges that can be blocked<\/strong>.<a href=\"https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/block-IP-addresses-in-AWS-124kp.png\" data-rel=\"lightbox-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-12815\" src=\"https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/block-IP-addresses-in-AWS-124kp.png\" alt=\"block IP addresses in AWS\" width=\"730\" height=\"850\" srcset=\"https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/block-IP-addresses-in-AWS-124kp.png 1048w, https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/block-IP-addresses-in-AWS-124kp-258x300.png 258w, https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/block-IP-addresses-in-AWS-124kp-768x894.png 768w, https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/block-IP-addresses-in-AWS-124kp-880x1024.png 880w, https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/block-IP-addresses-in-AWS-124kp-21x24.png 21w, https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/block-IP-addresses-in-AWS-124kp-31x36.png 31w, https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/block-IP-addresses-in-AWS-124kp-41x48.png 41w\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" \/><\/a><\/li>\n<li>If you dig even further into what AWS offers, you&#8217;ll find that you can <a href=\"https:\/\/aws.amazon.com\/blogs\/networking-and-content-delivery\/how-to-integrate-third-party-firewall-appliances-into-an-aws-environment\/\">integrate your own third-party firewall<\/a> into your EC2 environment, but this solution will be complex and expensive.<\/li>\n<li>If you&#8217;re using <strong>Windows Firewall<\/strong>, then you can block an IP address using Windows Firewall, and you can even programmatically block IPs using the <a href=\"https:\/\/docs.microsoft.com\/en-us\/previous-versions\/windows\/desktop\/ics\/using-windows-firewall-with-advanced-security\">Windows Firewall API<\/a>. This is like a decent option, but one I&#8217;ve never tried before. The AWS documentation encourages users to use <strong>Security Groups<\/strong> <em>instead<\/em> of Windows Firewall, so ever since I set up Security Groups, I have disabled Windows Firewall on my production servers.<\/li>\n<li>After exhausting your native AWS options, you&#8217;ll start to look at what kind of blocking IIS can do natively. You&#8217;ll come across <a href=\"https:\/\/www.xsofthost.com\/help\/setup-dynamic-ip-address-restrictions-anti-ddos-attack-iis8\/\">Dynamic IP restrictions<\/a>, but if your web app is even close to as complex as mine, you&#8217;ll note a few things lacking.<\/li>\n<\/ol>\n<h2>Why IIS&#8217;s Dynamic IP Restrictions Kind of Sucks<\/h2>\n<ul>\n<li>It&#8217;s great to be able to stop IPs that send too many requests at once, but if you have any kind of busy web app, this will lead to false positives. <em>What about images?<\/em> Let&#8217;s say you have a page with <strong>200 images<\/strong>, each of which will be a unique request. The user might get blocked after requesting this page even if you have this set to a reasonable threshold like 100.<\/li>\n<li>Most malicious attacks involve a query string. It would be nice to apply these rules just to requests that have a query string, but no such option exists.<\/li>\n<\/ul>\n<h2>What is the easiest and the best solution?<\/h2>\n<p>My preferred method of blocking IPs is by using the <strong>IP Address and Domain Restrictions<\/strong> function of <strong>IIS<\/strong>. It requires you to <a href=\"https:\/\/www.ryadel.com\/en\/iis-restrict-web-site-access-ip-address-mask-block-deny-allow-how-to\/\">install the IP and Domain Restrictions module<\/a> from <strong>Server Manager<\/strong>, but once installed, blocking an IP is as easy as:<\/p>\n<ol>\n<li>Use the IIS user interface to navigate to the <strong>IP Address and Domain Restrictions <\/strong>section to block an IP address. This can be done both on the individual site level by navigating to a specific site, or on a server-wide level by navigating up a few levels to the entire server.<\/li>\n<li>Add an <strong>ipSecurity<\/strong> item to a website&#8217;s <strong>web.config<\/strong> file, which is the same as adding the IP to an <strong>individual site<\/strong> in IIS.<\/li>\n<li>Add an <strong>ipSecurity<\/strong> item to the server&#8217;s <strong>ApplicationHost.config file<\/strong>, which is the same as adding the IP to the <strong>whole server<\/strong> in IIS. This file is\u00a0found under <strong>c:\\windows\\system32\\inetsrv\\config.<\/strong><\/li>\n<li>Use the <strong>Microsoft.Web.Administration<\/strong> API to add new IPs easily to the block list, which essentially writes new IP addresses to <strong>ApplicationHost.config<\/strong>.<\/li>\n<\/ol>\n<h2>Using the IIS API to block IPs server-wide<\/h2>\n<p>To programmatically block IP addresses in IIS, use the <strong>Microsoft.Web.Administration<\/strong> API. However, <strong>don&#8217;t install the Nuget package<\/strong>, as <a href=\"https:\/\/blog.lextudio.com\/whats-microsoft-web-administration-and-the-horrible-facts-you-should-know-b82f2c974da6\">programmer Lex Li explains<\/a>. Instead, reference the DLL that&#8217;s already part of your Windows OS.<\/p>\n<p>Here&#8217;s the C# code I use personally:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n        public void IISBlockSingleIP(string ipAddress)\r\n        {\r\n            IPAddress ip;\r\n            bool IsIPValid = IPAddress.TryParse(ipAddress, out ip);\r\n            \/\/IT'S VERY IMPORTANT THAT YOU VALIDATE THE IP, BECAUSE THE API WILL ACCEPT ANY TEXT AND ADD IT TO ApplicationHost.CONFIG\r\n            \/\/AND THIS WILL CORRUPT ApplicationHost.CONFIG AND TAKE DOWN EVERY WEBSITE ON YOUR SERVER\r\n            if (IsIPValid)\r\n            {\r\n\r\n                using (ServerManager serverManager = new ServerManager())\r\n                {\r\n                    Configuration config = serverManager.GetApplicationHostConfiguration();\r\n\r\n                    ConfigurationSection ipSecuritySection = config.GetSection(&quot;system.webServer\/security\/ipSecurity&quot;);\r\n\r\n                    ConfigurationElementCollection ipSecurity = ipSecuritySection.GetCollection();\r\n\r\n                    var addElement = ipSecurity.CreateElement(&quot;add&quot;);\r\n                    addElement.SetAttributeValue(&quot;ipAddress&quot;, ipAddress);\r\n                    addElement.SetAttributeValue(&quot;allowed&quot;, &quot;false&quot;);\r\n                    ipSecurity.Add(addElement);\r\n\r\n                    serverManager.CommitChanges();\r\n                }\r\n            }\r\n\r\n        }\r\n<\/pre>\n<p>As I&#8217;ve noted in the comments, it&#8217;s critically important to validate every IP before committing it to <strong>ApplicationHost.config<\/strong>, because the API will accept any junk text and add it as a DENY rule \u2014 and if a non-IP makes it in there, it will bring your whole server down.<\/p>\n<figure id=\"attachment_12816\" aria-describedby=\"caption-attachment-12816\" style=\"width: 729px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/Validate-each-IP-address-35kb.png\" data-rel=\"lightbox-image-1\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-12816\" src=\"https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/Validate-each-IP-address-35kb.png\" alt=\"Validate each IP address\" width=\"729\" height=\"160\" srcset=\"https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/Validate-each-IP-address-35kb.png 1224w, https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/Validate-each-IP-address-35kb-300x66.png 300w, https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/Validate-each-IP-address-35kb-768x168.png 768w, https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/Validate-each-IP-address-35kb-1024x224.png 1024w, https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/Validate-each-IP-address-35kb-24x5.png 24w, https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/Validate-each-IP-address-35kb-36x8.png 36w, https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/Validate-each-IP-address-35kb-48x11.png 48w\" sizes=\"auto, (max-width: 729px) 100vw, 729px\" \/><\/a><figcaption id=\"caption-attachment-12816\" class=\"wp-caption-text\"><em>This will bring your server down.<\/em><\/figcaption><\/figure>\n<p>Again, all this code does is add a line to the <strong>ipSecurity<\/strong> section of <strong>ApplicationHost.config<\/strong>. So technically, you could manipulate the file yourself, without the Microsoft API, but since this is just a few lines of code, it&#8217;s much easier than risking corrupting the file with malformed XML.<\/p>\n<p><strong>Why bother with blocking an IP programmatically when you can just as easily do it manually through the IIS interface?<\/strong><\/p>\n<p>I block IPs almost weekly because they&#8217;re pounding my server with malicious requests. I detect these requests in the <strong>Application_BeginRequest<\/strong> method of my <strong>Global.asax<\/strong> file, and then I send myself an email when an IP meets certain criteria. That email then contains a link which calls the above-referenced code. So <strong>blocking an IP for me is as easy as getting an email notification and clicking a link<\/strong>. It&#8217;s much easier than RDPing into my web server, launching the IIS Administration tool, navigating to the right area, and adding the IP through the UI.<\/p>\n<p><strong>Why not just keep the bad IPs in a database table and check against that table from Application_BeginRequest?<\/strong><\/p>\n<p>That is a great idea, and also something I do, but it turns out that not every request goes through <strong>Application_BeginRequest<\/strong>. A malicious request like the one in red above would not go through <strong>Application_BeginRequest<\/strong>. A user flooding your server with these requests can easily affect server performance if the requests are allowed through, which is why I&#8217;ve outlined additional steps.<\/p>\n<h2>What actually happens when you block an IP?<\/h2>\n<p>Now that your IP is added to the block list in applicationHost.config, what does a hacker from that IP see when accessing your website? Unfortunately blocking via applicationHost.config does not block the hacker&#8217;s attempt at connecting at all. It still lets the hacker content but the hacker will see this in his web browser:<\/p>\n<p><a href=\"https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/AWS-hacker-error-message-24kb.png\" data-rel=\"lightbox-image-2\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-12918\" src=\"https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/AWS-hacker-error-message-24kb.png\" alt=\"AWS hacker error message\" width=\"1148\" height=\"202\" srcset=\"https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/AWS-hacker-error-message-24kb.png 1224w, https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/AWS-hacker-error-message-24kb-300x53.png 300w, https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/AWS-hacker-error-message-24kb-768x136.png 768w, https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/AWS-hacker-error-message-24kb-1024x181.png 1024w, https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/AWS-hacker-error-message-24kb-24x4.png 24w, https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/AWS-hacker-error-message-24kb-36x6.png 36w, https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/AWS-hacker-error-message-24kb-48x8.png 48w\" sizes=\"auto, (max-width: 1148px) 100vw, 1148px\" \/><\/a><\/p>\n<p>Another thing to note is that &#8220;dangerous&#8221; requests don&#8217;t go down the same pipeline that normal requests do, and therefore &#8220;dangerous&#8221; requests circumvent the IP blocking in applicationHost.config altogether. A dangerous request will still be responded to with this IIS error:<\/p>\n<p><span style=\"color: #ff0000;\">System.Web.HttpException (0x80004005): A potentially dangerous Request.Path value <\/span><br \/>\n<span style=\"color: #ff0000;\">was detected from the client (&lt;). at System.Web.HttpRequest.ValidateInputIfRequiredByConfig() at <\/span><br \/>\n<span style=\"color: #ff0000;\">System.Web.HttpApplication.PipelineStepManager.ValidateHelper(HttpContext context)<\/span><\/p>\n<p>As an example, here&#8217;s a &#8220;dangerous&#8221; request you can try now on the GMass website: <a href=\"http:\/\/www.gmass.co\/booya\/build_now%3Csvg\/onload=alert(1337)%3E\">http:\/\/www.gmass.co\/booya\/build_now%3Csvg\/onload=alert(1337)%3E<\/a><\/p>\n<p>So, even if your IP was blocked, you would still be able to access that dangerous URL and you would still get the same message.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s the problem \u2014 you&#8217;re hosting a Windows server running IIS on AWS, and your web app is getting hammered with requests that look like this: https:\/\/www.mywebsite.com\/?q=%23Hcker%3Cbody%20oninput%3Djavascript%3Aalert(1)%3EHcker These\u2026<\/p>\n","protected":false},"author":2,"featured_media":12818,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[6120,3462,6539],"tags":[],"class_list":["post-12724","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aws","category-developers","category-iis"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\r\n<title>How to block IP Addresses in an AWS\/Windows\/IIS environment<\/title>\r\n<meta name=\"description\" content=\"There are a few ways to block an IP address in an AWS\/Windows environment, but only a couple good ones. I&#039;ll show you the bad and good ones.\" \/>\r\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\r\n<link rel=\"canonical\" href=\"https:\/\/www.gmass.co\/blog\/block-ip-addresses-aws-windows-iis\/\" \/>\r\n<meta property=\"og:locale\" content=\"en_US\" \/>\r\n<meta property=\"og:type\" content=\"article\" \/>\r\n<meta property=\"og:title\" content=\"How to block IP Addresses in an AWS\/Windows\/IIS environment\" \/>\r\n<meta property=\"og:description\" content=\"There are a few ways to block an IP address in an AWS\/Windows environment, but only a couple good ones. I&#039;ll show you the bad and good ones.\" \/>\r\n<meta property=\"og:url\" content=\"https:\/\/www.gmass.co\/blog\/block-ip-addresses-aws-windows-iis\/\" \/>\r\n<meta property=\"og:site_name\" content=\"GMass Blog\" \/>\r\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/GmailMailMerge\/\" \/>\r\n<meta property=\"article:published_time\" content=\"2020-06-22T08:36:26+00:00\" \/>\r\n<meta property=\"article:modified_time\" content=\"2020-07-09T16:22:19+00:00\" \/>\r\n<meta property=\"og:image\" content=\"https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/how-to-block-IP-addresses-in-AWS-featured-image-140kb.png\" \/>\r\n\t<meta property=\"og:image:width\" content=\"1001\" \/>\r\n\t<meta property=\"og:image:height\" content=\"467\" \/>\r\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\r\n<meta name=\"author\" content=\"Ajay Goel\" \/>\r\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\r\n<meta name=\"twitter:creator\" content=\"@PartTimeSnob\" \/>\r\n<meta name=\"twitter:site\" content=\"@GMassForGmail\" \/>\r\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ajay Goel\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\r\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.gmass.co\\\/blog\\\/block-ip-addresses-aws-windows-iis\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.gmass.co\\\/blog\\\/block-ip-addresses-aws-windows-iis\\\/\"},\"author\":{\"name\":\"Ajay Goel\",\"@id\":\"https:\\\/\\\/www.gmass.co\\\/blog\\\/#\\\/schema\\\/person\\\/b5fa74f8765b860701158fd77162fff8\"},\"headline\":\"How to block IP Addresses in an AWS\\\/Windows\\\/IIS environment\",\"datePublished\":\"2020-06-22T08:36:26+00:00\",\"dateModified\":\"2020-07-09T16:22:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.gmass.co\\\/blog\\\/block-ip-addresses-aws-windows-iis\\\/\"},\"wordCount\":1341,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.gmass.co\\\/blog\\\/block-ip-addresses-aws-windows-iis\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.gmass.co\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/how-to-block-IP-addresses-in-AWS-featured-image-140kb.png\",\"articleSection\":[\"AWS\",\"Developers\",\"IIS\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.gmass.co\\\/blog\\\/block-ip-addresses-aws-windows-iis\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.gmass.co\\\/blog\\\/block-ip-addresses-aws-windows-iis\\\/\",\"url\":\"https:\\\/\\\/www.gmass.co\\\/blog\\\/block-ip-addresses-aws-windows-iis\\\/\",\"name\":\"How to block IP Addresses in an AWS\\\/Windows\\\/IIS environment\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.gmass.co\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.gmass.co\\\/blog\\\/block-ip-addresses-aws-windows-iis\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.gmass.co\\\/blog\\\/block-ip-addresses-aws-windows-iis\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.gmass.co\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/how-to-block-IP-addresses-in-AWS-featured-image-140kb.png\",\"datePublished\":\"2020-06-22T08:36:26+00:00\",\"dateModified\":\"2020-07-09T16:22:19+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.gmass.co\\\/blog\\\/#\\\/schema\\\/person\\\/b5fa74f8765b860701158fd77162fff8\"},\"description\":\"There are a few ways to block an IP address in an AWS\\\/Windows environment, but only a couple good ones. I'll show you the bad and good ones.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.gmass.co\\\/blog\\\/block-ip-addresses-aws-windows-iis\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.gmass.co\\\/blog\\\/block-ip-addresses-aws-windows-iis\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.gmass.co\\\/blog\\\/block-ip-addresses-aws-windows-iis\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.gmass.co\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/how-to-block-IP-addresses-in-AWS-featured-image-140kb.png\",\"contentUrl\":\"https:\\\/\\\/www.gmass.co\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/how-to-block-IP-addresses-in-AWS-featured-image-140kb.png\",\"width\":1001,\"height\":467,\"caption\":\"how to block IP addresses in AWS\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.gmass.co\\\/blog\\\/block-ip-addresses-aws-windows-iis\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.gmass.co\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to block IP Addresses in an AWS\\\/Windows\\\/IIS environment\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.gmass.co\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.gmass.co\\\/blog\\\/\",\"name\":\"GMass Blog\",\"description\":\"Tips and tricks for sending mail merge and mass email campaigns directly from Gmail\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.gmass.co\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.gmass.co\\\/blog\\\/#\\\/schema\\\/person\\\/b5fa74f8765b860701158fd77162fff8\",\"name\":\"Ajay Goel\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f3a70af05bbabe47925150d5a1320540e801b78055a74da20658fc97cd0706a2?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f3a70af05bbabe47925150d5a1320540e801b78055a74da20658fc97cd0706a2?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f3a70af05bbabe47925150d5a1320540e801b78055a74da20658fc97cd0706a2?s=96&d=mm&r=g\",\"caption\":\"Ajay Goel\"},\"description\":\"Ajay is the founder of GMass and has been developing email sending software for 20 years.\",\"sameAs\":[\"https:\\\/\\\/twitter.com\\\/PartTimeSnob\",\"https:\\\/\\\/x.com\\\/PartTimeSnob\"],\"url\":\"https:\\\/\\\/www.gmass.co\\\/blog\\\/author\\\/ajay-goel\\\/\"}]}<\/script>\r\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to block IP Addresses in an AWS\/Windows\/IIS environment","description":"There are a few ways to block an IP address in an AWS\/Windows environment, but only a couple good ones. I'll show you the bad and good ones.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.gmass.co\/blog\/block-ip-addresses-aws-windows-iis\/","og_locale":"en_US","og_type":"article","og_title":"How to block IP Addresses in an AWS\/Windows\/IIS environment","og_description":"There are a few ways to block an IP address in an AWS\/Windows environment, but only a couple good ones. I'll show you the bad and good ones.","og_url":"https:\/\/www.gmass.co\/blog\/block-ip-addresses-aws-windows-iis\/","og_site_name":"GMass Blog","article_publisher":"https:\/\/www.facebook.com\/GmailMailMerge\/","article_published_time":"2020-06-22T08:36:26+00:00","article_modified_time":"2020-07-09T16:22:19+00:00","og_image":[{"width":1001,"height":467,"url":"https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/how-to-block-IP-addresses-in-AWS-featured-image-140kb.png","type":"image\/png"}],"author":"Ajay Goel","twitter_card":"summary_large_image","twitter_creator":"@PartTimeSnob","twitter_site":"@GMassForGmail","twitter_misc":{"Written by":"Ajay Goel","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.gmass.co\/blog\/block-ip-addresses-aws-windows-iis\/#article","isPartOf":{"@id":"https:\/\/www.gmass.co\/blog\/block-ip-addresses-aws-windows-iis\/"},"author":{"name":"Ajay Goel","@id":"https:\/\/www.gmass.co\/blog\/#\/schema\/person\/b5fa74f8765b860701158fd77162fff8"},"headline":"How to block IP Addresses in an AWS\/Windows\/IIS environment","datePublished":"2020-06-22T08:36:26+00:00","dateModified":"2020-07-09T16:22:19+00:00","mainEntityOfPage":{"@id":"https:\/\/www.gmass.co\/blog\/block-ip-addresses-aws-windows-iis\/"},"wordCount":1341,"commentCount":0,"image":{"@id":"https:\/\/www.gmass.co\/blog\/block-ip-addresses-aws-windows-iis\/#primaryimage"},"thumbnailUrl":"https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/how-to-block-IP-addresses-in-AWS-featured-image-140kb.png","articleSection":["AWS","Developers","IIS"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.gmass.co\/blog\/block-ip-addresses-aws-windows-iis\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.gmass.co\/blog\/block-ip-addresses-aws-windows-iis\/","url":"https:\/\/www.gmass.co\/blog\/block-ip-addresses-aws-windows-iis\/","name":"How to block IP Addresses in an AWS\/Windows\/IIS environment","isPartOf":{"@id":"https:\/\/www.gmass.co\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.gmass.co\/blog\/block-ip-addresses-aws-windows-iis\/#primaryimage"},"image":{"@id":"https:\/\/www.gmass.co\/blog\/block-ip-addresses-aws-windows-iis\/#primaryimage"},"thumbnailUrl":"https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/how-to-block-IP-addresses-in-AWS-featured-image-140kb.png","datePublished":"2020-06-22T08:36:26+00:00","dateModified":"2020-07-09T16:22:19+00:00","author":{"@id":"https:\/\/www.gmass.co\/blog\/#\/schema\/person\/b5fa74f8765b860701158fd77162fff8"},"description":"There are a few ways to block an IP address in an AWS\/Windows environment, but only a couple good ones. I'll show you the bad and good ones.","breadcrumb":{"@id":"https:\/\/www.gmass.co\/blog\/block-ip-addresses-aws-windows-iis\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.gmass.co\/blog\/block-ip-addresses-aws-windows-iis\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.gmass.co\/blog\/block-ip-addresses-aws-windows-iis\/#primaryimage","url":"https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/how-to-block-IP-addresses-in-AWS-featured-image-140kb.png","contentUrl":"https:\/\/www.gmass.co\/blog\/wp-content\/uploads\/2020\/06\/how-to-block-IP-addresses-in-AWS-featured-image-140kb.png","width":1001,"height":467,"caption":"how to block IP addresses in AWS"},{"@type":"BreadcrumbList","@id":"https:\/\/www.gmass.co\/blog\/block-ip-addresses-aws-windows-iis\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.gmass.co\/blog\/"},{"@type":"ListItem","position":2,"name":"How to block IP Addresses in an AWS\/Windows\/IIS environment"}]},{"@type":"WebSite","@id":"https:\/\/www.gmass.co\/blog\/#website","url":"https:\/\/www.gmass.co\/blog\/","name":"GMass Blog","description":"Tips and tricks for sending mail merge and mass email campaigns directly from Gmail","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.gmass.co\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.gmass.co\/blog\/#\/schema\/person\/b5fa74f8765b860701158fd77162fff8","name":"Ajay Goel","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f3a70af05bbabe47925150d5a1320540e801b78055a74da20658fc97cd0706a2?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f3a70af05bbabe47925150d5a1320540e801b78055a74da20658fc97cd0706a2?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f3a70af05bbabe47925150d5a1320540e801b78055a74da20658fc97cd0706a2?s=96&d=mm&r=g","caption":"Ajay Goel"},"description":"Ajay is the founder of GMass and has been developing email sending software for 20 years.","sameAs":["https:\/\/twitter.com\/PartTimeSnob","https:\/\/x.com\/PartTimeSnob"],"url":"https:\/\/www.gmass.co\/blog\/author\/ajay-goel\/"}]}},"_links":{"self":[{"href":"https:\/\/www.gmass.co\/blog\/wp-json\/wp\/v2\/posts\/12724","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gmass.co\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gmass.co\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gmass.co\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gmass.co\/blog\/wp-json\/wp\/v2\/comments?post=12724"}],"version-history":[{"count":16,"href":"https:\/\/www.gmass.co\/blog\/wp-json\/wp\/v2\/posts\/12724\/revisions"}],"predecessor-version":[{"id":12919,"href":"https:\/\/www.gmass.co\/blog\/wp-json\/wp\/v2\/posts\/12724\/revisions\/12919"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gmass.co\/blog\/wp-json\/wp\/v2\/media\/12818"}],"wp:attachment":[{"href":"https:\/\/www.gmass.co\/blog\/wp-json\/wp\/v2\/media?parent=12724"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gmass.co\/blog\/wp-json\/wp\/v2\/categories?post=12724"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gmass.co\/blog\/wp-json\/wp\/v2\/tags?post=12724"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}