Public Cloud Snapshots and Disk Images: An Overlooked Exposure

Public Cloud Snapshots and Disk Images: An Overlooked Exposure

Cloud security reviews usually start with storage buckets and end with IAM policies, while public cloud snapshots and disk images sit unnoticed between the two, often shared far more widely than anyone intended. If your team runs workloads on AWS, Azure or Google Cloud, one publicly restorable EBS snapshot or shared machine image can give an outsider a full copy of a server, including its files, databases and keys. This article explains how these exposures happen, how to find them in your own accounts, what to do when you find one, and when the standard advice doesn’t apply.

Why a Snapshot Is Worse Than a Leaked File

A leaked spreadsheet exposes one dataset. A leaked disk image exposes everything the machine ever touched. Restore a snapshot of a typical Linux application server and you get /etc/shadow, SSH host keys, a .bash_history full of pasted passwords, .env files, cached credentials in ~/.aws/credentials and often a local database directory.

Windows images are frequently worse. The SAM and SYSTEM registry hives, hiberfil.sys and pagefile.sys can all hold credential material. A snapshot of a domain controller includes NTDS.dit, which effectively contains the password hashes for the whole Active Directory domain.

Snapshots are also block-level copies. A file deleted before the snapshot was taken can often still be recovered from unallocated blocks. Engineers who “clean up” an image before sharing it rarely think about this.

How Public Cloud Snapshots Become Exposed

On AWS, an EBS snapshot becomes public when its createVolumePermission attribute includes the group “all”. An AMI becomes public the same way through its launch permission. Either change is one console checkbox or one CLI flag. Azure works differently: granting export access to a managed disk generates a SAS URL, and anyone holding that URL can download the VHD until the URL expires. In Google Cloud, binding allAuthenticatedUsers to an image gives access to anyone with a Google account.

The trigger is usually mundane. A common pattern: a contractor migrating a legacy ERP server needs to move a snapshot into a partner’s AWS account. Cross-account sharing fails because of a mistyped 12-digit account ID, so the snapshot is set to public “just for the transfer”. The migration finishes and the ticket closes. The snapshot stays public for 11 days until Security Hub control EC2.1 flags it in someone’s weekly review. By then, the only safe assumption is that someone copied it.

Machine images follow a similar path. A team publishes a “golden image” for a sister company or vendor and forgets that the build process baked in an API key or a database seed file. Container registries have the same problem, covered in more depth in Docker images and leaked secrets.

Myth: Nobody Can Find a Snapshot Without Its ID

This is the most common misconception, and it’s wrong. Public EBS snapshots can be listed by anyone. Any AWS account holder can run describe-snapshots with –restorable-by-user-ids all and get every public snapshot in a region, along with descriptions like “prod-db-backup-final”. Public AMIs can be listed the same way.

Researchers have shown this repeatedly. A DEF CON 27 talk in 2019 walked through pulling secrets out of publicly shared EBS volumes at scale. Copying a public snapshot into another account takes one API call, and open-source tools such as Rhino Security Labs’ dsnap then download it for offline analysis. Hiding the snapshot ID protects nothing. An attacker only needs a free-tier account and a few minutes.

Auditing Your Accounts for Exposed Disk Images

An experienced cloud security engineer starts with an inventory, not with policy. The steps below are written for AWS, and Azure and GCP have close equivalents:

1. Check every region. Snapshots and AMIs are regional. Run describe-snapshots –owner-ids self –restorable-by-user-ids all and describe-images –owners self –filters Name=is-public,Values=true in every enabled region, including the ones nobody thinks they use.
2. Review targeted shares. describe-snapshot-attribute –attribute createVolumePermission shows snapshots shared with specific external account IDs. Confirm that each ID belongs to a party you still have a contract with.
3. Enable block public access. AWS added account-level block public access settings for EBS snapshots and for AMIs in 2023. Turn both on in every region, ideally through AWS Organizations so new accounts get the setting automatically.
4. Add continuous detection. The AWS Config managed rule ebs-snapshot-public-restorable-check, Security Hub or Prowler will catch regressions. On Azure, set managed disk networkAccessPolicy to DenyAll or AllowPrivate. On GCP, alert on allUsers or allAuthenticatedUsers bindings on compute images.
5. Encrypt by default. AWS does not allow snapshots encrypted with the AWS-managed aws/ebs key to be shared publicly at all, which rules out this whole class of mistake for most workloads.

Include RDS in the review. Unencrypted manual RDS snapshots can also be made public, and they hold the database itself rather than just the server around it.

Responding When a Public Snapshot Turns Up

Removing the public flag takes seconds. The real work comes after. A seasoned incident lead treats the whole exposure window as a breach window. CloudTrail will not reliably show whether someone in another account copied the snapshot, so a lack of evidence proves nothing.

Next, mount the snapshot in an isolated forensic account and scan the file system with TruffleHog or Gitleaks. Rotate everything they find, not just the obvious items: cloud access keys, database passwords, SSH keys, TLS private keys and service account tokens. Credential hygiene after a leak alert covers what to rotate first and how fast. If personal data was on the disk, the GDPR 72-hour notification clock starts when you become aware of the breach, not when the investigation ends.

Data taken from disk images tends to show up later in other places: AWS keys in credential markets, database dumps on forums, internal hostnames in targeted phishing. Monitoring those external sources over time is how you learn whether a possible exposure turned into a real one.

Common Mistakes That Keep Exposures Alive

Auditing only the main regions. Teams review us-east-1 and eu-west-1, while a test snapshot from two years ago sits public in ap-southeast-2. Attackers check every region, so audits must too.

Deregistering the AMI but keeping the snapshot. Deregistering an AMI does not delete its backing EBS snapshot. If that snapshot was shared separately, the exposure survives the cleanup and nobody notices.

Treating storage and compute as separate problems. Security programs often lock down buckets with a dedicated checklist, like the one for securing S3 buckets, but never look at EC2 or RDS snapshots with the same care. A snapshot is storage too. It just lives in a different console menu.

When the Standard Advice Doesn’t Fit

AWS Marketplace sellers and open-source projects publish public AMIs on purpose, and blanket block public access would break their release pipeline. The safer pattern is a separate publishing account. Every image built there is mounted and scanned for secrets in CI before it is made public.

Regulated industries face a different conflict. A financial firm that must keep backups for 5-7 years can’t simply delete old snapshots. There the controls are encryption with customer-managed KMS keys, tight key policies and regular reviews of who can use those keys.

Teams of fewer than 10 people with a single AWS account have the easiest job. Enabling block public access in every region takes about 15 minutes and covers most of the risk. On-premises and air-gapped environments are not immune either: VMware VMDK or OVA exports copied to a shared file server carry exactly the same contents.

FAQ

Can an encrypted EBS snapshot be made public?
No. AWS does not allow encrypted snapshots to be shared publicly. A snapshot encrypted with a customer-managed key can be shared with specific accounts if the key policy allows it, so KMS key policies need the same review as snapshot permissions.

Does deleting a public snapshot end the risk?
It stops new access but does nothing about copies already made in other accounts. Treat the exposure window as an incident and rotate every credential that was on the disk.

How often should snapshot permissions be audited?
Run detection continuously with AWS Config or Security Hub. Add a manual review across all regions every quarter and after every migration project, because migrations are when temporary public sharing usually happens.

Summary

Public snapshots and machine images contain whole servers, not single files, and anyone with a cloud account can find and copy them. Enable block public access in every region, encrypt by default and alert on any public or unknown cross-account share. If you find an exposed image, assume it was copied, scan it for secrets, rotate everything you find and keep monitoring for that data to appear outside your environment.