<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Haroon Khan</title>
    <description>The latest articles on DEV Community by Haroon Khan (@haroonkhancyber).</description>
    <link>https://dev.to/haroonkhancyber</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4123502%2F0b1e2e10-ea65-46ca-a679-55fc2961e4ba.png</url>
      <title>DEV Community: Haroon Khan</title>
      <link>https://dev.to/haroonkhancyber</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/haroonkhancyber"/>
    <language>en</language>
    <item>
      <title>Designing and Automating a Zero-Downtime Container CI/CD Pipeline on AWS</title>
      <dc:creator>Haroon Khan</dc:creator>
      <pubDate>Sat, 21 Nov 2026 22:33:45 +0000</pubDate>
      <link>https://dev.to/haroonkhancyber/designing-and-automating-a-zero-downtime-container-cicd-pipeline-on-aws-4de4</link>
      <guid>https://dev.to/haroonkhancyber/designing-and-automating-a-zero-downtime-container-cicd-pipeline-on-aws-4de4</guid>
      <description>&lt;p&gt;The goal of this project is to build a fully automated, serverless CI/CD (Continuous Integration and Continuous Deployment) pipeline on Amazon Web Services (AWS) for a containerized 2048 web game. Whenever a developer pushes updated code to the main branch on GitHub, AWS automatically builds a new Docker container image, stores it securely, and updates the live website without any manual work or server management.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Packaging the Application with Docker&lt;/strong&gt;&lt;br&gt;
The 2048 game is a static web application made of HTML, CSS, and JavaScript files. To make sure it runs reliably in the cloud, it was packaged inside a lightweight Docker container using Nginx (a fast web server) running on Alpine Linux. This keeps the container small and allows it to start up in seconds. The initial container image was uploaded to a private storage registry called Amazon Elastic Container Registry (ECR).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Serverless Hosting on Amazon ECS Fargate&lt;/strong&gt;&lt;br&gt;
Instead of renting and managing traditional virtual servers (EC2 instances), the application is hosted on Amazon Elastic Container Service (ECS) using AWS Fargate. Fargate is a serverless compute engine that runs containers directly. A cluster and service were configured with 0.25 vCPU and 0.5 GB of memory, opening port 80 to the internet so users can play the game directly through the container's public IP address.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Connecting GitHub to AWS&lt;/strong&gt;&lt;br&gt;
To detect code changes automatically, the GitHub repository was linked to AWS using AWS Code Connections (via the official AWS GitHub App). This creates a secure webhook connection so that AWS is notified immediately whenever new commits are pushed to the main branch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Automated Building with AWS CodeBuild&lt;/strong&gt;&lt;br&gt;
AWS CodeBuild acts as the automated build engine. Whenever triggered, it launches a temporary build environment, downloads the latest code from GitHub, builds a fresh Docker image, and tags it with both "latest" and the unique 7-character Git commit ID. It then pushes the new image to Amazon ECR and saves a small tracking file (imagedefinitions.json) into an Amazon S3 bucket so the deployment stage knows exact image details to use.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Orchestrating the Workflow with AWS CodePipeline&lt;/strong&gt;&lt;br&gt;
AWS CodePipeline ties the entire process together into three automated stages:&lt;br&gt;
   &lt;strong&gt;Source Stage:&lt;/strong&gt; Pulls the newly pushed code from GitHub.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Build Stage:&lt;/strong&gt; Runs AWS CodeBuild to compile the Docker image and push it to Amazon ECR.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deploy Stage:&lt;/strong&gt; Instructs Amazon ECS to update the live service. ECS performs a zero-downtime rolling update by launching a brand-new container task with the updated image, routing user traffic to it, and safely shutting down the old container task.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security and Key Engineering Lessons&lt;/strong&gt;&lt;br&gt;
