<?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 DIPNARAYAN NANDI on Medium]]></title>
        <description><![CDATA[Stories by DIPNARAYAN NANDI on Medium]]></description>
        <link>https://medium.com/@dipnarayan.n?source=rss-e18bc0123517------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Zs18QPihQMGT4k5OqRdbWw.jpeg</url>
            <title>Stories by DIPNARAYAN NANDI on Medium</title>
            <link>https://medium.com/@dipnarayan.n?source=rss-e18bc0123517------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 23:03:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dipnarayan.n/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[Incident Response Lifecycle: From Detection to Recovery]]></title>
            <link>https://medium.com/@dipnarayan.n/incident-response-lifecycle-from-detection-to-recovery-708cfa77d2ca?source=rss-e18bc0123517------2</link>
            <guid isPermaLink="false">https://medium.com/p/708cfa77d2ca</guid>
            <category><![CDATA[aws-guardduty]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[anomaly-detection]]></category>
            <category><![CDATA[incident-response-plan]]></category>
            <category><![CDATA[incident-response-lifecy]]></category>
            <dc:creator><![CDATA[DIPNARAYAN NANDI]]></dc:creator>
            <pubDate>Fri, 03 Jul 2026 17:57:17 GMT</pubDate>
            <atom:updated>2026-07-03T17:57:45.533Z</atom:updated>
            <content:encoded><![CDATA[<p>Every organization invests heavily in preventive security controls — firewalls, endpoint protection, IAM policies, vulnerability management, and secure development practices. Yet, no security control is perfect. Attackers continuously evolve their techniques, making it essential for organizations to have a <strong>well-defined Incident Response (IR) process</strong>.<br>The true measure of a security team’s maturity isn’t whether they prevent every attack, it’s how quickly they<strong> detect, contain, eradicate, and recover </strong>from an incident.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mkh2wzFDXrIv2Bwcx3UvIA.png" /><figcaption>Figure 1. End-to-End Security Incident Response Lifecycle</figcaption></figure><p>Let’s walk through the <strong>Incident Response Lifecycle</strong> using a real-world AWS example where <strong>Amazon GuardDuty </strong>detects <strong>cryptocurrency mining </strong>activity on<strong> an EC2 instance.</strong></p><h4>What is Incident Response?</h4><p>Incident Response (IR) is a structured process used by security teams to detect, investigate, contain, eliminate, and recover from cybersecurity incidents while minimizing business impact.</p><p>A mature Security Operations Center (SOC) typically relies on multiple security tools working together, including:</p><ul><li>Amazon GuardDuty</li><li>AWS Security Hub</li><li>AWS CloudTrail</li><li>AWS Network Firewall</li><li>SIEM (Splunk, Wazuh, Microsoft Sentinel, QRadar, etc.)</li><li>EDR/XDR (CrowdStrike Falcon, Microsoft Defender, SentinelOne, etc.)</li><li>AWS Config</li><li>AWS IAM</li><li>Threat Intelligence Platforms</li></ul><p>Think of Incident Response like Incident Response (IR) is a structured process used by security teams to detect, investigate, contain, eliminate, and recover from cybersecurity incidents while minimizing business impact.</p><p>A mature Security Operations Center (SOC) typically relies on multiple security tools working together, including:</p><ul><li>Amazon GuardDuty</li><li>AWS Security Hub</li><li>AWS CloudTrail</li><li>AWS Network Firewall</li><li>SIEM (Splunk, Wazuh, Microsoft Sentinel, QRadar, etc.)</li><li>EDR/XDR (CrowdStrike Falcon, Microsoft Defender, SentinelOne, TrendMicro Vision One, Checkpoint, Bitdefender etc.)</li><li>AWS Config</li><li>AWS IAM</li><li>Threat Intelligence Platforms</li></ul><p>Think of Incident Response like firefighting.</p><blockquote><em>The goal isn’t just to extinguish the fire, it’s also to discover how it started and ensure it never happens again.</em></blockquote><h4><strong>Incident Scenario</strong></h4><p>Imagine your production AWS environment hosts several business-critical applications.</p><p>One morning, <strong>Amazon GuardDuty</strong> generates a <strong>High-Severity Finding</strong>:</p><blockquote><em>EC2 Instance is communicating with a known Cryptocurrency Mining Pool</em></blockquote><p>At the same time,</p><ul><li>SIEM receives GuardDuty alerts.</li><li>EDR flags suspicious Linux processes.</li><li>CloudTrail shows unusual API activity.</li><li>Security Hub aggregates the finding into a High severity security issue.</li><li>Network Firewall logs show outbound traffic to suspicious IP addresses.</li></ul><p>Now the Incident Response process begins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IMeGqO61MiUVoRTWy6bRCw.png" /><figcaption>Figure 2. Incident Response Lifecycle for Amazon GuardDuty Findings</figcaption></figure><h3>1. Preparation</h3><p>Preparation is everything you do <strong>before an incident occurs.</strong></p><p>A well-prepared organization responds in minutes instead of hours.</p><p><strong>Typical Preparation Activities</strong></p><p>✔ Deploy GuardDuty across all AWS accounts</p><p>✔ Enable CloudTrail organization-wide</p><p>✔ Configure Security Hub</p><p>✔ Centralize logs into a SIEM</p><p>✔ Install EDR/XDR agents on all endpoints</p><p>✔ Enable VPC Flow Logs</p><p>✔ Configure AWS Network Firewall</p><p>✔ Create Incident Response Playbooks</p><p>✔ Define Severity Levels</p><p>✔ Assign Incident Response Roles</p><p>✔ Maintain Contact Lists</p><p>✔ Conduct Tabletop Exercises<br><strong>Example:</strong></p><p>Before the incident:</p><ul><li>GuardDuty is enabled.</li><li>CrowdStrike Falcon is installed.</li><li>CloudTrail logging is active.</li><li>SIEM is ingesting AWS logs.</li><li>Security engineers have predefined runbooks for EC2 compromise.</li></ul><p>When the alert appears, nobody wastes time deciding what to do. They already have a documented process.</p><h3>2. Detection</h3><p>Detection is identifying suspicious activity through continuous monitoring. This is where your security tools generate alerts.</p><p><strong>In this incident</strong></p><p>GuardDuty raises the following finding:</p><blockquote><strong><em>CryptoCurrency:EC2/BitcoinTool.B!DNS</em></strong></blockquote><p>Severity: High</p><p>Reason: The EC2 instance is communicating with a known cryptocurrency mining domain.</p><p><strong>Other tools also detect suspicious behavior</strong></p><p><strong>GuardDuty</strong></p><ul><li>Crypto mining communication</li><li>Threat intelligence match</li></ul><p><strong>CloudTrail</strong></p><ul><li>IAM user launches an unexpected EC2 instance</li><li>Security Group modifications</li><li>New IAM access keys created</li></ul><p><strong>SIEM</strong></p><ul><li>Correlates GuardDuty alerts</li><li>Detects abnormal outbound traffic</li><li>Identifies repeated failed logins</li></ul><p><strong>EDR/XDR</strong></p><ul><li>Detects mining process</li><li>High CPU utilization</li><li>Unknown binaries executing</li></ul><p><strong>Network Firewall</strong></p><ul><li>Outbound traffic to malicious IP addresses</li></ul><h3>Why Multiple Tools Matter</h3><p>One alert rarely tells the whole story.</p><p>By combining GuardDuty, SIEM, EDR, CloudTrail, and Network Firewall telemetry, analysts gain a complete picture instead of isolated events.</p><h3>3. Validation (Investigation &amp; Triage)</h3><p>Not every alert is a real attack.</p><p>The analyst must determine whether it is:</p><ul><li>True Positive</li><li>False Positive</li><li>Benign Activity</li></ul><p>This phase prevents unnecessary disruption.</p><p><strong>Investigation Steps:</strong></p><p>Review the GuardDuty finding.</p><p>Analyze CloudTrail logs:</p><ul><li>Who launched the EC2 instance?</li><li>Which IAM role was used?</li><li>Were new credentials created?</li></ul><p>Review SIEM:</p><ul><li>Similar alerts from other systems?</li><li>Lateral movement indicators?</li><li>Authentication anomalies?</li></ul><p>Check EDR:</p><ul><li>Running processes</li><li>Parent-child process relationships</li><li>Persistence mechanisms</li><li>Suspicious binaries</li></ul><p>Review Network Firewall logs:</p><ul><li>Destination IP addresses</li><li>Known malicious domains</li><li>Data exfiltration attempts</li></ul><p><strong>Findings</strong></p><p>The investigation reveals:</p><ul><li>An outdated application vulnerability was exploited.</li><li>A cryptomining binary was downloaded.</li><li>The attacker established persistence.</li><li>The server connected to multiple mining pools.</li><li>CPU usage remained above 95% for several hours.</li></ul><p>The incident is confirmed as a <strong>True Positive</strong>.</p><p>Severity: <strong>High</strong></p><h3>4. Containment</h3><p>Now the priority shifts to limiting the damage.</p><p>The goal is <strong>not</strong> to fix the issue immediately but to stop it from spreading.</p><p><strong>Immediate Actions:</strong></p><ul><li>Isolate the EC2 instance using EDR network containment.</li><li>Remove the instance from the Load Balancer target group.</li><li>Block outbound traffic using AWS Network Firewall.</li><li>Restrict Security Group rules.</li><li>Disable compromised IAM credentials.</li><li>Capture forensic evidence before shutting down the instance.</li><li>Preserve CloudTrail, VPC Flow Logs, and EDR telemetry.</li></ul><p><strong>Why Isolation Matters</strong></p><p>Deleting the EC2 instance immediately may destroy valuable forensic evidence.</p><p>Contain first.</p><p>Investigate second.</p><p>Recover later.</p><h3>5. Eradication</h3><p>Containment stops the attack.</p><p>Eradication removes its root cause.</p><p><strong>Activities</strong></p><ul><li>Delete malware binaries.</li><li>Remove persistence mechanisms.</li><li>Patch the exploited vulnerability.</li><li>Rotate IAM credentials.</li><li>Revoke compromised access keys.</li><li>Update Security Groups.</li><li>Strengthen IAM policies.</li><li>Update GuardDuty suppression rules if required.</li><li>Update EDR detection policies.</li></ul><p><strong>Root Cause</strong></p><p>The attacker exploited an outdated web application vulnerability that had not been patched.</p><p>Without addressing this weakness, the attacker could return even after cleanup.</p><h3>6. Recovery</h3><p>Recovery restores business operations safely. Simply bringing the compromised server back online is risky.</p><p>Instead:</p><ul><li>Launch a clean EC2 instance from a trusted AMI.</li><li>Restore application data from verified backups.</li><li>Reinstall the EDR agent.</li><li>Validate application functionality.</li><li>Monitor GuardDuty findings.</li><li>Increase SIEM monitoring.</li><li>Watch CloudWatch metrics for anomalies.</li><li>Verify there is no malicious outbound traffic.</li></ul><p>Only after confirming the environment is clean should the workload return to production.</p><h3>7. Post-Incident Activity (Lessons Learned)</h3><p><strong>Goal:</strong> Improve security posture and prevent future incidents.</p><ul><li>🔍 Perform <strong>Root Cause Analysis (RCA)</strong></li><li>📄 Document the incident timeline &amp; findings</li><li>🛡️ Fine-tune <strong>SIEM/EDR/XDR</strong> detection rules</li><li>🚫 Update Firewall, WAF &amp; IAM security policies</li><li>🔧 Patch vulnerabilities and harden systems</li><li>🤖 Improve SOAR playbooks &amp; automation</li><li>📚 Update Incident Response runbooks</li><li>👨‍💻 Conduct knowledge sharing &amp; team training</li><li>📈 Track KPIs (MTTD, MTTR) and identify improvement areas</li></ul><p><strong>Example:</strong><br> <em>Root cause identified as an exposed EC2 application vulnerability. The vulnerability was patched, GuardDuty and SIEM detection rules were optimized, firewall rules were updated, and the IR playbook was revised to reduce response time for similar incidents.</em></p><p>This version is concise, practical, and aligns well with real-world SOC and cloud security operations.</p><h4><strong>Incident Response Flow</strong></h4><pre>GuardDuty Alert<br>        │<br>        ▼<br>SIEM Correlation<br>        │<br>        ▼<br>Security Analyst Investigation<br>        │<br>        ▼<br>Validate the Incident<br>        │<br>        ▼<br>Contain the EC2 Instance<br>        │<br>        ▼<br>Remove Malware &amp; Patch Systems<br>        │<br>        ▼<br>Restore Clean Infrastructure<br>        │<br>        ▼<br>Lessons Learned &amp; Improve Security Controls</pre><h3>Key Takeaways</h3><ul><li><strong>Preparation</strong> enables faster and more effective response.</li><li><strong>Detection</strong> relies on layered visibility across GuardDuty, SIEM, EDR/XDR, CloudTrail, and Network Firewall.</li><li><strong>Validation</strong> distinguishes real threats from false positives.</li><li><strong>Containment</strong> minimizes business impact while preserving evidence.</li><li><strong>Eradication</strong> removes the threat and addresses the root cause.</li><li><strong>Recovery</strong> restores services using trusted infrastructure.</li><li><strong>Lessons Learned</strong> transform every incident into a stronger security posture.</li></ul><p>In cybersecurity, incidents are not a matter of <strong>if</strong> but <strong>when</strong>. Organizations with a mature Incident Response process recover faster, reduce operational impact, and continuously improve their resilience against future attacks.</p><p>#CyberSecurity #IncidentResponse #SOC #CloudSecurity #AWS #AmazonWebServices #AmazonGuardDuty #AWSSecurity #MicrosoftSecurity #MicrosoftDefender #CrowdStrike #SentinelOne #PaloAltoNetworks #CiscoSecurity #Fortinet #Splunk #MicrosoftSentinel #Wazuh #ElasticSecurity #QRadar #SecurityHub #CloudTrail #EDR #XDR #SIEM #ThreatDetection #BlueTeam #DFIR #DigitalForensics #SecurityOperations #DevSecOps #InformationSecurity #CyberDefense #SecurityEngineering</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=708cfa77d2ca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The OSI Model Through a Cybersecurity Lens]]></title>
            <link>https://medium.com/@dipnarayan.n/the-osi-model-through-a-cybersecurity-lens-3f4963e19706?source=rss-e18bc0123517------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f4963e19706</guid>
            <category><![CDATA[cyber-security-awareness]]></category>
            <category><![CDATA[osi-model]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[DIPNARAYAN NANDI]]></dc:creator>
            <pubDate>Sun, 26 Apr 2026 08:44:08 GMT</pubDate>
            <atom:updated>2026-04-26T13:20:41.999Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*iXEvyI9daEVRkkf6lrevyQ.png" /></figure><p>It’s <strong>1</strong> AM. Somewhere in a dimly lit apartment, a young woman named <strong><em>Nikita</em></strong> is on a video call with her mother in another city. They’re laughing, sharing news, maybe arguing a little about something small. Nikita doesn’t know it and neither does her mother, but in the 45 minutes they’ve been talking, their conversation has passed through <strong>seven </strong>invisible checkpoints, been packaged and unpackaged <strong>thousands of times</strong>, and survived the chaotic, hostile wilderness of the public internet.</p><p>Now picture something darker. In another window, on another machine, someone is watching that journey happen. Not the content…not yet. But the <em>shape</em> of it. The timing. The packets. The handshakes. They’re looking for a crack in one of those seven checkpoints.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*izt0WrrWwf3gAvAkJmaIgQ.png" /><figcaption><strong>Fig 1:</strong> Data moving through all 7 OSI layers while an attacker tries to intercept it.</figcaption></figure><p>This is not science fiction. This is happening right now on the internet.<br>The framework that governs all of it, the rulebook that every device, every router, every server on earth silently follows is called the <strong><em>OSI Model</em></strong>. And once you understand it, you’ll never look at a network the same way again. You’ll start to see what attackers see: not cables and screens, but <em>layers </em>each one beautiful, each one fragile. Let’s go layer by layer…</p><h4>What Is the OSI Model? (And Why Does It Exist?)</h4><p>Before the OSI Model existed, networking was chaos.</p><p>Every company built its own networking systems IBM had one, DEC had another, and they couldn’t talk to each other at all. It was like every city in the world inventing its own language and then wondering why trade was hard. In 1984, the <strong><em>International Organization for Standardization (ISO)</em></strong> stepped in and said: <em>enough</em>. They published the <strong><em>Open Systems Interconnection (OSI) </em></strong>model<strong><em> </em></strong>a universal, seven-layer framework that describes exactly how data should travel from one device to another.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0ONG0rmn0tvULT5sXBjI7A.png" /><figcaption><strong>Fig 2:</strong> The 7 OSI layers framework for network communication. Each layer has a unique role, a unique language, and a unique set of vulnerabilities</figcaption></figure><p>Think of it like this: sending data across a network is not one job. It’s <strong>seven separate jobs</strong>, each handled by a specialist. The OSI model is the org chart for those specialists.</p><p><em>Why seven layers?</em> Because the engineers who designed it separated <em>physical</em> concerns (how do electrons move through a wire?) from <em>logical</em> concerns (how do you know a message arrived complete?) from <em>human</em> concerns (how do you display a webpage?). Each layer has a single responsibility, and that clean separation is exactly what makes modern networking reliable and also exactly what makes it attackable.</p><h4>The Secret Trick to Remember All Seven Layers Forever</h4><p>The internet may look simple on the surface, open a browser, click a link, and everything just works. But behind every single request lies a layered architecture quietly doing its job.</p><p>If you’ve ever struggled to remember the <strong>OSI model</strong>, you’re not alone.<br>Seven layers, each with its own responsibility, it’s easy to mix them up. So before we go deeper, here’s a small gift that will make sure you never forget them again:</p><blockquote><strong>“Please Do Not Touch Sachin Patni Anjali”</strong></blockquote><p>This one sentence maps perfectly to all seven OSI layers and once it clicks, it stays forever.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*vlrAd5mFcHTrjKuO1BxuHw.png" /><figcaption><strong>Fig 3: </strong>Understanding OSI Layers Using Mnemonic Mapping (P-D-N-T-S-P-A)</figcaption></figure><h4>The 7 Layers</h4><p><strong>Layer 1 :: Physical</strong><br> Sends raw signals (cable, Wi-Fi). Just moves data physically.</p><p><strong>Layer 2 :: Data Link</strong><br>Connects devices in the same network. Uses MAC address to send data correctly.</p><p><strong>Layer 3 :: Network</strong><br> Finds the path to the destination using IP address (internet routing).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*AtEfM5iS_DOeI-YCyX1R4Q.png" /><figcaption><strong>Fig 4: </strong>How Data Travels in OSI Model (Sender → Receiver)</figcaption></figure><p><strong>Layer 4 :: Transport</strong><br> Makes sure data is delivered properly (no loss, correct order).</p><p><strong>Layer 5 :: Session</strong><br> Starts and manages connection between two systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-f2P7LodNF5aSFgfK128fQ.png" /></figure><p><strong>Layer 6 :: Presentation</strong><br> Formats data (encryption, compression, translation).</p><p><strong>Layer 7 :: Application</strong><br> User level where apps like browser, email work.</p><h4>Now for the Real Talk: Attacks on Every Layer</h4><p>Understanding the OSI model academically is satisfying. Understanding it through the eyes of an attacker is <em>essential</em>. Because every layer is not just a mechanism, it’s a <strong>potential entry point</strong>.</p><p>Let’s look at the battlefield.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P_0uHl74cOkNpabr-vFXvA.png" /><figcaption><strong>Fig 5: </strong>OSI Model with Attack Categories (Layer-wise Threat Mapping)</figcaption></figure><blockquote>Every layer of the OSI model has its own attack surface. This is not a theoretical concern, these are the techniques used in real breaches, every single…</blockquote><p><strong>The Attack &amp; Defense Cheatsheet — All 7 Layers</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CUwsDYG8yoMset3bPGxy-A.png" /></figure><p><strong><em>Layer 1 Defense (Physical) </em></strong><em>:: </em>Protect the hardware so no one can touch or damage it.</p><ul><li><strong>Lock rooms</strong> → Only authorized people can enter</li><li><strong>Use cameras</strong> → Monitor and deter attackers</li><li><strong>Secure cables</strong> → Detect if unplugged or tampered</li><li><strong>Security guards</strong> → Stop unknown people</li><li><strong>Track devices</strong> → Know if anything is added or removed</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dvHCHmBuafjWWIAz32R2YQ.png" /></figure><p><strong><em>Layer 2 Defense (Data Link) ::</em></strong> Control which devices can connect.</p><ul><li><strong>Port security</strong> → Allow only known devices</li><li><strong>802.1X auth</strong> → Verify before access</li><li><strong>ARP protection</strong> → Stop fake devices</li><li><strong>VLANs</strong> → Separate network</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GhESIx_W-FSc7UFQ_nTV4w.png" /></figure><p><strong><em>Layer 3 Defense (Network) :: </em></strong>Control traffic flow and routing.</p><ul><li><strong>Firewalls</strong> → Allow/deny traffic</li><li><strong>ACLs</strong> → Set rules for access</li><li><strong>IPSec</strong> → Encrypt traffic</li><li><strong>Ingress/egress filtering</strong> → Block fake IPs, traffic analysis</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*upLQrkUK4-pt5y9Bf9TcGg.png" /></figure><p><strong><em>Layer 4 Defense (Transport)::</em></strong> Protect against overload attacks.</p><ul><li><strong>Rate limiting</strong> → Limit requests</li><li><strong>IDS/IPS</strong> → Detect &amp; block attacks</li><li><strong>SYN protection</strong> → Stop floods</li><li><strong>Close ports</strong> → Reduce entry points</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UxF0VbnMKYYV9-rwYbaOcQ.png" /></figure><p><strong><em>Layer 5 Defense (Session) </em></strong>:: Secure user sessions.</p><ul><li><strong>Short sessions</strong> → Expire quickly</li><li><strong>MFA</strong> → Extra authentication</li><li><strong>Logout properly</strong> → Kill session</li><li><strong>Secure cookies</strong> → Protect tokens</li></ul><blockquote><strong>Protect the session like a key…</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t7ARTg494XXtxqAX68FNFA.png" /></figure><p><strong><em>Layer 6 Defense (Presentation) ::</em></strong> Secure data format and encryption.</p><ul><li><strong>Use HTTPS (TLS)</strong> → Encrypt data</li><li><strong>Disable old SSL</strong> → Avoid weak crypto</li><li><strong>Validate files</strong> → Check content</li><li><strong>Decode inputs</strong> → Catch hidden attacks</li></ul><blockquote><strong>Encrypt everything, trust nothing blindly…</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3qru45EKrIEdrm9wt8Pyyg.png" /></figure><p><strong><em>Layer 7 Defense (Application) ::</em></strong> Protect apps from user input attacks.</p><ul><li><strong>Input validation</strong> → Check all data</li><li><strong>Prepared queries</strong> → Stop SQLi, XSS</li><li><strong>WAF</strong> → Block common attacks, Geo-IP restriction, Bot Control, Regex, OWASP Top 10</li><li><strong>CSP &amp; CSRF tokens</strong> → Prevent exploits</li></ul><blockquote><strong>Never trust user input…</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*GjrBTrnv3L7stD2mttszCA.png" /><figcaption><strong>Fig 6:</strong> Layer-wise Cyber Attacks and Defense Mechanisms</figcaption></figure><h4>Final Thought: Security Is a Seven-Floor Building</h4><p>If you live in a building and you only lock the front door, a thief who finds an open window on the third floor will thank you for the convenience.</p><p>Networks are the same. You cannot secure just your application and call it done. You cannot secure just your firewall and go home. Real security means understanding every floor, every window, every vulnerability and building defenses that span all of them.</p><p>The OSI model isn’t just a networking concept. It’s a security philosophy. And now that you know all seven floors, you’ve taken the first and most important step: you know where to look.</p><p>But knowing where to look is only half the battle.</p><p>The other half? Acting on it, before someone else does.</p><p>Because right now, somewhere in the world, an attacker is scanning ports at Layer 4. Someone is crafting a phishing email aimed at Layer 7. Someone is sitting quietly in a coffee shop, running ARP poison on Layer 2, watching every packet float by like pages of an open book.</p><p>They are not waiting for you to be ready. They are counting on you not being ready. So here is the only question that matters after reading this:</p><p><strong><em>Which floor of your building is still unlocked?</em></strong></p><blockquote>Security is not a product you install. It is a practice you build — layer by layer, defense by defense, assumption by assumption.</blockquote><blockquote>An attacker needs to find only one open door. A defender must close all of them. That asymmetry is what makes cybersecurity hard. The OSI model is what gives you the map. You now know every floor. Every attack surface. Every defensive tool available to you.</blockquote><blockquote>The question is no longer, where do I start? The question is, which floor do you protect first?</blockquote><blockquote><strong>The answer, always, is all of them…</strong></blockquote><p><strong>Stay curious || Stay paranoid || Stay defended</strong></p><h4>👋 Before You Go</h4><p>If this article made you see the internet differently, that’s the point. Share it with someone who says <em>“I’m not technical enough to understand security.”</em> After reading this, they are. If you work in IT, development, or run your own business forward this to your team. Not because it’s interesting. Because it’s necessary.</p><p>And if you found value here, follow for more because this is only Layer 1 of what we’re building together.</p><h3>For More Updates, Connect with Me</h3><ul><li><strong>Bio Link:</strong> <a href="https://dipnarayan.bio.link/">https://dipnarayan.bio.link/</a></li><li><strong>LinkedIn:</strong> <a href="https://www.linkedin.com/in/dipnarayan-nandi-95b6a21b3?utm_source=share&amp;utm_campaign=share_via&amp;utm_content=profile&amp;utm_medium=android_app">Dipnarayan Nandi</a></li><li><strong>Website:</strong> <a href="https://www.dipnarayan.in/">www.dipnarayn.in</a></li><li><strong>GitHub:</strong> <a href="https://github.com/Dip0375">github.com</a></li><li><strong>Medium: </strong><a href="https://medium.com/@dipnarayan.n">medium.com</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f4963e19706" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Analyzing AWS WAF Logs with CloudWatch Log Insights Query Language (QL)]]></title>
            <link>https://medium.com/@dipnarayan.n/analyzing-aws-waf-logs-with-cloudwatch-log-insights-query-language-ql-c5ba4ebdbda1?source=rss-e18bc0123517------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5ba4ebdbda1</guid>
            <category><![CDATA[aws-wafv2]]></category>
            <category><![CDATA[cloudwatch-logs]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[log-insight]]></category>
            <category><![CDATA[web-application-firewall]]></category>
            <dc:creator><![CDATA[DIPNARAYAN NANDI]]></dc:creator>
            <pubDate>Sun, 02 Feb 2025 17:57:06 GMT</pubDate>
            <atom:updated>2025-02-02T18:32:23.292Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*QnD7hNFZCfJq3p-KKJIqMw.png" /></figure><p>AWS <strong>Web Application Firewall</strong> (WAF) is a powerful security service that provides protection to the applications against various common web exploits. The proper monitoring and analysis of AWS WAF logs would help in threat identification, rule optimization, and traffic pattern study. CloudWatch <strong>Log Insights</strong> presents a structured query language (QL) for efficiently analyzing and visualizing AWS WAF logs.</p><p>This blog dives into some queries in CloudWatch Log Insight about AWS WAF logs that give meaningful insights on how to enrich security teams in their defense.</p><p><strong>1. Finding Top 100 IPs and Their Country Origins</strong></p><p>This query will fetch the top 100 IP addresses requesting your application along with their country of origin. The identification of high-requesting IPs helps in identifying potential malicious activity.</p><pre>fields httpRequest.clientIp, httpRequest.country<br>| stats count(*) as requestCount by httpRequest.clientIp, httpRequest.country<br>| sort requestCount desc<br>| limit 100</pre><p>2. Top 100 Requesting Countries</p><p>This query provides insights into the geographical distribution of incoming requests, highlighting potential regional threats.</p><pre>fields httpRequest.country<br>| stats count(*) as requestCount by httpRequest.country<br>| sort requestCount desc<br>| limit 100</pre><p>3. Top 1000 User-Agents with URIs</p><p>Scalable web applications distribute user-agents, helping to detect bot traffic, suspicious scripts, or anomalies in user behavior</p><pre>fields @timestamp, @message, httpRequest.clientIp, httpRequest.headers.4.name as userAgent<br>| stats count() as requestCount by httpRequest.clientIp, userAgent, httpRequest.country, httpRequest.uri<br>| sort requestCount desc<br>| limit 1000</pre><p>4. Filtering Requests Blocked by Rate-Based Rules</p><p>Rate-based rules help prevent DoS attacks by blocking excessive requests from a single source.</p><pre>fields @timestamp, httpRequest.clientIp as ClientIP, httpRequest.uri as URI, terminatingRuleId as rule, httpRequest.country as Country<br>| filter action = &quot;ALLOW&quot;<br>| filter terminatingRuleType = &quot;RATE_BASED&quot;<br>| sort @timestamp desc</pre><p>5. Analyzing Specific Client IP Requests</p><p>Use this query to investigate requests from a specific IP address. You can change the action filter to either BLOCK or ALLOW as per your analysis requirements.</p><pre>fields @timestamp, httpRequest.clientIp as clientIp, httpRequest.country as country, httpRequest.uri as ReqUrl<br>| filter action = &#39;BLOCK&#39;  # Change to &#39;ALLOW&#39; as needed<br>| filter clientIp = &#39;117.17.1x4.1xx&#39;<br>| sort @timestamp desc<br>| display clientIp, country, ReqUrl, action<br>| limit 1000</pre><p>AWS WAF and CloudWatch Log Insights provide an effective framework to analyze traffic patterns and security threats. Using such queries, the security teams are able to predict malicious activity proactively, optimize WAF rules, and generally improve their posture on cybersecurity.</p><p>For more complex AWS WAF Log Insight queries, such as Top 100 Cross-Site Scripting (XSS) or SQL Injection, Analyzing requests for a specific rule ID, WAF Report for BLOCK, and WAF Report for ALL logs, refer to my <strong>GitHub repo</strong>: <a href="https://github.com/Dip0375/WAFLogInsightQL.git">WAFLogInsightQL</a> repo and my <a href="https://www.dipnarayan.in/">website</a> blog Analyzing AWS WAF Logs with CloudWatch Log Insights Query Language (QL).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5ba4ebdbda1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Startups Secure Their Environment from Cyber Threats]]></title>
            <link>https://medium.com/@dipnarayan.n/how-startups-secure-their-environment-from-cyber-threats-c3338c68614d?source=rss-e18bc0123517------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3338c68614d</guid>
            <dc:creator><![CDATA[DIPNARAYAN NANDI]]></dc:creator>
            <pubDate>Wed, 13 Nov 2024 16:27:04 GMT</pubDate>
            <atom:updated>2024-11-13T16:27:04.280Z</atom:updated>
            <content:encoded><![CDATA[<p>Cyber attacks being so frequent and severe in their impacts have made cybersecurity a concern to every business, but among these the startups face a specific threat. Cybercriminals tend to exploit vulnerabilities found in less fortified environments, making them the most vulnerable. For instance, the cyber attack affects a business or an individual once every 11 seconds, and this comes with a wide-ranging loss. Ransomware affects nearly 6 out of every 10 businesses in 2023 with an upward trend of 15% in North America. Financially, it is doomsday, with an average figure of attacks on IoT devices being more than $ 330,000 and phishing data breaches costing $4.88 million.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*y869J-MfLYJUFRzp" /></figure><p>Also out of the rise numbers is leveled against startups. The Identity Theft Resource Center (ITRC) documented 2,365 cyberattacks resulting in data compromises this year, a number higher than previous years. More than 343 million fall victim each year, and proactive cybersecurity is no exception. What makes matters worse is that nearly 80% of users reuse one password across multiple accounts, making credential-targeted attacks a persistent threat. In addition, 95% of these cyber threats are financially motivated, costing an average $50,000 per phishing attack, which can hardly be recovered in most cases.</p><p>The staggering statistics have forced startups to think about doing things the right way to protect against what is fast becoming the most sophisticated cyber threats in today’s world. This guide summarizes some of the most important measures that startups need to understand to design and minimize risks within a secure environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*d0Y5Pv4Ma8rttS_n" /></figure><h4>How Secure Your Environment From Attacks</h4><p><strong>1. Focus on Cyber Security from Day One</strong><br>Speed and growth are the calling cards of start-ups, however, cyber-security cannot be exempt from that conversation. But if the right robust security measures are taken early, they ensure risks do not escalate-they are mitigated well before they happen. This means more confidence in scaling while not giving up what it takes to protect data.<br>One of the first steps in setting up a secure environment is to define and document basic security policies. Such policies set clear expectations for employees and, in turn, can mitigate the killer of so many security breaches: human error. Here are some essential policies that every startup should have in place:</p><p><strong>&gt; Password Management:</strong> Enforce strong password requirements, implement multi-factor authentication (MFA), and ensure password rotation.<br>&gt; <strong>Device Use: </strong>Provide guidelines for the proper use of company-owned devices that include the measures that should be taken to secure them appropriately, including encryption and screens locked, and monitored.<br>&gt; <strong>Acceptable Use of Internet:</strong> They clearly define their rules related to the use of internet and state restrictions imposed on accessing sites or applications that may appear to be harmful to the organization.</p><p><strong>2. Leverage Cloud Security Best Practices</strong><br>With many startups relying on cloud-based services for scalability and cost efficiency, their environments require secure access as well. Here are some of the most important cloud security practices to implement:</p><p>&gt;&gt; <strong>Secure Cloud Accounts:</strong> Use strong, unique passwords for all cloud accounts and enable two-factor authentication (2FA) for an added layer of protection. 2FA prevents unauthorized access even if credentials are compromised.</p><p>&gt;&gt;<strong>Access Control:</strong> Implement RBAC. This ensures that users have the least permissions necessary to effectively allow access. In this regard, it minimizes the risks of both internal and external threats by restricting exposure to sensitive information.</p><p>&gt;&gt;<strong>Data Encryption:</strong> Encrypt information at rest and in transit. Most cloud providers provide tools for encryption. Encryption of information ensures that intercepted data will remain unreadable.</p><p>&gt;&gt;<strong>Regular Audits and Monitoring:</strong> Implement auditing and monitoring of any suspicious activities. Utilize tools that will alert on unusual patterns of access or changes to configuration. This helps identify vulnerabilities before the bad guy does.</p><p>&gt;&gt;<strong>Backup and Recovery: </strong>Automate your backup solutions for the most important data. Store those backups securely and test the recovery processes with minimal time out if disaster strikes.</p><p>&gt;&gt;<strong>Cloud Security Posture Management (CSPM): </strong>This also provides deployment and operation of CSPM tools to continuously monitor and manage the security configurations of your cloud environment. These help identify misconfigurations, compliance issues, and vulnerabilities before they can be exploited and make real-time visibility possible with automated remediation in ensuring that your cloud infrastructure stays safe and compliant with industry standards.</p><p><strong>3. The First Line of Defence :: Firewalls</strong></p><p>Firewalls monitor incoming and outgoing network traffic based on predefined security rules to block unauthorized access, while keeping malware-laden traffic from reaching internal systems. They constitute a type of perimeter defence, creating a secure boundary between trusted internal networks and untrusted external sources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dwbB9FX0MoTm0jhT" /></figure><p>Usefulness: Firewalls are an absolute necessity to block external threats from reaching your network. Startups will surely need to safeguard their systems from various forms of attacks, such as DDoS, unauthorized access, and malware; cloud-based firewalls are scalable and, thus, perfect for startups employing infrastructure on cloud.</p><p><strong>4. Web Application Firewall (WAF) To Protect Your Web Applications</strong></p><p>All incoming HTTP/HTTPS requests are intercepted by the WAF, which identifies malicious traffic. It evaluates the request data and detects those harmful attacks in terms of SQL injection and XSS even before they hit the application.<br>In detail, WAFs protect web applications from the threat of application-layer attacks, which refers to attacks on vulnerabilities that fall within an application and are neither the underlying infrastructure nor the network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aSNZ1lXmxmKNVbgX.png" /></figure><p><strong>Why WAFs Are the Essentials for Startups?</strong><br>For startups, securing web applications is of great importance because they are as close to the face of the company to customers. Thus, WAFs are an important security tool for startups as they will protect your web application from basic and advanced attacks such as SQL injection, cross-site scripting (XSS), as well as other OWASP Top Ten vulnerabilities.</p><p>When startups become large and internet applications are their primary means to attract users, that creates a huge opportunity for cybercriminals. WAFs prevent this by filtering and monitoring HTTP/HTTPS traffic to stop malicious requests from ever exploiting the vulnerability of applications. This means a proactive defense that protects all sensitive customer data, intellectual property, and business assets in the hands of hackers.</p><p>Also, WAFs are very easy to set up they usually come as cloud-based options that scale with the growth of the startup. Hence, as the load of the startup increases with time, so does the WAF, and it can handle larger volumes of traffic and even more complicated threats. Moreover, thanks to its automated updates and customizable rules, WAFs will continuously protect against this ever-changing threat landscape, crucial for startups who don’t have enough IT resources.</p><p><strong>5. Security Information and Event Management (SIEM)</strong></p><p>SIEM significantly impacts the cybersecurity domain because it aggregates and analyzes security events from virtually everywhere in the IT environment of an organization. SIEM delivers real-time monitoring, as well as real-time incident detection and response, which makes it the most essential tool for any startup required to identify and mitigate threats before they become too severe.</p><p><strong>Why SIEM Matters for Startups?</strong><br>SIEM offers a central view of security across all environments, especially important for startups that are often leveraging a hybrid mix of cloud-based and on-premises IT infrastructure. Here is why SIEM is crucial:<br> <br>&gt;&gt;<strong>Centralized Security Monitoring:</strong> Most startups today use multiple systems or platforms that could generate security events. Centralizing monitoring through SIEM simplifies the visibility into and response to threats emanating from different sources.<br>&gt;&gt;<strong>Early Threat Detection:</strong> It is possible for SIEM solutions to detect malicious activities early enough by analyzing logs and correlating data. This allows the startups to respond to the situation before an attack escalates, hence minimizing the overall effect.<br>&gt;&gt;<strong>Scalability and Flexibility:</strong> Cloud-based SIEMs are particularly much more helpful for startup companies because they can work in tandem with the growth of the business, providing complete security with minimal infrastructure investment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*QfEy9MqfpgSr4YuA" /></figure><p>SIEM systems collect logs from multiple sources, such as firewalls, Web Application Firewalls (WAFs), Data Loss Prevention (DLP) systems, and endpoint devices. SIEM systems use correlation rules to scrutinize this data and reveal suspicious patterns or anomalies that could be indicative of security threats. It generates actionable alerts based on correlated events; thus it also enables the security teams to respond faster and better to attacks.</p><p><strong>6. File Integrity Monitoring (FIM) With SIEM</strong></p><p>FIM monitors change events for critical files, directories, and system settings. When these changes indicate unauthorized access and potential malicious activity, they report these changes to security teams as possible breaches.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oksTTCvuXmbaUPE2" /></figure><p>Usefulness for Startups: FIM serves to detect security breach early on by monitoring for tampering and unauthorized changes in critical files, which is a necessary measure to ensure the integrity of your core system, along with the regulatory standards that are usually set in place.</p><p><strong>7. Data Loss Prevention For Sensitive Information</strong></p><p>DLP solutions prevent unauthorized transfers of confidential data that can leak through an endpoint or into email and cloud services. This will help ensure the confidentiality of customer data, intellectual property, and financial information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XjFBQkoD4PIIQh27.png" /></figure><p>All customer information or proprietary information that a startup handles needs protection against leakage or data breaches due to accidental exposure. DLP reduces the risk of information leakage or theft and also ensures compliance with specific regulations, like GDPR or HIPAA, which further enhances the overall security posture of an organization so that it does not lose in expensive breaches and reputation damages.</p><p><strong>8. Extended Detection and Response (XDR) In-depth Threat Detection Across Layers</strong></p><p>XDR unifies threat detection and response capabilities, spanning from endpoints to the network, to the cloud infrastructure. XDR provides a comprehensive view of security and helps detect complex, multi-stage attacks that evade traditional solutions.<br>As the startups scale and diversify their IT environments, the need for comprehensive threat visibility turns into a challenge. XDR consolidates security monitoring across all systems and brings in enhanced visibility into threats with streamlined coordination of incident responses. Using advanced, multi-layered attacks, XDR enables startups to respond more effectively and much faster, lessening the chances of an executed cyberattack.</p><p>Cybersecurity today is an important requirement for any startup with a view to safeguarding sensitive data, fostering customer trust and securing business continuity. Although startups suffer from resource constraints, a multi-layered approach to security can make a huge difference in minimizing cyber threats. Tool-based primitives, including <strong>firewalls</strong> and <strong>Web Application Firewalls (WAFs)</strong>, are critical perimeter defenses that help block malicious traffic while also protecting web applications. <strong>SIEM</strong>- it helps with centralizing the monitoring and real-time detection of potential threats, followed by quick response mechanisms against various incidents. The <strong>DLP</strong> solution helps keep sensitive information secure and wards off unauthorized data transfers. Finally, <strong>Extended Detection and Response (XDR)</strong> merges security from endpoints, networks, and cloud infrastructures at its heart, hence providing an all-rounded approach in the detection and response to threats. Consequently, by such integrated security products and processes, startups can effectively proactively govern their risks while responding adequately to emerging threats-basically scaling without compromising their security.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3338c68614d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloud Security Posture Management(CSPM) Using AWS Security Hub]]></title>
            <link>https://medium.com/@dipnarayan.n/cloud-security-posture-management-cspm-using-aws-security-hub-2431b7cb614d?source=rss-e18bc0123517------2</link>
            <guid isPermaLink="false">https://medium.com/p/2431b7cb614d</guid>
            <dc:creator><![CDATA[DIPNARAYAN NANDI]]></dc:creator>
            <pubDate>Fri, 18 Oct 2024 00:47:56 GMT</pubDate>
            <atom:updated>2024-10-18T00:47:56.637Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OWURzEqI5C5B2XZv_Jdlhg.png" /></figure><p>Do you know about <strong>Marvel’s Watcher</strong>? The Watcher is a cosmic entity existing beyond the planes of space and time. He will see everything that has already happened, is happening, and will happen-not only in our universe but in all of the realities.</p><p>Similarly, in today’s digital landscape, organizations across various sectors whether small businesses, mid sized enterprises, or large corporations in finance, healthcare, and more are increasingly adopting cloud infrastructure to ensure the seamless operation of their critical applications. With this shift to the cloud, maintaining a secure environment is paramount.</p><p>The <strong>Cloud Security Posture Management (CSPM)</strong>, can be said to be the <strong>“Watcher”</strong> of the cloud environment. Think about it 🤔 The CSPM always keeps an eye on the infrastructure for detecting risks, misconfigurations, and vulnerabilities. It watches everything over the whole cloud ecosystem at all times and ensures that security policies are always enforced and alerting teams about their deviations before they become threats.</p><p>CSPM also contributes to compliance management and in that it supports out-of-the-box regulatory frameworks and security standards, among them, including <strong>CIS Benchmark</strong>,<strong> PCI DSS</strong>,<strong> NIST</strong>,<strong> HIPAA,</strong> and many more. It keeps the organizations compliant by checking against those standards and continually scanning in the environments of the cloud. Just like the <strong>Watcher</strong>, then, CSPM sees what is, what was, and what may come to be in enabling organizations to take that vigilant and secure posture in their cloud environments.</p><h4><strong>Why CSPM is Crucial for Cloud Security?</strong></h4><p>1. CSPM tools detect and fix misconfigurations in real-time to enhance security and prevent unauthorized access. <br>2. It updates cloud services automatically with respect to the standard policies and the mandatory requirements.<br>3. Centralized visibility across the whole cloud environment is provided by CSPM to make management easier.<br>4 It detects flaws and threats early, thereby allowing the mitigation of the same at a proper time to avoid the threat.<br>5. CSPM identifies unused resources, thus enabling the optimization of expense as created by the organization in its cloud environment.</p><h4>Key Capabilities of AWS Security Hub as a CSPM Tool</h4><p>1. Collects insights from AWS services like GuardDuty, Inspector, Config, Macie, etc, and third-party tools into a unified dashboard for monitoring.<br>2. Tracks compliance with frameworks like CIS AWS Foundations, PCI DSS, and GDPR, offering detailed reporting and actionable remediation recommendations.<br>3. Gets a list of misconfigured and vulnerable AWS resources to proactively mitigate security risks.<br>4. Aggregates data, prioritizes according to severity and noise reduction, presents actionable insights to focus on the most urgent issues<br>5. Creates use of Amazon EventBridge for automated workflows triggering, it enables a swift response to remediation of security incidents<br>6. Provides comprehensive visibility across many AWS accounts and even regions, simplifies the management of security in distributed environments.</p><h4>Let’s Quickly Enable AWS Config</h4><p>To make Security Hub standards and controls available, resource recording needs to be enabled using AWS Config. If resource recording hasn’t been enabled, you might find some issues while configuring standards and controls for Security Hub. Keep in mind that AWS Config will bill you separately for resource recording.</p><p>To provision AWS Config, I will be using an AWS CloudFormation template that makes it easier to establish. It will minimize all the manual configurations since the deployment is smooth and automated. Using EnableAWSConfig.yml as the template will ensure that AWS Config is created efficiently with the right settings and proper configuration, there will be proper consistency in the monitoring and compliance of the environment.</p><p><strong>Step 1:</strong> Open the <strong>AWS CloudFormation console</strong> at <a href="https://console.aws.amazon.com/cloudformation.">https://console.aws.amazon.com/cloudformation.</a> and select your Region.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*oxiOTRkP2pjpm6Ui5OjzLg.png" /></figure><p><strong>Step 2:</strong> Select <strong>Create Stack</strong> → choose <strong>with new resources (standard)<br>Step 3:</strong> On the <strong>Create stack</strong> page, Upload Template file: Select your <strong>EnableAWSConfig.yml</strong> file. Click on <strong>Next</strong>.</p><p>🔗GitHub repo of <a href="https://github.com/Dip0375/EnableAWSConfig_CFT.git"><strong>EnableAWSConfig.yml</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*ZLv_Rmlu0sMtvRHdmR5G-A.png" /></figure><p><strong>Step 4:</strong> Provide a <strong>stack name</strong>. In the <strong>Parameters</strong> section, specify values for the parameters that were defined in the template. Select <strong>Next</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*X7sMZNYlcL92EghuPO5kyQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*ioVQpNzggZA1g03OTT_Dvg.png" /></figure><p><strong>Step 5: </strong>Click <strong>Next</strong>, review the settings, and select <strong>submit</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*LyFQ2we9hp3SQVa62e_G9g.png" /></figure><p><strong>Step 6:</strong> Wait for the status to change to <strong>CREATE_COMPLETE</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*VUFiN7ryZrt4G_X3__U4HA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*moWE2j-h3-aR9h0bC7PlSg.png" /></figure><h4>Quick Setup of AWS Security Hub</h4><p>Next step after AWS Config is enabled is to configure Security Hub for the continuous monitoring of your environment. This means choosing the appropriate security standards to run assessments for compliance, as well as the fulfillment of best practices.</p><p><strong>Step 1:</strong> Go to <strong>AWS Security Hub</strong> console.<br><strong>Step 2: </strong>Selecting <strong>Security Standards.</strong><br>Go to the landing page and select boxes for security standards that you’d like to have scanned, like CIS AWS Benchmarks, PCI DSS or AWS Foundational Best Practices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*BOJyNwSHyobE1vV03G3m1Q.png" /></figure><p><strong>Step 3: </strong>Now, click the <strong>Enable Security Hub</strong> icon to turn on the monitoring of security.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*epp7pbGADR4P4-L0vRiYCg.png" /></figure><p><strong>Note:</strong> It may take up to 2 hours to get the results of security checks for newly enabled standards after enabling Security Hub.</p><h4>Centralized Visibility of AWS Security Hub</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*ykMt_nQhaReYtbbvCBWmlg.png" /></figure><h4>AWS Security Hub Security Standards</h4><p>AWS Security Hub provides you with a wide range of security standards to help track your cloud environment for compliance and best practices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*ncqbiaJmNSZGO8uKHz5hMw.png" /></figure><h4>AWS Security Hub Findings</h4><p>In AWS Security Hub, findings represent security-related events or issues that have been detected in your AWS environment. These findings aggregate data from AWS services, like GuardDuty, Config, and Inspector, as well as third-party integrations to help you identify and respond to security risks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*Xb6RXbarZxepqpfBXJVfiA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*5aDgL9IBu8Mh6jFh918wqw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*DmedlwpLzLvEnaiZPaYdnA.png" /></figure><h4>AWS Security Hub Automation and Incident Response Workflow</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qWwIHq4RKrkDlIipIhrxgw.png" /></figure><ul><li>Security Services, such as GuardDuty, Inspector, Macie, IAM Access Analyzer and Firewall Manager continuously monitors threats and weaknesses, then sends their findings to AWS Security Hub.<br>Third-party tools include Fortinet, CrowdStrike and McAfee, which send their findings to AWS Security Hub.<br>All events are redirected from AWS Security Hub for central processing via Amazon EventBridge.</li><li>AWS Lambda invoked by EventBridge rule to automating responses such as restrict open ports or isolating resources.</li><li>The incident is passed on to a SIEM tool for further correlation and deeper inspection of the events.</li><li>Email or any other communication channel notifications trigger teams(SOC Team) to take an appropriate intervention if required.</li></ul><h4>Let’s configure customized email notifications for AWS Security Hub findings with AWS Lambda and Amazon SNS</h4><p><strong>Step 1:</strong> Create an SNS topic and subscription</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*nd_J9VQGXLVL34NF5lqCxA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*u2_AVvSIXXyqPhlRzkt5Aw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hyDX7r2By-0WBTinCBjV-w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*GrStb1g3TmQjr79cHbZqWw.png" /></figure><p><strong>Step 2:</strong> Create a Lambda function</p><p>2.1. Open the <strong>Lambda console</strong>. Go to <strong>Functions</strong> and click <strong>Create function</strong>. Select <strong>Author from scratch</strong>.</p><p>2.2. Enter a <strong>Function name</strong> and choose <strong>Python 3.12</strong> as the runtime. Select <strong>x86_64</strong> for architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*nuCSPtLTZ5ScdVUwLTFN-Q.png" /></figure><p>2.4. Keep <strong>default execution role </strong>and later attach Policy with Lambda Role.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3B2t3eQ40dVMi4LIY5nlLQ.png" /></figure><p>2.5. Paste the provided code in the <strong>Code source</strong> section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rc8zPJCI6VlEmhZU0Iq-zg.png" /></figure><p><strong>Note:</strong> GitHub repo for Lambda Code <a href="https://github.com/Dip0375/SecurityHub_CustomFindings.git"><strong>SecurityHub-CustomFindings</strong></a><strong> </strong>and <a href="https://github.com/Dip0375/SecurityHub_CustomFindings.git"><strong>Lambda execution role</strong></a>.</p><p><strong>Step 3:</strong> Create and configure the EventBridge rule</p><p>3.1. Open the <strong>EventBridge console</strong>. Click <strong>Create rule</strong>.</p><p>3.2. Enter a <strong>Name</strong> and optional <strong>Description</strong>. In <strong>Define pattern</strong>, select <strong>Rule with an Event pattern</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*QNqaj-DQ_DeKeoERUW-TLA.png" /></figure><p>3.3. Choose <strong>Pre-defined pattern by service</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/1*9ecxBCG6d15NGqOe5GFcrQ.png" /></figure><p>3.4. Set <strong>Service provider</strong> to <strong>AWS</strong> and <strong>Service name</strong> to <strong>Security Hub</strong>. For <strong>Event type</strong>, select <strong>All Events</strong> (or specify events as needed). Click on <strong>Next</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*XIOB3lMskSokNw1dcFXfiQ.png" /></figure><p>3.5. In <strong>Select targets</strong>, choose <strong>Lambda</strong> and select the previously created function. Click on <strong>Next</strong>. Select <strong>Create rule</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*U8T9_gFxDoW-7gwLhF4x8w.png" /></figure><p>When the rule is triggered, you receive customized findings over email with details extracted from Security Hub alerts.</p><h4>Snapshots of Sample Customized Findings Sent via Email</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IBnRaBv7--L0pHPvTj1Peg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zGy3U-d5S408BKYOR8r73w.png" /></figure><p>This setup also lets you send email notifications based on AWS Security Hub findings, keeping you informed of the actual threats in real time. You can tailor this configuration to suit your needs, filter events to focus only on those, or even customize logic in your Lambda function to do something further than here.<br>Stay tuned for the next blog, where we will explore <strong>setting up automated remediation using AWS Lambda</strong> and the steps involved in automatic incident response.</p><h3>Attribute Sources or References</h3><h4>GitHub Repositories</h4><ul><li><a href="https://github.com/Dip0375/SecurityHub_CustomFindings.git">SecurityHub Custom Findings</a></li><li><a href="https://github.com/Dip0375/EnableAWSConfig_CFT.git">Enable AWS Config CFT</a></li></ul><h4>AWS Documentation</h4><ul><li><strong>AWS Config:</strong> <a href="https://docs.aws.amazon.com/config/latest/developerguide/gs-console.html">Getting Started with AWS Config</a></li><li><strong>Security Hub Setup:</strong> <a href="https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-settingup.html">Setting up Security Hub</a></li><li><strong>Security Hub Custom Actions:</strong> <a href="https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-cwe-custom-actions.html">Create Custom Actions</a></li><li><strong>EventBridge Rule:</strong> <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule.html">Create EventBridge Rule</a></li><li><strong>Lambda Function:</strong> <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html">AWS Lambda Python Documentation</a></li><li><strong>Boto3 Python Code:</strong> <a href="https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/securityhub.html">Boto3 SecurityHub API Reference</a></li></ul><h4>For More Updates, Connect with Me</h4><ul><li><strong>Bio Link:</strong> <a href="https://dipnarayan.bio.link/">https://dipnarayan.bio.link/</a></li><li><strong>LinkedIn:</strong> <a href="https://www.linkedin.com/in/dipnarayan-nandi-95b6a21b3?utm_source=share&amp;utm_campaign=share_via&amp;utm_content=profile&amp;utm_medium=android_app">Dipnarayan Nandi</a></li><li><strong>Website:</strong> <a href="https://www.dipnarayan.in/">www.dipnarayn.in</a></li><li><strong>GitHub:</strong> <a href="https://github.com/Dip0375">github.com</a></li><li><strong>Medium: </strong><a href="https://medium.com/@dipnarayan.n">medium.com</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2431b7cb614d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Patch Management Process On Windows Server Through Amazon System Manager]]></title>
            <link>https://medium.com/@dipnarayan.n/patch-management-process-on-windows-server-through-amazon-system-manager-0402d68f07f6?source=rss-e18bc0123517------2</link>
            <guid isPermaLink="false">https://medium.com/p/0402d68f07f6</guid>
            <dc:creator><![CDATA[DIPNARAYAN NANDI]]></dc:creator>
            <pubDate>Mon, 15 Jan 2024 07:33:01 GMT</pubDate>
            <atom:updated>2024-01-15T08:31:59.623Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*HgZ3bwlbJwmWg0q9_lz0gA.jpeg" /></figure><h3>What is Patch Management?</h3><p>Patch management is the process of applying updates to software, drivers, and firmware to protect against vulnerabilities. In AWS, Amazon Systems Manager (SSM) is a service that helps automate and simplify the patch management process for instances within your environment.</p><h3>Benefits of Patch Management</h3><p>The key benefits of patch management in a nutshell:</p><p><strong>Security:</strong> Mitigates vulnerabilities and protects against cyber threats.<br><strong>Stability:</strong> Enhances system stability and reduces crashes.<br><strong>Compliance:</strong> Helps meet industry standards and regulations.<br><strong>Performance:</strong> Improves software efficiency and responsiveness.<br><strong>Data Protection:</strong> Safeguards sensitive data from breaches.<br><strong>Cost Savings:</strong> Prevents financial losses due to security incidents.<br><strong>Efficiency:</strong> Automates updates, saving time and effort.<br><strong>Availability:</strong> Reduces downtime by preventing issues.<br><strong>Consistency:</strong> Ensures uniformity across systems.<br><strong>Reputation:</strong> Maintains trust by preventing breaches.</p><h3>Prerequisites:</h3><p>Before we begin the patch management process on Ubuntu Server through Amazon Systems Manager (SSM), there are a few prerequisites we need to ensure:</p><p><strong>Amazon Web Services (AWS) Account:</strong> Ensure you have an active AWS account to access Amazon Systems Manager and other AWS services.</p><p><strong>Windows Instances:</strong> You should have Windows Server instances running within your AWS environment that you want to manage and patch using Amazon SSM.</p><p><strong>SSM Agent Installed:</strong> The Amazon SSM Agent needs to be installed and running on your Windows instances. This agent facilitates communication between the instances and the Systems Manager service.</p><p><strong>IAM Permissions:</strong> Instances require IAM roles with appropriate permissions to interact with Amazon SSM. Ensure that the IAM role associated with your instances has the necessary permissions to perform actions related to Systems Manager, such as running patching tasks.</p><p><strong>Security Groups and Firewalls:</strong> Configure security groups and firewall settings to allow communication between instances and Amazon SSM. Ensure there are no restrictions that could impede SSM Agent communication.</p><h3>Process Of Patch Management</h3><p><strong>Step 1: Create an IAM Role with IAM Policy to configure SSM Agent</strong></p><p><strong>Step 2: Install SSM Agent on the Windows Server</strong></p><p><strong>Step 3: Viewing Patch summaries of Servers</strong></p><p><strong>Step 4: RDP to the Windows Server</strong></p><p><strong>Step 5: Patch the Server through the Patch Manager</strong></p><p><strong>Step 6: RDP to the Server and check the system update</strong></p><h3><strong>Step 1: Create an IAM Role with IAM Policy to configure SSM Agent</strong></h3><ul><li>In the left side navigation pane of IAM, choose <strong>Roles,</strong> then choose <strong>Create role</strong>.</li><li>On the <strong>Select trusted entity page</strong>, choose <strong>AWS service</strong>, and then select the <strong>EC2</strong> use case. Select <strong>Next</strong>.</li><li>On the <strong>Add Permission page</strong>, select the policies that grant instances access to the resources that they need. Choose <strong>Next</strong>.</li><li>Give a suitable Role name (<strong>SSM_ManagerRole</strong>) and description for the role. Click on <strong>Create role</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-vsAH17zlhO2MsN-" /></figure><p>Now, Attach the newly created IAM role to the existing EC2 Instance.</p><h3>Step <strong>2: Install SSM Agent on the Windows Server</strong></h3><p>If the SSM agent is not configured in Windows Server, then we need to follow the below process:</p><ul><li>RDP to the Windows EC2 instance, then download the latest version of SSM Agent into the EC2 instance:</li></ul><p><a href="https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/windows_amd64/AmazonSSMAgentSetup.exe">https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/windows_amd64/AmazonSSMAgentSetup.exe</a></p><ul><li>Run the downloaded <strong>AmazonSSMAgentSetup.exe</strong> file to install SSM Agent.</li><li>Restart the SSM Agent in Powershell using the following command:</li></ul><pre>Restart-Service AmazonSSMAgent</pre><h3>Step 3: Viewing Patch summaries of Servers</h3><ul><li>Open the <strong>AWS Systems Manager</strong> console.</li><li>In the left side navigation pane, choose <strong>Patch Manager. </strong>Then select <strong>Start with an overview</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*9lVQ9HOd7vIzupMj" /></figure><ul><li>Choose the <strong>Dashboard</strong> tab.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dKRUxcCuvT_-kG7t" /></figure><ul><li>Choose <strong>Compliance reporting</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rc3e9hXdwcsXUdoz" /></figure><p>After choosing<strong> Compliance reporting, </strong>we can see two servers are there, but in the<strong> Compliance status, </strong>it<strong> </strong>shows<strong> Never reported, i.e., </strong>no patching activity happened before on this server.</p><h3>Step 4: RDP to the Windows Server:</h3><ul><li>On the Windows server, go to <strong>Settings</strong>, then select <strong>Update and Security</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WBvAKcKZZ-ws9jXn" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IdL8OlTx4k6Na4og" /></figure><h3>Step 5: Patch the Server through the Patch Manager</h3><ul><li>Click on <strong>Patch now</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hGEM-03N1KlEFYva" /></figure><ul><li>In the <strong>Patch instances now </strong>page, <strong>Patching operation</strong> section, choose <strong>Scan</strong>.</li><li>In the <strong>Instances to patch </strong>section, select <strong>Patch only the target instances I specify </strong>and Click on <strong>Choose Instance manually, </strong>select the target Instance.</li><li>bnn</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*V3ADS6DNzvQHu0v7" /></figure><ul><li>Choose <strong>Patch now</strong>. Now, We can see the target server scan is successful.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gS4FWu940xT_a4z1" /></figure><ul><li>Then, go to <strong>Compliance reporting</strong>, we can see server <strong>Compliance status </strong>is<strong> Not complaint</strong>. So, some patch management processes are required on that server.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mjgpgisBVPLH1v6w" /></figure><ul><li>Now, select on<strong> Patch now.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QQEWW9RF6hjSwz0G" /></figure><ul><li>In the <strong>Patch instances now </strong>page, in the <strong>Patching operation</strong> section, choose <strong>Scan and Install</strong>.</li><li>In the <strong>Instances to patch </strong>section, select <strong>Patch only the target instances I specify, </strong>and Click on <strong>Choose Instance manually, </strong>select the target Instance.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pcI8cxbTY60UsNzY" /></figure><ul><li>Select <strong>Patch now</strong>. Now, We can see the target server <strong>scan and Instal</strong>l status is <strong>Success</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-_n8EdEOLh5ilZQf" /></figure><ul><li>Then, go to <strong>Compliance reporting, </strong>and we can see that the server <strong>Compliance status </strong>is<strong> complaint</strong>. So, patch management processes are successful on that server.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0ImL3ge6AmIEjjlQ" /></figure><h3>Step 6: <strong>RDP to the Server and check the system update</strong></h3><ul><li>RDP to the EC2 instance.</li><li>On the Windows server, go to <strong>Settings</strong>, then select <strong>Update and Security</strong>. You can see system is Update.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VV-FZwmBC3-24oE_" /></figure><h3>References</h3><ul><li><strong>AWS Systems Manager :</strong> <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/what-is-systems-manager.html">https://docs.aws.amazon.com/systems-manager/latest/userguide/what-is-systems-manager.html</a></li><li><strong>SSM agent install:</strong> <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-install-win.html">https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-install-win.html</a></li><li><strong>Patch Manager: </strong><a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager.html">https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager.html</a></li></ul><p># If you have any queries or doubts feel free to reach out to me.</p><p><strong>LinkedIn:</strong> <a href="https://www.linkedin.com/in/dip-narayan-nandi-95b6a21b3/">https://www.linkedin.com/in/dip-narayan-nandi-95b6a21b3/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0402d68f07f6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Patch Management Process On Ubuntu Server Through Amazon System Manager]]></title>
            <link>https://medium.com/@dipnarayan.n/patch-management-process-on-ubuntu-server-through-amazon-system-manager-86ac181f2987?source=rss-e18bc0123517------2</link>
            <guid isPermaLink="false">https://medium.com/p/86ac181f2987</guid>
            <dc:creator><![CDATA[DIPNARAYAN NANDI]]></dc:creator>
            <pubDate>Thu, 17 Aug 2023 13:37:51 GMT</pubDate>
            <atom:updated>2023-08-17T13:37:51.964Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*sdduo2JUcv9Mt9eoUiQchw.jpeg" /></figure><h3>What is Patch Management?</h3><p>Patch Management refers to the process of applying software updates, security patches, and fixes to instances (virtual machines) and other resources within your AWS environment. AWS offers a service called Amazon Systems Manager (SSM) that provides tools and features to automate and streamline the patch management process for your instances.</p><h3>Benefits of Patch Management</h3><p>The key benefits of patch management in a nutshell:</p><p><strong>Security:</strong> Mitigates vulnerabilities and protects against cyber threats.<br><strong>Stability:</strong> Enhances system stability and reduces crashes.<br><strong>Compliance:</strong> Helps meet industry standards and regulations.<br><strong>Performance:</strong> Improves software efficiency and responsiveness.<br><strong>Data Protection:</strong> Safeguards sensitive data from breaches.<br><strong>Cost Savings:</strong> Prevents financial losses due to security incidents.<br><strong>Efficiency:</strong> Automates updates, saving time and effort.<br><strong>Availability:</strong> Reduces downtime by preventing issues.<br><strong>Consistency:</strong> Ensures uniformity across systems.<br><strong>Reputation:</strong> Maintains trust by preventing breaches.</p><h3>Prerequisites</h3><p>Before we begin the patch management process on Ubuntu Server through Amazon Systems Manager (SSM), there are a few prerequisites we need to ensure:</p><p>1. <strong>Amazon Web Services (AWS) Account</strong>: You need an active AWS account to access Amazon Systems Manager and other AWS services.</p><p>2. <strong>Ubuntu Instances</strong>: You should have Ubuntu Server instances running within your AWS environment that you want to manage and patch using Amazon SSM.</p><p>3. <strong>SSM Agent Installed</strong>: The Amazon SSM Agent needs to be installed and running on your Ubuntu instances. The agent enables communication between the instances and the Systems Manager service.</p><p>4. <strong>IAM Permissions</strong>: Instances require IAM roles with appropriate permissions to interact with Amazon SSM. Ensure that the IAM role associated with your instances has the necessary permissions to perform actions related to Systems Manager, such as running patching tasks.</p><p>5. <strong>Security Groups and Firewalls</strong>:<br> Configure security groups and firewall settings to allow communication between instances and Amazon SSM. Make sure there are no restrictions that could prevent SSM Agent communication.</p><h3>Process Of Patch Management</h3><p><strong>Step1: Create an IAM Role with IAM Policy to configure SSM Agent</strong></p><p><strong>Step 2: Install SSM Agent on the Ubuntu Server</strong></p><p><strong>Step 3: Viewing Patch summaries of Servers</strong></p><p><strong>Step 4: Patch the Server through the Patch Manager</strong></p><p><strong>Step 5: SSH to the Server and update the system</strong></p><h3><strong>Step1: Create an IAM Role with IAM Policy to configure SSM Agent</strong></h3><ul><li>In the left side navigation pane of IAM, choose <strong>Roles</strong> then choose <strong>Create role</strong>.</li><li>On the <strong>Select trusted entity page</strong>, choose <strong>AWS service</strong>, and then select the <strong>EC2</strong> use case. Select <strong>Next</strong>.</li><li>On the <strong>Add permissions page</strong>, select the policies that grant instances access to the resources that they need. Choose <strong>Next</strong>.</li><li>Give a suitable Role name (<strong>SSM_ManagerRole</strong>) and description for the role. Click on <strong>Create role</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wiR_n_Xx3crKgGdN" /></figure><p>Now, Attach the newly created IAM role with the existing EC2 Instance.</p><h3>Step 2: Install SSM Agent on the Ubuntu Server</h3><ul><li>Connect to your Ubuntu Server instance, such as SSH.</li><li>Run the following command to create a temporary directory on the instance.</li></ul><p><strong>mkdir /tmp/ssm</strong></p><ul><li>Change to the temporary directory.</li></ul><p><strong>cd /tmp/ssm</strong></p><ul><li>Run the following commands.</li></ul><p><strong>wget </strong><a href="https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/debian_amd64/amazon-ssm-agent.deb"><strong>https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/debian_amd64/amazon-ssm-agent.deb</strong></a></p><p><strong>sudo dpkg -i amazon-ssm-agent.deb</strong></p><ul><li>Install the SSM service run below command</li></ul><p><strong>sudo install amazon-ssm-agent -y</strong></p><ul><li>Run one of the following commands to start the service</li></ul><p><strong>sudo systemctl start amazon-ssm-agent</strong></p><p><strong>sudo systemctl enable amazon-ssm-agent</strong></p><ul><li>Run one of the following commands to determine if the SSM Agent is running</li></ul><p><strong>sudo systemctl status amazon-ssm-agent</strong></p><h3><strong>Step 3: Viewing Patch summaries of Servers</strong></h3><ul><li>Open the <strong>AWS Systems Manager</strong> console.</li><li>In the left side navigation pane, choose <strong>Patch Manager. </strong>Then select <strong>Start with an overview</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HY6u4tcoerbX8WZC" /></figure><ul><li>Choose the <strong>Dashboard</strong> tab.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3zpipsdJbmfqhhsf" /></figure><ul><li>Choose <strong>Compliance reporting</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4E0hg0FsqntB2vXU" /></figure><p>After choosing<strong> Compliance reporting, </strong>we can see two servers are there, but the<strong> Compliance status </strong>shows<strong> Never reported, i.e., </strong>no patching activity happened before on this server.</p><h3><strong>Step 4: Patch the Server through the Patch Manager</strong></h3><ul><li>Click on <strong>Patch now</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Z8aaB6wKmlJyl7IE" /></figure><ul><li>In the <strong>Patch instances now </strong>page, <strong>Patching operation</strong> section, choose <strong>Scan</strong>.</li><li>In the <strong>Instances to patch </strong>section, select <strong>Patch only the target instances I specify </strong>and Click on <strong>Choose Instance manually, </strong>select the target Instance.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jqBDe9KvAYVIRoVL" /></figure><ul><li>Choose <strong>Patch now</strong>. Now, We can see the target server scan is a Success.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3UKWvGOVtQAC70WO" /></figure><ul><li>Then, go to <strong>Compliance reporting</strong>, we can see the server <strong>Compliance status </strong>is<strong> Not complaint</strong>. So, some patch management processes are required on that server.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-jjdJDGFxclHWNPy" /></figure><p>Now, select <strong>Patch now.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZevSITVRbf7167MF" /></figure><ul><li>In the <strong>Patch instances now </strong>page, <strong>Patching operation</strong> section, choose <strong>Scan and Install</strong>.</li><li>In the <strong>Instances to patch </strong>section, select <strong>Patch only the target instances I specify </strong>and Click on <strong>Choose Instance manually, </strong>select the target Instance.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GaNa-Z_KeAajfh8N" /></figure><ul><li>Select <strong>Patch now</strong>. Now, We can see the target server <strong>scan and Instal</strong>l status is Success.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*B3YG2wFaYiyzSMio" /></figure><ul><li>Then, go to <strong>Compliance reporting</strong>, and we can see server <strong>Compliance status </strong>is<strong> complaint</strong>. So, patch management processes are successful on that server.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CBgO7C95_Tq4xwDl" /></figure><h3><strong>Step 5: SSH to the Server and update the system</strong></h3><p>Now, we can SSH the Compliant Server through the Session Manager.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/0*G0-JXFxAquu4ahRg" /></figure><p>Run the server update command:</p><p><strong>sudo apt update -y</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/0*_yE2V12sC1vojwrG" /></figure><h3>References</h3><ul><li><strong>AWS Systems Manager :</strong> <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/what-is-systems-manager.html">https://docs.aws.amazon.com/systems-manager/latest/userguide/what-is-systems-manager.html</a></li><li><strong>SSM agent install:</strong> <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/agent-install-ubuntu.html">https://docs.aws.amazon.com/systems-manager/latest/userguide/agent-install-ubuntu.html</a></li><li><strong>Patch Manager: </strong><a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager.html">https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager.html</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86ac181f2987" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Encrypted AMI Cross Account Share]]></title>
            <link>https://medium.com/@dipnarayan.n/encrypted-ami-cross-account-share-fa9ad8c76553?source=rss-e18bc0123517------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa9ad8c76553</guid>
            <dc:creator><![CDATA[DIPNARAYAN NANDI]]></dc:creator>
            <pubDate>Wed, 02 Aug 2023 17:31:50 GMT</pubDate>
            <atom:updated>2023-08-02T17:31:50.272Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*0kdVfUH_xCjX0ivp2WmgfA.jpeg" /></figure><h3>Purpose:</h3><p>The purpose of AWS Encrypted AMI Cross Account Share is to securely and efficiently share encrypted Amazon Machine Images (AMIs) between different AWS accounts. This feature allows organizations to share custom AMIs, containing pre-configured applications and settings while ensuring data privacy and compliance with security standards. By leveraging AWS Key Management Service (KMS) encryption, the AMIs are protected both in transit and at rest, providing an added layer of security during the sharing process. With this capability, businesses can streamline their operations, collaborate seamlessly across accounts, and maintain a robust security posture when distributing sensitive AMIs within the AWS ecosystem.</p><h3>Prerequisites:</h3><p>Before using AWS Encrypted AMI Cross Account Share, there are several prerequisites that must be met:</p><ul><li><strong>AWS Accounts:</strong> We need at least two AWS accounts, the source account where the encrypted AMI is created, and the target account where the AMI will be shared.</li><li><strong>IAM Roles: </strong>You must have the necessary IAM roles with appropriate permission in both the source and target accounts. The roles should allow cross-account access to the required resources, such as EC2 instances, S3 buckets, and KMS keys.</li><li><strong>KMS Encryption:</strong> The source account must have an AWS Key Management Service (KMS) customer-managed key (CMK) to encrypt the AMI. The key policy should allow the target account to use the key for decryption.</li><li><strong>AMI Encryption:</strong> Ensure the AMI you want to share is encrypted using the KMS CMK mentioned in the previous step.</li><li><strong>Trust Policy: </strong>The IAM role in the target account must have a trust policy that allows the source account to assume the role. This enables the source account to share the AMI with the target account.</li></ul><h3>Steps for Sharing an AMI (Console)</h3><p>Step 1: Create one shared KMS key</p><p>Step 2: Create one snapshot from the encrypted EBS volume using the AWS managed key (aws/ebs)</p><p>Step 3: Create another snapshot from the previous snapshot using the shared KMS key</p><p>Step 4: Create one AMI using a snapshot, which one created using the share KMS key</p><p>Step 5: Migrate encrypted AMI</p><h3><strong>Step 1: Create one shared KMS key</strong></h3><p>First, we need to create one KMS key.</p><ol><li>In the Key Management Console, choose <strong>Customer managed keys</strong></li><li>Choose the <strong>create key</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3jQ876h4oa0UCCzm" /></figure><p>3. Choose key type Symmetric and key usage Encrypt and decrypt.</p><p>4. Then, expand <strong>Advanced options</strong>. Choose Key material origin as KMS and Regionality as Multi-Region key. Click on <strong>Next.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/0*kPEsMIAiOVeQgcEq" /></figure><p>5. Give <strong>alias </strong>name</p><p>6. Click on <strong>Next</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/0*CKIUcOPan_wLO2c0" /></figure><p>7. Choose any Key administrators and select <strong>Next</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/0*W-QUjnGXszt8XYee" /></figure><p>8. Select any Key users and click on <strong>Add another AWS account</strong>. Give Target AWS account ID.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/0*b8TrBB-OEg4ihuXt" /></figure><p>9. Select <strong>Next</strong>. Then, <strong>Review and Finish</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1NFAfimC15nqRuxd" /></figure><h3>Step 2: Create one snapshot from the encrypted EBS volume using the AWS managed key(aws/ebs)</h3><ol><li>Go to the EC2 console. Then, on the left side pane, select <strong>Volumes.</strong> Select the check box of exact volume. Click on Actions and select Create Snapshot.</li><li>Give an appropriate description and select <strong>Create Snapshot</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*R005FBaFll86FnVk" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/0*VEFSiREEGW4lZwon" /></figure><p><strong>Snapshot:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MS9RMirw5IdHG6bN" /></figure><h3>Step 3: Create another snapshot from the previous snapshot using the Share KMS key</h3><ol><li>Now, we need to create another snapshot from the previous snapshot.</li><li>on the left side pane, select<strong> Snapshots</strong>.</li><li>Choose the exact Snapshot. Click on <strong>Actions </strong>and select<strong> Copy Snapshot</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*g_3DLXn97iUqVFDj" /></figure><p>4. Give an appropriate description and choose the share KMS key. Select <strong>Copy Snapshot</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/0*t8MgDbYOYn77A341" /></figure><h3>Step 4: Create one AMI using a snapshot, which one created using the share KMS key</h3><p>Now, we will create one AMI using this snapshot, which is created using the shared KMS key.</p><ol><li>In the Snapshots section, choose the exact snapshot and select <strong>Actions</strong>. Choose to <strong>Create image from snapshot</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LoRFoncwjnwcY8OB" /></figure><p>2. Give an Image name. Select <strong>Create image</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/0*gE9V_KqTuzIR6V1u" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vmTVPXpnkg3dJhAU" /></figure><h3>Step 5: Migrate encrypted AMI</h3><ol><li>In the EC2 console, on the life side pane, go to the <strong>AMIs</strong> section.</li><li>Choose the exact AMI. Click on <strong>Actions</strong> and select <strong>Edit AMI permissions</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qaIectZ9772Qisc_" /></figure><p>3. Click on the checkbox (Add ‘Create volume’ permission to associated snapshots when creating account permissions.)</p><p>4. In the <strong>Shared accounts </strong>section, Click on <strong>Add account ID</strong>. Give the account ID of the destination/target account. Click on <strong>Save Changes</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/0*nsoQbXqrJeKFYUKA" /></figure><p>Now, go to the destination/target account and in the EC2 console, go to the <strong>AMIs</strong> section, we can see the shared AMI. Using this shared AMI, we can launch EC2 Instance in the destination account.</p><p># If you have any queries or doubts feel free to reach out to me.</p><p><strong>LinkedIn:</strong> <a href="https://www.linkedin.com/in/dip-narayan-nandi-95b6a21b3/">https://www.linkedin.com/in/dip-narayan-nandi-95b6a21b3/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa9ad8c76553" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>