<?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>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>
