<?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 Mugilvannan Loganathan on Medium]]></title>
        <description><![CDATA[Stories by Mugilvannan Loganathan on Medium]]></description>
        <link>https://medium.com/@mugilvannan.4?source=rss-2a09eb04628c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*vLO4lM3xOdpAWsXf.jpg</url>
            <title>Stories by Mugilvannan Loganathan on Medium</title>
            <link>https://medium.com/@mugilvannan.4?source=rss-2a09eb04628c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 21:54:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mugilvannan.4/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[One Night. One Region Down. One DR Built from Scratch.]]></title>
            <link>https://medium.com/@mugilvannan.4/one-night-one-region-down-one-dr-built-from-scratch-0c330026cbdd?source=rss-2a09eb04628c------2</link>
            <guid isPermaLink="false">https://medium.com/p/0c330026cbdd</guid>
            <dc:creator><![CDATA[Mugilvannan Loganathan]]></dc:creator>
            <pubDate>Tue, 07 Apr 2026 09:40:52 GMT</pubDate>
            <atom:updated>2026-04-07T09:40:52.208Z</atom:updated>
            <content:encoded><![CDATA[<p>It was the end of a long day. I was exhausted with a dozen things still on my plate when the message came in. The applications we believed were highly available? Not anymore. They needed to be migrated to an entirely different region, far from the affected one. Immediately.</p><p>I was one of those people who assumed that multi-AZ meant bulletproof until an entire region went down and proved me wrong. You know that feeling when you finally use a formula you thought you’d never need outside an exam? That night, disaster recovery was my (a+b)². Some lessons only land when the alarms are real.</p><p>In this blog, I’ll walk you through how we pulled off an overnight migration, hour by hour. I recently watched <em>The Pitt </em>a medical drama that unfolds in real time, one hour at a time inside an ER. I liked that format so much, I’m borrowing it. Why should doctors have all the fun?</p><h4><strong>Before we get to the chaos, here’s what we wanted to achieve</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2n8jObAYfJqkSOn4-W2JOg.png" /><figcaption>The architecture — before the night had other plans</figcaption></figure><p>Our goal was to get the application running in a new region from scratch overnight. A full setup with AWS EKS across availability zones, traffic routed through Route 53 failover, bank connectivity via AWS Site-to-Site VPN, and data on a Multi-Region MongoDB Atlas Cluster with the new region promoted as primary.</p><p>This diagram is what we were building <em>towards</em>. At 4PM, none of the right side existed. By morning, it had to.</p><h4>5PM to 6PM</h4><p>The first hour of any crisis has a 100% chance of news that will ruin your evening. I was peacefully working through a task, the good kind where you actually know what you are doing and how to finish, when a text landed from my lead. DR needs to be up by morning.</p><p>My brain immediately did what any reasonable brain does. It protested. I asked for 48 hours. One client call later I had 12.</p><p>What I did not know yet was that we were not alone. Every team was moving their applications out of the region at the same time. That is the moment I stopped thinking like a solo engineer. You cannot run alone when everyone is running as a group.</p><h4>6PM to 7PM</h4><p>You know that feeling when you think you are running a flat track and somewhere around the 200 meter mark you realise it is actually a hurdles race? That was 6PM.</p><p>The work was not the hard part. The hard part was context switching between execution mode and explanation mode. In a crisis everyone wants to be in the loop and that is completely fair. There is just a fine line between staying informed and staying in each other’s way.</p><p>I did what any sensible engineer does when they need to reset. I stepped away from my desk, got some fresh air and called someone to talk it out. If you grew up middle class you know that a good gossip session is basically therapy. Same price, faster results. No prescription required.</p><p>The real lesson of 6PM? In a crisis, protect your team’s focus. The best thing a leader can sometimes do is get out of the way and let the team run.</p><h4>7PM to 8PM</h4><p>After the break I mentally fixed that I have to be awake the entire night but at the same time I had this idea of finishing things faster and sleeping around 2AM. I did not sleep at all but that is a story for later.</p><p>First thing I had to do was dig through Bitbucket to find the IaC repo. I am not good at remembering names especially when the primary region was set up 3 years ago across multiple laptops. But we found it. And this is where past us deserves some credit because we had automated everything with Terraform. Three years ago we did the right thing and that one good decision made this night a lot easier than it could have been.</p><p>Then came CIDR ranges. It sounds simple. It is never simple. Conflicting CIDR ranges is not just a bug it is an architecture change and I have learned that lesson the hard way before. I picked ranges that were obscure enough to avoid conflicts. I just simply did not want to put extra salt in the wound.</p><h4>8PM to 9PM</h4><p>I may not remember repository names but I know the flow. I know what needs to be done and in what order. That muscle memory kicks in when everything else is chaos.</p><p>This hour was all about laying the foundation. VPC, subnets, route tables, gateways, all the network groundwork that sounds boring but without it nothing else stands. I moved through it quickly because these are the easy things. There are bigger fish to catch later.</p><p>I was also supposed to eat dinner during this window. Intermittent fasting, very disciplined, very healthy. The next day I broke a streak and ate everything in sight because irregular sleep does things to you that no nutrition plan survives. Some casualties of the night were expected. My fasting streak was not one I predicted.</p><p>By 9PM the base was up and nothing had gone wrong yet. It felt like the first half of a feel good movie. You know something is coming. You just do not know when.</p><h4>9PM to 10PM</h4><p>Now it is time for the bigger fish. EKS cluster and the node groups.</p><p>EKS cluster is pretty simple to create and manage as long as you do it in the public subnets and expose it to the world with all the security risks that come with it. But things get complicated when you set up EKS in the private subnet. You never succeed in the first attempt for sure, like a baby walking for the first time. There are always issues connecting to the EKS cluster from the IaC tools or the provider plugin acting up. I am yet to solve that maze completely.</p><p>Another big thing is attaching the node group to the EKS cluster. It is another riddle to solve. This time it took a while thanks to the NACL rules. Like I said even one simple firewall rule can kill your time and make you cry especially at a time like this. The EKS cluster creation was smooth this time but we ran into node group issues. What we did not know then was that it was going to take another two hours.</p><h4>10PM to 11PM</h4><p>On a normal day at 10PM I would be playing FC26 online and losing to a bot or some random player. Tonight I was losing to myself.</p><p>The node group issue was still not resolved and the clock was very much still running. Every time we ran the Terraform script and watched the logs it felt like entering my registration number and waiting for exam results to load. That specific kind of stress where you know the answer is coming and you are terrified of what it is.</p><p>I was not hungry. I was not tired yet. I was just fully drowned in the problem. That tunnel vision where nothing else exists except the thing that is not working.</p><p>We got on a call with support. They walked us through all the debugging steps. The same ones we had already done. We nodded, we followed along, we were completely clueless. Sometimes support is less about finding the answer and more about having someone to be stuck with.</p><h4>11PM to 00AM</h4><p>Full transparency. At this point I had self doubt about this blog too. Two hours of writing and I hit a wall. The same thing happened that night. A flood of if else statements but in my head. What if this does not work. Are we doing it the right way. Can we do it manually. Should we just put the cluster in public subnets and deal with the security issues later. That is what stress does. It turns engineers into people who consider bad ideas seriously.</p><p>We were on a support call for over an hour and nothing was moving. Just the same debugging steps on repeat. Copy this command. Paste it here. Share your screen. I do not blame them. Debugging someone else’s infrastructure at midnight is not easy. But at some point I lost my patience with the process.</p><p>So I did something radical. I asked everyone to take a dinner break. Fifteen minutes. Step away.</p><p>I had been postponing dinner since 8PM so I quickly grabbed something I was not even hungry for anymore. Came back to the desk in a few minutes, cleared my head and started tracing everything I had created in a hurry. Six or seven minutes later I found it. One NACL rule sitting quietly in the wrong place causing all of this.</p><p>Fixed. Done. Relief.</p><p>Some problems do not need more debugging. They need dinner.</p><h4>00AM to 01AM</h4><p>Full transparency again. I am continuing this blog after a weekend break. I thought two days off would recharge the creativity. It is Monday and it has not. Some things do not improve with rest apparently.</p><p>Back to that night. By midnight the infrastructure side had stabilised. Small win. But the bigger fish was still swimming. Data migration.</p><p>MongoDB Atlas was also having trouble in the affected region. So it was not just AWS, the entire stack was feeling the impact. The first thing we did after a quick sync was to confirm data replication to the secondary region. We tried setting up the multi region cluster but the Atlas console was not showing the green status we needed. No confirmation, no certainty, just a console staring back at us.</p><p>Accessing the AWS console and Atlas console that night felt like doing something you know by heart but blindfolded. Everything looked familiar and nothing was behaving normally.</p><p>Fortunately the team managed to get MongoDB support on the call. Within that hour we had initiated the migration to the secondary region. Not done yet but moving. At midnight that felt like everything.</p><h4>01AM to 02AM</h4><p>We were stuck again. Data migration was in progress and nothing was in our control except hope and patience. Two things engineers are not traditionally trained for.</p><p>The team took full ownership of the support call with MongoDB. I am genuinely grateful for that. They were now going through exactly what I went through two hours ago with the node group debugging. The waiting, the repetitive steps, the screen sharing. I did not join the call. Not because I did not care but because too many people on a support call does not make the problem solve faster. It just makes the call louder.</p><p>Working alone at midnight sounds manic. That night it felt like freedom.</p><p>So I did what anyone does when they are forced to wait but cannot fully switch off. I put on some songs, scrolled through reels, and opened my daily journal to keep the streak alive. Small wins. I tried everything to stay out of the work headspace because I knew the moment the call ended there would be something waiting for me on the other side.</p><p>The place I was staying did not have great food options at 2AM. The hobbies I had access to were not exciting. This hour was honestly just boring. And sometimes in a crisis a boring hour is the best hour you can get.</p><h4>02AM to 03AM</h4><p>Data migration completed somewhere in this window. We did not cheer. We did not have the energy. We just nodded, cast the net again and went after the next fish. Application migration.</p><p>I handed the wheel to the team. Keeping engineers idle at 2AM is a crime and they were too good to waste. What they pulled off next deserves its own movie scene.</p><p>The original cluster was completely gone. Servers not responding. The AWS console was doing its best impression of a brick wall. No artifacts, no app files, nothing reachable from the primary region. On paper we were cooked.</p><p>Except we were not. The team raided the lower environment like it was a backup fridge at 3AM and found exactly what they needed. Copied the artifacts, deployed to DR, application came up clean. No major inconsistencies. No drama. Just results.</p><p>The secret weapon? Our dev team had always kept lower environments consistent with production. A habit nobody celebrated on a normal day that single handedly saved us at 2AM.</p><p>If you are wondering why we did not use a CI/CD pipeline or keep artifacts in the repository the honest answer is that this application does not need frequent deployments. It spins up its own deployments for new APIs. We just had not thought to store the one time deployment artifacts in the repo. We are thinking about it now.</p><h4>03AM to 04AM</h4><p>This is the hour where the body gives up but the brain refuses to. We were setting up the EKS cluster with autoscale mode and somewhere in the process nobody told our brains to stop autoscaling random thoughts. Tired minds scale everything. 30 to 40 percent of work left felt like 60 percent. A five minute task felt like thirty. Everything was slightly larger and slightly harder than it actually was.</p><p>But we stretched ourselves anyway. We had decided from the beginning that this was not going to be a quick and dirty migration. We wanted it watertight. So at 3AM we were setting up VPN access for the APIs, configuring ingress load balancers to expose the application privately and ticking off every security measure we could think of.</p><p>Can you sleep with your front door open? I cannot. So we locked every door we could find before calling it done.</p><p>Some of it I honestly cannot remember now. 3AM has a way of blurring the details. But the work got done and that is what matters.</p><h4>04AM to 06AM</h4><p>If you noticed the heading covers two hours this time there is a reason for that. I was stuck. Badly stuck. And I knew it.</p><p>Just when you think everything is falling into place the universe sends you a reminder that you are not done yet. Mine came in the form of OpenVPN. Set it up, connected, tried to access the application. Nothing. I read every link on the internet. Watched YouTube videos at 4AM like a person who has completely lost the plot. Reconfigured the VPN multiple times. Nothing helped. I was glued to my chair for two full hours with the same problem staring back at me.</p><p>Here is the cruel irony. When I was training for a marathon last year I used to love this window. 4AM to 6AM in Chennai with humidity above 60% is somehow still the golden hour for runners. Quiet roads, cool enough to breathe, just you and the city before it wakes up.</p><p>That same window this night was the most painful two hours of the entire migration.</p><p>The most peaceful hours of my day became the most painful. Same time. Different universe.</p><h4>06AM to 08AM</h4><p>Whoever is still reading this, I see you. I know you are tired. So was I.</p><p>The sunrise showed up right on schedule. Nobody asked for it. I thought the bright light might bring some freshness, some second wind, some sign from the universe that things were about to get better. I was still searching for the light at the end of the tunnel while the actual sun was rising outside my window. The irony was lost on me at the time.</p><p>I had spent two hours reading every OpenVPN configuration known to mankind. I had tried 20 plus combinations. I knew that product well enough to crack a support interview that morning if someone had offered me one.</p><p>Then my dog reminded me he existed.</p><p>I took him for a walk. He looked at me with genuine confusion. Fair enough. Even he knew this was not normal. But that ten minutes of fresh air and a confused dog did something two hours of debugging could not.</p><p>I came back, switched everything off and took a power nap. Fifteen minutes. No alarm. Just my responsibilities doing the job of waking me up.</p><p>I fixed the issue in twenty minutes after waking up.</p><p>Like food, sometimes you just need a power nap.</p><p>And just like that it was done. DR was up. The night was over. The application was running in the secondary region.</p><p>You know what I did after fixing the last issue?</p><p>Not sleep. Not food.</p><p>I played FC26. And lost. Obviously.</p><p>But this time I enjoyed losing.</p><h4><strong>Lessons learned</strong></h4><p>We always planned to set up DR properly. We just planned to do it tomorrow. Tomorrow came faster than expected and it came with a deadline.</p><p>Multi AZ means your application survives a server failure. It does not mean it survives the world having a bad day.</p><p>Terraform was a three year old decision that paid off at midnight. Good decisions do not always feel important when you make them. They feel important when you need them.</p><p>Consistency between lower environments and production is not a nice to have. It is your emergency parachute.</p><p>We built the DR in one night that we should have built in one sprint. The difference was just urgency. Urgency is an expensive way to get things done.</p><p>Nobody plans to fail. Most people just do not plan.</p><p><strong><em>The cloud is resilient. The world is not. Plan accordingly.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0c330026cbdd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Port 22 to 443 — The Hidden Dangers of Exposing Cloud Services]]></title>
            <link>https://medium.com/@mugilvannan.4/from-port-22-to-443-the-hidden-dangers-of-exposing-cloud-services-c7102ce0c945?source=rss-2a09eb04628c------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7102ce0c945</guid>
            <dc:creator><![CDATA[Mugilvannan Loganathan]]></dc:creator>
            <pubDate>Tue, 29 Apr 2025 05:29:24 GMT</pubDate>
            <atom:updated>2025-04-29T05:29:51.575Z</atom:updated>
            <content:encoded><![CDATA[<h3>From Port 22 to 443 — The Hidden Dangers of Exposing Cloud Services</h3><h4><strong>Introduction</strong></h4><p>I’ve been working with cloud services for over three years, and like many others, I was under the false assumption that everything deployed on the cloud was inherently safe and secure, until I set up a cloud-based honeypot.</p><p>The reality hit hard: the moment I exposed open ports to the internet, I observed more than 20+ attack attempts within just 90 seconds. This highlights an important truth <strong>anything you deploy on the cloud is under attack the moment it’s accessible from the public internet</strong>.</p><p>In this blog, I’ll walk you through:</p><ul><li>The basic sanity checks every cloud deployment should follow,</li><li>Essential practices for securing APIs, and</li><li>Cloud-native security tools like <strong>Amazon GuardDuty, AWS WAF</strong>, and more, to help you mitigate real-world threats.</li></ul><h4>The Reality: Cloud Isn’t Safe by Default</h4><blockquote>Common misconception: Cloud providers handle all security.</blockquote><blockquote>Truth: Providers secure the <strong>infrastructure</strong>; you are responsible for securing your <strong>applications, configurations, and exposed services</strong>.</blockquote><p>To experiment with cloud security, I deployed a honeypot trap setup on AWS in the Mumbai region. The video below captures the results as soon as the setup went live, it immediately started receiving bot and human attack attempts from various regions across the globe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*py1VepBqPXgWpcaNZf4DKQ.gif" /><figcaption>Honeypot set up with all opened ports</figcaption></figure><p>We immediately started seeing attack attempts in the dashboard as soon as I exposed commonly used ports such as SSH, SFTP, API, and database ports to the public internet. Automated bots continuously scan cloud IP ranges, looking for exposed services to exploit.</p><p>We observed over 200 hits within a one-hour period.</p><p>Now, let’s look into how to secure our cloud infrastructure.</p><h4>Basic Security hardening for Cloud Infra</h4><p>Before diving into the security hardening steps, let me walk you through the following sample architecture, which I’ll use to demonstrate the basic sanity measures for securing cloud deployments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*OLQYTh6AreIliPWRHk8O5A.png" /></figure><p>Basic Sanity checks:</p><ul><li>Public Subnet — Bastion Host / OpenVPN <br> → Deploy a bastion host or OpenVPN server in the public subnet for secure, audited access to private resources.<br> → Ensure only trusted IPs are allowed to connect.</li><li>Use Private Subnets — Harden SSH<br> → Place your application servers or databases in private subnets, completely isolated from direct internet access.<br> → Disable password-based authentication on EC2 instances; use key-based authentication.<br> → Restrict SSH (or RDP) access to connections originating from the Bastion Host or OpenVPN server only.</li><li>Security Groups — NACL<br> → Remove default “allow all” rules.<br> → Allow only essential ports from trusted IP ranges.<br> → Block direct access to databases from outside the private subnet. <br> → Use NACLs to filter traffic at the subnet level.<br> → Block known bad IPs and allow only expected traffic patterns.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*SOpe4etW-sjVIFwnQZI3gQ.png" /><figcaption>Restrict SSH access to the app server so that it is only accessible via the Bastion host.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MHfHzKgD9bCKbQiFLw8h5Q.png" /><figcaption>Restrict SSH access to the Bastion host so that it is only accessible from my network.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QugjlnVgEHThcKhBIm3Y9A.png" /><figcaption>NACL rule to block the malicious IP address.</figcaption></figure><p>Implementing basic security measures is enough to drastically reduce the attack surface.</p><p>Let’s look below at how to secure the APIs.</p><h4><strong>Expose APIs — But Safely</strong></h4><p><strong>What Happens Without Protection</strong></p><p>Look at the below honeypot attack map. I have only exposed API ports to the public internet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*xsSVyium6iEAmXt4cf9U9A.gif" /><figcaption>Honeypot set up with only API ports</figcaption></figure><p>We observed around <strong>2+ attack hits in just one hour</strong>. Even though the number reduced after applying basic infrastructure security, it was not zero — we were still receiving requests to the API endpoints.</p><p>This clearly shows that the APIs are still exposed and not fully secured yet.</p><p><strong>Avoid Direct Exposure</strong></p><ul><li>Use network-level filtering (Security Groups, NACL) and place sensitive APIs behind VPN, private subnets, or reverse proxies.</li><li>Allow API access only from the Whitelisted IP’s or VPC endpoints.</li></ul><p><strong>Option 1 — Routing APIs through ALB</strong></p><p>I have created Application Load Balancer to expose the APIs running on a backend EC2 instance.</p><p>Additionally, I Integrated Web Application Firewall(WAF) with the load balancer and and applied the following protections:</p><ul><li>Enabled the <strong>Default AWS Managed Rules</strong>.</li><li>Added <strong>Bot Control</strong> to specifically block automated scanning and scripted attacks.</li></ul><p>Observation<strong>:</strong><br> After the setup, the attack surface was significantly reduced.</p><p>The below heat-map shows zero direct attack attempts reaching the backend servers, confirming that the WAF intercepted and blocked malicious traffic at the ALB layer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*9bg95a6RhDSn1frwLAAqnw.gif" /><figcaption>HoneyPot Attack Map with ALB configuration</figcaption></figure><p>You can also observe blocked requests in the WAF logs:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xqcVCQqANj8cMASjG66szw.png" /><figcaption>WAF dashboards</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*97v01EwRjzyZH9UXMVP64A.png" /><figcaption>WAF dashboards</figcaption></figure><p><strong>Option 2— API Gateway</strong></p><p>API Gateway is another excellent method for securely exposing APIs over the internet. It acts as a front-door for your services and adds multiple layers of protection including API Keys, Authentication, and Authorisation mechanisms.</p><p>Refer to the implementation architecture:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*ZamNCjqby1m0bEn3IOEnXg.jpeg" /></figure><ul><li>I created an API Gateway and integrated it with the public-facing Application Load Balancer (ALB).</li><li>An even more secure option is to use a VPC Link to integrate API Gateway with a Private ALB endpoint, ensuring the backend is never directly exposed to the internet.</li><li>API Keys were enabled and added to the request headers to control access.</li><li>I also created an AWS WAF Web ACL with default managed rules and associated it with the API Gateway for added protection.</li></ul><p>Below are the WAF dashboards showing blocked attempts and traffic insights:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GVbPR0m4aba7E_r84r2acg.png" /><figcaption>WAF dashboards</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ep7fCrJeDifz8Mjttb83Ew.png" /><figcaption>WAF dashboards</figcaption></figure><p>Whether you use <strong>ALB with WAF</strong> or <strong>API Gateway with WAF</strong>, both help protect your APIs from common attacks when exposed to the internet. ALB works well for routing to backend services like EC2, while API Gateway gives more control with built-in features like rate limiting and authentication. As developers and engineers, it’s our responsibility to not just build APIs, but also expose them in a secure way — because anything open to the world is a potential target.</p><h4>Cloud-Native Security Tools for Monitoring.</h4><p>Now let’s take a look at some cloud-native security tools that help identify potential risks and threats.</p><p><strong>AWS GuardDuty</strong></p><p>A threat detection service that continuously monitors your AWS accounts and workloads for malicious activity and delivers detailed security findings.</p><p>Implementation:</p><ul><li>Enabled <strong>VPC Flow Logs</strong> for the HoneyPot EC2 Instance’s ENI.</li><li>Enabled <strong>CloudTrail</strong> for management events.</li><li>Activated <strong>Amazon GuardDuty</strong> to monitor and report suspicious activity.</li></ul><p>Observations:</p><p>After exposing the ports from the HoneyPot EC2 instance, GuardDuty flagged a port probe — confirming that the cloud environment is under constant observation by attackers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k-evps7CbWCCl6Bvq5oZyQ.png" /><figcaption>GaurdDuty Summary</figcaption></figure><p>Details of the flagged threat</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9nOjOH5XmdPRhsozqlsZpA.png" /><figcaption>GaurdDuty findings</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eYE_vtLhaMY_9yo0IcgUMg.png" /><figcaption>GaurdDuty findings</figcaption></figure><p><strong>AWS WAF (Web Application Firewall)</strong></p><p>AWS WAF helps protect your websites and APIs from common attacks like SQL injection, XSS, and bad bots.</p><p>We already saw how WAF was used with ALB and API Gateway in the earlier sections. You can check those parts to see how it was set up and what it blocked.</p><p><strong>VPC Flow Logs &amp; AWS CloudTrail</strong></p><p>VPC Flow Logs help you monitor network traffic going to and from a specific Elastic Network Interface (ENI). This is useful to detect unusual or potentially harmful traffic from the internet.</p><p>AWS CloudTrail records all API calls made within your AWS account. It helps you track who is accessing your AWS resources, what actions they performed, and when.</p><p>Together, these tools give better visibility into your environment and help detect suspicious behavior.</p><p><strong>AWS Inspector</strong></p><p>AWS Inspector helps identify vulnerabilities in EC2 instances, container images, and other AWS resources.</p><p>Also it highlights risks such as outdated packages, missing patches, and exposed services.</p><p>Implementation:</p><ul><li>Opened all ports on the Honeypot EC2 Instance to simulate real-world exposure.</li><li>Enabled AWS Inspector from the console.</li></ul><p>Observations:</p><p>Inspector quickly detected multiple vulnerabilities that could be exploited by attackers</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lFcHPBaRh6cpk1cBNy840A.png" /></figure><p><strong>AWS Sheild</strong></p><p>It protects your applications from Distributed Denial of Service (DDoS) attacks automatically, helping to keep your public endpoints like ALB and API Gateway safe. Its enabled by defult for the account. For advanced protection, you need to subscribe to AWS Shield Advanced.</p><h4>Conclusion</h4><p>Whether it’s server ports (21–23), API ports (1024–65535), or HTTP ports (80 &amp; 443), anything exposed to the internet is not safe by default — it’s up to us to make it secure. With the rise of Infrastructure as Code (IaC) tools like Terraform, provisioning resources in the cloud has become easier than ever. But securing what we deploy is just as important. Cloud providers are responsible for the infrastructure, but it’s our responsibility to secure the resources and applications we create on top of it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7102ce0c945" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS VPC IP Conflict with Another Network? Here’s How We Fixed It!]]></title>
            <link>https://medium.com/@mugilvannan.4/aws-vpc-ip-conflict-with-another-network-heres-how-we-fixed-it-86517eeac1e0?source=rss-2a09eb04628c------2</link>
            <guid isPermaLink="false">https://medium.com/p/86517eeac1e0</guid>
            <category><![CDATA[ip-address-conflict]]></category>
            <category><![CDATA[aws-s2s]]></category>
            <category><![CDATA[private-nat-gateway]]></category>
            <category><![CDATA[priavte-subnet]]></category>
            <category><![CDATA[nat-ip]]></category>
            <dc:creator><![CDATA[Mugilvannan Loganathan]]></dc:creator>
            <pubDate>Thu, 20 Mar 2025 09:17:17 GMT</pubDate>
            <atom:updated>2025-03-21T04:21:25.295Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>When working with AWS and hosting our PaaS, subnet conflicts with external client networks can be a significant challenge, especially when integrating with client environments using AWS Site-to-Site (S2S) VPN. We recently encountered such an issue while establishing a VPN connection with a client network. After attempting multiple solutions — including AWS Transit Gateway and public IP addressing — we finally resolved the problem using a <strong>Private NAT Gateway</strong>.</p><p>This blog post will walk you through our problem-solving process, explaining why Private NAT Gateway was the best solution and how to implement it effectively.</p><h3>The Problem: AWS VPC and Subnet Conflict</h3><p>Our AWS environment included:</p><ul><li><strong>VPC CIDR Block:</strong> 10.XX.0.0/21</li><li><strong>Subnets:</strong> 10.XX.2.0/24 &amp; 10.XX.3.0/24(One subnet per Az)</li><li><strong>AWS Site-to-Site VPN:</strong> Connecting to a client network</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*1JhEZG0X9AfD6mqhXSJAew.jpeg" /></figure><p>The client’s on-premises network also used one of the above subnet ranges internally, which led to a <strong>CIDR conflict</strong>, preventing proper routing between AWS resources and the client network.</p><h3>Why Was This an Issue?</h3><ul><li>Overlapping CIDR ranges meant the client network and AWS couldn’t determine which traffic should go where.</li><li>AWS Site-to-Site VPN connection failed to establish due to routing conflicts.</li><li>AWS resources could not communicate with the client’s network directly.</li><li>Standard AWS networking solutions did not resolve the issue due to the CIDR overlap.</li></ul><h3>Failed Approaches &amp; Why They Didn’t Work</h3><h4>1. Expanding Client CIDR Block to Cover Subnets</h4><p><strong>Expectation:</strong> We tried using a bigger IP range on the client side to cover conflicting subnets. For example, 10.XX.2.0/23 covers both subnets 10.XX.2.0/24 &amp; 10.XX.3.0/24. This seemed like a quick and simple fix.</p><p><strong>Issue:</strong> While this worked initially, it was not scalable. In higher environments, where more subnets are required, a larger CIDR block would be needed to cover all subnets, leading to inefficient IP management.</p><h3>2. AWS Transit Gateway (TGW)</h3><p><strong>Expectation:</strong> We used Transit Gateway instead of a Virtual Private Gateway to bridge the VPC and VPN. Any traffic coming from VPC subnets was forwarded to the VPN.</p><p><strong>Issue:</strong> Even though we were able to use a single private IP to represent the subnet CIDR and successfully establish the VPN connection, routing from the client network to the subnet failed due to overlapping CIDRs.</p><p>Additionally, <strong>TGW does not inherently resolve CIDR conflicts</strong>; it requires non-overlapping IP ranges, which made it ineffective for our use case.</p><h3>3. Public IP NATing.</h3><p><strong>Expectation:</strong> NATing using a public IP.</p><p><strong>Issue:</strong> This approach required the NAT Gateway to be created in the public subnet. However, security and compliance concerns prevented us from exposing the application to the public internet.</p><h3>Final Solution: Private NAT Gateway</h3><p>After several unsuccessful attempts, we decided to implement a <strong>Private NAT Gateway</strong> to enable communication while keeping our AWS resources private.</p><h3>How Does Private NAT Gateway Work?</h3><p>A Private NAT Gateway allows instances in private subnets to access other private networks without needing public IP addresses. It provides a mechanism for <strong>outbound traffic translation</strong> while keeping inbound connections restricted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6bp762P5Oa_LFWy-dgLFGw.png" /></figure><p>Here’s how it works in the given scenario:</p><p>In the above diagram, the <strong>range 10.0.1.0/24 represents the conflicting IP range (Non-routable subnet)</strong>. If a non-routable subnet in VPC A needs to communicate with routable subnets in VPC B, the traffic must follow this path:</p><ol><li>Traffic from the non-routable subnet (10.0.1.0/24) in <strong>VPC A</strong> is forwarded to the <strong>Private NAT Gateway</strong> located in the routable subnet (100.64.1.0/24) of <strong>VPC A</strong>.</li><li>The <strong>Private NAT Gateway</strong> translates the source IP to a different range (100.64.1.0/24) before forwarding it.</li><li>The traffic then traverses through the <strong>Transit Gateway (TGW)</strong>.</li><li>The TGW forwards the translated traffic to <strong>VPC B</strong>, where it reaches the intended destination in the <strong>routable subnet (100.64.2.0/24)</strong>.</li></ol><p>By using <strong>Private NAT Gateway</strong>, we avoid direct CIDR conflicts while maintaining seamless connectivity between VPCs.</p><h3>Implementation Guide: Step-by-Step</h3><p>Now lets look at the real time requirement with private NAT gateway.</p><p><strong>Note:</strong> I cannot exactly replicate the client/AWS setup, but I can use another region VPC to pretend to be the client network to replicate the scenario.</p><p>Also, in the below diagram, I haven’t mentioned any conflicting IP ranges between AWS &amp; Client network.</p><p>Let’s assume <strong>10.XX.3.0/24 (AWS network) is conflicting with the Client network</strong>, and we will see how to tackle the problem using Private NAT GW.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*vve1VAbfhcc9QZld1c9Pvg.png" /></figure><p><strong>AWS Side:</strong></p><p>VPC: 10.XX.0.0/21</p><p>Subnets: 10.XX.3.0/24(<strong>Non-Routable</strong>) , 10.XX.2.0/24(<strong>Routable)</strong></p><p>Source Server: 10.XX.3.XX</p><p><strong>Client Network:</strong></p><p>VPC: 172.XX.0.0/16</p><p>Destination Server: 172.XX.13.XX</p><p>Our requirement is to connect to the client network server from the AWS network (conflicting subnet) via an <strong>IPSec tunnel</strong>.</p><p><strong>Before establishing the VPN connection, we attempt to telnet the client server:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F4cnKJK9cXQhYoqGljb5BA.png" /></figure><p>Now, let’s follow the steps to make this work.</p><p><strong>Step 1: Establish IPSec VPN Connection between AWS &amp; Client Network</strong></p><p>I am not covering IPSec Tunnel setup in this blog. It needs another blog to cover VPN setup. So I will skip for now. Refer to official documents to set up AWS S2S.</p><p><strong>Step 2: Create a Private NAT Gateway</strong></p><ol><li>Create a NAT GW in the private routable subnet(10.XX.2.0/24).</li><li>Navigate to VPC → NAT Gateways → Create NAT Gateway</li><li>Enter Name, choose the subnet and Connectivity type as Private.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VrBH3YlU9Mn2R_M3RzYMMw.png" /></figure><p><strong>Step 3: Configure Route table</strong></p><ol><li>Navigate to the <strong>route table of the Non-Routable subnet (10.XX.3.0/24)</strong>.</li><li>Add a route to forward client network traffic to the <strong>NAT Gateway</strong>.</li><li>Ensure the NAT Gateway forwards traffic to the <strong>VPN Gateway</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JN-E5ifkrxefYccNqCKxzg.png" /></figure><p>Now, traffic from <strong>10.XX.3.0/24</strong> first reaches the <strong>NAT Gateway in 10.XX.2.0/24</strong>, which then forwards it to the <strong>VPN Gateway</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zANoxyXtjHJyAWCIZN8Ekw.png" /></figure><p>Make sure the appropriate rules are added to the <strong>Security Groups</strong> and <strong>Network ACLs (NACLs)</strong> to allow necessary traffic.</p><p><strong>Step 4: Test Connectivity</strong></p><p>Now, when traffic is initiated from the <strong>non-routable subnet</strong> (10.XX.3.0/24), it is forwarded to the <strong>NAT Gateway</strong>, which is deployed in the <strong>routable subnet</strong> (10.XX.2.0/24). The <strong>routable subnet</strong> then forwards the traffic to the <strong>Virtual Private Gateway (VGW)</strong>, allowing it to reach the <strong>client server via VPN</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HXv1fPE1XLUnTfpU_OGSCg.png" /></figure><p>The only drawback of this approach is the need to <strong>turn off route propagation</strong> in the route tables. Otherwise, the <strong>default route may get added automatically</strong>.</p><p>For example, when the <strong>VPN tunnel is established</strong>, the <strong>default static route (</strong><strong>172.XX.0.0/16 - Client network)</strong> is automatically added to the <strong>non-routable route table</strong>. This conflicts with the <strong>NAT Gateway rule</strong>, potentially causing routing issues.</p><h3>Conclusion</h3><p>We used <strong>Private NAT Gateway</strong> to solve the <strong>overlapping IP ranges</strong> problem, and we found it to be the most <strong>effective and cost-efficient</strong> solution compared to the other options we tried.</p><h3>Why This Approach Worked Best:</h3><p>✅ <strong>Eliminated subnet conflicts</strong> without requiring changes to client-side IPs.<br> ✅ <strong>Maintained security &amp; compliance</strong> by keeping AWS resources private.<br> ✅ <strong>Provided a scalable &amp; future-proof</strong> networking solution with minimal complexity.</p><p>If you’re facing similar <strong>networking challenges in AWS</strong>, consider <strong>Private NAT Gateway</strong> as a <strong>simple yet powerful</strong> solution to manage <strong>overlapping CIDRs</strong> while ensuring secure and seamless connectivity.</p><p>To be honest, <strong>this wasn’t an out-of-the-box solution</strong> — AWS provides all these options, but it takes time and <strong>deep exploration</strong> to find the right fit. This journey took me a while, and I wanted to share my experience so that <strong>others can solve this problem faster</strong>. Hopefully, this helps someone struggling with a similar issue!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86517eeac1e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Life on wheels]]></title>
            <link>https://medium.com/@mugilvannan.4/life-on-wheels-f1276c474cc6?source=rss-2a09eb04628c------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1276c474cc6</guid>
            <dc:creator><![CDATA[Mugilvannan Loganathan]]></dc:creator>
            <pubDate>Sun, 09 Jan 2022 17:38:12 GMT</pubDate>
            <atom:updated>2022-01-09T17:38:12.391Z</atom:updated>
            <content:encoded><![CDATA[<p>Life on wheels</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X2CiecwK7rtsgc9vt1eHeg@2x.jpeg" /></figure><p>In the second half of 2019, I started eating all the food from every corner of Chennai city like I owned a YouTube food channel and increased my weight along with petrol prices towards the 100 mark. Slowly started dreaming to reduce the weight, and that dream melts just like any other saving the world daydreams. I have reached closer to 100 kg mark at the end of 2019 eventually the petrol price too. In early 2020, I got an idea out of the blue that I can use my office journey to reduce my weight. Yup, I call it a journey since I have to travel 5 hours every day by train like London kings station to Hogwarts, but here I use platform No 3. So I have started to walk long instead of auto ricks, climbed stairs instead of lifts/elevators, skipped breakfast for nothing, and did some crazy other things to reduce my so-called fat. The next 2 months went like a leaping frog in the well story, reduced 3 kgs and increased 2 kgs. Somehow I have started seeing some miracles in the 3rd month and then covid happened. We all started to live in a cage, washed our hands for someone who ate raw food in China, our eating habit becomes 5 to 6 times a day from 3 times, my weight started increasing with stress &amp; depression and everything got blocked mentally and physically. We hoped that covid will end in 21 days but we end up lighting candles and banging utensils for 6 months.</p><p>When obesity hits its peak, I started controlling my appetite by fasting and dieting for days and ended up eating a lot. Negativity covered me like a thick blanket during winter. At some point, I felt like in the maze, no matter how hard I have tried, and ended up at the same point. At last during September 2020, I got motivation from my favorite people and their stories inspired me. So I have decided to try the methods they suggested and realized that we have to invest some time now for ourselves for a healthy future. We all got a gift called time during the lockdown and decided to try something and make it work.</p><p>I tried to find out what are the things that can be done surroundings of my home. The first idea that pops out is running, being an introvert/shy I struggled a lot to run for 10 meters. Even if I have managed to run against my odds, my neighbors peeped at me like a thief who stole something and ran away. Tried a few other things that I can’t name as a workout. The final and best thing narrowed to the last option called cycling to escape from neighbors CCTV and any human sight in just 2 hard minutes. So far the best investment I have made ever for myself.</p><p>In September 2020, I have managed to buy a gear cycle. For me, the Gear cycles are one of my childhood memory. But I never tried to change the gear in my cycle since I bought it, still cycling with the same gear settings (Honestly, I am yet to figure out the use of gears). Buying something in a middle-class family is not that easy too. If you buy something and kept it ideal for a couple of days you will get a lecture for a week that you wasted the entire 3 generations asset. I bought for the price of 90% discount from the actual price that I have paid for my family’s sake. Initial days, cycling was very hard, and struggled to cycle 3 days a week. Slowly it became 5 days a week and at some point started to cycle 7 days a week. It was very tough to covert the scattered workout to your daily habit. Everything is addictive when you see the results of the thing which you are trying. Yup, I have started reducing weights and my brain got auto-tuned to make cycling part of my daily routine. All the hurt started to heal with thousands of kilometers of happiness. Maybe I don’t know how to change the gear in the cycle, but I felt that my life shifted the gears. I have started investing one hour every day in spite of having more important work. Delayed every day’s tasks, learned to say NO, and avoided other distractions. Down the line, My brain becomes light along with my body. Obesity comes under control, food becomes healthy, and sleep becomes dessert. Four walls become a thousand miles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wiRzb1StSSK5n6Gp86zIOw@2x.jpeg" /></figure><p>I have enjoyed every minute on the wheels and flourished in every possible way.</p><p>I got inspired by so many peoples for many things and I envied their talents. Well, this is my first official blog that too inspired by others’ writing. I am a guy who thinks a lot to send one simple text message. But here I wrote a blog about how I took the hit when life hits with the shit. If I can write something, anyone in the world can write. At the same time, my hobbies are like monkeys in trees. It will jump from one to another. I wish to write a lot before I jump to another one.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1276c474cc6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>