Skip to content
Tutorials Center
My learning

Topics

Lesson 7 of 38 ยท Shared Responsibility and Threats

Misconfiguration and Exposed Storage

Why cloud misconfiguration is the top cause of breaches, how public buckets and open ports happen, and how to detect and prevent them with a runnable policy checker.

Ask a cloud incident responder what they see most and the answer is rarely "a clever zero-day". It is a storage bucket that anyone on the internet could list, a database with no password, or a firewall rule that allowed the whole world to reach an admin port. These are misconfigurations: settings that work perfectly well but are unsafe. In this lesson you learn why they happen, which ones matter most, and how to catch them automatically.

Why misconfiguration is so common

  • Speed. Teams create resources quickly, often by copying an example that was meant for a demo.
  • Complexity. A single service can have dozens of settings across several layers (account-level, resource-level, policy, network).
  • Unsafe convenience. "Make it public so the front end can read it" is the fastest fix when something does not work.
  • Drift. A setting that was correct at launch is changed later by hand, and nobody notices.
  • Unclear ownership. Resources without an owner are never reviewed.

The usual suspects

  1. Public object storage. A bucket or container whose contents can be listed or read by anyone, sometimes with write access too.
  2. Open network ports. Rules allowing 0.0.0.0/0 (the entire internet) to reach remote administration (SSH 22, RDP 3389), databases (3306, 5432, 1433, 27017) or cache servers.
  3. Databases and search clusters without authentication that are reachable from outside.
  4. Overly broad permissions. Policies with "Action": "*" and "Resource": "*".
  5. Disabled or missing logging, so a breach cannot be investigated.
  6. Unencrypted data stores and snapshots, and snapshots shared publicly by mistake.
  7. Default credentials and sample apps left in place.
  8. Debug and metadata endpoints reachable from places they should not be.
flowchart TB
    Dev["Developer wants it to work"] --> Quick["Opens access widely"]
    Quick --> Scan["Internet scanners find it"]
    Scan --> Loss["Data exposed or resource abused"]
    Quick -.->|"guardrails and checks"| Safe["Blocked or flagged before harm"]

Guardrails turn the quick shortcut into a flagged mistake instead of an incident.

How exposure is judged

A storage resource is exposed when an anonymous or very wide audience can read (or write) it. The decision usually combines several layers:

  • An account-level setting that blocks public access for all buckets, if the provider offers one.
  • A resource policy that names who may access the bucket.
  • Access control lists or sharing links on individual objects.
  • Network paths: whether the service is reachable from the internet or only from your private network.

The safest default is to turn on the account-wide public access block and allow exceptions only deliberately, for example a bucket dedicated to public website files, tagged and reviewed.

Runnable example: a bucket policy checker

The program below reads simplified bucket policies (a JSON-like structure) and reports which ones allow public access. The format is a teaching model inspired by how many providers write policies, not any provider's exact syntax.

Python Flag publicly readable buckets

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

You should see a high-severity finding for customer-exports (anyone can list) and uploads (anyone can write), and only an informational note for the intentional public website bucket. Severity depends on context: the same setting can be fine or serious.

Network exposure checks

Open ports are checked the same way. The Python ipaddress module can tell whether a rule's source range covers the whole internet.

Python Find rules open to the whole internet

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Prevention: make the safe way the easy way

  1. Secure defaults and account guardrails. Block public storage at the account level; deny creation of internet-wide rules for admin ports using organization-level policies.
  2. Infrastructure as code with review. Define resources in code so changes are reviewed, then scan the code before deployment (DevSecOps covers this).
  3. Continuous posture scanning. Tools that compare live configuration to a baseline and alert on drift. This is often called Cloud Security Posture Management (CSPM).
  4. Ownership tags and expiry. Every resource has an owner; untagged ones are flagged.
  5. Auto-remediation for the worst cases, such as closing a public bucket automatically and notifying the owner.
  6. Education. Developers who know why a rule is risky stop making the mistake.

Fix the cause, not just the instance. If three teams opened the same port, the problem is a missing guardrail or a confusing template, not three careless people.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. Which rule is the most dangerous?

    Remote administration open to the whole internet invites constant brute-force and exploit attempts.
  2. 2. What does an account-wide public access block do?

    It is a guardrail that overrides risky resource-level settings.
  3. 3. Why is the same public read setting sometimes acceptable?

    Risk depends on what the data is and whether the exposure is intentional and approved.
  4. 4. What is configuration drift?

    Drift means the live state no longer matches the intended, reviewed configuration.
  5. 5. Which approach best prevents repeated misconfiguration?

    Automated guardrails and checks catch mistakes before or soon after they happen.

Summary

  • Misconfiguration (public storage, open ports, broad permissions, missing logs) causes most cloud breaches.
  • Exposure depends on several layers: account settings, resource policies, ACLs and network paths.
  • Simple programs can audit policies and network rules; real tools do this continuously (CSPM).
  • Prevent with guardrails, code review, ownership tags and auto-remediation, and fix the root cause.

Next: Threat Modeling for Cloud Workloads