SlideShare a Scribd company logo
3
Most read
4
Most read
6
Most read
Unexpected Leaks in AWS
Transit Gateways
Cloud Village @ DEFCON32
William Taylor
• William Taylor
• Security Consultant @ WithSecure
• Cloud, Kubernetes, Mobile Security
Introduction
• Client has a new deployment of sensitive
compute resources
• Isolation of compute stated as primary
security concern
• New deployment is temporarily connected to
old deployment during transition phase (1~2
years)
• WithSecure to perform a security assessment
to assess efficacy of the design‘s security
controls
The Scenario
The Design
Virtual private cloud (VPC)
Compute Compute Compute
Egress Egress Egress
Availability Zone A
AWS PrivateLink
Availability Zone B Availability Zone C
Isolated Account Legacy Account
VPC
Subnet 1
TGW TGW Subnet 2
Subnet N
The Expectation
Virtual private cloud (VPC)
Compute Compute Compute
Egress Egress Egress
Availability Zone A Availability Zone B Availability Zone C
Isolated Account Legacy Account
VPC
Subnet 1
TGW TGW Subnet 2
Subnet N
The Reality
Virtual private cloud (VPC)
Compute Compute Compute
Egress Egress Egress
Availability Zone A Availability Zone B Availability Zone C
Isolated Account Legacy Account
VPC
Subnet 1
TGW TGW Subnet 2
Subnet N
nmap found ALL hosts up
• The design makes sense, but the
evidence proves otherwise, what’s going
on?
• Reviewed AWS account
• Reviewed IaC
• Double/triple checked NACLs
• Google
• Blog post on AWS support forum
• “…we use multiple subnets by AZ. Our
standard VPC configuration includes two
subnets in AZ … two subnets in AZ B ...
[a]ccording to my test and documentation,
it is impossible to link two or more subnets
to a Transit Gateway Attachment.”
• “The subnet association is simply the subnet
WITHIN THE ENTIRE AZ … it will be able to
communicate to any subnet in that AZ, as
long as your routing rules and security
groups allow it.”
The Investigation
• The design makes sense, but the
evidence proves otherwise, what’s going
on?
• Reviewed AWS account
• Reviewed IaC
• Double/triple checked NACLs
• Google
• Blog post on AWS support forum
• “…we use multiple subnets by AZ. Our
standard VPC configuration includes two
subnets in AZ … two subnets in AZ B ...
[a]ccording to my test and documentation,
it is impossible to link two or more subnets
to a Transit Gateway Attachment.”
• “The subnet association is simply the subnet
WITHIN THE ENTIRE AZ … it will be able to
communicate to any subnet in that AZ, as
long as your routing rules and security
groups allow it.”
The Investigation
The Explanation
Virtual private cloud (VPC)
Compute Compute Compute
Egress Egress Egress
Availability Zone A Availability Zone B Availability Zone C
Isolated Account Legacy Account
VPC
Subnet 1
TGW TGW Subnet 2
Subnet N
• Solutions and recommendations are a
guidance only
• Apply restrictive NACLs to compute subnets
• If using NACLs, don’t keep the default allow all
• VPC peering as an alternative to TGW peering
• Separate Compute and Egress VPCs
The Fix
• Strong design, strong start
• Security design review valuable
• Practical testing to verify critical
• Dangers of dodgy documentation
The Conclusion
• AWS EC2 Deployment
• Public IPs; security group set to allow all
• iptables rules used to prevent tcp
connections
• Scanning showed 1 of 800 was publicly
exposed
• Error in the init script, rule never set
• Identified with security assessment
• Azure subscription with sensitive
compute
• Large number of NSGs; granular
permissions
• Outbound rule used AzureCloud service
tag
• Permitted outbound connection to all Az
Compute IPs
The Others
Unexpected Leaks in AWS Transit Gateways

More Related Content

Similar to Unexpected Leaks in AWS Transit Gateways (20)

PDF
Datensicherheit mit AWS - AWS Security Web Day
AWS Germany
 
PDF
Security best practices on AWS cloud
Martin Yan
 
PDF
Module 2 - Networking on AWS -Animated.pdf
chiakeehong5
 
PPTX
Amazon Web Services Federation Integration Governance Workshop with Layer 7
CA API Management
 
PDF
Reach: Solving AWS Networking Problems Faster
DanLuhring
 
PDF
AWS reinvent 2019 recap - Riyadh - Network and Security - Anver Vanker
AWS Riyadh User Group
 
PPTX
AWS Network Topology/Architecture
wlscaudill
 
PPTX
Pitt Immersion Day- Module 1
EagleDream Technologies
 
PPTX
Vpc (virtual private cloud)
RashmiDhanve
 
PDF
PLNOG 17 - Tomasz Stachlewski - Infrastruktura sieciowa w chmurze AWS
PROIDEA
 
PDF
5 Not-to-Ignore Best Practices for AWS NACLs (Network Access Control Lists)
TotalCloud Inc.
 
PPTX
Pitt Immersion Day Module 3 - networking in AWS
EagleDream Technologies
 
PPTX
AWS Virtual Private Cloud (VPC) in nutshell
Mohit Kumar
 
PDF
AWS Network Architecture Rework
Olaf Reitmaier Veracierta
 
PDF
AWS Networking – Advanced Concepts and new capabilities | AWS Summit Tel Aviv...
AWS Summits
 
PPTX
Virtual Private Cloud(subnet,routetable).pptx
ibrahimkn04
 
PPTX
AWS VPC Fundamentals- Webinar
Amazon Web Services LATAM
 
PDF
Aws Network Introduction
Rafael Salerno de Oliveira
 
DOCX
AWS virtual private clould
Megha Sahu
 
PDF
Architecting Advanced Network Security Across VPCs with AWS Transit Gateway
Cynthia Hsieh
 
Datensicherheit mit AWS - AWS Security Web Day
AWS Germany
 
Security best practices on AWS cloud
Martin Yan
 
Module 2 - Networking on AWS -Animated.pdf
chiakeehong5
 
Amazon Web Services Federation Integration Governance Workshop with Layer 7
CA API Management
 
Reach: Solving AWS Networking Problems Faster
DanLuhring
 
AWS reinvent 2019 recap - Riyadh - Network and Security - Anver Vanker
AWS Riyadh User Group
 
AWS Network Topology/Architecture
wlscaudill
 
Pitt Immersion Day- Module 1
EagleDream Technologies
 
Vpc (virtual private cloud)
RashmiDhanve
 
PLNOG 17 - Tomasz Stachlewski - Infrastruktura sieciowa w chmurze AWS
PROIDEA
 
5 Not-to-Ignore Best Practices for AWS NACLs (Network Access Control Lists)
TotalCloud Inc.
 
Pitt Immersion Day Module 3 - networking in AWS
EagleDream Technologies
 
AWS Virtual Private Cloud (VPC) in nutshell
Mohit Kumar
 
AWS Network Architecture Rework
Olaf Reitmaier Veracierta
 
AWS Networking – Advanced Concepts and new capabilities | AWS Summit Tel Aviv...
AWS Summits
 
Virtual Private Cloud(subnet,routetable).pptx
ibrahimkn04
 
AWS VPC Fundamentals- Webinar
Amazon Web Services LATAM
 
Aws Network Introduction
Rafael Salerno de Oliveira
 
AWS virtual private clould
Megha Sahu
 
Architecting Advanced Network Security Across VPCs with AWS Transit Gateway
Cynthia Hsieh
 

More from Cloud Village (18)

PDF
The Rise of the Planet of the Agents: LLM-based AI Agents and Cloud Security ...
Cloud Village
 
PDF
Creating Azure Policy Compliant Backdoor
Cloud Village
 
PPTX
Kicking in the Door to the Cloud: Exploiting Cloud Provider Vulnerabilities f...
Cloud Village
 
PDF
Cloud Tripwires: fighting stealth with stealth
Cloud Village
 
PPTX
Connecting the Dots - Mastering Alert Correlation for Proactive Defense in th...
Cloud Village
 
PDF
Runtime Reachability: Prioritizing Vulnerabilities with eBPF & Continuous Pro...
Cloud Village
 
PPTX
Revealing Choke Points - Practical Tactics for Boosting Cloud Security
Cloud Village
 
PDF
Finding Holes in Conditional Access Policies
Cloud Village
 
PPTX
One Click, Six Services - Abusing The Dangerous Multi-service Orchestration P...
Cloud Village
 
PDF
Terraform Unleashed - Crafting Custom Provider Exploits for Ultimate Control
Cloud Village
 
PPTX
Workshop: Hands-On Container Image Security Mastering Sigstore for Unbreachab...
Cloud Village
 
PDF
DC 32: Epyon - Attacking DevOps environments
Cloud Village
 
PDF
Exploit K8S via Misconfiguration .YAML in CSP environments
Cloud Village
 
PDF
Cloud Offensive Breach and Risk Assessment (COBRA)
Cloud Village
 
PDF
One Port to Serve Them All - Google GCP Cloud Shell Abuse
Cloud Village
 
PDF
The Oracle Awakens: Demystifying Privilege Escalation in the cloud
Cloud Village
 
PDF
Catch them all! Detection engineering and purple teaming in the cloud
Cloud Village
 
