Cloud Attack Surface
IAM, storage and metadata risks.
Cloud Attack Surface is a free Cyber Security Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Cyber Security Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
The Cloud Shared Responsibility Model
In the cloud, the provider secures the infrastructure while the customer secures configuration, identity, and data. Most breaches occur on the customer side of this line.
- The provider patches hypervisors and physical security.
- The customer owns IAM policies, storage permissions, and network rules.
- Misconfiguration, not provider compromise, is the dominant risk.
Identity Is the New Perimeter
Cloud has no traditional network edge. Access is governed by IAM: users, roles, policies, and keys. A leaked access key can be as damaging as a stolen domain admin password.
- IAM policies grant actions on resources.
- Roles let services and users assume temporary credentials.
- Over-permissioned identities are the primary escalation vector.
Credential Exposure
Cloud credentials leak constantly. Common sources include:
- Access keys committed to public Git repositories.
- Keys hardcoded in mobile apps, CI logs, or container images.
- Server-Side Request Forgery (SSRF) reaching the metadata service.
- Overly broad sharing of long-lived keys instead of short-lived roles.
# Scan a repo for leaked cloud secrets
trufflehog git file://./repo --only-verified
# Validate an AWS key you found
aws sts get-caller-identityThe Metadata Service
Every cloud instance exposes a metadata endpoint that can hand out temporary role credentials. An SSRF or RCE on a VM that reaches it often yields the instance role.
- AWS IMDS lives at
169.254.169.254. - IMDSv1 is request-only and trivially abused via SSRF.
- IMDSv2 requires a session token (PUT then GET), blunting many SSRF attacks.
# IMDSv1 (vulnerable) credential theft via SSRF
curl http://169.254.169.254/latest/meta-data/iam/security-credentials/ROLE
# IMDSv2 requires a token first
TOKEN=$(curl -X PUT 'http://169.254.169.254/latest/api/token' -H 'X-aws-ec2-metadata-token-ttl-seconds: 60')Storage Misconfigurations
Object storage (S3, GCS, Azure Blob) is a recurring source of data exposure.
- Public-read buckets leak sensitive files.
- Public-write buckets allow tampering or malware hosting.
- Overly broad bucket policies or ACLs grant authenticated users access.
- Pre-signed URLs with long expiry leak persistent access.
# Enumerate and test an S3 bucket
aws s3 ls s3://target-bucket --no-sign-request
aws s3 cp s3://target-bucket/secret.txt . --no-sign-requestNetwork and Service Exposure
Cloud network controls (Security Groups, NSGs, firewall rules) are easy to over-open.
- Databases or admin ports exposed to
0.0.0.0/0. - Management planes (Kubernetes API, RDP, SSH) reachable from the internet.
- Internal services trusting the VPC implicitly with no auth.
Serverless and Managed Services
Serverless shifts but does not remove risk. Functions, queues, and managed databases each have an execution identity.
- A Lambda's execution role may be over-permissioned.
- Environment variables often hold secrets readable on compromise.
- Event-source misconfig can let untrusted input trigger privileged functions.
The Control Plane vs Data Plane
Distinguish the two attack surfaces:
- Control plane: the cloud API (create resources, modify IAM, read configs). Compromise here is account-wide.
- Data plane: the workloads themselves (apps, VMs, containers).
A foothold in the data plane that yields control-plane credentials is the classic cloud escalation.
Multi-Account and Cross-Tenant
Large organizations split workloads across many accounts/subscriptions/projects.
- Cross-account roles with weak trust policies allow pivoting.
- A confused-deputy in a third-party integration role can be abused.
- Organization-level roles (e.g., OrganizationAccountAccessRole) are high value.
Logging and Detection Surface
Defenders rely on cloud-native logs. Attackers try to blind them.
- CloudTrail / Activity Log / Audit Logs record control-plane calls.
- Attackers may disable trails or stop log delivery.
- GuardDuty / Security Command Center / Defender flag anomalies.
Disabling logging is itself a high-signal event worth alerting on.
Scoping Cloud Tests
Cloud pentests require provider awareness and authorization. Some actions (denial-of-service, certain scanning) violate provider terms. Always confirm account ownership, agree on blast radius, and prefer read-only enumeration first.
Use a dedicated test account or clearly tagged resources, and never touch resources outside the documented scope.
Quick Check
Confirm your grasp of the cloud attack surface.
Recap
You mapped the cloud attack surface.
- Misconfiguration on the customer side dominates cloud risk.
- Identity is the perimeter; leaked keys and roles are key vectors.
- The metadata service bridges data-plane bugs to cloud credentials.
- Storage, network, and logging misconfigs round out the surface.
Next: enumerating cloud resources to find these issues.
Frequently asked questions
Is the “Cloud Attack Surface” lesson free?
Yes — the full text of “Cloud Attack Surface” is free to read here on the web, and the Cyber Security Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Cyber Security Academy course, upgrade to CoddyKit PRO.
What will I learn in “Cloud Attack Surface”?
IAM, storage and metadata risks. You practise Cyber Security Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Cyber Security Academy?
No prior experience is required. Cyber Security Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Cloud Attack Surface” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Cyber Security Academy lesson?
Yes. Every Cyber Security Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.