ROOM 1 OF 5

Hunting the Ghost

Advanced CloudTrail analysis and custom detection engineering

Prerequisites: CloudTrail basics
LEARNING MATERIAL

Detection Engineering in the Cloud

Advanced threat detection requires writing custom rules that catch sophisticated, slow-and-low attacker behaviors. Basic search filters miss multi-stage attacks because attackers deliberately spread their actions over time and across multiple services to avoid triggering simple thresholds. Detection engineering is the discipline of creating and maintaining these detection rules.

Key Detection Patterns: Anomalous behavior detection focuses on finding the needle in a haystack of millions of benign API calls. This involves analyzing rare API calls, unusual timing patterns (e.g., administrative actions at 3 AM), geographic anomalies (logins from countries where the company has no presence), and user agent mismatches (automated tools trying to blend in as standard AWS SDKs). API recon patterns detect initial discovery phases through rapid bursts of Describe* and List* API calls from a single IP address, which indicates an attacker mapping your environment.

Alert Tuning: Reducing false positives is critical for effective detection engineering. You should correlate multiple indicators before triggering an alert: unusual API sequence + new source IP + rare user agent + off-hours timing. Each individual indicator might be benign, but the combination provides high-confidence threat detection.

YOUR MISSION

  • Complete the knowledge check on detection engineering concepts and Athena query patterns
KNOWLEDGE CHECK

QUESTION 1 OF 4

What pattern in CloudTrail logs might indicate an attacker performing initial reconnaissance?

A single API call to S3:ListBuckets
Multiple failed login attempts
Rapid bursts of Describe* and List* API calls from a single IP address
High CPU utilization on EC2 instances

QUESTION 2 OF 4

What technique do attackers use to evade detection by blending their automated tools into normal traffic?

User Agent spoofing — using standard SDK user agents to mask automated tools
Encrypting all their API calls
Using only the AWS Console instead of the CLI
Making API calls from known corporate IP addresses

QUESTION 3 OF 4

In an Athena SQL query analyzing CloudTrail, which fields would you group by to detect an attacker performing recon from a new IP?

userIdentity.userName, sourceIPAddress, and eventName
errorCode and errorMessage only
resourceType and region
userAgent and requestParameters

QUESTION 4 OF 4

What is the purpose of alert tuning in detection engineering?

Reduce false positives by correlating multiple indicators before triggering an alert
Increase the volume of alerts to ensure nothing is missed
Disable all alerts during business hours
Forward all logs to an external SIEM
⬤ 0 / 4 Questions Correct
ROOM 2 OF 5

The Art of the Pivot

Active threat hunting, lateral movement detection, and VPC network analysis

Prerequisites: VPC Networking and IAM Role delegation
LEARNING MATERIAL

Lateral Movement in the Cloud

Lateral movement is the progression from an initial entry point (like a compromised web application) to high-value internal assets (like databases, administrative interfaces, or data lakes). In traditional on-premises environments, lateral movement often involves moving from one workstation to another. In the cloud, it typically involves moving between services, accounts, and VPCs.

VPC Peering & Transit Gateways: Attackers abuse trusted routes established through VPC peering connections or transit gateways. Once they compromise a resource in one VPC (e.g., a web server in a staging VPC), they look for peering connections to other VPCs. A staging VPC that has a peering connection to a production VPC is a common lateral movement path. VPC Flow Logs are the primary detection mechanism — they capture metadata about every IP traffic flow, including source, destination, port, protocol, and whether the traffic was accepted or rejected.

Role Assumption Chain: In AWS, attackers can chain multiple IAM role assumptions to move across accounts. A compromised role in Account A can assume a role in Account B if the trust policy allows it, then assume another role in Account C from there. Detecting this requires tracking the chain of AssumeRole API calls in CloudTrail and identifying unusual cross-account access patterns.

YOUR MISSION

  • Complete the knowledge check on lateral movement detection and VPC flow analysis
KNOWLEDGE CHECK

QUESTION 1 OF 4

What is the primary detection mechanism for identifying lateral movement through VPC peering connections?

VPC Flow Logs — they capture metadata about all IP traffic, including source, destination, port, and protocol
CloudWatch CPU metrics
SNS notifications
EC2 instance status checks