PDF
Gone in 60 Seconds… How Azure AD/Entra ID Tenants are Compromise
Cloud Village
 
The Rise of the Planet of the Agents: LLM-based AI Agents and Cloud Security ...
Cloud Village
 
Creating Azure Policy Compliant Backdoor
Cloud Village
 
Kicking in the Door to the Cloud: Exploiting Cloud Provider Vulnerabilities f...
Cloud Village
 
Cloud Tripwires: fighting stealth with stealth
Cloud Village
 
Connecting the Dots - Mastering Alert Correlation for Proactive Defense in th...
Cloud Village
 
Runtime Reachability: Prioritizing Vulnerabilities with eBPF & Continuous Pro...
Cloud Village
 
Revealing Choke Points - Practical Tactics for Boosting Cloud Security
Cloud Village
 
Finding Holes in Conditional Access Policies
Cloud Village
 
One Click, Six Services - Abusing The Dangerous Multi-service Orchestration P...
Cloud Village
 
Terraform Unleashed - Crafting Custom Provider Exploits for Ultimate Control
Cloud Village
 
Workshop: Hands-On Container Image Security Mastering Sigstore for Unbreachab...
Cloud Village
 
DC 32: Epyon - Attacking DevOps environments
Cloud Village
 
Exploit K8S via Misconfiguration .YAML in CSP environments
Cloud Village
 
Cloud Offensive Breach and Risk Assessment (COBRA)
Cloud Village
 
One Port to Serve Them All - Google GCP Cloud Shell Abuse
Cloud Village
 
The Oracle Awakens: Demystifying Privilege Escalation in the cloud
Cloud Village
 
Catch them all! Detection engineering and purple teaming in the cloud
Cloud Village
 
Gone in 60 Seconds… How Azure AD/Entra ID Tenants are Compromise
Cloud Village
 
Ad

Recently uploaded (20)

PPTX
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
PPTX
Agile Chennai 18-19 July 2025 | Workshop - Enhancing Agile Collaboration with...
AgileNetwork
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
NewMind AI Weekly Chronicles – July’25, Week III
NewMind AI
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PDF
Per Axbom: The spectacular lies of maps
Nexer Digital
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PPTX
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PPTX
AVL ( audio, visuals or led ), technology.
Rajeshwri Panchal
 
PDF
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PDF
Market Insight : ETH Dominance Returns
CIFDAQ
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
Agile Chennai 18-19 July 2025 | Workshop - Enhancing Agile Collaboration with...
AgileNetwork
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
NewMind AI Weekly Chronicles – July’25, Week III
NewMind AI
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
Per Axbom: The spectacular lies of maps
Nexer Digital
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
The Future of Artificial Intelligence (AI)
Mukul
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
AVL ( audio, visuals or led ), technology.
Rajeshwri Panchal
 
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
Market Insight : ETH Dominance Returns
CIFDAQ
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Ad

Unexpected Leaks in AWS Transit Gateways

  • 1. Unexpected Leaks in AWS Transit Gateways Cloud Village @ DEFCON32 William Taylor
  • 2. • William Taylor • Security Consultant @ WithSecure • Cloud, Kubernetes, Mobile Security Introduction
  • 3. • Client has a new deployment of sensitive compute resources • Isolation of compute stated as primary security concern • New deployment is temporarily connected to old deployment during transition phase (1~2 years) • WithSecure to perform a security assessment to assess efficacy of the design‘s security controls The Scenario
  • 4. The Design Virtual private cloud (VPC) Compute Compute Compute Egress Egress Egress Availability Zone A AWS PrivateLink Availability Zone B Availability Zone C Isolated Account Legacy Account VPC Subnet 1 TGW TGW Subnet 2 Subnet N
  • 5. The Expectation Virtual private cloud (VPC) Compute Compute Compute Egress Egress Egress Availability Zone A Availability Zone B Availability Zone C Isolated Account Legacy Account VPC Subnet 1 TGW TGW Subnet 2 Subnet N
  • 6. The Reality Virtual private cloud (VPC) Compute Compute Compute Egress Egress Egress Availability Zone A Availability Zone B Availability Zone C Isolated Account Legacy Account VPC Subnet 1 TGW TGW Subnet 2 Subnet N nmap found ALL hosts up
  • 7. • The design makes sense, but the evidence proves otherwise, what’s going on? • Reviewed AWS account • Reviewed IaC • Double/triple checked NACLs • Google • Blog post on AWS support forum • “…we use multiple subnets by AZ. Our standard VPC configuration includes two subnets in AZ … two subnets in AZ B ... [a]ccording to my test and documentation, it is impossible to link two or more subnets to a Transit Gateway Attachment.” • “The subnet association is simply the subnet WITHIN THE ENTIRE AZ … it will be able to communicate to any subnet in that AZ, as long as your routing rules and security groups allow it.” The Investigation
  • 8. • The design makes sense, but the evidence proves otherwise, what’s going on? • Reviewed AWS account • Reviewed IaC • Double/triple checked NACLs • Google • Blog post on AWS support forum • “…we use multiple subnets by AZ. Our standard VPC configuration includes two subnets in AZ … two subnets in AZ B ... [a]ccording to my test and documentation, it is impossible to link two or more subnets to a Transit Gateway Attachment.” • “The subnet association is simply the subnet WITHIN THE ENTIRE AZ … it will be able to communicate to any subnet in that AZ, as long as your routing rules and security groups allow it.” The Investigation
  • 9. The Explanation Virtual private cloud (VPC) Compute Compute Compute Egress Egress Egress Availability Zone A Availability Zone B Availability Zone C Isolated Account Legacy Account VPC Subnet 1 TGW TGW Subnet 2 Subnet N
  • 10. • Solutions and recommendations are a guidance only • Apply restrictive NACLs to compute subnets • If using NACLs, don’t keep the default allow all • VPC peering as an alternative to TGW peering • Separate Compute and Egress VPCs The Fix
  • 11. • Strong design, strong start • Security design review valuable • Practical testing to verify critical • Dangers of dodgy documentation The Conclusion
  • 12. • AWS EC2 Deployment • Public IPs; security group set to allow all • iptables rules used to prevent tcp connections • Scanning showed 1 of 800 was publicly exposed • Error in the init script, rule never set • Identified with security assessment • Azure subscription with sensitive compute • Large number of NSGs; granular permissions • Outbound rule used AzureCloud service tag • Permitted outbound connection to all Az Compute IPs The Others

