Résumé
ONYEDIKACHI BERNARDCLOUD · DEVSECOPS · AI
RésuméGet in touch
CASE 06NETWORK & PERIMETER

The Forgotten NACL

Both tiers of a two-tier VPC shared the default network ACL, which allowed everything in and out. I replaced it with dedicated public and private NACLs scoped to the app's real traffic, and checked the site still loaded.

Status: REMEDIATED · VERIFIED

DOMAIN
Network & perimeter
PLATFORM
AWS VPC, Network ACLs
SEVERITY
Medium
OUTCOME
Defence in depth

TOOLS

AWS CLIAmazon VPCAmazon EC2AWS Systems Manager Session ManagerNetwork ACLscURL
RESULT
BEFOREAllow all, on both subnets
AFTERTwo scoped NACLs, one per tier
01

Objective

I set out to check whether network ACLs gave the two-tier VPC a second layer of protection, and to replace the default configuration with dedicated subnet-level controls for each tier.

02

Scenario

room33-vpc had a public subnet (10.0.1.0/24) for the web server and a private subnet (10.0.2.0/24) for the backend. The security groups were already scoped: room33-web-sg allowed HTTP on 80 from anywhere, and room33-backend-sg allowed 8080 only from the web server's security group. Both subnets, though, were still on the default network ACL.

03

What I found

default-naclALLOW ALL
Rule 100   inbound    all traffic   0.0.0.0/0   ALLOW
Rule 100   outbound   all traffic   0.0.0.0/0   ALLOW
Rule 32767 inbound    all traffic   0.0.0.0/0   DENY   (never reached)
FINDING 01MEDIUM

The default NACL allowed everything

The default NACL was associated with both subnets, and its rule 100 allowed all inbound and all outbound traffic.

Because rule 100 matched first, the implicit deny was never reached. The security groups still filtered at the instance level, but the subnet boundary added nothing. If a security group were ever misconfigured, there would be no second layer between the public and private tiers.

04

What I did

  1. Mapped the VPC

    I inspected the VPC, its subnets, their NACL associations and the security groups.

  2. Confirmed the shared default

    Both subnets were on the default NACL with allow-all rules in both directions.

  3. Built a public NACL

    room33-public-nacl allows web traffic in and out, ephemeral return traffic, and 8080 out to the private subnet only.

  4. Built a private NACL

    room33-private-nacl allows 8080 in from the public subnet only, plus the return traffic it needs.

  5. Swapped the associations

    Each subnet moved to its own NACL, leaving the default NACL attached to nothing.

EVIDENCE

room33-public-nacl
Inbound    TCP 80, 443       from 0.0.0.0/0
Inbound    TCP 1024-65535    from 0.0.0.0/0
Outbound   TCP 80, 443       to   0.0.0.0/0
Outbound   TCP 8080          to   10.0.2.0/24
Outbound   TCP 1024-65535    to   0.0.0.0/0
room33-private-nacl
Inbound    TCP 8080          from 10.0.1.0/24
Inbound    TCP 1024-65535    from 10.0.0.0/16
Outbound   TCP 1024-65535    to   10.0.1.0/24
Outbound   TCP 443           to   10.0.0.0/16
05

Validation

The web server still served its page after the change, and the associations moved as planned:

CHECKRESULT
Web page loads (curl to the web server)Returned the expected HTML
room33-public-nacl1 subnet
room33-private-nacl1 subnet
Default NACL0 subnets
06

Before and after

CONTROLBEFOREAFTER
Public subnet NACLDefaultDedicated public NACL
Private subnet NACLDefaultDedicated private NACL
Inbound filteringAllow allScoped rules
Outbound filteringAllow allScoped rules
Default NACL associations2 subnets0 subnets
07

What I recommend

  1. 01Give public and private tiers their own NACLs.
  2. 02Do not rely on the default allow-all NACL for production workloads.
  3. 03Keep NACL rules scoped to the traffic the application needs.
  4. 04Review NACLs and security groups together, as two layers of the same boundary.

“Network ACLs are a subnet-level control that backs up instance-level security groups. Configured properly, they add a real second layer of defence.”

WHAT I LEARNED

SKILLS IT PROVES

  • Cloud Security
  • AWS VPC
  • Network ACLs
  • Network Segmentation
  • Defence in Depth
  • Security Hardening
  • Security Risk Assessment
  • Vulnerability Remediation
  • AWS CLI
View my labs on GitHub