QUESTION 2 OF 4

How do attackers typically chain IAM role assumptions to move across AWS accounts?

They compromise a role in Account A, then use it to assume roles in Account B, C, etc. if trust policies allow
They create new IAM users in each account
They use the root account of each AWS organization
They modify VPC peering connections

QUESTION 3 OF 4

What would you look for in VPC Flow Logs to detect potential lateral movement?

Unusual connections from a staging server to a production database on non-standard ports
High volume of DNS queries
Low network throughput
Standard HTTP traffic to known websites

QUESTION 4 OF 4

What should you do when you detect unauthorized lateral movement through a VPC peering connection?

Terminate the VPC peering connection and revoke the compromised role's credentials immediately
Monitor the traffic for 30 days before taking action
Increase the instance size to handle the extra traffic
Delete the staging server and restore from backup
⬤ 0 / 4 Questions Correct
ROOM 3 OF 5

Cloud Forensics

EC2 post-exploit investigation, evidence preservation, and artifact analysis

Prerequisites: Linux command line, OS structures
LEARNING MATERIAL

Cloud Forensic Methodology

Cloud forensics requires special techniques because cloud instances are ephemeral — they can be terminated and lost forever. The first rule of cloud forensics is "preserve before you investigate." Never shut down a compromised instance, because shutting down clears volatile memory (RAM) which may contain running processes, active network connections, and encryption keys. Instead, isolate the instance using a security group that denies all traffic (except your forensic workstation), then capture forensic artifacts.

Key Artifacts to Examine: Bash history (.bash_history) reveals every command the attacker ran, including privilege escalation attempts and data exfiltration commands. Cron jobs at /etc/cron.* and /var/spool/cron/ reveal persistence mechanisms — attackers commonly install reverse shells that run every few minutes to reconnect if disconnected. System logs at /var/log/auth.log or /var/log/secure show login attempts and authentication anomalies. Web server access logs reveal the initial exploitation vector (e.g., a suspicious POST request to a vulnerable endpoint).

Evidence Preservation: Take an EBS snapshot of all volumes attached to the compromised instance. Store the snapshot in a secure forensics account that the attacker cannot access. If possible, capture the instance's RAM using tools like LiME (Linux Memory Extractor) before isolating the instance. Document the chain of custody — who collected the evidence, when, and how.

YOUR MISSION

  • Complete the knowledge check on cloud forensic techniques and artifact analysis
KNOWLEDGE CHECK

QUESTION 1 OF 4

What is the FIRST thing you should do when you detect a compromised EC2 instance?

Isolate the instance using a restrictive security group to preserve volatile evidence
Terminate the instance immediately
Reboot the instance to clear any malware
Delete the instance and launch a replacement

QUESTION 2 OF 4

Where would you look on a Linux system to find evidence of a reverse shell persistence mechanism?

Check cron jobs in /etc/cron.d and /var/spool/cron for suspicious entries
Check the system's hostname
Check the network MTU settings
Check the system's timezone configuration

QUESTION 3 OF 4

What forensic artifact in Linux reveals the commands run by an attacker on a compromised system?

The .bash_history file in the compromised user's home directory
The /etc/passwd file
The /etc/fstab file
The system's kernel version

QUESTION 4 OF 4

Why should you take an EBS snapshot rather than shutting down a compromised instance?

Shutting down clears volatile memory (RAM) which may contain running processes and active network connections
EBS snapshots are faster than shutting down
The instance cannot be restarted after shutdown
Shutting down deletes the EBS volume
⬤ 0 / 4 Questions Correct
ROOM 4 OF 5

The Zero-Trust Shift

Design modern Zero-Trust architectures, micro-segmentation, and JIT access

Prerequisites: Basic network and identity architecture
LEARNING MATERIAL

Zero-Trust Architecture

Zero-Trust is a security framework based on the philosophy "Never Trust, Always Verify." No entity — whether a user, device, or service — is trusted by default, even if it is already inside the network perimeter. This is a fundamental shift from the traditional "castle-and-moat" model where everything inside the network was trusted. In the cloud era, where perimeters are fluid and employees work from anywhere, Zero-Trust is essential.

