<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ammar Alim on Medium]]></title>
        <description><![CDATA[Stories by Ammar Alim on Medium]]></description>
        <link>https://medium.com/@ammar.osman.ali?source=rss-48f0bb9f17b7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*JREdSsoNc78t9zUiIfU6Cw.jpeg</url>
            <title>Stories by Ammar Alim on Medium</title>
            <link>https://medium.com/@ammar.osman.ali?source=rss-48f0bb9f17b7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 19:37:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ammar.osman.ali/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Rise of the Machines: Battling Web Scraper Bots in the Age of Automated Threats]]></title>
            <link>https://medium.com/@ammar.osman.ali/the-rise-of-the-machines-battling-web-scraping-in-the-age-of-automated-threats-0def9eadec7b?source=rss-48f0bb9f17b7------2</link>
            <guid isPermaLink="false">https://medium.com/p/0def9eadec7b</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[fraud-detection]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[bots]]></category>
            <dc:creator><![CDATA[Ammar Alim]]></dc:creator>
            <pubDate>Fri, 28 Jun 2024 04:38:45 GMT</pubDate>
            <atom:updated>2024-06-28T19:26:54.480Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Id5FKLP3aeb1ZZEZFsLEVw.jpeg" /><figcaption>Generate by Adobe Firefly</figcaption></figure><p>“In any war, there are calms between storms.” ~ Optimus Prime, the leader of the Autobots</p><p><strong>Disclaimer</strong>: The code in this article is for demonstration purposes only. It is not for use beyond sandboxed testing and is not 100% accurate.</p><h4>The Last Great War</h4><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*LS9kZciSVrJchDHv" /><figcaption>Optimus Prime and Megatron from Transformers</figcaption></figure><p>Although I rarely watch TV, one of my favorite activities is watching the Transformers cartoon with my oldest child; he is obsessed, can narrate most scenes, and builds popular characters with Lego as he watches. Transformers is about a war between the good bots (auto bots), led by Optimus Prime, and the bad bots, “<em>The Decepticons,</em>” led by Megatron, the formidable leader of the Decepticons.</p><blockquote><em>&quot;The Decepticons are a malevolent race of robot warriors, brutal. The Decepticons are driven by a single undeviating goal: total domination of the universe.”</em></blockquote><p>One episode explored the stealthy tactics the villainous bots employ to elude human detection, unveiling that only the noble bots have the sharp acumen required to spot the Decepticons and halt their nefarious plans in their tracks. This captivating episode inspired me to write this piece as it aligns with one of my core security values: “Developers shouldn’t have to make security decisions; systems should.”</p><h4>Not all visitors are welcome:</h4><p>Recent research by Barracuda Networks revealed that bots accounted for nearly two-thirds of global internet traffic in early 2021, with malicious bots comprising almost 40%. This prevalence of non-human activity, a fact that many may not be fully aware of, is reshaping the digital landscape, presenting opportunities and significant challenges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kovyskWx2B4Q2TMfqU2CMw.png" /><figcaption>Akamai: Scraping Away Your Bottom Line</figcaption></figure><p>Bots, or internet robots, are automated software applications designed for specific online tasks. They range from benign and essential, like search engine crawlers, to malicious and disruptive, such as those engaged in click fraud or DDoS attacks. Understanding this ecosystem is not just crucial; it&#39;s empowering for anyone involved in digital operations and makes them feel informed and prepared.</p><h4>Types of Bots:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PPGrx6wvo4EK9nH2w13dkQ.png" /><figcaption>Akamai: Scraping Away Your Bottom Line</figcaption></figure><ol><li><strong>Click Bots</strong>: Simulate ad clicks, skewing analytics and draining ad budgets.</li><li><strong>Scraper Bots:</strong> Harvest content and data, often detrimental to original creators.</li><li><strong>Spam Bots:</strong> Flood comment sections and inboxes with unwanted content.</li><li><strong>Impersonator Bots: </strong>Mimic human behavior to bypass security measures.</li><li><strong>Beneficial Bots:</strong> Include search engine crawlers and monitoring bots.</li></ol><p>The impact of bot traffic extends beyond mere annoyance. It can significantly affect website performance, data accuracy, and revenue. With digital ad fraud projected to cost $100 billion by 2023, understanding and mitigating bot traffic has become crucial.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-De01gkCUIHqHKbBSQNdew.png" /><figcaption>Akamai: Scraping Away Your Bottom Line</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vJGSFnMYGK2RT5y17wZMPA.png" /><figcaption>Akamai: Scraping Away Your Bottom Line</figcaption></figure><h4>Web Scraping Evasion Techniques: A Technical Analysis</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KVQ0AcdFWKRrNpxltWusug.png" /><figcaption>Akamai: Scraping Away Your Bottom Line</figcaption></figure><p>As defensive measures evolve, so do the techniques employed by sophisticated web scrapers. Let’s examine the advanced evasion methods used by modern bots to circumvent detection:</p><ol><li><strong>JavaScript Fingerprinting Evasion:</strong></li></ol><ul><li><strong>Minimal JS Execution:</strong> Bots use lightweight JS engines to handle basic operations without triggering alarms.</li><li><strong>Headless Browser Deployment:</strong> More advanced bots utilize headless browsers with stealth plugins to mimic human-like interactions.</li></ul><ol><li><strong>Example (Python with Selenium):</strong></li></ol><pre>from selenium import webdriver<br>from selenium.webdriver.chrome.options import Options<br><br>chrome_options = Options()<br>chrome_options.add_argument(&quot;--headless&quot;)<br>chrome_options.add_argument(&quot;--window-size=1920x1080&quot;)<br><br>driver = webdriver.Chrome(options=chrome_options)<br>driver.get(&quot;https://example.com&quot;)<br><br>fingerprint = driver.execute_script(&quot;&quot;&quot;<br>    return {<br>        userAgent: navigator.userAgent,<br>        language: navigator.language,<br>        screenRes: window.screen.width + &#39;x&#39; + window.screen.height,<br>        timezone: Intl.DateTimeFormat().resolvedOptions().timeZone<br>    };<br>&quot;&quot;&quot;)<br>print(fingerprint)<br>driver.quit()      </pre><h4>2. HTTP and TLS Fingerprinting Circumvention:</h4><ul><li>Header Spoofing: Bots adjust HTTP headers to match popular browsers.</li><li>TLS Profile Manipulation: Advanced bots modify TLS parameters to evade fingerprinting.</li></ul><p><strong>Example (Python with custom SSL context):</strong></p><pre>import ssl<br>import requests<br>from urllib3.poolmanager import PoolManager<br>from urllib3.util.ssl_ import create_urllib3_context<br><br>class CustomHttpAdapter(requests.adapters.HTTPAdapter):<br>    def __init__(self, ssl_context=None, **kwargs):<br>        self.ssl_context = ssl_context<br>        super().__init__(**kwargs)<br><br>    def init_poolmanager(self, connections, maxsize, block=False):<br>        self.poolmanager = PoolManager(<br>            num_pools=connections,<br>            maxsize=maxsize,<br>            block=block,<br>            ssl_context=self.ssl_context<br>        )<br><br>def create_custom_ssl_context():<br>    context = create_urllib3_context()<br>    context.set_ciphers(&#39;ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256&#39;)<br>    context.options |= (ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3 | ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1)<br>    return context<br><br>session = requests.Session()<br>custom_adapter = CustomHttpAdapter(ssl_context=create_custom_ssl_context())<br>session.mount(&#39;https://&#39;, custom_adapter)<br><br>response = session.get(&#39;https://www.howsmyssl.com/a/check&#39;)<br>print(response.json())</pre><h4>3. IP Reputation Evasion:</h4><ul><li>Proxy Rotation: Bots use pools of proxies to distribute traffic and avoid IP-based rate limiting.</li><li>Residential and Mobile IP Usage: Advanced bots leverage residential or mobile IPs to appear more human-like.</li></ul><p><strong>Example (Python with proxy rotation):</strong></p><pre>import requests<br>from itertools import cycle<br><br>proxies = [<br>    {&#39;http&#39;: &#39;http://proxy1:8080&#39;},<br>    {&#39;http&#39;: &#39;http://proxy2:8080&#39;},<br>    {&#39;http&#39;: &#39;http://proxy3:8080&#39;}<br>]<br><br>proxy_pool = cycle(proxies)<br><br>for i in range(5):<br>    proxy = next(proxy_pool)<br>    try:<br>        response = requests.get(&#39;http://httpbin.org/ip&#39;, proxies=proxy, timeout=5)<br>        print(f&quot;Request {i+1}: IP = {response.json()[&#39;origin&#39;]}&quot;)<br>    except:<br>        print(f&quot;Request {i+1}: Failed&quot;)</pre><h4>Defending Against Web Scraping with AWS WAF</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S5Hlo-P_yGWuA95VKxk5Sw.jpeg" /><figcaption>Generated by Adobe Firefly</figcaption></figure><p>As web scraping techniques become more sophisticated, defense mechanisms are crucial. AWS Web Application Firewall (WAF) offers a powerful solution to protect against these advanced threats. Here’s a simple guide to configuring AWS WAF for anti-scraping protection:</p><ol><li><strong>Create a Web ACL:</strong></li></ol><ul><li>Sign in to the AWS Management Console and open the WAF console.</li><li>Choose “Create web ACL,” set a name (e.g., “AntiScrapingWAF”), and choose the resource type.</li></ul><p><strong>2. Implement IP-based Rules:</strong></p><ul><li>Add an IP set rule to block known scraper IP addresses:</li></ul><pre>{<br>  &quot;Name&quot;: &quot;BlockKnownScrapers&quot;,<br>  &quot;Priority&quot;: 10,<br>  &quot;Action&quot;: {<br>    &quot;Block&quot;: {}<br>  },<br>  &quot;Statement&quot;: {<br>    &quot;IPSetReferenceStatement&quot;: {<br>      &quot;ARN&quot;: &quot;arn:aws:wafv2:us-east-1:123456789012:regional/ipset/known-scrapers/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111&quot;<br>    }<br>  }<br>}</pre><p><strong>3. Rate-Based Rule for Request Throttling:</strong></p><ul><li>Add a rate-based rule to limit requests from a single IP:</li></ul><pre>{<br>  &quot;Name&quot;: &quot;RateLimitRule&quot;,<br>  &quot;Priority&quot;: 20,<br>  &quot;Action&quot;: {<br>    &quot;Block&quot;: {}<br>  },<br>  &quot;Statement&quot;: {<br>    &quot;RateBasedStatement&quot;: {<br>      &quot;Limit&quot;: 2000,<br>      &quot;AggregateKeyType&quot;: &quot;IP&quot;<br>    }<br>  }<br>}</pre><p><strong>4. User-Agent String Analysis:</strong></p><ul><li>Implement a string match rule to detect suspicious User-Agent strings:</li></ul><pre>{<br>  &quot;Name&quot;: &quot;BlockSuspiciousUserAgents&quot;,<br>  &quot;Priority&quot;: 30,<br>  &quot;Action&quot;: {<br>    &quot;Block&quot;: {}<br>  },<br>  &quot;Statement&quot;: {<br>    &quot;OrStatement&quot;: {<br>      &quot;Statements&quot;: [<br>        {<br>          &quot;ByteMatchStatement&quot;: {<br>            &quot;SearchString&quot;: &quot;python-requests&quot;,<br>            &quot;FieldToMatch&quot;: {<br>              &quot;SingleHeader&quot;: {<br>                &quot;Name&quot;: &quot;user-agent&quot;<br>              }<br>            },<br>            &quot;TextTransformations&quot;: [<br>              {<br>                &quot;Priority&quot;: 0,<br>                &quot;Type&quot;: &quot;LOWERCASE&quot;<br>              }<br>            ],<br>            &quot;PositionalConstraint&quot;: &quot;CONTAINS&quot;<br>          }<br>        },<br>        {<br>          &quot;ByteMatchStatement&quot;: {<br>            &quot;SearchString&quot;: &quot;scrapy&quot;,<br>            &quot;FieldToMatch&quot;: {<br>              &quot;SingleHeader&quot;: {<br>                &quot;Name&quot;: &quot;user-agent&quot;<br>              }<br>            },<br>            &quot;TextTransformations&quot;: [<br>              {<br>                &quot;Priority&quot;: 0,<br>                &quot;Type&quot;: &quot;LOWERCASE&quot;<br>              }<br>            ],<br>            &quot;PositionalConstraint&quot;: &quot;CONTAINS&quot;<br>          }<br>        }<br>      ]<br>    }<br>  }<br>}</pre><p><strong>5. Implement Token-Based Authentication:</strong></p><ul><li>Create a Lambda function for token generation and validation.</li><li>Add a WAF rule to check for valid tokens:</li></ul><pre>{<br>  &quot;Name&quot;: &quot;ValidateToken&quot;,<br>  &quot;Priority&quot;: 40,<br>  &quot;Action&quot;: {<br>    &quot;Block&quot;: {}<br>  },<br>  &quot;Statement&quot;: {<br>    &quot;ByteMatchStatement&quot;: {<br>      &quot;SearchString&quot;: &quot;valid_token&quot;,<br>      &quot;FieldToMatch&quot;: {<br>        &quot;SingleHeader&quot;: {<br>          &quot;Name&quot;: &quot;X-Auth-Token&quot;<br>        }<br>      },<br>      &quot;TextTransformations&quot;: [<br>        {<br>          &quot;Priority&quot;: 0,<br>          &quot;Type&quot;: &quot;NONE&quot;<br>        }<br>      ],<br>      &quot;PositionalConstraint&quot;: &quot;EXACTLY&quot;<br>    }<br>  }<br>}</pre><p><strong>6. CAPTCHA Implementation:</strong></p><ul><li>Set up a CAPTCHA service and create a Lambda function for validation.</li><li>Add a rule to trigger CAPTCHA for suspicious requests:</li></ul><pre>{<br>  &quot;Name&quot;: &quot;TriggerCaptcha&quot;,<br>  &quot;Priority&quot;: 50,<br>  &quot;Action&quot;: {<br>    &quot;Challenge&quot;: {}<br>  },<br>  &quot;Statement&quot;: {<br>    &quot;AndStatement&quot;: {<br>      &quot;Statements&quot;: [<br>        {<br>          &quot;RateBasedStatement&quot;: {<br>            &quot;Limit&quot;: 100,<br>            &quot;AggregateKeyType&quot;: &quot;IP&quot;<br>          }<br>        },<br>        {<br>          &quot;ByteMatchStatement&quot;: {<br>            &quot;SearchString&quot;: &quot;/sensitive-data&quot;,<br>            &quot;FieldToMatch&quot;: {<br>              &quot;UriPath&quot;: {}<br>            },<br>            &quot;TextTransformations&quot;: [<br>              {<br>                &quot;Priority&quot;: 0,<br>                &quot;Type&quot;: &quot;NONE&quot;<br>              }<br>            ],<br>            &quot;PositionalConstraint&quot;: &quot;STARTS_WITH&quot;<br>          }<br>        }<br>      ]<br>    }<br>  }<br>}</pre><p><strong>7. Geolocation-Based Rules:</strong></p><ul><li>Implement rules based on the geographic origin of requests:</li></ul><pre>{<br>  &quot;Name&quot;: &quot;GeoBlockHighRiskCountries&quot;,<br>  &quot;Priority&quot;: 60,<br>  &quot;Action&quot;: {<br>    &quot;Block&quot;: {}<br>  },<br>  &quot;Statement&quot;: {<br>    &quot;GeoMatchStatement&quot;: {<br>      &quot;CountryCodes&quot;: [&quot;CN&quot;, &quot;RU&quot;]<br>    }<br>  }<br>}</pre><h4>Advanced Considerations:</h4><ul><li>Implement dynamic rule updates using AWS Lambda to adapt to new threats.</li><li>Integrate machine learning models with Amazon SageMaker for sophisticated bot detection.</li><li>Combine WAF with other AWS services like Shield for DDoS protection and CloudFront for edge computing capabilities.</li><li>Continuously monitor and tune your defenses by regularly reviewing WAF logs and metrics.</li></ul><h4>Conclusion</h4><p>The battle against advanced web scraping is ongoing and complex. As scraping techniques evolve, so must our defense strategies. By understanding the sophisticated methods employed by modern bots and implementing protection measures like those offered by AWS WAF, we can significantly mitigate the risks posed by malicious automated traffic.</p><p>Remember, this is not a set-it-and-forget-it solution. Adequate protection requires continuous monitoring, analysis, and adaptation. Stay informed about emerging threats, regularly review your security logs, and be prepared to adjust your defenses as new evasion techniques emerge.</p><p>Combining technical knowledge with vigilant practices can create a more secure and reliable digital ecosystem. This will ensure that our online resources remain accessible to legitimate users while thwarting the efforts of malicious bots.</p><p>Lastly, the conversation doesn’t end here. What’s your experience with WAFs? Have you implemented one in your organization? What challenges or successes have you encountered?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0def9eadec7b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rules of Engagement: The Art of Crafting Effective WAF Rules]]></title>
            <link>https://medium.com/@ammar.osman.ali/rules-of-engagement-crafting-and-deploying-effective-waf-rules-7cc0cf047811?source=rss-48f0bb9f17b7------2</link>
            <guid isPermaLink="false">https://medium.com/p/7cc0cf047811</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[application-development]]></category>
            <dc:creator><![CDATA[Ammar Alim]]></dc:creator>
            <pubDate>Sun, 01 Oct 2023 22:17:40 GMT</pubDate>
            <atom:updated>2024-01-01T02:14:29.067Z</atom:updated>
            <content:encoded><![CDATA[<h3>Mastering AWS WAF Rules</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Thti277kC11izbBranAQUA.png" /></figure><blockquote>“The only truly secure system is one that is powered off, cast in a block of concrete, and sealed in a lead-lined room with armed guards.” — Kevin Mitnick.</blockquote><p>In the ceaseless flow of web traffic, discerning genuine requests from malicious ones is akin to finding a needle in a digital haystack.</p><blockquote>At the heart of this challenge lie Web Application Firewall (WAF) rules, the precise set of criteria that determine the acceptance or rejection of incoming web requests.</blockquote><blockquote>While WAFs serve as the gatekeepers, it’s their rules that truly dictate the narrative of web security. These rules, however, are not static entities; they evolve, adapt, and are fine-tuned to counter the ever-shifting landscape of cyber threats.</blockquote><p>This article explores the intricacies of WAF rules, highlighting their significance as an additional layer of defense and emphasizing that they operate best when complemented by robust coding practices and other security measures. Join me as we navigate the labyrinth of WAF rules, exploring their creation and optimization in the face of modern web threats.</p><p>While this article discusses the defensive capabilities of AWS WAF, the principles and strategies discussed apply to various web application firewalls. It&#39;s about something other than the specific tool you use but understanding the threats and deploying the proper defenses.</p><p>With that out of the way, let&#39;s explore the world of web attacks and the protective measures you can take, irrespective of your WAF vendor.</p><h3>How WAF rules work:</h3><p>WAF rules are the linchpin of any Web Application Firewall, providing the criteria by which traffic is filtered and managed. They represent a dynamic and adaptable defense mechanism that offers a robust protective layer against a wide array of web-based threats when properly configured and maintained. However, as with all security measures, they are most effective with other security practices and strategies.</p><h3>1. Points of Inspection:</h3><p>WAF rules inspect various parts of a web request, including:</p><ul><li><strong>Headers</strong>: Information about the request, such as <strong>User-Agent</strong>, <strong>Referer</strong>, and <strong>Host</strong>.</li><li><strong>HTTP Methods</strong>: GET, POST, PUT, DELETE, etc.</li><li>URI: The part of the request that identifies the resource, like /<strong>login</strong> or /<strong>products</strong>.</li><li><strong>Query Strings</strong>: The part of the URL that comes after the <strong>?</strong>, often containing parameters.</li><li><strong>Post Data</strong>: Data sent in the body of POST requests, often containing <strong>form submissions</strong> or <strong>JSON payloads.</strong></li><li><strong>Cookies</strong>: Small pieces of data stored on the user&#39;s computer by the web browser.</li></ul><h4>2. Rule Criteria:</h4><p>Rules are defined based on specific patterns or criteria. They can:</p><ul><li>Match <strong>string patterns</strong>, like detecting DROP TABLE (indicative of <strong>SQL injection</strong>).</li><li>Look for <strong>anomalies</strong>, such as substantial<strong> request sizes</strong>.</li><li>Check for the <strong>presence</strong> or <strong>absence</strong> of specific <strong>headers</strong>.</li><li>Use <strong>regular</strong> <strong>expressions</strong> to match complex patterns.</li><li><strong>Rate-based rules</strong> to prevent <strong>DDoS</strong> or <strong>brute-force</strong> attacks by limiting requests from a single IP.</li></ul><h4>3. Rule Actions:</h4><p>Once a rule criterion is met, the WAF takes a predefined action:</p><ul><li><strong>Allow</strong>: Let the request pass through.</li><li><strong>Block</strong>: Stop the request from reaching the application.</li><li><strong>Count</strong>: Tally the match but don&#39;t block or allow (useful for monitoring or testing new rules).</li><li><strong>Log</strong>: Record the request details for further analysis.</li></ul><h4>4. Rule Prioritization:</h4><p>Multiple rules can be active at once, so WAFs employ a <strong>prioritization</strong> <strong>system</strong>:</p><ul><li>Rules are processed in order, typically from <strong>highest</strong> to <strong>lowest</strong> <strong>priority</strong>.</li><li>Once a rule matches, the corresponding action is taken, and subsequent rules (with lower priority) might not be evaluated.</li></ul><h4>5. Anomaly Scoring:</h4><p>Some advanced WAFs use a scoring system:</p><ul><li>Each rule violation adds <strong>points</strong> to an overall <strong>anomaly score</strong> for a request.</li><li>The request is considered <strong>malicious</strong> and <strong>blocked if the score exceeds a threshold</strong>.</li></ul><h4>6. Updates and Adaptation:</h4><p>Cyber threats are constantly evolving. As such:</p><ul><li>WAF rules are frequently <strong>updated</strong> to address <strong>new</strong> <strong>vulnerabilities</strong> and <strong>attack</strong> <strong>vectors</strong>.</li><li><strong>Custom</strong> <strong>rules</strong> can be crafted based on specific threats or patterns observed in web traffic.</li></ul><h4>7. Challenges and False Positives:</h4><p>One of the challenges with WAF rules is avoiding false positives:</p><ul><li><strong>Overly</strong> <strong>aggressive</strong> rules might block <strong>legitimate</strong> traffic.</li><li>Careful tuning and monitoring are required to balance <strong>security</strong> and <strong>usability</strong>.</li></ul><h3>Rules by Example</h3><h3>1. Phishing</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Cu6_ArF3xyThX4E1rXwIA.png" /></figure><p>Phishing is a cyber-attack where adversaries deceive users into revealing sensitive information, typically through fraudulent emails or websites. These attacks can lead to severe consequences, including financial losses and data breaches.</p><h4>Code Example</h4><p>Consider a fraudulent email claiming to be from a bank:</p><pre>&lt;html&gt;<br>    &lt;body&gt;<br>        &lt;p&gt;Dear user,&lt;/p&gt;<br>        &lt;p&gt;Your bank account needs verification. Click &lt;a href=&quot;http://fakebank.com/verify&quot;&gt;here&lt;/a&gt; to verify your account.&lt;/p&gt;<br>        &lt;p&gt;Regards,&lt;br&gt;Bank Support&lt;/p&gt;<br>    &lt;/body&gt;<br>&lt;/html&gt;</pre><p><em>Users who click the link might be taken to a fake website to capture their login credentials.</em></p><h4>Mitigation with AWS WAF</h4><p>AWS WAF can be configured to block requests from known malicious IP addresses or URLs associated with phishing campaigns. By employing threat intelligence feeds or third-party integrations, AWS WAF can automatically update its rules to protect against emerging phishing threats.</p><p>Sample WAF Rule:</p><pre>{<br>    &quot;Name&quot;: &quot;BlockKnownPhishingURLs&quot;,<br>    &quot;Priority&quot;: 1,<br>    &quot;Statement&quot;: {<br>        &quot;ByteMatchStatement&quot;: {<br>            &quot;FieldToMatch&quot;: {<br>                &quot;Type&quot;: &quot;URI&quot;<br>            },<br>            &quot;SearchString&quot;: &quot;fakebank.com&quot;,<br>            &quot;TextTransformations&quot;: [<br>                {<br>                    &quot;Type&quot;: &quot;NONE&quot;,<br>                    &quot;Priority&quot;: 0<br>                }<br>            ]<br>        }<br>    },<br>    &quot;Action&quot;: {<br>        &quot;Block&quot;: {}<br>    },<br>    &quot;VisibilityConfig&quot;: {<br>        &quot;SampledRequestsEnabled&quot;: true,<br>        &quot;CloudWatchMetricsEnabled&quot;: true,<br>        &quot;MetricName&quot;: &quot;BlockKnownPhishingURLs&quot;<br>    }<br>}</pre><p><em>This rule will block requests containing the URL &quot;fakebank.com&quot; in the URI.</em></p><h3>2. Cross-site Scripting (XSS)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fM4XvsK6ZgdQUG-saGax5Q.png" /></figure><p>Cross-site scripting, commonly called XSS, is an injection attack where malicious scripts are embedded into web pages viewed by end users. These scripts can bypass access controls and perform actions on behalf of an authenticated user, potentially leading to data theft, session hijacking, or defacement of web pages.</p><h4>Code Example</h4><p>Consider a web application that allows users to post comments. If the application fails to sanitize user input, an attacker might post a comment like:</p><pre>&lt;script&gt;alert(&#39;XSS Attack!&#39;);&lt;/script&gt;</pre><p>The embedded script would execute when other users view this comment, displaying an alert box. This is a simple example, but in practice, XSS attacks can be much more malicious, stealing session cookies or redirecting users to fraudulent sites.</p><h4>Mitigation with AWS WAF</h4><p>AWS WAF can detect and block common XSS attack patterns by examining the content of HTTP requests. While developers must sanitize user input at the application level, AWS WAF is an additional layer of protection against oversight or zero-day vulnerabilities.</p><p>Sample WAF Rule:</p><pre>{<br>    &quot;Name&quot;: &quot;BlockXSSPatterns&quot;,<br>    &quot;Priority&quot;: 2,<br>    &quot;Statement&quot;: {<br>        &quot;RegexPatternSetReferenceStatement&quot;: {<br>            &quot;ARN&quot;: &quot;arn:aws:wafv2:region:account-id:regional/resourcetype/resource-id&quot;,<br>            &quot;FieldToMatch&quot;: {<br>                &quot;Type&quot;: &quot;BODY&quot;<br>            },<br>            &quot;TextTransformations&quot;: [<br>                {<br>                    &quot;Type&quot;: &quot;NONE&quot;,<br>                    &quot;Priority&quot;: 0<br>                }<br>            ]<br>        }<br>    },<br>    &quot;Action&quot;: {<br>        &quot;Block&quot;: {}<br>    },<br>    &quot;VisibilityConfig&quot;: {<br>        &quot;SampledRequestsEnabled&quot;: true,<br>        &quot;CloudWatchMetricsEnabled&quot;: true,<br>        &quot;MetricName&quot;: &quot;BlockXSSPatterns&quot;<br>    }<br>}</pre><p>The rule references a regex pattern set (specified by the ARN) that contains patterns commonly associated with XSS attacks. Any request matching these patterns will be blocked.</p><h3>3. SQL Injection</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y2XZ9D4yqXNCo3ANMhybzw.png" /></figure><p>SQL Injection (SQLi) is an attack technique that exploits vulnerabilities in a web application&#39;s database layer. Attackers can insert or &quot;inject&quot; malicious SQL code into input fields, leading to unauthorized viewing of data, corrupting or deleting data, and sometimes, in specific database systems, can lead to complete system compromise.</p><h4>Code Example</h4><p>Imagine a login page that takes a username and password. If the underlying code queries the database without proper input sanitization, it might look something like this:</p><pre>query = &quot;SELECT * FROM users WHERE username=&#39;&quot; + username + &quot;&#39; AND password=&#39;&quot; + password + &quot;&#39;;&quot;</pre><p>An attacker could input the following as the username:</p><pre>&#39; OR &#39;1&#39; = &#39;1&#39; --</pre><p>This would transform the query to:</p><pre>SELECT * FROM users WHERE username=&#39;&#39; OR &#39;1&#39; = &#39;1&#39; -- &#39; AND password=&#39;&#39;;</pre><p>The -- In SQL, it is a comment, effectively negating the rest of the query. This modified query would always return true, allowing the attacker to bypass the login check.</p><h4>Mitigation with AWS WAF</h4><p>AWS WAF can be set up to detect and block common SQL injection patterns in HTTP request content. While it&#39;s vital for developers to use parameterized queries or prepared statements at the application level, AWS WAF provides an additional defense against potential vulnerabilities.</p><p>Sample WAF Rule:</p><pre>{<br>    &quot;Name&quot;: &quot;BlockSQLInjectionPatterns&quot;,<br>    &quot;Priority&quot;: 3,<br>    &quot;Statement&quot;: {<br>        &quot;SqliMatchStatement&quot;: {<br>            &quot;FieldToMatch&quot;: {<br>                &quot;Type&quot;: &quot;BODY&quot;<br>            },<br>            &quot;TextTransformations&quot;: [<br>                {<br>                    &quot;Type&quot;: &quot;URL_DECODE&quot;,<br>                    &quot;Priority&quot;: 0<br>                },<br>                {<br>                    &quot;Type&quot;: &quot;HTML_ENTITY_DECODE&quot;,<br>                    &quot;Priority&quot;: 1<br>                }<br>            ]<br>        }<br>    },<br>    &quot;Action&quot;: {<br>        &quot;Block&quot;: {}<br>    },<br>    &quot;VisibilityConfig&quot;: {<br>        &quot;SampledRequestsEnabled&quot;: true,<br>        &quot;CloudWatchMetricsEnabled&quot;: true,<br>        &quot;MetricName&quot;: &quot;BlockSQLInjectionPatterns&quot;<br>    }<br>}</pre><p><em>This rule uses AWS WAF&#39;s built-in SQL injection match condition to inspect the body of HTTP requests for SQL injection patterns. Requests that match these patterns are blocked.</em></p><h3>4. Cross-Site Request Forgery (CSRF)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*11BOtfh1vzAIDVrIInQ9mg.png" /></figure><p>Cross-Site Request Forgery (CSRF) is an attack that tricks a victim into executing unwanted actions without their knowledge or consent on a web application in which they are authenticated. This can lead to unexpected actions such as changing account settings, purchasing, or compromising the entire account.</p><h4>Code Example</h4><p>Imagine a web application where users can change their email by submitting a form to changeEmail.php. The form might look like:</p><pre>&lt;form action=&quot;changeEmail.php&quot; method=&quot;post&quot;&gt;<br>    New Email: &lt;input type=&quot;text&quot; name=&quot;newEmail&quot;&gt;<br>    &lt;input type=&quot;submit&quot; value=&quot;Change Email&quot;&gt;<br>&lt;/form&gt;</pre><p><em>An attacker could create a malicious site with a form that is automatically submitted to </em><em>changeEmail.php When visited:</em></p><pre>&lt;form action=&quot;http://vulnerablewebsite.com/changeEmail.php&quot; method=&quot;post&quot; id=&quot;maliciousForm&quot;&gt;<br>    &lt;input type=&quot;hidden&quot; name=&quot;newEmail&quot; value=&quot;attacker@example.com&quot;&gt;<br>&lt;/form&gt;<br>&lt;script&gt;<br>    document.getElementById(&quot;maliciousForm&quot;).submit();<br>&lt;/script&gt;</pre><p><em>If a user who is logged into </em><em>vulnerablewebsite.com Visiting the attacker&#39;s site, the form would automatically submit, potentially changing the user&#39;s email without their consent.</em></p><h4>Mitigation with AWS WAF</h4><p>To defend against CSRF attacks, applications should use anti-CSRF tokens, unique codes checked with each state-changing request. AWS WAF can be configured to inspect requests for the presence of these tokens and block requests that lack them.</p><p>Sample WAF Rule:</p><pre>{<br>    &quot;Name&quot;: &quot;RequireCSRFToken&quot;,<br>    &quot;Priority&quot;: 4,<br>    &quot;Statement&quot;: {<br>        &quot;NotStatement&quot;: {<br>            &quot;Statement&quot;: {<br>                &quot;ByteMatchStatement&quot;: {<br>                    &quot;FieldToMatch&quot;: {<br>                        &quot;Type&quot;: &quot;HEADER&quot;,<br>                        &quot;Data&quot;: &quot;X-CSRF-Token&quot;<br>                    },<br>                    &quot;SearchString&quot;: &quot;EXPECTED_TOKEN_VALUE&quot;,<br>                    &quot;TextTransformations&quot;: [<br>                        {<br>                            &quot;Type&quot;: &quot;NONE&quot;,<br>                            &quot;Priority&quot;: 0<br>                        }<br>                    ]<br>                }<br>            }<br>        }<br>    },<br>    &quot;Action&quot;: {<br>        &quot;Block&quot;: {}<br>    },<br>    &quot;VisibilityConfig&quot;: {<br>        &quot;SampledRequestsEnabled&quot;: true,<br>        &quot;CloudWatchMetricsEnabled&quot;: true,<br>        &quot;MetricName&quot;: &quot;RequireCSRFToken&quot;<br>    }<br>}</pre><p>This rule checks for the presence of a X-CSRF-Token header and blocks requests that don&#39;t have the expected token value. Note that the actual token value (EXPECTED_TOKEN_VALUE) would change frequently, so this is just a conceptual example. The rule might be integrated with your application logic to validate dynamic CSRF tokens in a real-world scenario.</p><h3>5. Buffer Overflow</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gHIvflQ6oGxPgvNgmYeHeg.png" /></figure><p>Buffer Overflow is a type of vulnerability where an application writes more data to a buffer (like an array or a string) than it can hold. This can lead to unexpected behavior, including the potential for executing arbitrary code or crashing the application. Buffer overflows are especially critical in systems programming and can lead to complete system compromise.</p><h4>Code Example</h4><p>Consider a simple C program that takes user input and copies it into a fixed-size buffer:</p><pre>#include &lt;stdio.h&gt;<br>#include &lt;string.h&gt;<br>int main() {<br>    char buffer[50];<br>    <br>    printf(&quot;Enter your input: &quot;);<br>    gets(buffer);  // Vulnerable function!<br>    <br>    printf(&quot;You entered: %s\n&quot;, buffer);<br>    return 0;<br>}</pre><p>The gets The function used here doesn&#39;t check the input&#39;s size against the buffer&#39;s size. A user entering more than 50 characters will overflow the buffer, potentially overwriting other parts of the program&#39;s memory.</p><h4>Mitigation with AWS WAF</h4><p>While AWS WAF is primarily designed to defend against web-based attacks, it can help mitigate specific buffer overflow attack vectors that exploit web applications. For example, a web application vulnerable to buffer overflow attacks due to large HTTP headers or extensive payloads can be protected using AWS WAF by setting size limits.</p><p>Sample WAF Rule:</p><pre>{<br>    &quot;Name&quot;: &quot;LimitRequestBodySize&quot;,<br>    &quot;Priority&quot;: 5,<br>    &quot;Statement&quot;: {<br>        &quot;SizeConstraintStatement&quot;: {<br>            &quot;FieldToMatch&quot;: {<br>                &quot;Type&quot;: &quot;BODY&quot;<br>            },<br>            &quot;ComparisonOperator&quot;: &quot;LE&quot;,<br>            &quot;Size&quot;: 1000,  // Limit to 1000 bytes<br>            &quot;TextTransformations&quot;: [<br>                {<br>                    &quot;Type&quot;: &quot;NONE&quot;,<br>                    &quot;Priority&quot;: 0<br>                }<br>            ]<br>        }<br>    },<br>    &quot;Action&quot;: {<br>        &quot;Block&quot;: {}<br>    },<br>    &quot;VisibilityConfig&quot;: {<br>        &quot;SampledRequestsEnabled&quot;: true,<br>        &quot;CloudWatchMetricsEnabled&quot;: true,<br>        &quot;MetricName&quot;: &quot;LimitRequestBodySize&quot;<br>    }<br>}</pre><p>This rule restricts the size of the request body to 1000 bytes, blocking any request that exceeds this limit. This can help protect against buffer overflow attacks that rely on sending large payloads to vulnerable web applications.</p><h3>6. Directory Traversal</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vDEIcTl5haicc8SqIIXxMg.png" /></figure><p>Directory Traversal, or path traversal, involves exploiting insufficient security validation/sanitization of user-supplied input file names. Attackers exploit this vulnerability to access files and directories stored outside the intended folder, often aiming to access sensitive information.</p><h4>Code Example</h4><p>A web application may allow users to view files via a URL parameter:</p><pre>http://example.com/view?file=report.txt</pre><p>An attacker can exploit this by changing the file Parameter:</p><pre>http://example.com/view?file=../../etc/passwd</pre><p>This could expose sensitive system files.</p><h4>Mitigation with AWS WAF</h4><p>AWS WAF can be set up to detect and block patterns that resemble directory traversal attempts.</p><p>Sample WAF Rule:</p><pre>{<br>    &quot;Name&quot;: &quot;BlockDirectoryTraversalPatterns&quot;,<br>    &quot;Priority&quot;: 6,<br>    &quot;Statement&quot;: {<br>        &quot;ByteMatchStatement&quot;: {<br>            &quot;FieldToMatch&quot;: {<br>                &quot;Type&quot;: &quot;QUERY_STRING&quot;<br>            },<br>            &quot;SearchString&quot;: &quot;../&quot;,<br>            &quot;TextTransformations&quot;: [<br>                {<br>                    &quot;Type&quot;: &quot;URL_DECODE&quot;,<br>                    &quot;Priority&quot;: 0<br>                }<br>            ]<br>        }<br>    },<br>    &quot;Action&quot;: {<br>        &quot;Block&quot;: {}<br>    },<br>    &quot;VisibilityConfig&quot;: {<br>        &quot;SampledRequestsEnabled&quot;: true,<br>        &quot;CloudWatchMetricsEnabled&quot;: true,<br>        &quot;MetricName&quot;: &quot;BlockDirectoryTraversalPatterns&quot;<br>    }<br>}</pre><p>This rule inspects the query string of HTTP requests for patterns associated with directory traversal (../) and block matching requests.</p><h3>7. Server-Side Request Forgery (SSRF)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P3rBjodDKVsoPTzK_gY7FQ.png" /></figure><p>Server-side request Forgery (SSRF) is an attack where the attacker can abuse functionality on the server to read or update internal resources, often targeting internal systems that are not generally accessible from the external network.</p><h4>Code Example</h4><p>Consider a web application that fetches images from a URL provided by the user:</p><pre>http://example.com/loadImage?url=http://external.com/image.jpg</pre><p>An attacker could exploit this to make requests to internal resources:</p><pre>http://example.com/loadImage?url=http://internal-database-server/</pre><h4>Mitigation with AWS WAF</h4><p>AWS WAF can be set up to detect and block patterns that resemble SSRF attempts, particularly by inspecting URLs for internal IP address patterns or domain names.</p><p>Sample WAF Rule:</p><pre>{<br>    &quot;Name&quot;: &quot;BlockSSRFPatterns&quot;,<br>    &quot;Priority&quot;: 8,<br>    &quot;Statement&quot;: {<br>        &quot;ByteMatchStatement&quot;: {<br>            &quot;FieldToMatch&quot;: {<br>                &quot;Type&quot;: &quot;URI&quot;<br>            },<br>            &quot;SearchString&quot;: &quot;internal-database-server&quot;,<br>            &quot;TextTransformations&quot;: [<br>                {<br>                    &quot;Type&quot;: &quot;URL_DECODE&quot;,<br>                    &quot;Priority&quot;: 0<br>                }<br>            ]<br>        }<br>    },<br>    &quot;Action&quot;: {<br>        &quot;Block&quot;: {}<br>    },<br>    &quot;VisibilityConfig&quot;: {<br>        &quot;SampledRequestsEnabled&quot;: true,<br>        &quot;CloudWatchMetricsEnabled&quot;: true,<br>        &quot;MetricName&quot;: &quot;BlockSSRFPatterns&quot;<br>    }<br>}</pre><p>This rule inspects the URI of HTTP requests for patterns associated with SSRF attempts (internal-database-server) and block matching requests.</p><h3>8. HTTP Request Smuggling</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DZpm5rD3ZMhsIdtrmWSFtw.png" /></figure><p>HTTP Request Smuggling involves sending ambiguous HTTP requests to bypass or confuse security controls, leading to various potential attacks such as cache poisoning, session hijacking, or bypassing request filters.</p><h4>Code Example</h4><p>An attacker could send a request like:</p><pre>POST / HTTP/1.1<br>Host: example.com<br>Content-Length: 13<br>Transfer-Encoding: chunked<br>Content-Length: 6<br>0<br><br>G<br>GET /admin HTTP/1.1<br>Host: example.com</pre><p>This could confuse intermediaries (like reverse proxies) and lead to the unintended exposure of the /admin endpoint.</p><h4>Mitigation with AWS WAF</h4><p>AWS WAF can be used to block requests that contain multiple content-length headers or other anomalies that are indicative of request smuggling attempts.</p><p>Sample WAF Rule:</p><pre>{<br>    &quot;Name&quot;: &quot;BlockRequestSmugglingPatterns&quot;,<br>    &quot;Priority&quot;: 9,<br>    &quot;Statement&quot;: {<br>        &quot;SizeConstraintStatement&quot;: {<br>            &quot;FieldToMatch&quot;: {<br>                &quot;Type&quot;: &quot;HEADER&quot;,<br>                &quot;Data&quot;: &quot;Content-Length&quot;<br>            },<br>            &quot;ComparisonOperator&quot;: &quot;GT&quot;,<br>            &quot;Size&quot;: 1,<br>            &quot;TextTransformations&quot;: [<br>                {<br>                    &quot;Type&quot;: &quot;NONE&quot;,<br>                    &quot;Priority&quot;: 0<br>                }<br>            ]<br>        }<br>    },<br>    &quot;Action&quot;: {<br>        &quot;Block&quot;: {}<br>    },<br>    &quot;VisibilityConfig&quot;: {<br>        &quot;SampledRequestsEnabled&quot;: true,<br>        &quot;CloudWatchMetricsEnabled&quot;: true,<br>        &quot;MetricName&quot;: &quot;BlockRequestSmugglingPatterns&quot;<br>    }<br>}</pre><p>This rule inspects the headers of HTTP requests for multiple Content-Length headers, a standard indicator of HTTP request smuggling, and blocks matching requests.</p><h3>9. Insecure Deserialization</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SZnaSkdDMmVWwOCa5dHGJQ.png" /></figure><p>Insecure Deserialization vulnerabilities arise when an application deserializes untrusted or tampered data without proper validation or sanitation. This can lead to various attacks, such as remote code execution, replay attacks, injection attacks, or privilege escalation.</p><h4>Code Example</h4><p>Consider a web application that uses serialized objects to represent user sessions. An attacker could tamper with their serialized session cookie to escalate their privileges:</p><p>Original Cookie (simplified for demonstration):</p><pre>{&quot;user&quot;: &quot;normalUser&quot;, &quot;role&quot;: &quot;user&quot;}</pre><p>Tampered Cookie:</p><pre>{&quot;user&quot;: &quot;attacker&quot;, &quot;role&quot;: &quot;admin&quot;}</pre><p>By modifying their session cookie, the attacker might grant themselves administrative privileges.</p><h4>Mitigation with AWS WAF</h4><p>AWS WAF can be configured to detect and block common patterns or payloads associated with insecure deserialization attacks.</p><p>Sample WAF Rule:</p><pre>{<br>    &quot;Name&quot;: &quot;BlockInsecureDeserializationPatterns&quot;,<br>    &quot;Priority&quot;: 10,<br>    &quot;Statement&quot;: {<br>        &quot;RegexPatternSetReferenceStatement&quot;: {<br>            &quot;ARN&quot;: &quot;arn:aws:wafv2:region:account-id:regional/resourcetype/resource-id&quot;,<br>            &quot;FieldToMatch&quot;: {<br>                &quot;Type&quot;: &quot;COOKIE&quot;<br>            },<br>            &quot;TextTransformations&quot;: [<br>                {<br>                    &quot;Type&quot;: &quot;URL_DECODE&quot;,<br>                    &quot;Priority&quot;: 0<br>                },<br>                {<br>                    &quot;Type&quot;: &quot;BASE64_DECODE&quot;,<br>                    &quot;Priority&quot;: 1<br>                }<br>            ]<br>        }<br>    },<br>    &quot;Action&quot;: {<br>        &quot;Block&quot;: {}<br>    },<br>    &quot;VisibilityConfig&quot;: {<br>        &quot;SampledRequestsEnabled&quot;: true,<br>        &quot;CloudWatchMetricsEnabled&quot;: true,<br>        &quot;MetricName&quot;: &quot;BlockInsecureDeserializationPatterns&quot;<br>    }<br>}</pre><p>This rule references a regex pattern set (specified by the ARN) that contains patterns commonly associated with insecure deserialization attacks. Any cookie matching these patterns will result in the request being blocked.</p><h3>10. Clickjacking</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i9UQvqudWCXCFd5jGpyrTQ.png" /></figure><p>Clickjacking is a malicious technique where an attacker tricks a user into clicking something different from what the user perceives. This is often achieved by using transparent or opaque layers to deceive the user into performing unintended actions, potentially leading to confidential information disclosure or unintended actions on websites.</p><h4>Code Example</h4><p>An attacker might embed a legitimate site within an iframe and overlay a deceptive UI:</p><pre>&lt;iframe src=&quot;http://legitimatewebsite.com&quot; style=&quot;opacity:0.5;&quot;&gt;&lt;/iframe&gt;<br>&lt;button style=&quot;position: absolute; top: 50px; left: 50px;&quot;&gt;Click me for a prize!&lt;/button&gt;</pre><p>Users might believe they are clicking the &quot;prize&quot; button, but they interact with the legitimate website within the iframe.</p><h4>Mitigation with AWS WAF</h4><p>While Clickjacking is primarily mitigated by setting the X-Frame-Options HTTP header on the server (which tells the browser not to display the site within frames), AWS WAF can be used to monitor and log such attempts, helping to identify potential attackers or malicious sites.</p><p>Note: AWS WAF doesn&#39;t directly block clickjacking attempts since the defense lies in response headers set by the web server. However, ensuring that your web server sets the appropriate headers is crucial.</p><h3>11. Bots and Scrapers</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I_7_cVnZkKFqVIrw7OEscw.png" /></figure><p>Bots and scrapers are automated scripts or software that interact with websites. While some bots, like search engine crawlers, are legitimate, others can overload systems, scrape content, submit spam, or perform other malicious actions.</p><h4>Code Example</h4><p>Bots and scrapers often exhibit recognizable behavior patterns:</p><ul><li>High request rates from a single IP address.</li><li>User agents that identify as known scrapers.</li><li>Access patterns that don&#39;t resemble human navigation.</li></ul><h4>Mitigation with AWS WAF</h4><p>AWS WAF can be configured to detect and block traffic patterns that resemble malicious bots and scrapers.</p><p>Sample WAF Rule:</p><pre>{<br>    &quot;Name&quot;: &quot;BlockSuspiciousBots&quot;,<br>    &quot;Priority&quot;: 11,<br>    &quot;Statement&quot;: {<br>        &quot;OrStatement&quot;: {<br>            &quot;Statements&quot;: [<br>                {<br>                    &quot;ByteMatchStatement&quot;: {<br>                        &quot;FieldToMatch&quot;: {<br>                            &quot;Type&quot;: &quot;USER_AGENT&quot;<br>                        },<br>                        &quot;SearchString&quot;: &quot;suspiciousBotUserAgent&quot;,<br>                        &quot;TextTransformations&quot;: [<br>                            {<br>                                &quot;Type&quot;: &quot;LOWERCASE&quot;,<br>                                &quot;Priority&quot;: 0<br>                            }<br>                        ]<br>                    }<br>                },<br>                {<br>                    &quot;RateBasedStatement&quot;: {<br>                        &quot;Limit&quot;: 100,<br>                        &quot;AggregateKeyType&quot;: &quot;IP&quot;<br>                    }<br>                }<br>            ]<br>        }<br>    },<br>    &quot;Action&quot;: {<br>        &quot;Block&quot;: {}<br>    },<br>    &quot;VisibilityConfig&quot;: {<br>        &quot;SampledRequestsEnabled&quot;: true,<br>        &quot;CloudWatchMetricsEnabled&quot;: true,<br>        &quot;MetricName&quot;: &quot;BlockSuspiciousBots&quot;<br>    }<br>}</pre><p>This rule blocks user-agent requests that match known bot patterns and IP addresses that exceed a specified request rate.</p><p><strong>Thank you!</strong> for delving into the intricacies of WAF rules with me. Understanding these rules becomes paramount in the digital age, where threats evolve rapidly. I hope this article sheds light on the importance of crafting effective WAF rules and how they fit into the broader cybersecurity landscape.</p><p>If you found this article valuable, please 👏 and consider sharing it with colleagues, peers, and fellow cybersecurity enthusiasts. By sharing knowledge, we can build a safer and more secure digital world for all. Stay curious and stay safe!</p><p><strong>Source</strong>: PortSwigger :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7cc0cf047811" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Architecting Security & Governance Across your AWS Accounts]]></title>
            <link>https://itnext.io/architecting-security-governance-across-your-aws-accounts-4ee96b14ea08?source=rss-48f0bb9f17b7------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ee96b14ea08</guid>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Ammar Alim]]></dc:creator>
            <pubDate>Sun, 01 Sep 2019 01:05:41 GMT</pubDate>
            <atom:updated>2019-09-05T06:27:41.839Z</atom:updated>
            <content:encoded><![CDATA[<h3>Architecting Security &amp; Governance Across your AWS Accounts Part 3: Data Security on AWS.</h3><figure><img alt="“Pass on what you have learned.” ~ Yoda" src="https://cdn-images-1.medium.com/max/1024/1*b6j4kJg4VoovMsxdkZCjcQ.png" /><figcaption><strong>“Pass on what you have learned.” ~ Yoda</strong></figcaption></figure><p><strong><em>NOTE!</em></strong><em>: this is</em><strong><em> Part 3</em></strong><em> of a multi-part series. For Part 1, please click</em><strong><em> </em></strong><a href="https://itnext.io/architecting-security-governance-across-your-aws-accounts-part-1-introduction-ae200624424d"><strong><em>here.</em></strong></a><strong><em> </em></strong><em>for part 2, please click </em><a href="https://itnext.io/architecting-security-governance-across-your-aws-accounts-part-2-incident-response-on-aws-44b1ee01f1ee"><strong><em>here</em></strong></a></p><blockquote><em>“Companies spend millions of dollars on firewalls, encryption and secure access devices, and it is money wasted; none of these measures address the weakest link in the security chain.” — </em>Kevin Mitnick, “The World’s Most Famous Hacker”</blockquote><p>According to the 2019 Cloud Security Report, the top cloud security concern of cybersecurity professionals is <strong><em>data loss and leakage. </em></strong>This information should not come as a surprise to any of us as there is no shortage of data breaches nowadays. Data has never been this valuable before as major corporations are willing to pay top dollar to obtain data about consumers. Even though I would love to talk about how precious our data is, we need to move on.</p><p><strong>Before we start, let’s discuss why we even need to encrypt our data in the cloud (What people in the industry say about this?):</strong></p><blockquote>1- Compliance: You need to meet a compliance requirement, i.e., PCI-DSS</blockquote><blockquote>2- You’re trying to protect your data from your cloud provider’s other customers</blockquote><blockquote>3- You’re trying to protect your data from your cloud provider</blockquote><blockquote>4- It’s a security best practice</blockquote><p><strong>Let’s translate the above:</strong></p><blockquote>~ We need to minimize unauthorized physical access to data</blockquote><blockquote>~ We need to reduce unauthorized logical access to sensitive data</blockquote><blockquote>~ We need to achieve data integrity, confidentiality, and availability (CIA)</blockquote><p>Certainty, we can’t cover all aspects of data security in an article or two as it a colossal information security domain, books were written about this subject. This post is written equip you as a security or cloud engineer with the knowledge necessary to effectively implement data security in AWS.</p><p>Aspirations for this post are to answer questions I had a few years ago when I started to work with AWS trying to understand how encryption and data security works. I remember asking myself questions of this kind; “ if I encrypted an EBS volume today and attached to an EC2 instance in a few months. How would this EC2 instance know about encryption keys used to encrypt the EBS volume? What about messaging services? How do they handle encryption? Does CloudHSM interact with other AWS services similar to KMS? Would KMS store my encryption keys? Would it store them in plaintext? Encryption is by no means an easy topic for me to explain. I don’t blame you if you get lost trying to understand it from me. Especially if you are new to the subject by my goal is to simplify it for you.</p><p>AWS has lots of storage offerings; this makes it very difficult for customers to understand how each service should be configured to store data securely. Data is either traveling over the wire or resting waiting for a transfer call</p><h4>Encrypt Everything:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_03pqTj1DlGyRt8V3y7hSA.png" /><figcaption><strong>Werner Vogels ~ CTO AWS</strong></figcaption></figure><p>Seriously, encrypt everything! If your business is big enough for you to move to AWS, you understand why you need to encrypt everything. For the most part, all you need to do is to check a box or make an API call to enable encryption. It doesn’t take much to get up and running with encryption on AWS. However, we need to understand how each service talks to your key management system and how each service handles data encryption. With that, let’s start by looking at an essential AWS service in my opening when it comes to data security (AWS KMS)</p><h4>AWS Key Management System</h4><blockquote>AWS Key Management Service (KMS) makes it easy for you to create and manage keys and control the use of encryption across a wide range of AWS services and in your applications. AWS KMS is a secure and resilient service that uses hardware security modules that have been validated under FIPS 140–2, or are in the process of being validated, to protect your keys. AWS KMS is integrated with AWS CloudTrail to provide you with logs of all key usage to help meet your regulatory and compliance needs.</blockquote><h4>What problem is KMS trying to solve?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YHBiXRhJdvSesQCMby94Gg.png" /><figcaption><strong>BlackVault HSM</strong></figcaption></figure><p>Let’s say you want to encrypt some data in an EBS volume, and you easily apply AES 256 encryption using OpenSSL. That means you have an encryption key that you need to secure. You double encrypt the encryption key again to be sure. However, eventually, you need the plaintext key to be able to decrypt your encryption key(s) and finally your encrypted data. Where do you store that key? in a thumb drive? You invest in some Hardware Security Module where your key can never exist in plaintext outside of this super secure HSM. Your application needs to scale up and down, generate terabytes of data, and encrypt those. How are you going to use your on-prem HMS to pass this plaintext key securely to your EBS volume? You can’t. Using KMS allows you to talk AWS managed Cloud HSM meaning KMS is nothing more than an interface for you to store those plaintext keys. Your plaintext keys are replicated in thousands of HSMs to achieve high durability as those keys should never be lost. According to the AWS keys store in HMS are the most durable piece of information AWS guarantee for its customers. So using KMS means you comply with federal regulations as your key is stored in FIPS 140–2 complaint service. You can also have your application use the API to talk to your keys securely. Moreover, you will also achieve low latency since your data sits not too far away from your keys!</p><h4>KMS at work.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4K6yuQQ_mMS230jyG4cMZA.png" /></figure><p>Let’s say you have some critical customer data stored in your data center. You want to have two copies of the data stored in AWS, a copy in Amazon S3 and the other copy in an EBS volume.</p><p>To encrypt the data in EBS and S3, you’ve decided to use KMS. Let get this done, and we will explain things as we go as I think scenario-based illustrations make sense.</p><p><strong>Step One</strong>: To use KMS, we need to create a <strong>customer master key. </strong>What is it and why it called customer master key?</p><p>A customer master key (CMK) is a logical representation of the actual cryptographic material that is used to encrypt your data encryption key. Wait, I can’t use this CMK to encrypt my data? No, you use the CMK to encrypt the data key that is used to encrypt your data.</p><p>What are the data keys and backing keys? The backing key is the actual cryptographic material doing the encryption for you fancy CMK. Backing keys are stored and secured in AWS approved hardware and use hardware security modules that have been validated under <a href="https://en.wikipedia.org/wiki/FIPS_140-2">FIPS 140–2</a>. The data key is what KMS use to encrypt and decrypt the data. Data keys are always stored encrypted with the data (as metadata). Wait, KMS does not store the data keys? No, the data keys are stored with the data in the case of S3 each object will have a unique data key, with EBS each volume would have its own data key.</p><h4>Key Points about CMK:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6T-o_N_yo4G70cd6mWLQhg.png" /><figcaption>CMK Types</figcaption></figure><p>CMK is called CMK because the “customer” manages some aspects of the key. AWS creates and manages master keys in your behalf as well that’s why there is a distinction:</p><blockquote><em>1- The customer creates the key</em></blockquote><blockquote><em>2- The customer can rotate the key annually (there is a workaround for more frequent rotation)</em></blockquote><blockquote><em>3- The customer manages access to the key (who can rotate the key, delete the key, use the key for encryption operations)</em></blockquote><blockquote>4- You storage services and CMK must reside in the same region</blockquote><blockquote>5- You can’t export a CMK</blockquote><blockquote>6- If you delete the CMK you won’t be able to read data you encrypted using the deleted CMK (Use IAM/SCP to dent CMK deletion!)</blockquote><blockquote>7- CMK pricing is per key and usage</blockquote><blockquote>8- You can use OpenSSL to create your own cryptographic material (backing key) and then upload it to as you backing key for your CMK</blockquote><blockquote>9- Some AWS storage services can generate data keys for you</blockquote><p>Let’s go get a new shiny CMK to encrypt our data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gdhQRvLpttVFrBp2-MsHXA.png" /><figcaption>Creating CMK</figcaption></figure><p>We also need an Alias, CMK alias is nothing more than a pointed to your CMK. When you create a CMK AWS returns a CMK Id that you can reference when making use of the CMK.</p><p>Great use for the CMK alias is to leverage it to rotate your CMK keys more frequently.</p><p>Let’s say you have a compliance requirement were you need to rotate a KMS CMK key every three months. Since AWS only allows you to rotate the key every 12 months automatically. We can rotate the key by deleting it. However, remember if you delete the key, you won’t be able to read the data encrypted using the deleted key. CMK alias to the rescue. When you create your first CMK key, make sure you also create an alias for it by using the following command:</p><pre>aws kms create-alias --target-key-id ca52d1a0-af36-4ab6-95b6-567fbf837e17 --alias-name &quot;alias/Part3&quot; --region us-east-1 --profile default</pre><p>When it’s time to rotate the key create a new CMK and point your alias to the new CMK Id. Keep in mind that the CMK alias should be hardcode in your applications for them to be able to decrypt data. Moving forward, KMS would use the newly created CMK Id/old alias to process exiting data keys.</p><p>Let’s create a bucket and upload a file to it and then explain how AWS went about applying encryption to the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yksIOcDu-YccTWDMTXc6Rg.png" /><figcaption>New bucket with part3 KMS CMK selected for encryption Object metadata shows the use of our CMK</figcaption></figure><p>As you can see, we didn’t have to worry about data key generation all we had to do is to tell our bucket which CMK should be used.</p><p><strong>The Envelope Encryption:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q57xUy3m3-FDaW7PP7SBTQ.png" /><figcaption><strong>Envelope Encryption</strong></figcaption></figure><p><em>Whenever we upload an object to our S3 bucket, a new encryption (data) key is generated by AWS and used to encrypt the object before it’s stored to disk.</em></p><p><em>Having the object stored encrypted means it would be computationally infeasible for an attacker in possession of the raw object is stored on disk to decrypt it anyone in possession of that key could decrypt it, so the data keys have to be stored securely, and in a relatively useless form, and that cloud be achieved by encrypting the data keys with the CMK.</em></p><p><em>To decrypt the object, you need to have the unique data key for that object, but even if you have it, it can’t be used to decrypt the data since it’s also been encrypted by the CMK.</em></p><p><em>To decrypt the data key, or at least have it used on your behalf, you have to have the customer master key or have a trust relationship with an entity that controls the customer master key and can use it on your behalf.</em></p><p><em>The data keys are tiny in size as KMS only support symmetric encryption where a single key is used to encrypt and decrypt the data. Data keys are only a few tens of bytes each, which is why the CMK isn’t used to encrypt large objects, but just the tiny data keys. When the customer master key is rotated, the object-specific encryption (data) keys are decrypted with the old backing key and re-encrypted with the new backing key. The new data versions are stored, and the old versions are discarded.</em></p><p><em>Since the data keys are small in size, when we rotate a CMK AWS isn’t taxed heavily. AWS has to only work with the small data keys instead of astronomical objects using the data keys.</em></p><blockquote>Several analogies could be drawn to an apartment complex, where keys are stored in a common lockbox, where changing the lockbox lock would restrict future access to individual apartments by restricting access to the individual apartment keys by restricting access to the common lockbox. The analogy breaks down because physical keys are easily copied, among other reasons… but it’s apparent, in this illustration, that changing the lockbox lock (relatively simple operation) would be unrelated to changing the lock on one or more apartments (a much more substantial operation).</blockquote><blockquote>The bottom line, in this scenario, they create a new secret key to encrypt/decrypt each object you upload, then store that secret key in an encrypted form… periodically, and transparently to you, they change their stored representation of that secret key as a preventative measure. ~ <strong>Michael — sqlbot </strong><a href="https://medium.com/u/d53dd768d047"><strong>Stack Overflow</strong></a></blockquote><h4>Deeper Dive:</h4><p>Let’s simulate the above by playing the role of an S3 bucket request data keys to encrypt and decrypt a text file. Hopefully, this process helps us understand how things work behind the scene.</p><p>1- Generating the data keys; this step takes place when we upload an object to s3. AWS generates a plain text key for us to use for encrypting the data and CiphertextBlob that we would use to decrypt the data. The CiphertextBlob is stored with the object as metadata in the case of S3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RDX7uWG0UM3ANTZoy6hV-A.png" /><figcaption>Notice we referred to the alias instead of the Id</figcaption></figure><p>We need to keep track of the CiphertextBlob and the plaintext for later operations.</p><p>I am saving those in separate files:</p><pre>CiphertextBlob_base64_datakey.txt<br>Plaintext_base64_datakey.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CI-nuDeohsEshD2gHgE3rg.png" /><figcaption>saving the plaintext and its encrypted version</figcaption></figure><p>Let’s decoded the Plaintext_base64_datakey.txt file as KMS expect us to decode base64 encoded files. Finally, let’s encrypt some data using OpenSSL and the decoded plaintext key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s1eyRDxxCP1zT-VZb8m5PQ.png" /><figcaption>encrypting data</figcaption></figure><p>The decoded and base64 plaintext data keys have done their jobs help us encrypt our secret now it’s time for us to get rid of them! We don’t need them anymore. As the encrypted version (CiphertextBlob) has all the required information if we ever needed to decrypt the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KA11Q-0mpU59qJgj-qZcRg.png" /><figcaption>Removing plaintext keys</figcaption></figure><h4>Reversing the about (No screenshots this time ):</h4><p>To decrypt the encrypted file using KMS we need to run the following commands</p><p>1- Decode the base64 CiphertextBlob_base64_datakey.txt file:</p><pre>cat CiphertextBlob_base64_datakey.txt | base64 --decode  &gt; CiphertextBlob_decoded_datakey.txt</pre><p>2- Ask KMS to decrypt your cipher-blob:</p><pre>aws kms decrypt --ciphertext-blob CiphertextBlob_decoded_datakey.txt --region us-east-1 --profile default</pre><p>This command should return the required plaintext to decrypt the data. We will first same it in a file and then encoded it and finally run the following command with the encoded file against our encrypted data file as follow:</p><pre>cat my_super_important_secret.txt | openssl enc -d -aes256 -k plaintext_decode.txt</pre><p>This command should return “Architecting Security &amp; Governance Across your AWS Accounts” which we saved in our cat my_super_important_secret.txt file</p><h4>KMS Access Policies:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xIyHVSUibXQ9eht6pLARWw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@milkovi?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">MILKOVÍ</a> on <a href="https://unsplash.com/search/photos/secure?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Accidentally or maliciously deleting a CMK cloud be more dangerous than not using it to encrypt data keys in the first places. Unfortunately, you can’t recover the key or read the encrypted data ever again.</p><p>There are two methods for managing the security of KMS keys. You can have your security team create those keys in your AWS security account and then share them with development accounts. This approach reduces the stress that comes with not knowing where those keys are created, managed, etc. My preferred method is to allow developers to create those keys in their dev accounts, which will help you be more granular with key access management. You can always have a service control policy that prevents users from deleting those keys.</p><p>This technique also limits the blast radius as only users in that account should be able to access KMS keys. However, you can always use key policies only to allow few individual access to KMS keys. Overall, I like to see keys sit closer to the data as it reduces complexities when developers need to troubleshoot issues around data and encryption keys.</p><p>For managing your KMS key policies, I think you should look at <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html">AWS documentation</a> as I think it does a great job</p><p>Since our KMS discussion above covered lots of ground when it comes to encrypting data at rest. Let’s close the loop by quickly summarizing how AWS can help you with encrypted data traveling over the wire.</p><h4>AWS Data in Transport Security</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fSDuXk-I2wMZ-WehH93zUw.png" /><figcaption><strong>AWS Snowmobile</strong></figcaption></figure><p>This means ensuring data is encrypted and secured when traveling between internal and external endpoints. Data should be encrypted using protocols such as TLS, IPsec, and MACsec with keys that you control.</p><p><strong>Network Layer Encryption:</strong></p><p>Today, AWS has three different options for customers to encrypt traffic within virtual private clouds. The following screenshot stolen from AWS documentation summarizes those offerings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*PmdLu0l_b26rnggnlyRqwg.png" /><figcaption>VPC traffic encryption (Layer 4)</figcaption></figure><p>Keep in mind that AWS has recently announced that all traffic between endpoints within your VPC is encrypted by default, way to go AWS.</p><p><strong>Web Layer Encryption:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6-F6MEfMfh9KvQwPQuAiPA.png" /></figure><p>AWS has this incredible service called ACM (AWS Certificate Manager) that help you provision and push private and public certificates to your cloud resources. ACM would also manage the rotation of those certifications, and you can also bring you encryption keys similar to KMS.</p><p>ACM is trying to solve some of the following two problems:</p><p><strong>1- Provisioning TLS certificates for use with public-facing AWS Cloud resources:</strong></p><blockquote>~ ALB/NLB</blockquote><blockquote>~ Amazon CloudFront</blockquote><blockquote>~ Amazon API Gateway</blockquote><p><strong>2- Handling the painful part of PKI:</strong></p><blockquote>~ Key pair and cets signing request generation and distribution</blockquote><blockquote>~ Encryption and secure storage of private keys</blockquote><blockquote>~ Managed renewal and development of certs</blockquote><p>You can import your own certificates or use ACM when using the following services:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*GEXVZ3zf2YxI_f_DpO064A.png" /><figcaption>TLS Endpoints (HTTPS)</figcaption></figure><h4>Thanks for the valuable time :) Please let us know if you like to see more content about AWS Cloud Security or if you can help me improve the content.</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ee96b14ea08" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/architecting-security-governance-across-your-aws-accounts-4ee96b14ea08">Architecting Security &amp; Governance Across your AWS Accounts</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What’s in Your Bucket?]]></title>
            <link>https://itnext.io/whats-in-your-bucket-36ecaa4e0df5?source=rss-48f0bb9f17b7------2</link>
            <guid isPermaLink="false">https://medium.com/p/36ecaa4e0df5</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[capital-one]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[netflix]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Ammar Alim]]></dc:creator>
            <pubDate>Sun, 04 Aug 2019 22:42:39 GMT</pubDate>
            <atom:updated>2019-08-07T18:53:13.126Z</atom:updated>
            <content:encoded><![CDATA[<h4>An in-depth look into the nontechnical and technical side of Capital One breach. Why did it happen? How can we avoid a data breach of this magnitude?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s_tPzyCSV2J47wiGTqjppQ.png" /><figcaption>What’s in Your Bucket?</figcaption></figure><p><strong><em>Disclaimer:</em></strong><em> The views and opinions expressed in this article are those of mine and do not necessarily reflect any other person or organization. The assumptions made in this article are based on the data provided in the following </em><a href="https://regmedia.co.uk/2019/07/29/capital_one_paige_thompson.pdf"><em>court document</em></a><em>.</em></p><p><a href="https://techcrunch.com/2019/07/29/capital-one-hacked-over-100-million-customers-affected/">Capital One breach</a> has compromised the credit card application information for customers who applied for Capital One credit cards starting in 2005 to the day of the breach. Roughly 100 million individuals in the US and another six million Canadians. The compromised data was stored in an Amazon Web Services (AWS) S3 bucket. If your data was compromised, don’t hope for anything more than a credit monitoring as free credit monitoring is what we got from Equifax. At this point, customers aren’t wondering if their information isn’t out there, but they are wondering what isn’t out there about their financial records.</p><p>Capital One and GitHub have been sued this week as part of a class-action lawsuit filed in California on allegations of failing to secure or prevent a security breach.</p><p>Congress wants Capital One and Amazon to explain data breach they want to get answers on how this happened from both Capital One and Amazon. Let’s see how the fingerpointing game is going to pan out.</p><p>If you think this blog is about pointing the fingers of blame towards Capital One, you are reading the wrong blog, but I am certainly blaming someone. Even though I believe Capital One should take full responsibility for this breach as the investigation confirms that a security misconfiguration (firewall) had to lead to the breach.</p><p>I still think the enterprise as a whole share most of those technical weaknesses. You and I could very well be next victim to such attack. If you don’t believe me go and audit your AWS cloud infrastructure. Look for open security groups/NACLs, overly permissive IAM/resource policies or publically available buckets, don’t worry about unpatched servers or unencrypted data. I know you do, so keep on reading.</p><p>Capital One admitted that it’s a misconfigured firewall, but what about that IAM Role which gave the attacker that keys to the kingdom? I don’t think it is as simple as a bad firewall or permissive security policy. I know this is what the attacker exploited and maybe enough for an official statement for the public, but I think there is more to it than just that.</p><p>I am here to discuss a challenge our industry faces today.</p><p>Security professionals try to examine security incidents of this size, we like to learn about what the victim could’ve done right, and about the vulnerabilities the attacker exploited. The inside knowledge could help the security community better prepare to defend against security threats, fix misconfigurations, and patch vulnerabilities that would expose our infrastructure to similar attacks. Since we still don’t have an official statement from Capital One, and I doubt that would happen. It’s up to us to connect the dots based on the information found in the court document and other reports, so let’s do that.</p><p>Last Tuesday, the day after the news came out, I had a cup of coffee with a few friends in downtown Seattle. After a casual meetup about the future of AS-Code systems, one of my new security buddies asked this question; “why did Capital One Cloud Custodian fail to Protected Capital One Customers Data?” — This question was for me to answer, because as I tend to advocate for the tool more than I should. I said to my self; fair enough. If you recommend a technology, you should be able to report on its benefits, weaknesses. I think it is an excellent tool for any cloud security team. I didn’t know much about the AWS resources that the attacker was able to exploit based on the information I had then. I know a misconfigured firewall was comprised first. I didn’t know if that firewall was a security group, AWS Web Application Firewall (WAF)in front of their ELBs, or a third-party Web Application Firewall (open source/Commercial ). Based on the investigation, the IAM role that is attached to the compromised EC2 instance leads me to think the firewall in question was indeed a third party. WAF as IAM roles can’t be “attached” directly to AWS managed WAF.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rknRlXbv1gwr-jAVQGCV0Q.png" /><figcaption>Typic ModSecurity Deployment</figcaption></figure><p>Luckily on Friday, a report by Krebs revealed that the compromised resource was a misconfigured open-source <a href="https://en.wikipedia.org/wiki/ModSecurity">Web Application </a>Firewall (<a href="https://en.wikipedia.org/wiki/ModSecurity"><strong>ModSecurity</strong></a>). I looked at the technical detail to answer the question, but I asked myself, “Is it really about the tooling?”. Are we even going to gain anything if we determined whether cloud custodian cloud has a policy that could prevent this attack or not? The right question could’ve: “how could a company as technically progressive as Capital One, trusted with millions of personal financial records not get the basic stuff right.?”</p><p><em>“In everything we do at Capital One, we always start from what our customers need and work back from there to figure out how to give it to them. The most important benefit of working with AWS is that we don’t have to worry about building and operating the infrastructure necessary to do that and can instead focus our time, money, and energy on creating great experiences for our customers.” ~</em><strong><em> George Brady. Executive Vice President and Chief Technology Officer, Capital One</em></strong></p><p>I will come back to this quote!</p><h4>Let’s cut to the chase</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EWzw3TjKFUTOTr9BqH56Mg.png" /></figure><p>Those of you who are active in the Cloud space know very well that Capital One is a leader when it comes to Cloud Adoption. Capital One had openly talked about their cloud-first strategy in numerous cloud events. You can easily find more about this online by reading Capital One AWS case study. Capital One is behind an excellent cloud security tool (<a href="https://cloudcustodian.io/">Cloud Custodian</a>). Hundreds of cloud professionals use the tool to implement guardrails that enhance security and also help control cost on AWS. I can also tell you, Capital One employes very talented security professionals in the world today period, as I know some of them. Years back, when I was starting my cloud career, I applied to a cloud position with Capital One. I passed all their numeric and other reasoning exams. I took a couple of weeks to prepare for the interview, and I also had three AWS certification under my belt, going to the job interview. I still didn’t get the job and that the only job I didn’t get in the last seven years. In short, Capital One does not hire anyone they have bright people running their cloud ship. They just hired <a href="https://medium.com/netflix-techblog/netflix-information-security-preventing-credential-compromise-in-aws-41b112c15179">Will Bengtson</a> a former Netflix engineer as a director of cloud security. Will knows how to secure cloud infrastructure @Netfix scale and has had writing a blog about SSRF for Netflix long before this breach. On paper Capital, One poses the weapons needed in its Arsenal to stop such attacks.</p><p>So what is the deal!? They have strong cloud competency, tooling, talented security professionals, and still got hacked? Let’s go back to that romantic quote by Mr. <strong><em>George Brady </em></strong><em>as I think it’s where all of it starts.</em></p><h4>It’s Complicated</h4><p>Executives and decision-makers are very excited about offloading some of their operational overhead to their public cloud provider, and that includes some of the security operations as well. AWS explicitly callout their shared responsibility model where they identify the areas that we the customers need own. The shared responsibility model boils down to the fact that whatever cloud services we use; we will always own the responsibility of securing our data. If you need to know more about the shared responsibility model, please check my <a href="https://itnext.io/architecting-security-governance-across-your-aws-accounts-part-1-introduction-ae200624424d">Architecting Security &amp; Governance Across your AWS Accounts blog</a>. There I explain this concept in more details.</p><p>If you re-read the quote by <strong><em>George Brady</em></strong>, you won’t capture his excitement about security. He shows apparent excitement about how moving to AWS help them focus on the customers. That doesn’t mean he doesn’t care about security, but it reinforces I believe that I have about our industry. Executives don’t care all that much about security as they care about reducing time to market and continuously improving the numbers. They will tell you otherwise, but the reality paints a different picture. That means there is a lot of pressure on developers to deliver. I’ve been very close to customers in previous roles. Customers usually don’t care very much about security as they do care about enhancing current features and relacing new functionalities. That dictates what executives need to focus on and decision-based on pressure from customers also influences what developers need to worry about and more often than not, security.</p><p>Customers want more widgets and gadgets to click on, but they only care about its security when their an incident occurs. Technology executives are busy worrying about making the company more money, which makes sense at this is what they are hired to do. The problem is, we don’t see much action when it comes to supporting security programs that could help prevent disastrous damage to the company.</p><p>Per Capital One, the attacker gained access leveraging a misconfigured firewall. This statement points to the <em>security professionals who</em> should be responsible for securing the infrastructure; it does not scream “executives” or developers back at you. Not that I am blaming developers as I know how hard is it to keep up with the demand and also have good security practices implemented.</p><p>Executives want developers to deliver fast; I also believe they want to avoid breaches. I think they aren’t walking the walk when it comes to bridging the gap between developments and security operations. Developers are in charge of building those services on cloud infrastructure, migrating, and maintaining on-prem workloads, which makes it difficult for them to give security the deserved attention.</p><p>Security professionals are left fighting losing battles as they don’t get the support need from technology leaders.</p><p>This problem is apparent enterprise-wide, and it won’t go away anytime soon.</p><p>Usually, after an annual security audit, a roadmap of a software development team gets modified to accommodate the security findings that need fixing. We rarely see any security items in the backload or active sprints</p><p>Until we celebrate developers who deliberately act to improve the security posture, condiment lack of security hygiene, positive change won’t come about.</p><p>Security professionals are forced to create and manage all kind of exceptions. We have let an insecure build go to production because we don’t have the power to stop it. We keep a vulnerable infrastructure as is because securing it would mean the developers have to do more (unnecessary) work to make their application work. If you’ve been a security professional for a couple of years, I know you can relate.</p><p>If you’ve read my previous blogs, I am a big advocate of simplifying security processes to accommodate the business.</p><p>Heavy security processes and documentation isn’t the answer. The answer is close collaboration between security and development. Codify security policies, so no one has to find them, read them, and apply their content. Security and operations should build enabling platforms for developers to move reliable and secure code to production smoothly. A healthy security program won’t happen without the support of your CTO and technology leadership; it won’t work without developers buy-in.</p><h4>Key points for technology leaders</h4><p>Your employees may not talk about this so take it from me:</p><p>1- Start by understanding your security landscape; what data do you have? Who wants it? How valuable is it? What can you do to secure it? What would happen if you lose it?</p><p>2- It’s not about your tools; they are useless if your security team can use them to enforce security policies.</p><p>3- It’s not about your talented security team; they can’t add value without full support to fight the never-ending security challenges.</p><p>4- It’s not all about the immediate profit that could be made, a single breach means losing millions of dollars and a reputational damage</p><p>5- Establish a healthy security culture where everyone is held accountable for securing all the things. Everyone is celebrated when they implement security as much as they would get praised when they release a new service</p><p>6- Hire professionals who can tell a security story and transform your organization’s security culture by encouraging organization-wide collaboration.</p><p>7- Simplify security by codifying your security policies and commit them to the same Git repo that host your application code</p><h3>The technical side</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ee7smFd8rnVYeonNHQiTOg.png" /></figure><p>Even though the investigation doesn’t provide enough details from a technical standpoint. Security engineers had concluded that an overly permissive IAM role policy, which was attached to the compromised server was used to access the s3 bucket(s) containing the data.</p><p><strong>Steps:</strong></p><p>1- Attacker compromised an EC2 instance behind a misconfigured Web Application Firewall.</p><p>2- The compromised server has access to lots of buckets (terrible practice)</p><p>3- An smart attacker won’t extract the role credentials from the metadata service and make API calls (if the AWS CLI is installed) with those credentials. (that would trigger an AWS Guard Duty alert if it’s enabled) instead, just the attacker would run that command directly from the compromised EC2 and boom they have access and can run <em>s3 sync.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1OFlNy3QX3XAUL6M9f9oLQ.png" /><figcaption>The worst * you can have is a one behind an s3 resource.</figcaption></figure><p>I am not saying the above figure is the exact setup, but it’s pretty damn close considering what the attacker was able to accomplish.</p><p><strong>Simple things that could’ve prevented this attack</strong></p><p>1- <strong>Least privilege:</strong> Why give EC2 instance access to lots of buckets IAM allows us to craft fine-grained policies so you can give your code access just that single bucket or prefix. <strong><em>Not sure why that server needed to</em></strong><a href="https://aws.amazon.com/blogs/security/writing-iam-policies-how-to-grant-access-to-an-amazon-s3-bucket/"><strong><em> list all buckets</em></strong></a><strong><em>!?</em></strong></p><p>2- <strong>Healthy security groups/firewall: </strong>Your security group or firewall should never allow inbound traffic from 0.0.0.0/0 to a server that has direct access to sensitive data.</p><p>3- <strong>Monitoring: </strong>Capital One admitted that their log shows that the server in question was having a pleasant conversation with <a href="https://hackertarget.com/tor-exit-node-visualization/">a Tor exit node</a>. Who is looking at that stuff? I know GurdDuty alerts when detecting such events.</p><p>Only those simple measures could’ve prevented this breach? Yes, I said that!</p><h4>Can I automate the above? Yes. Please use Capital One Cloud Custodian!</h4><p>1- Write a Cloud Custodian policy which creates an AWS Config rule that flags over permissive policies.</p><p>2- Use Cloud Custodian to create a policy that responds to the following GurdDuty finding: “<strong>Credentials that were created exclusively for an EC2 instance through an instance launch role are being used from an external IP address.”</strong></p><p>3- Write a Cloud Custodian policy that reacts to events which indicates communication with Tor exit nodes.</p><p><strong>Finally:</strong></p><p>I really hope to see Capital One come out to educate the community about this event, share knowledge, and to never stop their cloud-first strategy. This event could’ve happened to the best of us and all we can do to fight similar security challenges is to build robust collective community knowledge.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36ecaa4e0df5" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/whats-in-your-bucket-36ecaa4e0df5">What’s in Your Bucket?</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Architecting Security & Governance Across your AWS Accounts Part 2: Incident Response on AWS.]]></title>
            <link>https://itnext.io/architecting-security-governance-across-your-aws-accounts-part-2-incident-response-on-aws-44b1ee01f1ee?source=rss-48f0bb9f17b7------2</link>
            <guid isPermaLink="false">https://medium.com/p/44b1ee01f1ee</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Ammar Alim]]></dc:creator>
            <pubDate>Mon, 11 Mar 2019 18:57:58 GMT</pubDate>
            <atom:updated>2024-01-01T02:11:35.779Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0vivIu4ZtQY2KHwOTI1R4w.png" /></figure><p><strong><em>NOTE</em></strong><em>: This is Part 2 of a multi-part series. For Part 1, please click</em><strong><em> </em></strong><a href="https://itnext.io/architecting-security-governance-across-your-aws-accounts-part-1-introduction-ae200624424d"><strong><em>here.</em></strong></a></p><p>This is part two of the &quot;Architecting Security &amp; Governance Across your AWS Accounts.&quot; series. In this part, we will navigate the narrow alleys of incident response planning on the AWS cloud and implement fun automated incident response activities using Cloud Custodian.</p><p><em>&quot;It takes 20 years to build a reputation and a few minutes of cyber-incident to ruin it,&quot; </em><strong><em>Stephane Nappo said.</em></strong></p><blockquote>According to <a href="https://www.nist.gov/"><strong>NIST</strong></a>, a security incident is <em>“An occurrence that actually or potentially jeopardizes the confidentiality, integrity, or availability of an information system or the information the system processes, stores, or transmits or that constitutes a violation or imminent threat of violation of security policies, security procedures, or acceptable use policies.”</em></blockquote><p>Well, that&#39;s a mouthful; let&#39;s simplify it. An incident is an unintended degradation of your IT services.</p><p>In this part, we will look at the processes, AWS services, and tactics you need to easily navigate the foggy nights of security breaches.</p><p>There are plenty of incident response frameworks that explain what you need to implement for an effective incident response team, playbook, and automation around your processes.</p><h3>Let&#39;s start by talking about incident response phases and the attack surface on AWS, then try recruiting AWS Lambda to our incident response team to assist when things go wrong; I hope we can afford Lambda&#39;s salary :)</h3><h3>Incident response phases in the Cloud (NIST)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*gn_hpSxP9ysbJaLcxjJTzQ.png" /><figcaption>Ref: NIST SP 800–53, Revision 4</figcaption></figure><p>Regarding responding to security events, the phases have mostly stayed the same in the Cloud compared to traditional data centers. Still, the technical implementation did change drastically for the better. Let&#39;s explore the phases.</p><p><strong>The Seven Incident response phases of a highly effective runbook</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F9ebtavsmXpLzEEsDkpAZQ.png" /></figure><h3>1- The Preparation Phase:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qo_PIECfexofmi8tu33CTA.png" /><figcaption><strong>Preparation Phase</strong></figcaption></figure><p>This phase is all about, well, you guessed it, preparations. We need to prepare by getting our threat modeling done, shrinking the attack surface, and taking proactive measures to prevent security incidents from occurring in the first place. We must enable <strong><em>logging</em></strong>, <strong><em>monitoring</em></strong>, and <strong><em>encryption</em></strong> and <strong>limit</strong> the<strong> <em>blast radius</em></strong>.</p><h4>Prepare by applying proactive measures:</h4><p><em>1- </em><strong><em>Data classification</em></strong><em>: Identify data sensitivity level, owners, and security requirements.</em></p><p><em>2- </em><strong><em>Ownership</em></strong><em>: All resources should be tagged; it&#39;s nice to know who owns a set of compromised resources; the minor owners can offer you information about the sensitivity level of the data stored in resources or configuration that might have led to the compromise. Hint: We should always tag our resources!</em></p><p>3- <strong><em>Risk Management</em></strong>: <em>Identify threats, risks, and vulnerabilities, figure out your risk appetite, and then manage your risks and vulnerabilities according to the level of risk you&#39;re willing to tolerate.</em></p><p><em>4-</em><strong><em> Resilience: </em></strong><em>Architect highly available, fault-tolerant infrastructure.Hint: Use the AWS well-architect tool and read the well-architect white paper.</em></p><p>5- <strong><em>Principle of least privilege</em></strong>:<em> Use AWS IAM and resource policies to grant only </em><strong><em>limited access</em></strong><em> to those who need to access data or operate on your environment.</em></p><p>6- <strong><em>Test (Game days): </em></strong><em>Test</em><strong><em> </em></strong><em>your incident response plan. You will likely find shortcomings you can address before a real security incident occurs.</em></p><h4>Prepare by Logging everything:</h4><p>There is no excuse for not enabling CloudTrail and other logging services on all accounts and regions. You won&#39;t have the forensics to tell what happened to your assets in the event of a breach.</p><p>When you enable CloudTrail, any AWS service you touch will record actions taken against them in Cloudtrail, which can also be integrated with CloudWatch and logs and stored in a centralized <strong>s3 bucket</strong>.</p><p>CloudWatch events can be consumed by <strong>AWS Lambda</strong> for real-time remediation and by <strong>SNS</strong> for real-time notification. It does not matter if you use the SDK, console, or the AWS CLI. All actions will be recorded. Any action you take against AWS resources can be used against you :) I know this one is bad, but I promise not to do it again. However, please remember to enable ClouTrail log file validation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kNrJ1YkkW4SSjwwfZ87k1A.png" /><figcaption><strong>CloudTrail WorkFlow</strong></figcaption></figure><h4>Prepare by Limiting the Blast Radius</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*bYlFccrrNhH30sVOQRMqxw.png" /><figcaption>Blast Radius</figcaption></figure><p>Use AWS Organizations and VPC, subnet NACLs, EC2 security groups, etc., to limit the blast radius by isolating AWS accounts and resources based on business units, products, etc.</p><p>Combined with principles like in-depth defense, this approach can provide excellent protection against threats.</p><h4>Prepare by Encrypting Everything:</h4><blockquote>Data privacy professionals would tell you, “treat your data as if everyone is looking at it all the time becasue they might be.”</blockquote><p>Encryption is the process of masking data by using an encryption algorithm and an encryption key. If a robust encrypting algorithm is used, bad actors won&#39;t be able to read your data as plaintext if they were able to intercept it in transit or access it at rest.</p><p>AWS gives you options to encrypt your data, including but not limited to KMS.</p><p>AWS KMS and other services that encrypt your data directly use a method called <strong><em>envelope</em></strong> encryption to provide a balance between performance and security. See below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*EHoYYlvFbb1JimDNDFc1kA.png" /><figcaption><strong>Server Side Encryption</strong></figcaption></figure><h3>2- The Identification Phase:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jmq6uLn59rfloqXZ80c8ag.png" /><figcaption><strong>The Identification Phase</strong></figcaption></figure><p>Compromise indicators are many, such as an AWS GuardDuty high severity alert that your EC2 instance is making outbound calls to a domain associated with bitcoin mining or not preferably a production service going down.</p><p>The identification phase is where we discover an incident is realized. The best way to implement the identification phase is by setting up alerts for all security findings that you deem critical, such as AWS root account logins.</p><p><strong>Here are some of the questions you need to answer in the event you realize that an incident has occurred:</strong></p><p><em>1-</em><strong><em> Why: </em></strong><em>Knowing the intentions behind the breach can help you identify the products and resources in scope and the nature of the attack.</em></p><p><em>2- </em><strong><em>What: </em></strong><em>Identify the lost data and damaged resources and </em><strong><em>what</em></strong><em> effort and resources you need to clean up, isolate, and mitigate.</em></p><p><em>3- </em><strong><em>How: </em></strong><em>Determine weaknesses they leveraged to gain unauthorized access to your system.</em></p><p><em>4- </em><strong><em>When: </em></strong><em>Make sure you keep track of all the events</em></p><p><em>5- </em><strong><em>Who: </em></strong><em>Who</em><strong><em> </em></strong><em>is the bad actor?</em></p><p>Relying on humans is a bad practice when identifying security issues, as we are better than machines regarding correlating outliers and anomalies. Automated incident response using AWS services is the way to go. You can also take advantage of this by applying machine learning and security analytics.</p><h3>3- The Containment Phase:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UdCGsXd4xtiuqMCAmbpQJw.png" /><figcaption>The Containment Phase:</figcaption></figure><p>You&#39;ve been through all the tedious identification steps. Now what? This phase involves removing the security threat.</p><p>We should have a Cloudformation or a Terraform template with all the resources needed to build an isolated environment for forensics investigation. Some of these actions we need to take are:</p><p><em>1- Move your AWS account to an organizational unit with restricted AWS organization service control policies.</em></p><p><em>2- Deny access should be applied to s3 buckets</em></p><p><em>3- Restricted security groups so they only allow ports designated for the investigation.</em></p><p><em>4- A global DENY * IAM policy should be attached to all entities that aren&#39;t involved with this phase</em></p><p>Automation should be deployed to stop compromised resources, snapshot volumes, turn off KMS encryption keys, and change Route53 recordsets.</p><h3>4- The Investigation Phase:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Brd4XDqJgDYbkQE3BZ_KBg.png" /><figcaption>The Investigation Phase</figcaption></figure><p>The investigation phase involves activities that follow the containment phase, including but not limited to forensics and general log analysis. The investigation phase should reveal when the event occurred, what actions the bad actors took to gain access to our system, the side effects of the breach, and the possibility of this breach happening again based on evidence collected so far. The investigations should occur in an isolated environment, as stated before.</p><h4>Services you can use:</h4><p><em>1- VPC Flow Logs.</em></p><p><em>2- CloudTrail.</em></p><p><em>3- CloudWatch.</em></p><p><em>4- Athena for analyzing logs.</em></p><h3>5- The Eradication Phase:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gtqtHIMSmpZGu415UySBXA.png" /><figcaption>The Eradication Phase</figcaption></figure><p>This phase involves the careful handling of affected resources. We delete resources if necessary and move healthy and clean resources to more secure environments.</p><p>Encrypted data should be undecipherable by attackers, which means we can perform some of the following:</p><p>1- Disable or delete KMS keys</p><p>2- Delete spilled files from EBS volumes and move the clean data to new encrypted EBS volumes</p><p>3- Delete encrypted s3 objects that are encrypted by s3 server-side encryption</p><p>4- Delete encrypted s3 objects and the encryption CMKs for s3 objects that are encrypted with KMS or customer keys</p><p>If the data wasn&#39;t encrypted, your only option is to restore your storage resource from a last known good state that you can guarantee it wasn&#39;t tampered with.</p><h3>6- The Recovery Phase:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5ctSy4rkoHJPQuVRnwGvUg.png" /><figcaption>The Recovery Phase</figcaption></figure><p>Now we have done everything to identify what has happened and data cleansing was performed to the best of our abilities, we need to restore our operations to normal.</p><p>Some of the actions we can perform at this stage:</p><p>1- Restore resources.</p><p>2- Restore network connectivity.</p><p>3- Use new and improved access control policies and encryption keys.</p><p>4- Monitor your environment for any unusual behaviors.</p><h3>7- The Follow-up Phase:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G8F_CmUtpaFSJZdFecVVmA.png" /><figcaption>The Follow-up Phase</figcaption></figure><p>The follow-up phase, aka post-mortem, is about the lessons learned and the follow-up activities that need to be implemented to avoid new security incidents and make improvements to our incident runbook.</p><h3>Automation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oz_s65ZBOpC0-HZRTPcSJw.png" /><figcaption>AWS GuardDuty Automation workflow</figcaption></figure><p>If you have made it so far, thank you! Let&#39;s get our hands dirty and review a use case that should drive home the ideas we&#39;ve discussed thus far. Ultimately, having a solid plan isn&#39;t enough if you don&#39;t walk the walk.</p><p><strong>For this activity, we need the following:</strong></p><p>1- An isolated AWS environment. <strong>Please do not use your production environments; this activity can take resources down.</strong></p><p>2- On the <strong>isolated</strong> AWS environment, <strong>AWS GuardDuty</strong> must be enabled to generate findings that CloudWatch events and AWS Lambda would consume.</p><p>3- An EC2 instance ( t2.micro) to generate some security findings; we can open all ports or something along those lines.</p><p>4- We will set up <a href="https://github.com/cloud-custodian/cloud-custodian"><strong>Cloud Custodian</strong></a> so it deploys the serverless components needed for this activity.</p><p><strong><em>Note</em></strong><em> — you must deploy Cloud Custodian to the region where GuardDuty is enabled.</em></p><p>This solution is straightforward: when our Cloud Custodian policy detects a medium/high severity finding generated by AWS GuardDuty, it should take action against the resource in scope.</p><p><strong>What actions <em>Custodian is going to take </em>against the compromised EC2 instance:</strong></p><p><em>1- Remove the IAM role attached to the EC2 instance.</em></p><p><em>2- Stop the EC2 instance.</em></p><p><em>3- Snapshot the volume for forensics investigations.</em></p><p>Let&#39;s start by installing Cloud Custodian and write our first policy. In your terminal, run the below commands to install CC:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qlw9-rtKbUQTweM6W88JoQ.png" /><figcaption>Install Cloud Custodian</figcaption></figure><p>Then, create a file named custodian.yml With the below content:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*iN-enDgjo3vEviTRB8_Vgw.png" /><figcaption>Your first policy</figcaption></figure><p>All this policy does is stop any EC2 instances that have a tag key &quot;Custodian.&quot;</p><p>Running your first policy:</p><p>I am assuming you&#39;re using profiles to access your AWS accounts via the CLI; if not, you can look up how you authenticate Custodian using API keys or custodians assume role command; if you are using a profile, below is how you can run the policy locally using an AWS CLI profile, meaning this policy won&#39;t run based on an event generated by CloudTrail or on a predefined schedule.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_gJU0mRaKi4ll6mCNjUQIg.png" /></figure><p>If successful, you should see output similar to the following on the command line:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rFoLN6so0MC5Oe-jOEH1_w.png" /></figure><p>Now you are a Cloud Custodian expert who can automate security on AWS, let&#39;s get our actual policy out there!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*jxKx8py33ZKsAobQPIlr7Q.png" /><figcaption>The real deal</figcaption></figure><p>Follow the steps provided for your first policy: write the policy, save it, deploy it to an <strong>isolated </strong>AWS environment, and watch the magic. If GuardDuty generates findings, the policy Lambda will consume the generated event and react by taking the abovementioned actions.</p><p><strong>Alright! That&#39;s it for the incident response part!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*OjgRZyi4DYALntZ9YFDtUA.png" /></figure><p><strong>Thank you for spending your valuable time! If you would like to see more of this, please </strong>👏 <strong><em>so others can see it</em></strong>, <strong>and most importantly, share your experience in the comments for the community.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44b1ee01f1ee" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/architecting-security-governance-across-your-aws-accounts-part-2-incident-response-on-aws-44b1ee01f1ee">Architecting Security &amp; Governance Across your AWS Accounts Part 2: Incident Response on AWS.</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Architecting Security & Governance Across your AWS Accounts part 1: Introduction]]></title>
            <link>https://itnext.io/architecting-security-governance-across-your-aws-accounts-part-1-introduction-ae200624424d?source=rss-48f0bb9f17b7------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae200624424d</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[governance]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[autmation]]></category>
            <dc:creator><![CDATA[Ammar Alim]]></dc:creator>
            <pubDate>Thu, 07 Mar 2019 19:04:26 GMT</pubDate>
            <atom:updated>2024-01-01T01:46:46.150Z</atom:updated>
            <content:encoded><![CDATA[<h3>Maximizing AWS Security: Transforming Cloud Strategies for Agile Success — Part 1</h3><h4>Part 1: Introduction.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uzjBLkr7KHRAUxC5GJk69Q.png" /></figure><p><strong><em>NOTE</em></strong><em>: — this is Part 1of a multi-part series. For Part 2, please click </em><a href="https://medium.com/@ammar.osman.ali/architecting-security-governance-across-your-aws-accounts-part-2-incident-response-on-aws-44b1ee01f1ee"><strong><em>here.</em></strong></a></p><p><em>&quot;Security will forever be our top priority,&quot; said</em> Werner Vogels, VP &amp; CTO of Amazon.</p><blockquote><strong>Agility, cost, autonomy, and faster time to market is why most customers moved their on prem workloads to the cloud — Let’s figure out how we can move security to the left ← and align it to those software development principles — Security shouldn’t become the bottleneck, You can use the cloud to secure workloads on the cloud.</strong></blockquote><h3>Target Audience</h3><p>If you&#39;ve been working with AWS Cloud for a few years, you can relate to the points I am trying to get across in this post. Please share your experiences with a broader audience. If you&#39;re about to start your journey, this is an excellent place to start, as I will summarize some of the practices I&#39;ve learned over the years.</p><p>I assume you have been working with AWS for at least a year. Therefore, I will only explain AWS services mentioned in this post in detail in this part of the series. I will highlight strategies you should implement for better security architecture. Other parts of the series will shed some light on the implementations.</p><p>During the last two years, I spent a great deal of time working with my team and other cloud professionals via the many open source platforms in attempts to improve security practices on the AWS Cloud. While it sounds simple on paper, achieving it at production scale is a very challenging task, there is a need to collaborate across various teams and very diverse sets of technology stacks.</p><p>Don&#39;t worry; we&#39;ll cover all the nitty-gritty on this and upcoming posts. You will learn from our mistakes and leverage our wins. Importantly, share your experiences with us.</p><p>With that out of the way. Let&#39;s roll the DevOps way!</p><h3>The Culture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*k6Tt7HcA8Y_hUT11dc96Hg.png" /><figcaption><a href="https://www.oreilly.com/ideas/ironic-oreilly">Eliminate the cycle of blame</a></figcaption></figure><p>Before we get to discuss security implementations on AWS, let&#39;s start with us (security folks), our culture, our processes, and the mindset.</p><p><em>&quot;Collectively, we have failed our customers,&quot; said Pat Gelsinger, chief</em> executive officer of VMWare.</p><p>Pat couldn&#39;t be more right about us, security teams. For years, we&#39;ve focused on threats instead of building security capabilities. Instead of preventing threats, in the first place, security teams spend the majority of their time reacting to threats.</p><p>We should discuss implementations that shrink the attack surface and prevention mechanisms. Complexity, slowness, and inter-team conflicts destroyed lots of organizations. Only when you apply simplicity to your processes, a more collaborative spirit to your culture, and solid security principles backed by data to your decision-making engine can you see things moving in the right direction. I also agree with the voices that say security teams are underfunded and always have to fight for the &quot;best bang for the buck.&quot; that makes us wiser!</p><p>Our teams must be challenged to work together to achieve organizational security goals; in the end, security should be everyone&#39;s job. The less time we spend blaming each other, the easier it is for us to collaborate effectively.</p><h3>The Shared Responsibility Model</h3><p>I can tell you&#39;re wondering where to start. You&#39;re trying to catch up with application teams releasing new features or bug fixes daily and have much to worry about. I know it&#39;s tempting to jump to the cool stuff and start enforcing policies via automation or other means, but understanding your responsibilities as a customer is where you need to start, so start with the shared responsibility model because you are going to avoid lots of rookie mistakes in the long run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*m4PdTpL-LOIZ-TfOaTD3cA.png" /><figcaption><a href="https://aws.amazon.com/compliance/shared-responsibility-model/"><strong>AWS Shared Responsibility Model</strong></a></figcaption></figure><p>Depending on your choice of AWS compute service (EC2, ECS/EKS, lambda, etc) or public Cloud model (IaaS, PaaS, or SaaS) your responsibility as a customer could change radically. Still, we won&#39;t cover that in detail in this post because this can be an article on its own.</p><p>At a high level, though, you should be very <strong><em>anxious</em></strong> about securing your data as you can&#39;t offload this responsibility to AWS; it&#39;s your obligation no matter what AWS services you use or the public cloud model you adopt.</p><p>The more you move toward serverless, the less you worry about patch management and OS-level security hardening nightmares.</p><p>The same goes for your public cloud model; the more you move toward SaaS, the less you have to worry about infrastructure security. Please note, that I am not advocating for SaaS, I am just stating facts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e7E7SwipI_6rYfDRA2EpXQ.png" /><figcaption>Public Cloud Models</figcaption></figure><h3>The Multi Account Model</h3><p>After understanding your security responsibilities as a customer, it&#39;s time to think about implementing governance at scale. One of the significant lessons early adopters learned is that deploying your applications on a single AWS account is a dangerous practice as it complicates your cloud management processes from a security and cost management standpoint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5zrnzBUuVzgnI5gq9S44CA.png" /><figcaption>AWS Accounts Architecture</figcaption></figure><p>I will let you decide how to architect your accounts, but the diagram above illustrates a familiar pattern.</p><p>You need a sandbox account for your developers to try new cool things and formal Dev, pre-Prod, and Prod accounts for each product. Have a logging account where you aggregate all your CloudTrail logs, Config rules, S3 access logs, and other security-related data that auditors may need access to in case of a breach.</p><p>You also need a management account to enforce policies on your other accounts. Try to delegate billing to a billing-admin account instead of using your master account. Use the master account to apply organization service control policies on your linked accounts.</p><p>Resource tagging is a huge issue, and cost control is one of the significant problems the enterprise faces today. Again, multi-account model to the rescue; since you have deployed each product on a separate AWS account, you know that the &quot;product team&quot; can eat the entire bill, and you shouldn&#39;t worry too much about their tagging shortcomings even though I believe tagging is essential for many other reasons.</p><p>Many AWS customers who use a single account for all their applications experience the pain of increasing service limits. You have many engineers competing for limited resources (s3 buckets, computer resources, and others). AWS has some hard limits that they can&#39;t increase for you.</p><p>My all-time favorite benefit of the multi-account model is its limited blast radius. I can ensure Dev Team A does not have access to Dev Team B&#39;s accounts so they keep their stuff intact. I can also sleep at night knowing that if my cat&#39;s image processing product on AWS account 120 were to get breached, my other products on the other AWS accounts wouldn&#39;t be impacted. I think you now see the benefits of using this model :) And it does not cost you more money! AWS accounts are free until you start using resources.</p><h3>Cloud Enablement</h3><p>Make sure you do whatever it takes not to block your developers for no good reason. It takes work to balance allowing developers to move fast and ensuring your environments are secure. Start by making sure your developers know that you are not there to be the blocker but rather the enabler.</p><p>Establish an agreed-upon security baseline that needs to be on each account for your business to comply with industry-specific regulations.<br>Anatomy and velocity are essential to your business as much as security so make sure you align your security practices to your business so both work together in harmony, this is easy said than done as it takes lots of evangelism, understanding of your products and infrastructure in addition to all your compliance requirements.</p><h3>Automation &amp; Policy as Code (PaC)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7skcXiEMDiHQ_EmiQBmooQ.png" /><figcaption><a href="https://www.capitalone.io/">Cloud Custodian</a></figcaption></figure><p>I don&#39;t know about you, but the idea of architecting security policies in code and having them deployed to production within minutes is very cool. You can version control your policies, know who made a lousy merge, and what the last good version was to put to good use.</p><p>Remember when developers had to wait five weeks for you to approve that firewall request? Well, those days are gone. Developers can now create security group rules in a few seconds and open port 22 to the world in less than that.</p><p>Developers never cared about your tedious documentation filled with outdated security policies; they never read them and will never do so, even if you spent your valuable time updating them.</p><p>So what should you do? If you&#39;re considering automating your security policies, you should pat yourself on the shoulder. To keep up with speed, the cloud provides your business security policies, which need to be as elastic as your infrastructure. It would be best to move as fast or slow as your application teams.</p><p>There are many ways to define policies on AWS, AWS organization&#39;s service control policies, IAM policies, and service-specific policies such as KMS keys and bucket policies.</p><p>Automation enables that flexibility, and codifying your policy is incredible since you can treat your security policies as your infrastructure and application code. Policies can be checked in git, revised, improved, refactored, and looked at by multiple people, and everything that applies to the application code can be applied to your policy code.</p><p>You can use services such as Lambda and CloudWatch events or leverage open-source tools such as Cloud Custodian to help you achieve compliance via automation.</p><blockquote>The point is, automate your security controls or be prepared to lose this battle.<br>Real-time detection, notification, and remediation are very cloud and human-friendly.</blockquote><p>If one of your developers opens an s3 bucket to the world during a PRD deployment, detect that, notify them immediately that you have detected the issue and fixed it for them. If you discover security findings two weeks after that product went to production, convincing the builder to fix it would be challenging. Real-time feedback is well received as it can be acted upon immediately.</p><h3>Identity and Access Management</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hDJiftasQ9sq71v_.png" /><figcaption><a href="https://aws.amazon.com/iam/">AWS IAM</a></figcaption></figure><p>AWS IAM is the heart of AWS security. If you talk to IAM ninjas, they will tell you that getting AWS IAM right is a game changer as it is one of AWS most potent services.</p><p>AWS IAM enables you to define fine-grained policies that help you quickly set boundaries and implement least privilege principles. IAM integrates with all AWS services, even services that allow you to establish policies directly on them, such as s3 and KMS.</p><p>The key with IAM is to use roles and assume those roles instead of using API keys everywhere. Also, automate the creation of policies, groups, and roles as much as possible and have a well-defined naming conversion for your policies, roles, and groups to avoid configuration drifts. Understanding conditions and IAM actions can be tricky, but it is indispensable if you try to have a firm handle on your access policies.</p><blockquote>My advice for you is, please avoid a single AWS account model so you can avoid slicing and <em>dicing policies.</em></blockquote><h3>Data Security</h3><p>Securing data by encrypting data at rest and in transit and making sure only those who need access to the data get access to it is critical. Even though that seems straightforward, many organizations need help understanding it.</p><p>I often start my day by Googling S3 buckets data leakage and sharing my findings with people in my circle to scare everyone. I don&#39;t recall going more than a couple of days without running into that kind of news.</p><p>The lesson I learned is to classify your data early on and make sure all your data stores have owners. You should also encrypt everything and make sure all data stores are protected.</p><p>KMS is incredible as it does all the heavy lifting for you, creating master keys, data keys, and key rotation, which are all managed for you by AWS. If you want more control, you can bring and manage customer keys.</p><h3>Infrastructure Security</h3><p>As AWS handles the physical infrastructure security for you, you can focus on securing your VPC traffic and resources within the VPC. You start by creating private and public subnets using VPN or bastion hosts to access your servers. Using NACLs and Security groups to restrict traffic is a must implement best practice.</p><p>Avoid using protocols such as SSH by leveraging <strong><em>immutable infrastructure</em></strong> because it provides greater security.</p><blockquote>Don’t patch instances just rebuild a new AMI, don’t update in place, just destroy and build from a base image.</blockquote><p>Use AWS <a href="https://github.com/awslabs/git-secrets">git-secrets</a> to detect keys that are accidentally checked into git repositories. Use EC2 roles instead of API keys; remember your EC2 keypairs if that leak; rest assured, your servers will be mining Bitcoin in no time.</p><p>Suppose you are using s3 for static web hosting. In that case, I recommend fronting your bucket with a CloudFront distribution and leveraging AWS origin access identity to restrict your bucket to your distribution. This pattern hides your objects from bad actors and gives you access to security features such as AWS WAF and Shield, which can&#39;t work with s3 directly.</p><h3>Resilience</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D25Lx0jNrZ20YM0ZyQIBTg.png" /><figcaption><a href="https://netflix.github.io/chaosmonkey/">Netflix Chaos Monkey</a></figcaption></figure><p>High availability, continuity of operations, robustness and resilience, and disaster recovery are often reasons for cloud deployments with AWS. Multi-AZ and MultiRegion deployments are all patterns we need to adapt according to AWS&#39;s well-architected framework.</p><p>Tools such as the AWS Well-Architected Tool can help you deploy more <strong>resilient </strong>workloads on AWS. AWS makes it easier for you to architect for failure; most services offer high <strong>availability</strong> and <strong>durability</strong>, and others can be architected to be more <strong>resilient. </strong><em>AWS</em><strong><em> </em></strong><em>recommends that we architect with four pillars in mind; </em><strong><em>security</em></strong><em>, </em><strong><em>reliability</em></strong><em>, </em><strong><em>cost optimization</em></strong><em>, and </em><strong><em>performance</em></strong><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kVIqCE567gBtvHu5S4Nf-Q.png" /><figcaption><a href="https://aws.amazon.com/blogs/apn/the-5-pillars-of-the-aws-well-architected-framework/"><strong>AWS Four Pillars of Architecture</strong></a></figcaption></figure><p>After you finish the design and implementation phase, you can test your infrastructure by introducing <a href="https://en.wikipedia.org/wiki/Chaos_engineering"><strong>Chaos Engineering</strong></a><strong> to </strong>grow confidence in your infrastructure and define processes that can help you recover quicker in the event of a failure. You can start your tests with individual nodes and AZs or take down an entire region and see how your application copes with that.</p><h3>Logging &amp; Monitoring</h3><p>CloudTrail, Config, and VPC flow logs must be enabled and aggregated to a logging account. You should also ensure those services are enabled in each region and get notified via automation if anyone tries deactivating them.</p><p>AWS guardduty and SecurityHub should also be enabled; both offer outstanding monitoring capabilities. Passive monitoring isn&#39;t enough, and we should aim to react to security events with real-time automation.</p><h3>Incident Response</h3><p>Speaking of real-time automation, we should possess a playbook that helps guide security professionals and stakeholders within our business to respond to security events more effectively.</p><p>Not knowing who owns the data, what to do about a compromised instance, or, even worse, a hijacked AWS account is terrible. We need to automate as much as possible, but we also need defined responsibilities and documented processes that we can reference. Writing about this subject would be enjoyable, so I will stop here and work on a blog post soon!</p><h3>DevSecOps</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bL67u-ist5FayU_wvqFZ4A.png" /></figure><p>This is a buzzword that gets thrown around a lot, like DevOps. DevSecops or SecDevOps is implementing security on your CI/CD workflow. Code gets scanned and checked for security vulnerabilities as it moves to production through all lower environments.</p><p>We don&#39;t wait for the security team to bless our code at the last minute before it goes to production. We start with security as early as having IDE plugins that look for security bugs as we code. Using tools like Docker Bench and other easily integrated tools with Jenkins is an excellent place to start.</p><blockquote>DevSecOps is a way of approaching IT security with an “<strong>everyone is responsible for security</strong>” mindset. It involves injecting security practices into an organization’s DevOps pipeline. The goal is to incorporate security into <em>all</em> stages of the software development workflow. That’s contradictory to its predecessor development models — DevSecOps means you’re not saving security for the final stages of the <a href="https://www.plutora.com/blog/software-development-life-cycle-making-sense-of-the-different-methodologies">SDLC</a>.</blockquote><h3>Compliance Validation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U8E9KtG4mjaFYudiTer29g.png" /></figure><p>Do you hold customers credit card information? Health care information? Or any personally identifiable information (PII)? It would be best to see how you&#39;re doing when you check your infrastructure against industry-specific best practices.</p><p>You can only do business if you comply with industry regulations and follow the rules. We can use AWS Config rules to audit our infrastructure continuously. At the minimum, we should start with the CIS benchmarks if we don&#39;t have to comply with other frameworks such as PCI DSS or HPPA.</p><p><strong>That&#39;s it for the Introduction. Thank you for spending your valuable time! If you like to see more of this, please </strong>👏 <strong><em>so others can see it.</em></strong></p><p>In the coming articles, we will explore the next level of complexity!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae200624424d" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/architecting-security-governance-across-your-aws-accounts-part-1-introduction-ae200624424d">Architecting Security &amp; Governance Across your AWS Accounts part 1: Introduction</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>