Skip to content

End-to-end AWS security breach simulation with CloudTrail forensics, MITRE ATT&CK mapping, and professional incident response documentation.

Notifications You must be signed in to change notification settings

itsmiu/cloud-ir-simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

16 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Cloud-Native Incident Response Simulation Lab

A complete AWS security breach simulation demonstrating professional SOC incident response methodology.

AWS Python MITRE ATT&CK


๐ŸŽฏ Project Overview

End-to-end cloud security incident simulation featuring:

  • 3-phase attack chain: Initial access โ†’ Privilege escalation โ†’ Data exfiltration
  • Automated forensics: Custom Python tools analyzing 12,000+ CloudTrail events
  • Professional documentation: 25-page incident response report with executive summary
  • MITRE ATT&CK mapping: 5 techniques across 4 tactics
  • NIST SP 800-61 alignment: Structured incident response methodology

๐Ÿ“Š Project Statistics

Metric Value
CloudTrail Events Analyzed 12,444
Suspicious Events Identified 15 (0.12% signal-to-noise)
Attack Scripts Developed 3 (766 lines of Python)
Data Exfiltrated 4 files (2.52 KB) - PII, healthcare, credentials
IOCs Extracted 2 users, 2 IPs, 2 access keys
Documentation 588 lines (IR report + technical docs)

๐Ÿ”ฅ Simulated Attack Scenario

Initial Compromise

AWS service account credentials (dev-api-service) leaked via insecure storage, granting attacker access with overly permissive IAM policy:

  • s3:* on all buckets
  • iam:CreateUser + iam:AttachUserPolicy

Attack Timeline

Phase 1: Reconnaissance (21:01:33 - 21:01:50 UTC)

  • 7 enumeration API calls in 17 seconds
  • Discovered S3 buckets, IAM users, network topology

Phase 2: Privilege Escalation (21:06:03 - 21:07:32 UTC)

  • Created backdoor user backup-admin
  • Attached AdministratorAccess policy
  • Generated persistent access keys

Phase 3: Data Exfiltration (21:11:59 - 21:12:03 UTC)

  • Downloaded 4 sensitive files:
    • customers.csv - PII with SSN and credit cards
    • patient-records.csv - HIPAA protected healthcare data
    • api-keys.txt - Third-party service credentials
    • transactions.json - Financial transaction records

๐Ÿ› ๏ธ Technical Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    AWS ENVIRONMENT                          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                             โ”‚
โ”‚  CloudTrail (Multi-Region)                                 โ”‚
โ”‚  โ””โ”€> Logs all API calls to S3                             โ”‚
โ”‚  โ””โ”€> Log validation enabled (tamper-proof)                โ”‚
โ”‚                                                             โ”‚
โ”‚  Victim Environment                                         โ”‚
โ”‚  โ”œโ”€> IAM: dev-api-service (vulnerable policy)             โ”‚
โ”‚  โ”œโ”€> S3: customer-data-027929660855 (sensitive data)      โ”‚
โ”‚  โ””โ”€> IAM: backup-admin (attacker-created backdoor)        โ”‚
โ”‚                                                             โ”‚
โ”‚  GuardDuty (Planned)                                       โ”‚
โ”‚  โ””โ”€> Automated threat detection (pending activation)       โ”‚
โ”‚                                                             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ”‚
                           โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              FORENSIC INVESTIGATION                         โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                             โ”‚
โ”‚  CloudTrail Logs (1,989 files, 25 MB)                     โ”‚
โ”‚  โ””โ”€> 12,444 total events                                   โ”‚
โ”‚                                                             โ”‚
โ”‚  forensic_analyzer.py                                       โ”‚
โ”‚  โ”œโ”€> Filters to 15 suspicious events                      โ”‚
โ”‚  โ”œโ”€> Builds attack timeline                                โ”‚
โ”‚  โ”œโ”€> Extracts IOCs                                         โ”‚
โ”‚  โ””โ”€> Generates investigation report (JSON)                 โ”‚
โ”‚                                                             โ”‚
โ”‚  Incident Response Report (Markdown)                        โ”‚
โ”‚  โ”œโ”€> Executive summary                                     โ”‚
โ”‚  โ”œโ”€> Technical timeline with evidence                      โ”‚
โ”‚  โ”œโ”€> Root cause analysis                                   โ”‚
โ”‚  โ””โ”€> Remediation recommendations                           โ”‚
โ”‚                                                             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“ Project Structure

cloud-ir-simulation/
โ”‚
โ”œโ”€โ”€ attack-simulation/          # Attack phase artifacts
โ”‚   โ”œโ”€โ”€ scripts/
โ”‚   โ”‚   โ”œโ”€โ”€ reconnaissance.py           # Phase 1: Discovery
โ”‚   โ”‚   โ”œโ”€โ”€ privilege_escalation.py     # Phase 2: Backdoor creation
โ”‚   โ”‚   โ””โ”€โ”€ data_exfiltration.py        # Phase 3: Data theft
โ”‚   โ”œโ”€โ”€ mock-data/                      # Simulated sensitive data
โ”‚   โ”œโ”€โ”€ reconnaissance-report.json      # Discovery results
โ”‚   โ”œโ”€โ”€ privilege-escalation-report.json
โ”‚   โ”œโ”€โ”€ exfiltration-report.json
โ”‚   โ”œโ”€โ”€ VULNERABILITIES.md              # Security gap analysis
โ”‚   โ””โ”€โ”€ vulnerable-policy.json          # Overly permissive IAM policy
โ”‚
โ”œโ”€โ”€ scripts/                    # Forensic investigation tools
โ”‚   โ”œโ”€โ”€ forensic_analyzer.py            # Main analysis tool
โ”‚   โ””โ”€โ”€ guardduty_fetcher.py            # GuardDuty integration (planned)
โ”‚
โ”œโ”€โ”€ evidence/                   # Investigation artifacts
โ”‚   โ”œโ”€โ”€ cloudtrail-logs/                # 12,444 API events (25 MB)
โ”‚   โ””โ”€โ”€ investigation-report.json       # Machine-readable findings
โ”‚
โ”œโ”€โ”€ docs/                       # Documentation
โ”‚   โ”œโ”€โ”€ incident-response-report.md     # 25-page IR report
โ”‚   โ”œโ”€โ”€ progress-log.md                 # Session notes
โ”‚   โ”œโ”€โ”€ guardduty-integration.md        # Future enhancement plan
โ”‚   โ””โ”€โ”€ cloudtrail-bucket-policy.json   # Infrastructure config
โ”‚
โ””โ”€โ”€ detection/                  # SIEM rules (future)