Core Principles: Micro-segmentation breaks networks into tiny, isolated zones so that even if an attacker compromises one segment, they cannot move laterally to others. Just-In-Time (JIT) Access grants highly privileged access only for the exact duration of a specific task, then automatically revokes it — no standing permissions. Non-Human Identity (NHI) Security audits and manages credentials used by service accounts, APIs, and automated scripts, which are frequently overlooked in traditional security programs. Assume Breach means designing your architecture as if attackers are already inside your network, limiting the blast radius of any single compromise.

YOUR MISSION

  • Complete the knowledge check on Zero-Trust principles and implementation patterns
KNOWLEDGE CHECK

QUESTION 1 OF 4

What is the core philosophy of Zero-Trust security?

"Never Trust, Always Verify" — no entity is trusted by default, even inside the network
"Trust but verify" — trusted entities can access anything after a single check
"Everything inside the network is safe"
"Block all external traffic"

QUESTION 2 OF 4

What is Just-In-Time (JIT) Access in a Zero-Trust architecture?

Granting privileged access only for the exact duration of a specific task, then automatically revoking it
Granting permanent admin access to all users
Allowing access only during business hours
Requiring two-factor authentication for all logins

QUESTION 3 OF 4

What does "Assume Breach" mean in a Zero-Trust context?

Design architectures as if attackers are already inside, limiting blast radius through isolation and least privilege
Assume the system will never be breached
Only focus on external threats
Disable all security controls to test defenses

QUESTION 4 OF 4

How does micro-segmentation prevent lateral movement?

By breaking networks into tiny, isolated zones with restricted communication between them
By using a single large subnet for all resources
By allowing unrestricted traffic within the VPC
By disabling Security Groups
⬤ 0 / 4 Questions Correct
ROOM 5 OF 5

The Red vs. Blue Showdown

Comprehensive incident response — detect, contain, investigate, and remediate

Prerequisites: Rooms 1-4
INCIDENT RESPONSE REVIEW

Comprehensive Incident Response

This capstone brings together detection engineering, lateral movement analysis, forensics, and Zero-Trust architecture into a single incident response scenario. In a real-world cloud security incident, all these disciplines work together: detection engineering identifies the anomaly, forensic analysis determines the scope and method of compromise, lateral movement analysis traces the attacker's path, and Zero-Trust principles guide the remediation strategy.

The Incident Response Lifecycle: Preparation (having tools, runbooks, and trained personnel ready before an incident occurs), Detection & Analysis (identifying suspicious activity through monitoring tools and log analysis), Containment (stopping the attack and preventing further damage), Eradication (removing the attacker's access and persistence mechanisms), Recovery (restoring normal operations), and Post-Incident Activity (documenting lessons learned and improving defenses).

Key Takeaway: Effective cloud incident response requires understanding how attackers chain multiple techniques across IAM, networking, compute, and storage services. Each detection and response action must consider the interconnected nature of cloud environments.

YOUR MISSION

  • Complete all incident response knowledge check questions to finish the path
CAPSTONE KNOWLEDGE CHECK

QUESTION 1 OF 4

During an incident investigation, you find an attacker exfiltrating data from an S3 bucket. What is your FIRST containment action?

Apply an emergency deny policy to the compromised IAM role and revoke all active sessions
Delete all objects in the S3 bucket
Contact the attacker and ask them to stop
Ignore the alert — it might be a false positive

QUESTION 2 OF 4

What is the correct order of the incident response phases?

Preparation → Detection → Containment → Eradication → Recovery → Post-Incident
Detection → Preparation → Recovery → Eradication → Containment → Post-Incident
Containment → Detection → Recovery → Preparation → Eradication → Post-Incident
Eradication → Detection → Preparation → Recovery → Containment → Post-Incident

QUESTION 3 OF 4

After containing an incident and restoring operations, what is the MOST important remaining step?

Post-incident analysis to document lessons learned, root cause, and improvements to prevent recurrence
Archiving all logs to cold storage
Resetting all employee passwords
Deleting the compromised resources

QUESTION 4 OF 4

How does understanding Zero-Trust architecture principles improve incident response?

It reduces blast radius through micro-segmentation and JIT access, making containment more effective
It eliminates the need for incident response
It makes all logs automatically encrypted
It prevents all security incidents
⬤ 0 / 4 Questions Correct