Editor's Notes

  • #1: Hi everyone, thanks for being here Great effort making it to final day, final talk, looking fresher than I feel I’m here to talk though a security assessment that threw up strange behaviour in TGW, the issue, the investigation, lessons learned
  • #2: I’m will, security consultant at WS Perform security reviews and offensive security testing for range of clients Mobile, K8s, and for this talk cloud
  • #3: Sensitive compute, deploying to new region, compute auto applied as needed when customers request, no direct compute deployment control Isolation key concern, from the internet, from other regions, from other deployments Connected to old region during transition, auto deployment will place compute in both regions, connectivity needed only when required WS to perform a security review, clear focus on isolation of resources
  • #4: Isolated account, with a VPC, Some subnets, Compute subnets, where the instances will be deployed, and egress subnets for connecting to other services Subnets across three AZ Routing tables forward most traffic to PrivateLinks But we are not looking at that We are interested in the link to the legacy region, similar deployment of compute VPCs and subnets Uses TGW TW Attachment applied to each Egress subnet, routing tables configured to send Private IP ranges of legacy subnets to the TGW TGW peered to another TGW, which in turn is attached to the legacy subnets – simplified legacy details, not reviewed in the assessment Finally, and importantly, NACLs applied in the Egress subnets – granularly configured for each legacy subnet, plus a deny all
  • #5: Testing deployed instance to one compute subnet Attempting to hit legacy will hit NACLs
  • #6: Simple nmap to a known host in the legacy region – HIT Nmap to a know subnet – HIT HIT HIT Nmap to all know private IPs in legacy – CLICK Something wrong here
  • #7: Simplifed arch diagram matches design docs – seems OK Instance is in the compute subnet, routing tables make sense Checked the IaC, can see the TGW attachments to the Egress, no clear signs what is amiss Checked the NACLs. And then again. And again. But it’s not just one instance, all can be hit – no ALLOW all with high priority Time for a google Search turned up an interesting post on AWS Discussion Forum Not exaclty the same problem, someone is trying to connect TGWs to multiple subnets in the AZ but can’t – the docs and testing confirms you can’s only one subnet But the response tells us what we need to know
  • #8: The association is in THE ENTIRE AZ So even if we connect to Egress… we are not ONLY connecting to the Egress
  • #9: Revisit our diagram, there is a mistake – the TGW attachments should really be here And if the TGW is here, the it also means the Egress subnets are basically not there… And with our Egress subnets, we also lose our NACLs, and so… Now we can see the root of the problem. It’s not that the NACLs were wrong. IT’s that the traffic never even hit the NACLs. There were no NACLs in the Compute subnet, not a diagram oversight
  • #10: So what can we do to fix it? Caveat – solutions are context dependant But, NACLs should really be applied to the subnet where compute is deployed, also don’t use default NACLs with default allow Maybe VPC peering? But that is a design change Maybe separate VPCs for compute and Egress? Again, context and design needs need to be considered