GHOSTNET›MOD-09 // CLOUD SECURITY
CONCEPTLAB →
MODULE 09 - CONCEPT PAGE

CLOUD SECURITY

AWS IAM exploitation - S3 misconfigs - IMDS attacks - Azure AD - GCP service accounts - Kubernetes escapes - IaC security - Cloud IR

← MOD-08 NETWORK ATTACKSMOD-10 SOCIAL ENGINEERING →
8
CHAPTERS
~2.8hr
TOTAL READ
ADVANCED
DIFFICULTY
MOD-09
IDENTIFIER
BEGINNER~12 min READCHAPTER 1 OF 8

Cloud Security Fundamentals

KEY POINTS · THE QUICK VERSION
  • In IaaS the customer owns OS and above; in SaaS the provider owns almost everything - shared responsibility shifts dramatically across models
  • Identity IS the perimeter in cloud - there is no network boundary the way there is on-prem; compromised credentials = game over
  • Misconfiguration is the #1 cloud breach cause - public S3 buckets, open security groups, and overprivileged IAM roles are constant targets
  • CSPM tools like Wiz and Prisma Cloud continuously audit your cloud posture against CIS benchmarks and flag drift in real time
  • Multi-cloud environments compound risk: each platform has its own IAM model, logging gaps, and attack surface to master
Scan these first, then read below for the depth and examples — or jump straight to the lab.

Cloud computing has fundamentally changed the security landscape. On-premises networks had a clear perimeter: if you controlled the firewall, you controlled access. Cloud eliminates that perimeter entirely. Data and compute live in shared infrastructure operated by a third party, accessible from anywhere with the right credentials. This makes cloud security both more scalable and more treacherous.

NOTE
Think of cloud security like renting an apartment vs. owning a house. When you own, you control everything - the locks, the wiring, the roof. When you rent, you and the landlord share responsibilities. The lease (shared responsibility model) defines exactly who fixes what. Security breaches happen when tenants assume the landlord handles something they actually own themselves.
◈ PICTURE IT — MTAANI EDITION

A row of shops with no outer fence — that is the cloud. On an old office network, a wall and a gate kept strangers away from the building. In the cloud there is no wall: your data sits in a huge shared block anyone can walk up to, and the only thing between a thief and your shop is the padlock on your own door — your login. Lose that key and it does not matter how big the building's guards are; the intruder is already inside, holding your keys. That is why in the cloud we say identity, not the network, is the real perimeter.

► Cloud Service Models and Shared Responsibility

The shared responsibility model defines which security controls the cloud provider handles and which the customer must implement. This boundary shifts depending on which service model you use.

LayerIaaS ExamplePaaS ExampleSaaS ExampleFaaS Example
Physical / DatacentreProviderProviderProviderProvider
Network infrastructureProviderProviderProviderProvider
Hypervisor / Host OSProviderProviderProviderProvider
Guest OS / RuntimeCustomerProviderProviderProvider
Middleware / PlatformCustomerProviderProviderProvider
Application codeCustomerCustomerProviderCustomer
Data classificationCustomerCustomerCustomerCustomer
Identity and accessCustomerCustomerSharedCustomer
Network controlsCustomerSharedProviderProvider
👁 WATCH THIS · you don't need to run it yet — just read along
// CLOUD SERVICE MODELS AT A GLANCE
# IaaS — Infrastructure as a Service
# AWS EC2, Azure VMs, GCP Compute Engine
# You get: virtual machines, storage, networking
# You manage: OS patches, runtime, middleware, app code, IAM
# Attack surface: everything above the hypervisor is YOUR problem

# PaaS — Platform as a Service
# AWS Elastic Beanstalk, Azure App Service, GCP App Engine, Heroku
# You get: managed runtime + platform, deploy code directly
# You manage: application code, data, some network config
# Attack surface: code injection, dependency vulns, misconfigured env vars

# SaaS — Software as a Service
# Google Workspace, Microsoft 365, Salesforce, Slack
# You get: finished application, no infra to manage
# You manage: user accounts, permissions, data you put in
# Attack surface: identity (OAuth, SSO), data classification, integrations

