Cloud storage ransomware needs no malware: an attacker with a stolen access key or an over-privileged cloud identity can encrypt objects with a key only they hold, delete backups and versions, or simply copy the data out and destroy the original, all through the provider's own APIs. Endpoint controls such as EDR, application control and tamper protection never see these actions, because nothing runs on a host you manage. This guide explains the three cloud ransomware patterns seen in real campaigns on Amazon S3 and Azure Blob Storage, the identity weaknesses that enable them, the storage settings that make them fail, and how to detect and recover. It is for cloud security engineers, incident responders and backup owners. For host-based ransomware defences see the Ransomware Prevention Guide; this page covers what differs in object storage.
Key takeaways
- It is an identity attack first. Every documented cloud storage ransomware case started with a valid credential: leaked long-term AWS access keys in the Codefinger campaign, a synced Global Administrator account without MFA in Storm-0501. Removing long-term keys and standing privilege removes most of the risk.
- Customer-supplied encryption keys are the weapon. S3 SSE-C and Azure customer-provided keys let a caller encrypt data with a key the provider never stores. AWS now disables SSE-C by default on new buckets and advises keeping it disabled unless a workload needs it.
- Versioning without a lock is not protection. An attacker who can encrypt can usually also delete old versions, set lifecycle expiry or remove an unlocked immutability policy. Only compliance-mode Object Lock or a locked Azure immutability policy stops a privileged attacker.
- Put recovery copies out of reach. Backups in the same account, subscription or identity domain are deleted in the same session. Use a separate account or tenant with separate credentials.
- Detect on the control plane and the data plane. Watch for SSE-C or customer-key headers, lifecycle and retention changes, key listing, lock and immutability policy deletion, and bulk copy or delete operations.
How cloud storage ransomware works
Three patterns recur, often combined in one intrusion.
| Pattern | What the attacker does | Permissions needed | ATT&CK v20 |
|---|---|---|---|
| Re-encryption with a customer-supplied key | Rewrites each object (for example S3 CopyObject onto itself) with SSE-C, or writes Azure blobs with the x-ms-encryption-key header, using a key generated locally. The provider discards the key, so the data is unreadable without the attacker | S3: s3:GetObject and s3:PutObject. Azure: blob read and write, or Shared Key | T1486 Data Encrypted for Impact |
| Encryption with a key the attacker controls, then key deletion | Creates a new key vault and customer-managed key, applies it through encryption scopes, then deletes the key | Key Vault creation, storage account write | T1486 |
| Exfiltrate and destroy | Copies data to attacker storage, then deletes objects, versions, snapshots, backups, and in Azure whole storage accounts and recovery vault containers | Read plus delete; often Owner-level for backups | T1530, T1537, T1485, T1490 |
| Scheduled deletion | Adds a lifecycle rule that expires objects or versions within days, creating a deadline | s3:PutLifecycleConfiguration or equivalent | T1485.001 Lifecycle-Triggered Deletion |
None of these exploits a provider vulnerability. AWS's incident response team describes the S3 pattern as attackers using valid customer credentials with an ordinary encryption feature, and Microsoft describes Storm-0501 as cloud-native ransomware that relies on cloud functions rather than malware.
Lessons from incidents
Codefinger: SSE-C on Amazon S3 (2025)
In the Codefinger S3 ransomware campaign, reported by Halcyon in January 2025, the attacker used leaked or stolen long-term AWS access keys that had s3:GetObject and s3:PutObject, re-encrypted objects with SSE-C keys generated locally, and used the lifecycle API to schedule the encrypted objects for deletion within seven days. CloudTrail records only an HMAC of an SSE-C key, which cannot be used to rebuild it. The lessons are specific: the credential was a long-term key, the permissions were ordinary read and write, and nothing in the bucket configuration prevented SSE-C or fast lifecycle expiry.
Storm-0501: Azure storage and backups (2025)
Microsoft's August 2025 report on Storm-0501 describes the Azure version. After pivoting from on-premises Active Directory through Entra Connect Sync, the actor took over a synchronised Global Administrator account that had no MFA method registered, used elevateAccess to gain User Access Administrator over all subscriptions, and assigned itself Owner. It enabled public access on storage accounts, retrieved account keys with listKeys, exfiltrated with AzCopy, then deleted snapshots, VM restore points, storage accounts and Recovery Services protection containers. Where resource locks or immutability policies blocked deletion, it deleted the locks and the immutability policies, which shows those policies had not been locked. For data still protected, it created a key vault and customer-managed key, encrypted blobs through encryption scopes, and deleted the key; Microsoft notes Key Vault soft delete allowed recovery of that key. See the Storm-0501 hybrid cloud attacks page for the identity pivot.
Both cases are consistent with the wider pattern NHI Mgmt Group tracks: the Football Australia AWS keys exposure shows how keys left in public code can open many buckets at once.
Close the identity paths first
- Remove long-term cloud keys: AWS recommends IAM roles, IAM Roles Anywhere and IAM Identity Center so that workloads and people use short-lived STS credentials. Inventory and retire IAM user access keys, starting with any that have S3 write. See the AWS IAM Policies and Roles Guide.
- Disable Azure Shared Key: set
AllowSharedKeyAccessto false so a role withlistKeyscannot turn into unattributed full data access. See the Azure Storage Security Guide. - Separate write from delete and from policy: application roles should rarely need
s3:DeleteObjectVersion,s3:PutLifecycleConfiguration,s3:PutEncryptionConfiguration,s3:PutBucketPolicyors3:BypassGovernanceRetention. In Azure, storage data roles should not come with Owner or Contributor on the account. - Protect the top of the hierarchy: Storm-0501 went from Global Administrator to Owner on every subscription. Phishing-resistant MFA, pre-registered MFA for privileged accounts, cloud-only admin accounts and alerting on
elevateAccessare storage controls in practice. See the Microsoft Entra Connect and Cloud Sync Hardening Guide. - Scan for leaked keys: block AWS access keys, storage connection strings and SAS signatures in code hosts, and rotate on any finding. See the Cloud Secrets Managers Guide.
Storage controls that make the attack fail
Amazon S3
- Block SSE-C: since April 2026, S3 disables SSE-C for new writes on new general purpose buckets and on existing buckets in accounts with no SSE-C objects. Confirm and enforce it: the bucket default encryption setting
BlockedEncryptionTypeswithEncryptionType["SSE-C"]rejects SSE-C writes, copies, multipart uploads and replication with HTTP 403. Changing it needss3:PutEncryptionConfiguration, so restrict that permission. AWS also documents denyings3:PutObjectrequests that carry the SSE-C algorithm header through a bucket policy or an AWS Organizations resource control policy. - Versioning: an overwrite creates a new version and the previous one survives, unless the attacker can also delete versions.
- Object Lock: requires versioning. In governance mode, users with
s3:BypassGovernanceRetentioncan still delete locked versions if they send the bypass header (the console does by default). In compliance mode no user, including the root user, can delete or shorten retention; AWS says the only way to delete such an object early is to delete the account. A default retention on the bucket covers every new version. Locks do not stop new versions or delete markers, so the protected version remains recoverable. - Replication or backup to another account: AWS recommends replicating or backing up critical data to another bucket, account or Region with S3 replication or AWS Backup. See the AWS Backup Security Guide.
- Lifecycle guard rails: alert on lifecycle configuration changes and keep noncurrent version expiry longer than your detection and response time.
Azure Blob Storage
- Locked immutability: a locked time-based retention policy cannot be deleted or shortened by any user, including account administrators. An unlocked policy can be deleted, which is exactly what Storm-0501 did. Lock production policies quickly.
- Soft delete and versioning: enable blob and container soft delete (Microsoft recommends at least seven days) and versioning so overwrites and deletions can be reversed within the window.
- Resource locks: a CanNotDelete lock stops account deletion through the management plane but can be removed by anyone with lock delete rights, so restrict
Microsoft.Authorization/locks/deleteand alert on it. - Key Vault purge protection: with soft delete (default 90 days) and purge protection, a deleted customer-managed key can be recovered, which defeats the encrypt-then-delete-key move. Purge protection cannot be switched off once enabled. See the Azure Key Vault Security Guide.
- Customer-provided keys on requests: Azure Blob accepts an AES-256 key in the
x-ms-encryption-keyheaders and stores only its SHA-256 hash. Microsoft's customer-provided keys documentation does not describe an account-level block equivalent to S3's, so rely on least-privilege data roles, Shared Key disabled, monitoring of these headers in logs, and immutability for critical data. - Vaulted backup: Azure Backup and Azure Blob vaulted backup keep copies outside the storage account. Protect the vault itself. See the Azure Backup and Recovery Services Vault Security Guide.
Choosing the protection level
| Data type | Minimum | Recommended | Trade-off |
|---|---|---|---|
| Backups, logs, records | Versioning plus soft delete | Compliance-mode Object Lock or locked Azure immutability, copy in a separate account or tenant | Retention cannot be shortened; storage cost for the full period |
| Production application data | Versioning, SSE-C blocked, no long-term keys | Cross-account replication or backup with independent credentials; governance-mode lock where writes are frequent | Governance mode is bypassable by privileged identities |
| Temporary or derived data | SSE-C blocked, least privilege | Versioning with short noncurrent expiry | Recovery window is short |
Small organisations get most of the benefit from three changes: no long-term keys, SSE-C blocked, and a locked or compliance-mode copy of backups in a separate account. Large estates should add organisation-level policies (AWS resource control policies, Azure Policy at management group scope) so new buckets and accounts inherit the controls, and a dedicated recovery account or tenant. See the Backup Identity Isolation Guide.
Detection and monitoring
| Signal | AWS source | Azure source |
|---|---|---|
| Customer-supplied key use | CloudTrail S3 data events with x-amz-server-side-encryption-customer-algorithm; GuardDuty S3 Protection | Blob resource logs for writes carrying customer-provided keys; Defender for Storage |
| Retention or protection removed | Lifecycle configuration changes, PutBucketEncryption, PutObjectLockConfiguration, PutBucketVersioning (suspend), bypass-governance deletes | Activity log locks/delete, immutabilityPolicies/delete, soft delete or versioning disabled |
| Key access and creation | New IAM access keys, unusual key use from new IPs | listKeys, new key vaults and keys, encryptionScopes/write, key deletion |
| Privilege escalation | New policies attached to users and roles | elevateAccess, Owner and User Access Administrator assignments |
| Bulk read, copy, delete | CloudWatch DeleteRequests and PutRequests spikes; CloudTrail CopyObject volume | StorageBlobLogs operation counts; Defender for Storage unusual deletion and large extraction alerts |
| Exposure changes | Bucket policy and Block Public Access changes | Public network or anonymous access enabled on an account |
Microsoft's Storm-0501 guidance lists relevant Defender alerts across Resource Manager (AzureHound use, elevate access, backup deletion), Storage (unusual deletion, public access change, large extraction) and Key Vault (suspicious recovery). Route these, and the AWS equivalents, to the SIEM with a high-priority playbook. See the Amazon GuardDuty Guide and the Microsoft Defender for Cloud Guide.
Metrics
- Long-term key count: IAM user access keys and Azure accounts with Shared Key enabled, trending to zero.
- SSE-C posture: percentage of S3 buckets with SSE-C blocked, target 100% outside documented exceptions.
- Locked recovery copies: percentage of tier-1 data with a compliance-mode or locked immutable copy in a separate account or tenant.
- Detection latency: time from a lifecycle, lock or retention change to alert triage.
- Restore proof: date and duration of the last successful restore test from the isolated copy.
Implementation sequence
- Inventory: list buckets and storage accounts by data tier, with versioning, Object Lock or immutability state, SSE-C setting, Shared Key setting and backup location.
- Find current SSE-C and customer-key use: query CloudTrail data events and S3 Inventory, and Azure blob logs, before blocking, so legitimate workloads are not broken.
- Kill long-term credentials: rotate and remove IAM user keys with S3 write; disable Shared Key in Azure in pilot rings.
- Block SSE-C: apply
BlockedEncryptionTypesper bucket, then a resource control policy at organisation level once exceptions are known. - Create the isolated recovery copy: separate AWS account or Azure tenant or subscription with its own administrators; enable compliance-mode Object Lock or locked immutability there first, after testing retention in governance or unlocked mode.
- Enable detections: CloudTrail S3 data events for critical buckets, Azure storage resource logs, GuardDuty S3 Protection, Defender for Storage, Resource Manager and Key Vault.
- Test: run a tabletop and a technical exercise that overwrites and deletes test objects, then restore from the isolated copy and time it.
- Roll back safely: SSE-C blocking can be reversed per bucket by setting
["NONE"]; compliance-mode locks and locked immutability cannot be reversed, so pilot retention values on test data before applying them to production.
Responding to a cloud storage ransomware event
- Contain the identity: deactivate the access key or disable the account, revoke sessions, remove attacker-added role assignments, federated domains, app credentials and keys. Do not change bucket contents until evidence is preserved.
- Freeze deletion: remove attacker lifecycle rules, re-enable versioning, place legal holds on surviving versions, and check soft-deleted items and Key Vault deleted keys before their retention expires.
- Preserve evidence: export CloudTrail, Activity log, storage and Key Vault logs to a separate account.
- Assess exfiltration: assume data was copied before destruction, as in Storm-0501, and scope notification obligations.
- Restore from the isolated copy: verify integrity before restoring. See the Ransomware Response and Recovery Guide and the Cloud Storage Exposure Playbook.
Framework mapping
| Control | NIST SP 800-53 Rev. 5 | NIST CSF 2.0 | ATT&CK v20 addressed |
|---|---|---|---|
| Short-lived credentials, least privilege | AC-6, IA-5 | PR.AA-05 | T1078.004 Cloud Accounts |
| Block customer-supplied keys, protect key vaults | SC-12 | PR.DS-01 | T1486 |
| Versioning, immutability, isolated backups | CP-9 | PR.DS-11 | T1485, T1485.001, T1490 |
| Storage and control-plane monitoring | SI-4 | DE.CM-09 | T1530, T1537, T1619 |
| Containment and recovery | IR-4, CP-10 | RS.MI-01, RC.RP-01 |
Common failure patterns
- Endpoint-only ransomware plans: playbooks that assume encryption happens on hosts, with no runbook for API-driven encryption or deletion.
- Same-account backups: snapshots, versions and backup vaults reachable by the same Owner or administrator credentials as production.
- Governance mode and unlocked policies treated as WORM: both can be bypassed or removed by a sufficiently privileged identity.
- Long-term keys with write access: CI tokens, developer keys and partner integrations with
s3:PutObjecton production buckets, the precondition for Codefinger. - No data events: CloudTrail management events only, so SSE-C use and bulk copy operations are invisible.
- Key vaults without purge protection: letting an attacker turn customer-managed key encryption into permanent loss.
Practitioner checklist
- Retire IAM user access keys with S3 write and disable Azure Shared Key on production accounts.
- Confirm SSE-C is blocked on every bucket that does not need it and enforce it with an organisation policy.
- Enable versioning everywhere and compliance-mode Object Lock or locked immutability on backup and records data.
- Keep a recovery copy in a separate account or tenant with separate administrators.
- Enable purge protection on key vaults that hold storage customer-managed keys.
- Restrict lifecycle, encryption configuration, lock and immutability policy permissions to a small admin group.
- Turn on CloudTrail S3 data events and Azure storage resource logs for critical data.
- Alert on SSE-C use, lifecycle and retention changes,
listKeys,elevateAccessand lock deletion. - Add an API-driven storage ransomware scenario to the incident response plan and test a restore.
Standards and references
- AWS: Using server-side encryption with customer-provided keys (SSE-C)
- AWS: Blocking or unblocking SSE-C for a general purpose bucket
- AWS: Locking objects with Object Lock
- AWS Security Blog: Preventing unintended encryption of Amazon S3 objects
- Microsoft Threat Intelligence: Storm-0501's evolving techniques lead to cloud-based ransomware
- Microsoft Learn: Store business-critical blob data with immutable storage
- MITRE ATT&CK: Data Encrypted for Impact
- MITRE ATT&CK: Lifecycle-Triggered Deletion
Related NHI Mgmt Group resources: Ransomware Prevention Guide · Cloud Native Backup and Ransomware Resilience Guide · Amazon S3 Security Guide · Backup Security and Immutable Backup Guide