๐Ÿ” MITRE ATT&CK Techniques

Tactic Technique Implementation
Initial Access T1078.004 - Valid Cloud Accounts Compromised AWS credentials
Discovery T1580 - Cloud Infrastructure Discovery ListBuckets, DescribeInstances
Privilege Escalation T1098.001 - Additional Cloud Credentials CreateUser, AttachUserPolicy
Collection T1530 - Data from Cloud Storage GetObject on sensitive S3 files
Exfiltration T1537 - Transfer Data to Cloud Account Downloaded to attacker system

๐Ÿš€ Usage

Prerequisites

  • AWS account with appropriate permissions
  • Python 3.11+
  • AWS CLI configured
  • boto3 library

Quick Start

1. Clone and setup:

git clone <repository-url>
cd cloud-ir-simulation
pip install boto3 --break-system-packages

2. Configure AWS credentials:

aws configure
# Enter your access key, secret key, and region

3. Run forensic analysis:

# Analyze CloudTrail logs to find the attack
python3 scripts/forensic_analyzer.py

4. View results:

# Investigation findings (JSON)
cat evidence/investigation-report.json | jq '.'

# Full incident response report (Markdown)
cat docs/incident-response-report.md | less

Re-running Attack Simulation

# Phase 1: Reconnaissance
python3 attack-simulation/scripts/reconnaissance.py

# Phase 2: Privilege Escalation
python3 attack-simulation/scripts/privilege_escalation.py

# Phase 3: Data Exfiltration
python3 attack-simulation/scripts/data_exfiltration.py

๐Ÿ“ˆ Key Findings

Root Cause

Overly permissive IAM policy granting service account ability to:

  • Access ALL S3 buckets (s3:*)
  • Create IAM users (iam:CreateUser)
  • Attach ANY policy (iam:AttachUserPolicy)

Security Gaps Identified

  1. โŒ S3 data events not logged in CloudTrail
  2. โŒ S3 bucket encryption not enabled
  3. โŒ No automated alerting (GuardDuty pending activation)
  4. โŒ No S3 access logging
  5. โŒ Wildcard IAM permissions

Compliance Impact

  • GDPR: Article 32 encryption requirement violated
  • HIPAA: Security Rule encryption standard violated
  • PCI-DSS: Requirement 3.4 cardholder data protection violated

๐Ÿ›ก๏ธ Remediation

Immediate Actions

  1. Revoke compromised credentials
  2. Delete backdoor user (backup-admin)
  3. Implement least-privilege IAM policy
  4. Enable S3 bucket encryption
  5. Enable S3 access logging

Long-term Improvements

  1. Enable GuardDuty for automated threat detection
  2. Configure CloudWatch alarms for IAM actions
  3. Enable S3 data event logging
  4. Deploy AWS Config for compliance
  5. Implement IAM permission boundaries

๐Ÿ“š Skills Demonstrated

Cloud Security:

  • AWS CloudTrail forensics
  • IAM policy analysis
  • S3 security controls
  • Threat detection strategies

Incident Response:

  • NIST SP 800-61 methodology
  • IOC extraction and correlation
  • Timeline reconstruction
  • Root cause analysis
  • Executive reporting

Technical:

  • Python automation (1,242 lines)
  • Log analysis at scale (12K+ events)
  • MITRE ATT&CK framework
  • Git version control (10 commits)

๐Ÿ”ฎ Future Enhancements

  • GuardDuty integration (automated findings correlation)
  • ELK Stack deployment (centralized log analysis)
  • Custom SIEM detection rules
  • Automated remediation with Lambda
  • AWS Security Hub integration

See docs/guardduty-integration.md for detailed integration plan.


โš ๏ธ Disclaimer

This is a controlled security research project for educational purposes.

  • All attack activity conducted in isolated AWS account
  • Mock sensitive data used (no real PII)
  • Access keys redacted in public documentation
  • Complies with AWS Acceptable Use Policy

๐Ÿ“ Documentation

Document Description
docs/incident-response-report.md Complete 25-page IR report
docs/progress-log.md Session-by-session development notes
attack-simulation/VULNERABILITIES.md Security gap analysis
docs/guardduty-integration.md Future enhancement plan

๐ŸŽ“ Learning Resources


๐Ÿ‘ค Author

Imam Uddin Mohammed

  • Cybersecurity Graduate Student @ University of Central Oklahoma
  • Focus: Cloud Security, Incident Response, Threat Hunting

๐Ÿ“„ License

This project is for educational purposes. See organization policies regarding security research.


Built with Python ๐Ÿ | Powered by AWS โ˜๏ธ | Aligned with NIST ๐Ÿ“‹

Releases

No releases published

Packages

No packages published

Languages