# FaaS / Serverless — Function as a Service
# AWS Lambda, Azure Functions, GCP Cloud Functions
# You get: ephemeral compute triggered by events
# You manage: function code, IAM roles, environment variables
# Attack surface: event injection, dependency confusion, env var secrets, IAM roles
What you're seeing: A plain map of the four ways to rent computing. The big idea is the last line of each block: the further down you go, from IaaS to SaaS, the more the provider looks after and the less is left for you to secure — but your data and your logins stay yours to guard in every single one.
↪ Nothing to run here — just notice who owns what in each model before the lab.

► Major Cloud Providers - Security Feature Comparison

AWS holds roughly 31% market share and is the most common target in bug bounties and red team engagements. Azure holds around 25% and dominates enterprise environments deeply tied to Active Directory. GCP holds around 11% and is favoured by data-intensive and developer-heavy organisations.

FeatureAWSAzureGCP
IAM ServiceIAM (users/roles/policies)Azure AD + RBACCloud IAM + Service Accounts
Audit LoggingCloudTrailAzure Monitor / Activity LogCloud Audit Logs
Threat DetectionGuardDutyMicrosoft Defender for CloudSecurity Command Center
Secret ManagementSecrets Manager / SSMKey VaultSecret Manager
SIEMSecurity Hub + partnerMicrosoft SentinelChronicle / partner
Vulnerability MgmtInspectorDefender for ServersSecurity Command Center
Config ComplianceAWS ConfigAzure PolicySecurity Health Analytics
Network FirewallSecurity Groups + NACLsNSGs + Azure FirewallVPC Firewall Rules + Cloud Armor

► Cloud Threat Model

The cloud threat model differs significantly from on-premises. Physical attacks are largely irrelevant - you cannot walk up to an AWS rack. Instead, the threats concentrate around identity, configuration, and software supply chain.

// PRIMARY CLOUD THREAT CATEGORIES
# 1. MISCONFIGURATION (most common breach cause)
# Public S3 buckets, open RDS instances, permissive security groups
# Overprivileged IAM roles, public ECR images, open Redis/Elasticsearch
# Misconfigured Kubernetes RBAC, public etcd, unauthenticated kubelet

# 2. COMPROMISED CREDENTIALS
# Access keys hardcoded in GitHub repos (truffleHog, git-secrets detect these)
# Keys exposed via Lambda env vars, EC2 userdata, container image layers
# Phishing for AWS console credentials / Azure AD passwords
# SSRF attacks reaching IMDS (Instance Metadata Service) to steal temp creds

# 3. INSIDER THREAT
# Employee with broad IAM access - exfiltrates data before leaving
# Accidental public share of S3 bucket by developer
# Shadow IT: teams spinning up unmanaged cloud accounts

# 4. SUPPLY CHAIN
# Malicious packages in Lambda layers or container images
# Typosquatting in PyPI/npm that exfiltrate cloud credentials
# Compromised Terraform module or CDK construct in CI/CD pipeline
# Third-party SaaS integration with overpermissioned OAuth scope

► Cloud Attack Lifecycle

The cloud attack lifecycle maps closely to MITRE ATT&CK for Cloud. Understanding the phases helps you know where to focus detective controls and where attackers are likely to dwell longest.

// CLOUD ATTACK KILL CHAIN
# PHASE 1: RECONNAISSANCE
# Enumerate public S3 buckets (GrayhatWarfare, S3Scanner)
# Find exposed cloud credentials in GitHub (truffleHog, GitLeaks)
# Identify cloud provider via ASN, CNAME, response headers
# Shodan/Censys for open cloud ports (Redis 6379, etcd 2379, kubelet 10250)

# PHASE 2: INITIAL ACCESS
# Use exposed access key to call AWS STS GetCallerIdentity
# Exploit SSRF in web app to reach IMDS (169.254.169.254)
# Credential stuffing against Azure AD / AWS console login
# Illicit consent grant attack on Azure AD OAuth app

# PHASE 3: EXECUTION
# Invoke Lambda functions with malicious event payloads
# Run commands via SSM Session Manager (no SSH needed)
# Execute via EC2 userdata on new instances
# Kubernetes: kubectl exec into compromised pod

# PHASE 4: PERSISTENCE
# Create backdoor IAM user with access key
# Add attacker-controlled MFA device to existing user
# Register rogue OAuth application in Azure AD tenant
# Create new service account key in GCP project
# Install Lambda layer that persists across deployments

# PHASE 5: LATERAL MOVEMENT
# Assume cross-account IAM roles
# Hop through EC2 instance profiles to reach more-privileged roles
# Impersonate GCP service accounts across projects
# Use managed identity SSRF to access other Azure resources

# PHASE 6: PRIVILEGE ESCALATION
# iam:CreatePolicyVersion -> attach admin policy to self
# iam:PassRole + ec2:RunInstances -> run instance with admin role
# Azure: add self to Global Admin via Privileged Role Admin
# GCP: iam.serviceAccounts.actAs to impersonate high-priv SA

# PHASE 7: EXFILTRATION
# S3 sync to attacker-controlled bucket in different account
# RDS snapshot share to external account
# Exfil via DNS (slow but evades many DLP tools)
# CloudFront/S3 as staging point before final exfil

► Cloud Security Frameworks and Compliance

Several frameworks exist to help organisations structure their cloud security programs. The CSA Cloud Controls Matrix is the most comprehensive cloud-specific framework, covering 197 control objectives across 17 domains including identity, encryption, and incident response.

FrameworkFocusUse Case
CSA CCM v4Cloud-specific controls across 17 domainsSecurity architecture baseline
CIS AWS BenchmarkAWS-specific hardening (IAM, logging, networking)AWS configuration audit
CIS Azure BenchmarkAzure AD, Storage, Networking hardeningAzure configuration audit
CIS GCP BenchmarkGCP IAM, logging, compute hardeningGCP configuration audit
NIST CSFIdentify/Protect/Detect/Respond/RecoverRisk management program
SOC 2 Type IITrust Service Criteria - availability, confidentialitySaaS vendor assessment
ISO 27001Information security management systemEnterprise certification
PCI DSSPayment card data in cloud environmentsE-commerce/fintech compliance

► CIEM and CSPM Tools

Cloud Infrastructure Entitlement Management (CIEM) focuses specifically on who (or what) can access what in your cloud environment. Traditional IAM tools show you what permissions exist; CIEM shows you what permissions are actually being USED versus what was granted - revealing the massive privilege creep that accumulates over time. Cloud Security Posture Management (CSPM) continuously scans cloud configuration against policy baselines.

// CSPM AND CIEM TOOL COMPARISON
# Wiz
# Agentless, graph-based risk analysis
# Maps attack paths: "internet-exposed EC2 with admin role = critical"
# CIEM module shows effective permissions vs granted permissions
# Most popular enterprise CSPM as of 2024

# Prisma Cloud (Palo Alto Networks)
# Comprehensive CNAPP: CSPM + CWPP + CIEM + IaC scanning
# Deep AWS/Azure/GCP integration with compliance reporting

# Orca Security
# Agentless side-scanning via cloud provider API (no agents needed)
# Reads memory, disk of cloud workloads without touching them
# Strong container and serverless coverage

# Aqua Security
# Container and serverless focused CWPP
# Runtime protection, DTA (Dynamic Threat Analysis) for images
# Strong Kubernetes security posture management

# Open Source Alternatives:
# ScoutSuite     - multi-cloud audit (AWS/Azure/GCP) Python CLI
# Prowler        - AWS/Azure/GCP CIS benchmark checks, 200+ checks
# CloudMapper    - AWS network visualization and attack surface review
# Steampipe      - SQL queries against cloud APIs for custom auditing
RECAP · CHECK YOURSELF
  • In IaaS the customer owns OS and above; in SaaS the provider owns almost everything - shared responsibility shifts dramatically across models
  • Identity IS the perimeter in cloud - there is no network boundary the way there is on-prem; compromised credentials = game over
  • Misconfiguration is the #1 cloud breach cause - public S3 buckets, open security groups, and overprivileged IAM roles are constant targets
  • CSPM tools like Wiz and Prisma Cloud continuously audit your cloud posture against CIS benchmarks and flag drift in real time
  • Multi-cloud environments compound risk: each platform has its own IAM model, logging gaps, and attack surface to master
Read to the end to count this chapter
▸ READY TO PRACTISE
You've now covered enough for Lab steps 1–2 of 18. Try them in the lab while it's fresh.
OPEN LAB ▸
⚡ TEST YOURSELF
End-of-chapter quiz
A dozen questions — recall and practical. Graded, earns up to 20 XP.
PRACTISE IN THE LAB ▸
READY TO PRACTICE?
MOD-09 Interactive Lab
18 steps · 490 XP · Real commands · Flag captures
LAUNCH LAB →
← MOD-08: NETWORK ATTACKSMOD-10: SOCIAL ENGINEERING →