<?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: George Koufie</title>
    <description>The latest articles on DEV Community by George Koufie (@george_koufie_8e53af2660b).</description>
    <link>https://dev.to/george_koufie_8e53af2660b</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%2F4043640%2F88752b02-8315-4168-ae30-69b89d0d2f83.png</url>
      <title>DEV Community: George Koufie</title>
      <link>https://dev.to/george_koufie_8e53af2660b</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/george_koufie_8e53af2660b"/>
    <language>en</language>
    <item>
      <title>I Built a Web Application on AWS With Zero Inbound Ports — Then Tried to Break Its Security</title>
      <dc:creator>George Koufie</dc:creator>
      <pubDate>Fri, 27 Nov 2026 21:12:33 +0000</pubDate>
      <link>https://dev.to/george_koufie_8e53af2660b/i-built-a-web-application-on-aws-with-zero-inbound-ports-then-tried-to-break-its-security-1e8o</link>
      <guid>https://dev.to/george_koufie_8e53af2660b/i-built-a-web-application-on-aws-with-zero-inbound-ports-then-tried-to-break-its-security-1e8o</guid>
      <description>&lt;p&gt;Building CloudSecure with AWS, Cloudflare Tunnel, Terraform, Python, and evidence-driven security validation.&lt;/p&gt;

&lt;p&gt;By George Koufie | AWS Community Builder — Networking &amp;amp; Content Delivery&lt;/p&gt;

&lt;p&gt;The Challenge: Can a Website Be Publicly Accessible Without Exposing Its Server?&lt;/p&gt;

&lt;p&gt;Every organization faces a difficult security challenge: applications must be accessible to users, but the infrastructure hosting those applications must be protected from unauthorized access.&lt;/p&gt;

&lt;p&gt;A traditional web application architecture often exposes a load balancer or web server through ports 80 and 443. Security groups, firewalls, network segmentation, and web application firewalls help manage that exposure.&lt;/p&gt;

&lt;p&gt;But what if we could remove inbound access to the application server entirely?&lt;/p&gt;

&lt;p&gt;That question became the foundation of my latest project: CloudSecure, a hands-on cloud security lab built using Amazon Web Services (AWS), Cloudflare, Terraform, and Python.&lt;/p&gt;

&lt;p&gt;I wanted to do more than build infrastructure. I wanted to demonstrate a complete security engineering workflow:&lt;/p&gt;

&lt;p&gt;Deploy an application with a reduced attack surface.&lt;/p&gt;

&lt;p&gt;Assess its security configuration across two platforms.&lt;/p&gt;

&lt;p&gt;Deliberately introduce a controlled security misconfiguration.&lt;/p&gt;

&lt;p&gt;Detect the problem using automated security checks.&lt;/p&gt;

&lt;p&gt;Remediate the configuration using Infrastructure as Code.&lt;/p&gt;

&lt;p&gt;Collect evidence showing whether the remediation actually worked.&lt;/p&gt;

&lt;p&gt;On November 26, 2026, I deployed the lab in AWS, performed the assessments and security tests, and then dismantled the environment to avoid unnecessary charges.&lt;/p&gt;

&lt;p&gt;The results demonstrated why security needs to be tested rather than assumed.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Business Problem&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For organizations operating internet-facing applications, cloud security is not simply about deploying firewalls.&lt;/p&gt;

&lt;p&gt;Security teams must understand whether:&lt;/p&gt;

&lt;p&gt;Servers are unnecessarily exposed to inbound connections.&lt;/p&gt;

&lt;p&gt;Network security rules enforce the intended access restrictions.&lt;/p&gt;

&lt;p&gt;Encryption configurations meet organizational requirements.&lt;/p&gt;

&lt;p&gt;Administrative access is properly controlled and auditable.&lt;/p&gt;

&lt;p&gt;Cloud security misconfigurations can be detected reliably.&lt;/p&gt;

&lt;p&gt;Security remediation can be validated with evidence.&lt;/p&gt;

&lt;p&gt;These concerns become especially important in regulated environments, including organizations that process payment information.&lt;/p&gt;

&lt;p&gt;Misconfigurations can also arise gradually. A security group might be modified during troubleshooting, a TLS configuration might accept outdated protocols, or a web application firewall rule might fail to recognize alternate request formats.&lt;/p&gt;

&lt;p&gt;A control that exists is not necessarily a control that works.&lt;/p&gt;

&lt;p&gt;The goal of CloudSecure was to build a small, reproducible environment where these security questions could be answered through actual testing.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Solution Architecture&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;CloudSecure combines AWS infrastructure security with Cloudflare edge protection.&lt;/p&gt;

&lt;p&gt;The AWS environment includes:&lt;/p&gt;

&lt;p&gt;Amazon VPC with separate application and isolated subnets.&lt;/p&gt;

&lt;p&gt;Amazon EC2 running a Python demonstration application.&lt;/p&gt;

&lt;p&gt;Security groups with no inbound access rules.&lt;/p&gt;

&lt;p&gt;AWS IAM roles for workload permissions.&lt;/p&gt;

&lt;p&gt;AWS Systems Manager for administrative access.&lt;/p&gt;

&lt;p&gt;Amazon CloudWatch for session and network logging.&lt;/p&gt;

&lt;p&gt;Encrypted Amazon EBS storage.&lt;/p&gt;

&lt;p&gt;Terraform for infrastructure provisioning and changes.&lt;/p&gt;

&lt;p&gt;Cloudflare provides:&lt;/p&gt;

&lt;p&gt;DNS and proxy services.&lt;/p&gt;

&lt;p&gt;Cloudflare Tunnel for application connectivity.&lt;/p&gt;

&lt;p&gt;TLS configuration and HTTPS enforcement.&lt;/p&gt;

&lt;p&gt;Custom web application firewall rules.&lt;/p&gt;

&lt;p&gt;Security analytics.&lt;/p&gt;

&lt;p&gt;A Python assessment tool uses the AWS and Cloudflare APIs to examine selected security configurations and generate JSON evidence.&lt;/p&gt;

&lt;p&gt;[Insert architecture diagram from the GitHub README here.]&lt;/p&gt;

&lt;p&gt;How requests reach the application&lt;/p&gt;

&lt;p&gt;A visitor connects to Cloudflare over HTTPS.&lt;/p&gt;

&lt;p&gt;Cloudflare evaluates the request against its configured edge security controls and forwards permitted traffic through Cloudflare Tunnel.&lt;/p&gt;

&lt;p&gt;The tunnel connector, cloudflared, runs on the AWS instance and initiates outbound connectivity to Cloudflare.&lt;/p&gt;

&lt;p&gt;The application itself listens only on:&lt;/p&gt;

&lt;p&gt;127.0.0.1:8080&lt;/p&gt;

&lt;p&gt;This means the application does not bind to the EC2 instance's external network interface.&lt;/p&gt;

&lt;p&gt;The EC2 security group also has no inbound rules.&lt;/p&gt;

&lt;p&gt;Consequently, visitors can use the application through the Cloudflare hostname, but cannot directly connect to the application's origin ports.&lt;/p&gt;

&lt;p&gt;This design reduces exposure without requiring inbound SSH access or an internet-facing application load balancer.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Engineering Decision: Cloudflare Tunnel Instead of an Internet-Facing Origin&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;One of the most important design decisions was to use Cloudflare Tunnel.&lt;/p&gt;

&lt;p&gt;Traditional approaches often require an internet-facing entry point, with inbound traffic allowed on selected ports.&lt;/p&gt;

&lt;p&gt;CloudSecure takes a different approach: the server establishes the connection outward, while Cloudflare handles incoming user requests.&lt;/p&gt;

&lt;p&gt;The Terraform security group contains outbound rules for required services and tunnel connectivity, but no inbound rules.&lt;/p&gt;