To keep the pipeline secure, a dedicated IAM service role was created following the principle of least privilege, restricting permissions strictly to the required ECR repository, S3 bucket, ECS service, and GitHub connection. During implementation, three critical configuration requirements were addressed:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Enabling Privileged Mode&lt;/strong&gt; inside CodeBuild so it has permission to run Docker build commands.&lt;br&gt;
&lt;strong&gt;Granting both modern (codeconnections) and legacy (codestar-connections)&lt;/strong&gt; permissions in the IAM policy so CodeBuild can authenticate with GitHub during the source download phase.&lt;br&gt;
&lt;strong&gt;Matching&lt;/strong&gt; the exact container name between the build output file and the ECS task definition so automated deployments link properly.&lt;/p&gt;

</description>
      <category>cicd</category>
      <category>cybersecurity</category>
      <category>docker</category>
      <category>devops</category>
    </item>
    <item>
      <title>AWS VPC Networking:Choosing Between VPC Peering and Transit Gateway</title>
      <dc:creator>Haroon Khan</dc:creator>
      <pubDate>Wed, 07 Oct 2026 17:39:40 +0000</pubDate>
      <link>https://dev.to/haroonkhancyber/aws-vpc-networkingchoosing-between-vpc-peering-and-transit-gateway-3n58</link>
      <guid>https://dev.to/haroonkhancyber/aws-vpc-networkingchoosing-between-vpc-peering-and-transit-gateway-3n58</guid>
      <description>&lt;p&gt;As your cloud architecture scales, keeping all your applications inside a single Virtual Private Cloud (VPC) quickly becomes impractical. Most teams eventually split workloads—separating production environments, testing staging servers, and isolating shared microservices into their own distinct VPCs.&lt;/p&gt;

&lt;p&gt;Once you have multiple isolated VPCs, they inevitably need a secure way to exchange data. AWS gives us two primary networking constructs to bridge these gaps: VPC Peering and VPC Transit Gateway. Let's examine how each option operates, how they handle scaling, and where they fit best.&lt;/p&gt;

&lt;h2&gt;
  
  
  VPC Peering and VPC Transit Gateway.
&lt;/h2&gt;

&lt;p&gt;Let's examine how each option operates, how they handle scaling, and where they fit best.Direct Connections with VPC PeeringWe use &lt;strong&gt;VPC Peering&lt;/strong&gt; when our goal is to link two VPCs directly through the internal AWS backbone. Because data stays off the public internet, communication remains fast, encrypted, and private.For small setups, VPC Peering is an amazing choice because it is straightforward to set up, free of extra hourly charges, and lacks a single point of failure. However, a major scaling hurdle appears as your network grows. If you only need to link two or three VPCs, peering works effortlessly. But if the number of VPCs increases, managing the connections becomes overwhelming.&lt;/p&gt;

&lt;p&gt;For example, if VPC A is connected to VPC B, and VPC B is connected to VPC C, VPC A still cannot communicate with VPC C through VPC B. A separate peering connection between VPC A and VPC C is required.&lt;/p&gt;

&lt;p&gt;This works well with a few VPCs, but as the number of VPCs grows, we need more peering connections and routes. This makes the network harder to manage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Centralizing Traffic with VPC Transit Gateway
&lt;/h2&gt;

&lt;p&gt;To completely overcome the massive route-table overhead and scaling bottlenecks of VPC Peering, AWS provides VPC Transit Gateway.Rather than wiring every single VPC directly to every other VPC, Transit Gateway acts as a central cloud router using a hub-and-spoke architecture. Instead of multiple point-to-point links, every VPC only needs a single attachment to the Transit Gateway hub.The core power of Transit Gateway lies in its centralized routing control. It dynamically handles traffic forwarding across all attached spokes using unified routing rules. This drastically reduces connection counts and cleans up route table management, replacing a chaotic network web with a streamlined, enterprise-ready topology.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deployment Scenarios:
&lt;/h2&gt;

