Cloud Threat Model

From Theory to Practice

Cloud Threat Model

I attended a cybersecurity event πŸ‘‰container security village. I learn this topic Threat Modelling in Cloud so i want to apply this theory. Some memories :)

Joined Images

My experiment a static website in an AWS S3 bucket, served via a Content Delivery Network (CDN), with an AWS Lambda backend API. I want to apply threat modeling: shifting security left by finding flaws in the design phase rather than in production.

demo

Diagram showing Components (Data Flows) ✴️

  • Where does secure private data start?
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
Browser / app.py
   AWS WAF 
      β”‚
      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  API Gateway    │──────▢ β”‚  Lambda (Python) β”‚
β”‚  (HTTP API)     β”‚        β”‚  handler.py      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                    β”‚ s3:ListBucket
                                    β–Ό
                           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                           β”‚    S3 Bucket     β”‚  (private)
                           β”‚  gallery images  β”‚
                           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                    β–²
                           OAC (sigv4)
                                    β”‚
Browser ──────────────────▢ CloudFront CDN
                            (image delivery)

Phase 2: Identify Threats (Using STRIDE) 🧐

Component STRIDE Category Threat Description
S3 Bucket Information Disclosure Misconfigured permissions allow unauthorized public read access.
CDN (CloudFront) Spoofing / Tampering Attackers bypass the CDN to target the S3 origin directly.
API Gateway / Lambda Elevation of Privilege Lack of authentication allows unauthorized code execution.

STRIDE methodology (Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, Elevation of Privilege) to identify threats at each component.

Mitigation Plan: Cloud configuration fixes.

  • S3: Block direct public access and apply CloudFront restriction.
  • Lambda: Use IAM roles for S3 and Cloudfront access.
  • API Gateway: Enable a firewall to block IPs that exceed request limits.
  • CloudFront: Apply Amazon CloudFront Origin Access Control (OAC).

πŸ‘‰My code:πŸ”— Results

  • OWASP Threat Dragon (Free, open-source tool)

Offtopic

Love your dogs by giving them a quality life. Don’t forget to neuter!

comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy