CLOUD SECURITY
AWS IAM exploitation - S3 misconfigs - IMDS attacks - Azure AD - GCP service accounts - Kubernetes escapes - IaC security - Cloud IR
Cloud Security Fundamentals
- 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
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.
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.
| Layer | IaaS Example | PaaS Example | SaaS Example | FaaS Example |
|---|---|---|---|---|
| Physical / Datacentre | Provider | Provider | Provider | Provider |
| Network infrastructure | Provider | Provider | Provider | Provider |
| Hypervisor / Host OS | Provider | Provider | Provider | Provider |
| Guest OS / Runtime | Customer | Provider | Provider | Provider |
| Middleware / Platform | Customer | Provider | Provider | Provider |
| Application code | Customer | Customer | Provider | Customer |
| Data classification | Customer | Customer | Customer | Customer |
| Identity and access | Customer | Customer | Shared | Customer |
| Network controls | Customer | Shared | Provider | Provider |
► 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.
| Feature | AWS | Azure | GCP |
|---|---|---|---|
| IAM Service | IAM (users/roles/policies) | Azure AD + RBAC | Cloud IAM + Service Accounts |
| Audit Logging | CloudTrail | Azure Monitor / Activity Log | Cloud Audit Logs |
| Threat Detection | GuardDuty | Microsoft Defender for Cloud | Security Command Center |
| Secret Management | Secrets Manager / SSM | Key Vault | Secret Manager |
| SIEM | Security Hub + partner | Microsoft Sentinel | Chronicle / partner |
| Vulnerability Mgmt | Inspector | Defender for Servers | Security Command Center |
| Config Compliance | AWS Config | Azure Policy | Security Health Analytics |
| Network Firewall | Security Groups + NACLs | NSGs + Azure Firewall | VPC 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.
# 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.
# 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.
| Framework | Focus | Use Case |
|---|---|---|
| CSA CCM v4 | Cloud-specific controls across 17 domains | Security architecture baseline |
| CIS AWS Benchmark | AWS-specific hardening (IAM, logging, networking) | AWS configuration audit |
| CIS Azure Benchmark | Azure AD, Storage, Networking hardening | Azure configuration audit |
| CIS GCP Benchmark | GCP IAM, logging, compute hardening | GCP configuration audit |
| NIST CSF | Identify/Protect/Detect/Respond/Recover | Risk management program |
| SOC 2 Type II | Trust Service Criteria - availability, confidentiality | SaaS vendor assessment |
| ISO 27001 | Information security management system | Enterprise certification |
| PCI DSS | Payment card data in cloud environments | E-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.
# 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
- 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