&lt;p&gt;When to Use Which?Deciding between these two networking models comes down entirely to the scale and future growth of your infrastructure:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;VPC Peering fits best in small, simple environments with minimal networking requirements. If you only have two or three VPCs that need dedicated point-to-point communication (such as an app tier talking directly to a database tier), Peering is lightweight, cost-efficient, and easy to maintain.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;VPC Transit Gateway is engineered for large-scale enterprise multi-VPC architectures. If your organization manages dozens of VPCs, requires seamless hybrid integration with on-premises data centers via VPN or Direct Connect, and demands centralized traffic control, Transit Gateway is the ideal solution to keep your network manageable.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Both networking approaches have their rightful place in AWS. Understanding how they handle scale prevents you from getting trapped in an unmanageable routing maze later on.Kick off with VPC Peering if your infrastructure is small and straightforward, but pivot to a Transit Gateway early if your multi-VPC environment is bound to expand rapidly!&lt;/p&gt;

</description>
      <category>cloudcomputing</category>
      <category>cybersecurity</category>
    </item>
    <item>
      <title>How I built and secured my first AWS static website using S3, CloudFront, and ACM</title>
      <dc:creator>Haroon Khan</dc:creator>
      <pubDate>Thu, 17 Sep 2026 07:20:25 +0000</pubDate>
      <link>https://dev.to/haroonkhancyber/how-i-built-and-secured-my-first-aws-static-website-using-s3-cloudfront-and-acm-iik</link>
      <guid>https://dev.to/haroonkhancyber/how-i-built-and-secured-my-first-aws-static-website-using-s3-cloudfront-and-acm-iik</guid>
      <description>&lt;p&gt;Three days ago, AWS was completely new territory for me. As a cybersecurity student, I knew I needed hands-on cloud infrastructure experience, but starting from absolute zero is always a bit daunting. Fast forward 72 hours, and I have successfully deployed my first static website on my own domain, haroonkhan.online.&lt;/p&gt;

&lt;p&gt;More importantly, I didn't just host it—I secured it.&lt;/p&gt;

&lt;p&gt;Here is how I bypassed the insecure beginner shortcuts and built a locked-down architecture in my first three days.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Problem with Default Tutorials&lt;/strong&gt;&lt;br&gt;
If you search for "how to host a static website on S3," the vast majority of guides tell you to upload your files, uncheck "Block all public access," and call it a day.&lt;/p&gt;

&lt;p&gt;Coming at this with a security-first mindset, leaving a storage bucket entirely exposed to the public internet was an immediate red flag. I wanted to build this correctly, mirroring professional enterprise architectures rather than settling for a quick, vulnerable fix.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Building a Secure Pipeline&lt;/strong&gt;&lt;br&gt;
Instead of relying on public S3 endpoints, I designed a three-tier delivery method to protect haroonkhan.online:&lt;/p&gt;

&lt;p&gt;The Vault (Amazon S3): My actual HTML, CSS, and JS files live here. The bucket is strictly private, with all public access permanently blocked.&lt;/p&gt;

&lt;p&gt;The Shield (Amazon CloudFront): This acts as a global Content Delivery Network (CDN). It caches the content for fast global delivery while enforcing strict HTTPS encryption so all transit is secure.&lt;/p&gt;

&lt;p&gt;The Map (Route 53): This handles the DNS routing, ensuring anyone typing my domain name is seamlessly directed to the CloudFront distribution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Secret Sauce: Origin Access Control (OAC)&lt;/strong&gt;&lt;br&gt;
The most challenging—and rewarding—part of this build was figuring out how to bridge a locked-down S3 bucket with the public internet. The modern solution is Origin Access Control (OAC).&lt;/p&gt;

&lt;p&gt;By writing a highly specific S3 Bucket Policy, I explicitly denied all external access except for my designated CloudFront distribution. If a malicious actor tries to hit the raw S3 URL directly, they hit a brick wall. The only way to view the site is through the secure, encrypted CDN pathway.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Looking Forward&lt;/strong&gt;&lt;br&gt;
Getting this architecture live and fully secure in my first three days has been a massive confidence booster. It proves that robust cloud infrastructure isn't just for seasoned veterans—you just need the patience to read the documentation and understand the mechanics.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>cloudcomputing</category>
      <category>cybersecurity</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