&lt;p&gt;resource "aws_security_group" "origin" {&lt;br&gt;
  name_prefix = "cloudsecure-origin-"&lt;br&gt;
  description = "No inbound access; outbound TLS and tunnel"&lt;br&gt;
  vpc_id      = aws_vpc.lab.id&lt;/p&gt;

&lt;p&gt;egress {&lt;br&gt;
    description = "HTTPS to SSM, package repos and Cloudflare API"&lt;br&gt;
    from_port   = 443&lt;br&gt;
    to_port     = 443&lt;br&gt;
    protocol    = "tcp"&lt;br&gt;
    cidr_blocks = ["0.0.0.0/0"]&lt;br&gt;
  }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;The complete configuration also permits the required Cloudflare Tunnel connections on port 7844.&lt;/p&gt;

&lt;p&gt;During testing, the public application responded successfully through Cloudflare using TLS 1.3.&lt;/p&gt;

&lt;p&gt;However, an attempt to connect directly to the instance's public IP on the application's port received no response.&lt;/p&gt;

&lt;p&gt;VPC Flow Logs also recorded more than 2,000 rejected connection attempts against the instance.&lt;/p&gt;

&lt;p&gt;This demonstrated two things:&lt;/p&gt;

&lt;p&gt;First, the application remained reachable through the intended route.&lt;/p&gt;

&lt;p&gt;Second, the security group prevented inbound connections from reaching the origin directly.&lt;/p&gt;

&lt;p&gt;There is an important architectural distinction here: the EC2 instance still used a public IPv4 address for outbound connectivity to avoid NAT Gateway expenses. The server was not deployed in a fully private subnet.&lt;/p&gt;

&lt;p&gt;For a production deployment, I would favor private subnets, controlled egress, and multiple tunnel connectors to improve defense in depth and availability.&lt;/p&gt;

&lt;p&gt;[Insert screenshot: EC2 security group with no inbound rules.]&lt;/p&gt;

&lt;p&gt;[Insert screenshot: Cloudflare Tunnel healthy connector.]&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Eliminating SSH: AWS Systems Manager for Administration&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A second design decision was to avoid traditional SSH access.&lt;/p&gt;

&lt;p&gt;Instead of opening port 22 or distributing private SSH keys, I configured AWS Systems Manager Session Manager.&lt;/p&gt;

&lt;p&gt;This allowed administration through authenticated AWS access without enabling inbound SSH connections.&lt;/p&gt;

&lt;p&gt;The EC2 instance uses an IAM role with the AWS-managed AmazonSSMManagedInstanceCore policy.&lt;/p&gt;

&lt;p&gt;CloudSecure also configures CloudWatch logging for administrative sessions.&lt;/p&gt;

&lt;p&gt;This approach provides several operational advantages:&lt;/p&gt;

&lt;p&gt;No inbound SSH port is required.&lt;/p&gt;

&lt;p&gt;Access is controlled through IAM permissions.&lt;/p&gt;

&lt;p&gt;Administrative access can be revoked centrally.&lt;/p&gt;

&lt;p&gt;Session activity can be logged.&lt;/p&gt;

&lt;p&gt;Engineers can perform maintenance and troubleshooting without managing SSH keys.&lt;/p&gt;

&lt;p&gt;For organizations managing multiple cloud servers, centralized access management and operational evidence are important parts of reducing administrative risk.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Building a Security Assessment Engine With Python&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Protecting infrastructure is only one part of cloud security.&lt;/p&gt;

&lt;p&gt;I also wanted a way to verify that the expected controls remained in place.&lt;/p&gt;

&lt;p&gt;For this, I developed a Python security assessment engine using boto3 and the Cloudflare API.&lt;/p&gt;

&lt;p&gt;The scanner examines selected AWS and Cloudflare configurations, including:&lt;/p&gt;

&lt;p&gt;Platform&lt;/p&gt;

&lt;p&gt;Security checks&lt;/p&gt;

&lt;p&gt;AWS&lt;/p&gt;

&lt;p&gt;IMDSv2 enforcement&lt;/p&gt;

&lt;p&gt;AWS&lt;/p&gt;

&lt;p&gt;Security group exposure&lt;/p&gt;

&lt;p&gt;AWS&lt;/p&gt;

&lt;p&gt;EBS encryption&lt;/p&gt;

&lt;p&gt;Cloudflare&lt;/p&gt;

&lt;p&gt;Proxied tunnel DNS configuration&lt;/p&gt;

&lt;p&gt;Cloudflare&lt;/p&gt;

&lt;p&gt;Minimum TLS version&lt;/p&gt;

&lt;p&gt;Cloudflare&lt;/p&gt;

&lt;p&gt;HTTPS enforcement&lt;/p&gt;

&lt;p&gt;The assessment results are written to a timestamped JSON report.&lt;/p&gt;

&lt;p&gt;One of the most important design principles was how the scanner handles uncertainty.&lt;/p&gt;

&lt;p&gt;The tool supports four statuses:&lt;/p&gt;

&lt;p&gt;PASS: The selected control meets the expected configuration.&lt;/p&gt;

&lt;p&gt;FAIL: The configuration does not meet the expected requirement.&lt;/p&gt;

&lt;p&gt;ERROR: The scanner could not complete the check.&lt;/p&gt;

&lt;p&gt;NOT_TESTED: The control was not evaluated.&lt;/p&gt;

&lt;p&gt;Why is that distinction important?&lt;/p&gt;

&lt;p&gt;Because a security tool should never report a passing result simply because it was unable to access the information needed to perform an assessment.&lt;/p&gt;

&lt;p&gt;A real permission failure&lt;/p&gt;

&lt;p&gt;During the initial combined assessment, the Cloudflare API token lacked the permission needed to read zone security settings.&lt;/p&gt;

&lt;p&gt;The Cloudflare API returned 403 Forbidden.&lt;/p&gt;

&lt;p&gt;Instead of crashing or treating the unavailable information as secure, the scanner recorded an ERROR and continued evaluating the remaining checks.&lt;/p&gt;

&lt;p&gt;After correcting the token's permissions, the affected checks completed successfully.&lt;/p&gt;

&lt;p&gt;This reinforced a principle that matters in security engineering:&lt;/p&gt;

&lt;p&gt;An assessment result is only useful when it accurately reflects what was actually verified.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Testing the Web Application Firewall — and Finding Bypasses&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Another valuable part of the project involved Cloudflare's web application firewall.&lt;/p&gt;

&lt;p&gt;I configured a custom rule to block requests targeting a test path:&lt;/p&gt;

&lt;p&gt;/blocked-test&lt;/p&gt;

&lt;p&gt;Initially, the rule matched the exact path.&lt;/p&gt;

&lt;p&gt;A normal request to /blocked-test returned HTTP 403, indicating that Cloudflare blocked it.&lt;/p&gt;

&lt;p&gt;However, I did not stop with the first successful test.&lt;/p&gt;

&lt;p&gt;I submitted variations of the same request to determine whether the rule could be bypassed.&lt;/p&gt;

&lt;p&gt;Two variations passed through the first rule:&lt;/p&gt;

&lt;p&gt;/blocked-test/&lt;/p&gt;

&lt;p&gt;/BLOCKED-TEST&lt;/p&gt;

&lt;p&gt;The application returned 404 for these requests, showing that they had reached the application rather than being blocked at the edge.&lt;/p&gt;

&lt;p&gt;This was not the intended security behavior.&lt;/p&gt;

&lt;p&gt;I revised the firewall expression to normalize the case and match the beginning of the request path:&lt;/p&gt;

&lt;p&gt;(starts_with(lower(http.request.uri.path), "/blocked-test"))&lt;/p&gt;

&lt;p&gt;After the change, the documented retest blocked all seven bypass attempts.&lt;/p&gt;

&lt;p&gt;Legitimate requests to /health and /api/transactions continued to return HTTP 200.&lt;/p&gt;

&lt;p&gt;This was an important lesson.&lt;/p&gt;

&lt;p&gt;A firewall rule can appear effective while still containing gaps that only become visible through negative testing.&lt;/p&gt;

&lt;p&gt;[Insert screenshots: initial WAF rule, blocked request, and Cloudflare security events.]&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Most Important Experiment: Breaking and Restoring IMDSv2&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The strongest security validation in CloudSecure was a controlled break-and-fix exercise involving the EC2 Instance Metadata Service.&lt;/p&gt;

&lt;p&gt;AWS uses the Instance Metadata Service to make instance information and temporary IAM role credentials available to workloads.&lt;/p&gt;

&lt;p&gt;IMDSv2 improves protection by requiring callers to obtain a session token before accessing metadata.&lt;/p&gt;

&lt;p&gt;For the lab, I deployed the EC2 instance with IMDSv2 required.&lt;/p&gt;

&lt;p&gt;The baseline assessment showed:&lt;/p&gt;

&lt;p&gt;7 PASS · 0 FAIL · 0 ERROR&lt;/p&gt;

&lt;p&gt;Then I deliberately changed the Terraform configuration:&lt;/p&gt;

&lt;p&gt;http_tokens = "optional"&lt;/p&gt;

&lt;p&gt;This allowed requests using the older, tokenless metadata interface.&lt;/p&gt;

&lt;p&gt;Before applying the change, I reviewed the Terraform plan.&lt;/p&gt;

&lt;p&gt;It showed one in-place change, with no new resources and no destroyed resources.&lt;/p&gt;

&lt;p&gt;After applying the change, I ran the security scanner again.&lt;/p&gt;

&lt;p&gt;The IMDSv2 check correctly changed from PASS to FAIL.&lt;/p&gt;

&lt;p&gt;But I wanted more than a failed configuration check.&lt;/p&gt;

&lt;p&gt;Demonstrating the actual security impact&lt;/p&gt;

&lt;p&gt;Using AWS Systems Manager, I tested whether the instance metadata endpoint would respond without an IMDSv2 token.&lt;/p&gt;

&lt;p&gt;During the misconfigured state:&lt;/p&gt;

&lt;p&gt;Tokenless IMDS request: HTTP 200&lt;br&gt;
Tokenless credentials-path request: HTTP 200&lt;/p&gt;

&lt;p&gt;The results demonstrated that the token requirement was no longer protecting the metadata endpoint.&lt;/p&gt;

&lt;p&gt;I then restored the secure Terraform configuration:&lt;/p&gt;

&lt;p&gt;http_tokens = "required"&lt;/p&gt;

&lt;p&gt;After applying the remediation, I repeated the tests.&lt;/p&gt;

&lt;p&gt;Tokenless IMDS request: HTTP 401&lt;br&gt;
Tokenless credentials-path request: HTTP 401&lt;br&gt;
Valid IMDSv2 request: HTTP 200&lt;/p&gt;

&lt;p&gt;This provided evidence that:&lt;/p&gt;

&lt;p&gt;The scanner detected the deliberately introduced misconfiguration.&lt;/p&gt;

&lt;p&gt;The insecure metadata access path became accessible during the drill.&lt;/p&gt;

&lt;p&gt;Terraform successfully restored the intended configuration.&lt;/p&gt;

&lt;p&gt;Tokenless requests were rejected after remediation.&lt;/p&gt;

&lt;p&gt;Legitimate IMDSv2 requests continued working.&lt;/p&gt;

&lt;p&gt;Finally, Terraform reported no outstanding changes, confirming that the deployed configuration matched the code.&lt;/p&gt;

&lt;p&gt;For me, this was the most valuable part of the project.&lt;/p&gt;

&lt;p&gt;It demonstrated not just security configuration, but detection, controlled change management, remediation, and post-change validation.&lt;/p&gt;

&lt;p&gt;[Insert screenshot: IMDSv2 required in AWS.]&lt;/p&gt;

&lt;p&gt;[Insert screenshot or formatted excerpt: before-and-after evidence from the drill.]&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Security Assessment Results&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;CloudSecure's documented deployment produced the following results:&lt;/p&gt;

&lt;p&gt;Validation&lt;/p&gt;

&lt;p&gt;Result&lt;/p&gt;

&lt;p&gt;Combined AWS and Cloudflare assessment&lt;/p&gt;

&lt;p&gt;7 of 7 checks passed&lt;/p&gt;

&lt;p&gt;Direct access to application origin&lt;/p&gt;

&lt;p&gt;Blocked&lt;/p&gt;

&lt;p&gt;Cloudflare application availability&lt;/p&gt;

&lt;p&gt;HTTP 200&lt;/p&gt;

&lt;p&gt;TLS 1.0 and 1.1 after remediation&lt;/p&gt;

&lt;p&gt;Rejected&lt;/p&gt;

&lt;p&gt;TLS 1.2 and 1.3&lt;/p&gt;

&lt;p&gt;Accepted&lt;/p&gt;

&lt;p&gt;Revised WAF bypass tests&lt;/p&gt;

&lt;p&gt;7 of 7 blocked&lt;/p&gt;

&lt;p&gt;IMDSv2 misconfiguration&lt;/p&gt;

&lt;p&gt;Detected&lt;/p&gt;

&lt;p&gt;IMDSv2 remediation&lt;/p&gt;

&lt;p&gt;Validated&lt;/p&gt;

&lt;p&gt;Rejected inbound network attempts&lt;/p&gt;

&lt;p&gt;More than 2,000 recorded&lt;/p&gt;

&lt;p&gt;Automated scanner unit tests&lt;/p&gt;

&lt;p&gt;14&lt;/p&gt;

&lt;p&gt;These results describe the tested controls in this particular lab. They do not establish that the environment is fully secure or compliant with every applicable standard.&lt;/p&gt;

&lt;p&gt;Nevertheless, they provide a useful example of how security teams can move from configuration assumptions to verifiable evidence.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Mapping Security Evidence to PCI DSS&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I also created a starter control mapping aligned with selected requirements of PCI DSS v4.0.&lt;/p&gt;

&lt;p&gt;The mapping connects implemented and tested controls to security objectives such as network protection, secure system configuration, encryption, access management, logging, and security testing.&lt;/p&gt;

&lt;p&gt;Examples include:&lt;/p&gt;

&lt;p&gt;PCI DSS requirement area&lt;/p&gt;

&lt;p&gt;CloudSecure evidence&lt;/p&gt;

&lt;p&gt;Requirement 1 — Network security controls&lt;/p&gt;

&lt;p&gt;Security group restrictions and tunnel configuration&lt;/p&gt;

&lt;p&gt;Requirement 2 — Secure configurations&lt;/p&gt;

&lt;p&gt;IMDSv2 enforcement&lt;/p&gt;

&lt;p&gt;Requirement 3 — Protection of stored account data&lt;/p&gt;

&lt;p&gt;Encrypted EBS storage demonstration&lt;/p&gt;

&lt;p&gt;Requirement 4 — Encryption in transit&lt;/p&gt;

&lt;p&gt;TLS configuration checks&lt;/p&gt;

&lt;p&gt;Requirement 6 — Secure systems and software&lt;/p&gt;

&lt;p&gt;WAF test evidence&lt;/p&gt;

&lt;p&gt;Requirement 10 — Logging and monitoring&lt;/p&gt;

&lt;p&gt;VPC Flow Logs and SSM session logs&lt;/p&gt;

&lt;p&gt;It is important to distinguish control mapping from compliance validation.&lt;/p&gt;

&lt;p&gt;CloudSecure does not process real payment card data, does not represent a complete cardholder data environment, and does not constitute a PCI DSS certification or formal assessment.&lt;/p&gt;

&lt;p&gt;In addition, some lab configurations are intentionally below production-oriented requirements. For example, the lab's default CloudWatch log retention is 90 days rather than the 12 months generally expected for relevant PCI DSS audit logs.&lt;/p&gt;

&lt;p&gt;These limitations are recorded in the repository rather than hidden.&lt;/p&gt;

&lt;p&gt;In a professional security assessment, documenting gaps and accepted risks is just as important as documenting successful controls.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Infrastructure as Code, Automated Testing, and CI/CD&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Terraform provisions the AWS environment, including networking, IAM, EC2, security groups, storage encryption, and logging resources.&lt;/p&gt;

&lt;p&gt;The project also includes a GitHub Actions pipeline that performs:&lt;/p&gt;

&lt;p&gt;Terraform formatting and validation.&lt;/p&gt;

&lt;p&gt;Checkov infrastructure security scanning.&lt;/p&gt;

&lt;p&gt;Python scanner unit tests.&lt;/p&gt;

&lt;p&gt;ShellCheck validation of the instance bootstrap script.&lt;/p&gt;

&lt;p&gt;The pipeline uses commit-pinned GitHub Actions and hash-locked Python dependencies to improve build reproducibility and reduce software supply-chain risk.&lt;/p&gt;

&lt;p&gt;Another important design choice was to document deliberate Checkov exceptions directly in the Terraform code.&lt;/p&gt;

&lt;p&gt;For example, the lab permits a public IPv4 address for outbound connectivity because the instance's inbound security group rules remain closed.&lt;/p&gt;

&lt;p&gt;Rather than silently suppressing the finding, the code records the reason for the exception.&lt;/p&gt;

&lt;p&gt;This is the difference between ignoring a security finding and documenting an intentional architectural trade-off.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What I Learned&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Several lessons stood out from this project.&lt;/p&gt;

&lt;p&gt;Secure defaults still need validation&lt;/p&gt;

&lt;p&gt;The new Cloudflare zone initially accepted outdated TLS versions until I explicitly configured the minimum version.&lt;/p&gt;

&lt;p&gt;Test the behavior, not only the configuration&lt;/p&gt;

&lt;p&gt;The first WAF rule appeared successful until request variations revealed bypasses.&lt;/p&gt;

&lt;p&gt;Failures need distinct reporting&lt;/p&gt;

&lt;p&gt;An API permission error should never be treated as a successful compliance check.&lt;/p&gt;

&lt;p&gt;Infrastructure changes should be predictable&lt;/p&gt;

&lt;p&gt;Reviewing Terraform plans before the IMDSv2 drill helped confirm that the change would affect the intended configuration without rebuilding the instance.&lt;/p&gt;

&lt;p&gt;Cost optimization introduces trade-offs&lt;/p&gt;

&lt;p&gt;Using a public IPv4 address for outbound connectivity avoided NAT Gateway charges but reduced defense in depth compared with a private-subnet architecture.&lt;/p&gt;

&lt;p&gt;Security evidence strengthens engineering decisions&lt;/p&gt;

&lt;p&gt;The most useful results were not screenshots showing that a feature was enabled. They were tests demonstrating how the system behaved before and after a security change.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What I Would Improve Next&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;CloudSecure is a working laboratory implementation, not a finished enterprise security platform.&lt;/p&gt;

&lt;p&gt;My next improvements would focus on expanding the architecture and assessment coverage.&lt;/p&gt;

&lt;p&gt;These include:&lt;/p&gt;

&lt;p&gt;Deploying the application in private subnets.&lt;/p&gt;

&lt;p&gt;Adding multiple Cloudflare Tunnel connectors for high availability.&lt;/p&gt;

&lt;p&gt;Introducing customer-managed KMS keys.&lt;/p&gt;

&lt;p&gt;Expanding log retention and security monitoring.&lt;/p&gt;

&lt;p&gt;Integrating AWS Config and Security Hub findings.&lt;/p&gt;

&lt;p&gt;Adding CloudTrail assessment checks.&lt;/p&gt;

&lt;p&gt;Automating additional WAF validation tests.&lt;/p&gt;

&lt;p&gt;Implementing Cloudflare Access for identity-based application protection.&lt;/p&gt;

&lt;p&gt;Expanding the PCI DSS control mapping with more comprehensive evidence.&lt;/p&gt;

&lt;p&gt;These additions would help move the project closer to the architecture and operational capabilities expected in larger enterprise environments.&lt;/p&gt;

&lt;p&gt;Final Thoughts: Security Is Stronger When It Can Be Demonstrated&lt;/p&gt;

&lt;p&gt;CloudSecure reinforced something I consider fundamental to cloud engineering:&lt;/p&gt;

&lt;p&gt;Deploying a security control is not the same as proving that it works.&lt;/p&gt;

&lt;p&gt;An effective security engineering process should include architecture decisions, infrastructure automation, configuration assessment, negative testing, controlled remediation, and documented validation.&lt;/p&gt;

&lt;p&gt;Through this project, I gained practical experience integrating AWS infrastructure with Cloudflare edge security and developing a Python assessment engine that produces evidence rather than assumptions.&lt;/p&gt;

&lt;p&gt;More importantly, I learned how to investigate whether a security control is effective, reproduce an issue, make a controlled change, and verify the outcome.&lt;/p&gt;

&lt;p&gt;That is the engineering discipline I intend to keep developing as I continue working in cloud infrastructure, security, automation, and platform reliability.&lt;/p&gt;

&lt;p&gt;Explore the Project&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/gkoufie1/cloudsecure" rel="noopener noreferrer"&gt;https://github.com/gkoufie1/cloudsecure&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The repository includes Terraform configurations, Python assessment code, automated tests, screenshots, sanitized security findings, and the complete IMDSv2 remediation evidence.&lt;/p&gt;

&lt;p&gt;If you are learning AWS networking, cloud security, Terraform, or DevSecOps, I hope this project provides a useful foundation for building and testing your own environment.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1e7t9kj2h4jaij84bvsj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1e7t9kj2h4jaij84bvsj.png" alt=" " width="800" height="503"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2dyi22bj9ic5bccu63ap.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2dyi22bj9ic5bccu63ap.png" alt=" " width="800" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnv8lyiefqzbcm3vad32o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnv8lyiefqzbcm3vad32o.png" alt=" " width="799" height="258"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz0kadt07yfpfhmb4kx6w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz0kadt07yfpfhmb4kx6w.png" alt=" " width="799" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdb3rqc2otv5wyxo0079k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdb3rqc2otv5wyxo0079k.png" alt=" " width="800" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;George Koufie is an AWS Community Builder in the Networking &amp;amp; Content Delivery category, with a focus on AWS networking, cloud infrastructure, automation, and operational reliability.&lt;/p&gt;

&lt;p&gt;Medium tags: AWS, Cloud Security, Cloudflare, Terraform, DevSecOps&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>aws</category>
      <category>infrastructure</category>
      <category>security</category>
    </item>
  </channel>
</rss>
