Intermediate · Cloud security basics · topic 30 of 43 · 35 min
Common cloud misconfigurations
Explanation
Why misconfigurations dominate
Cloud makes it easy to create things in seconds, often by people who are not security experts. One wrong click can make data public to the world. Attackers run automated scans of the whole internet that find open storage and open ports within hours.
The usual suspects
| Misconfiguration | Why it is dangerous | Fix |
|---|---|---|
| Public storage bucket or blob container | Anyone with the URL, or a scanner, can list and download files | Block public access at account level; share files with short-lived signed links |
| Security group / network rule allowing 0.0.0.0/0 on SSH, RDP or databases | Brute force and exploits from the whole internet | Allow only specific IPs, use a VPN, bastion or the provider's session manager |
| Unencrypted disks, databases or snapshots | A copied snapshot leaks everything | Turn on encryption at rest (usually one setting, often default now) |
| Public snapshots or machine images | Others can copy your disks | Keep them private; audit sharing |
| Logging disabled | No evidence after an incident | Turn on audit logs in every account and region |
| Secrets in VM user data, environment files or code | Anyone with read access gets the keys | Use a secrets manager |
| Old instance metadata settings | An SSRF bug in an app can steal the server's cloud credentials | On AWS, require IMDSv2 (session-based metadata) |
| Default passwords on managed services or dashboards | Easy takeover | Change on creation; use SSO |
Public buckets in detail
Object storage (AWS S3 buckets, Azure Blob containers, Google Cloud Storage buckets) holds files. It can be made public through access settings or policies. Since April 2023, AWS turns on S3 Block Public Access and disables ACLs by default for new buckets, which helps, but older buckets and deliberate changes still cause leaks.
$ aws s3api get-public-access-block --bucket invoices-bucket
{
"PublicAccessBlockConfiguration": {
"BlockPublicAcls": true,
"IgnorePublicAcls": true,
"BlockPublicPolicy": true,
"RestrictPublicBuckets": true
}
}Infrastructure as code and scanning
Many teams define cloud resources in code (Terraform, CloudFormation, Bicep). That lets security checks run before anything is created. CSPM (cloud security posture management) tools, built into providers (like AWS Security Hub, Microsoft Defender for Cloud and Google Security Command Center) or from vendors, scan live accounts and list misconfigurations against benchmarks such as the CIS Benchmarks.
buckets = [
{"name": "invoices", "public": False, "encrypted": True},
{"name": "test-upload", "public": True, "encrypted": False},
]
for b in buckets:
problems = []
if b["public"]:
problems.append("PUBLIC")
if not b["encrypted"]:
problems.append("NOT ENCRYPTED")
print(b["name"], problems or "ok")Detection
- Alert when a bucket policy or ACL changes to public.
- Alert when a network rule opens a sensitive port to 0.0.0.0/0.
- Alert when logging is stopped or deleted.
- Watch for large downloads from storage by unusual identities or IPs.
Common mistakes
- "Temporary" public access for testing that is never removed.
- Fixing a finding by hand but not in the infrastructure code, so the next deployment brings it back.
- Scanning only the main region; attackers use the regions nobody watches.
Need help?
Stuck on a word or an idea? Search this course, or every course, and jump straight to the explanation or a worked question.
Try:
Watch the lesson
Common cloud misconfigurations · 1/7
Most cloud breaches come from settings, not clever hacking.
Prefer a video by a teacher? Find free videos on “common cloud security misconfigurations public S3 bucket security groups” on YouTube ↗
In real life: KYC documents in an open bucket
A lending app stored customers' Aadhaar and PAN card scans in a storage bucket. A developer made the bucket public to test an image viewer and forgot to undo it. A security researcher found it with a simple search and reported it responsibly. The company blocked public access at account level, moved to short-lived signed links for viewing documents, turned on alerts for any public bucket, and, as personal data was exposed, followed its breach reporting duties.
Practice (0/3 done)
Which setting most directly prevents an S3 bucket from being made public by mistake?
Write findings(buckets) where each bucket is a dict with "name", "public" (bool), "encrypted" (bool) and "logging" (bool). Return a list of strings "NAME: PROBLEM" for every problem, in bucket order, with problems checked in this order: "public", "not encrypted", "no logging".
Create a free-tier account on one cloud provider (use MFA and a billing alert). Create a private storage bucket, confirm public access is blocked, try to open a file by its public URL (it should fail), then delete the bucket. Write down each setting you checked.
Quick quiz
Read more (free)
Related help
Before this, learn
This topic builds on these. If something here feels new, open them first.
Related topics
- Logging and monitoring in the cloudCloud security basics · same module
- The shared responsibility modelCloud Computing (AWS, Azure, Google Cloud) · What cloud computing is
- Securing and sharing S3 dataCloud Computing (AWS, Azure, Google Cloud) · Compute and storage: EC2 and S3
- Logging, threat detection and incident responseCloud Computing (AWS, Azure, Google Cloud) · Cloud security and compliance
- The command line on all three cloudsCloud Computing (AWS, Azure, Google Cloud) · Google Cloud and comparing the clouds
- Terraform for the cloudCloud Computing (AWS, Azure, Google Cloud) · Infrastructure as code
Questions people ask about this
Open a question to see the answer and why. The first ones are this topic's own quiz, so try the quiz above before you peek.
What does CSPM stand for?
Answer: Cloud security posture management
CSPM tools scan cloud accounts for risky settings.
Why require IMDSv2 on AWS servers?
Answer: It makes it much harder for an SSRF bug to steal the server's credentials
IMDSv2 needs a session token, which typical SSRF requests cannot get.
A finding is fixed by hand in the console but returns after the next deployment. Why?
Answer: The infrastructure code still has the bad setting
Fix the source (infrastructure as code), not just the live resource.
Which is the best way to let a customer download one private document?
Answer: A short-lived signed URL
Signed URLs give temporary access to one object only.
Why should you scan all regions, not just the main one?
Answer: Attackers and forgotten resources can be in regions nobody watches
Unused regions are a classic blind spot.
A company's storage bucket of invoices was left public and was downloaded by strangers. Whose responsibility was that setting?Related
Answer: The customer's
Bucket access settings are configuration, which is security IN the cloud.
Which bucket policy statement makes data public?Related
Answer: Allow, Principal "*", s3:GetObject, no Condition
Allow to Principal "*" without a limiting condition grants access to anyone on the internet.
In every cloud model, who is responsible for the customer's data and user access?Related
Answer: The customer
Data and identities are always on the customer side.
Which service finds credit card numbers stored in S3 buckets?Related
Answer: Amazon Macie
Macie discovers and reports sensitive data in S3.
Pass the quiz (60% or more) or mark this topic as done when you are ready.
Your progress is saved on this device only.
Next steps
- 1 more topic in “Cloud security basics” before its exam: Logging and monitoring in the cloud.
- Module 7 exam: Cloud security basics · 12 questions · 20 min, without help. 4 topics of this module still to finish first.
- Then the next module, Governance, risk and compliance. 43 topics left in the course before the final exam.