The recent discovery of a cryptomining campaign targeting Amazon compute resources highlights a critical gap in traditional cloud defense. Attackers are bypassing perimeter defenses by leveraging compromised credentials to execute legitimate but privileged API calls like ec2:CreateLaunchTemplate, ecs:RegisterTaskDefinition, ec2:ModifyInstanceAttribute, and lambda:CreateFunctionUrlConfig.
While detection tools identify anomalies after they occur, they do not prevent execution, lateral movement, or persistence by the bad actor. The Sonrai Cloud Permissions Firewall neutralizes this kill chain by protecting the privileged permissions that enable the attack, but are rarely needed by most cloud identities. Research shows that 92% of identities granted these privileged permissions never use them. By enforcing a “Global Default Deny” on these privileges and allowing only the 8% of identities that actually require them, the Firewall proactively blocks the API calls required to complete these attacks.
Detection can only observe cryptomining after it starts; the Cloud Permissions Firewall prevents it by design by denying the exact permissions attackers must use to launch and sustain mining infrastructure.
The cryptomining campaign leverages compromised identity credentials to execute privileged API calls. The Sonrai Cloud Permissions Firewall disrupts this sequence by protecting privileged permissions, causing the attack to fail. The Firewall also sends instant notifications of the attempts to use privileged permissions to the teams responsible for running workloads – the teams that are most likely to recognize the behavior as unexpected.
Specific details from this week’s attack: The adversary uses compromised credentials to spin up compute resources using templates created via ecs:RegisterTaskDefinition and ec2:CreateLaunchProfile. This is where financial damage begins. The attacker can scale up cryptominers within ECS clusters or as part of EC2 AutoScaling groups.
To maintain access and expand their footprint, attackers used iam:CreateUser, iam:CreateAccessKey, or iam:AttachUserPolicy to generate new backdoor accounts.
Additionally, to maintain external access to the cloud environment, attackers used unauthenticated and publicly invocable Lambda Functions. The functions were created using lambda:CreateFunction, and their publicly accessible invocation URL was created using lambda:CreateFunctionUrlConfig.
Lastly, to persist the EC2 compute resources amid attempts to remove them, attackers used ec2:ModifyInstanceAttribute to complicate terminating the malicious computes by toggling the “disableApiTermination” setting.
In independent penetration testing, the Cloud Permissions Firewall achieved a 100% prevention rate against highly vulnerable AWS accounts. The testing was commissioned by Sonrai Security and conducted by Software Secured using industry-standard attack simulations such as CloudGoat and IAM Vulnerable.
| Test Scenario | Critical Privileged Permission | Result (Unprotected) | Result (Firewall Protected) |
| Lateral Movement | ssm:StartSession | Success (Pivot Completed) | BLOCKED (Permission Stripped) |
| Privilege Escalation | iam:CreatePolicyVersion | Success (Admin Access Gained) | BLOCKED (Permission Stripped) |
| Persistance | iam:CreateAccessKey | Success (Credentials Created) | BLOCKED (Permission Stripped) |
Bottom Line: The Cloud Permissions Firewall blocked 16 out of 16 tested attack paths, specifically by denying the privileged API calls required to execute the kill chain.
A common concern with locking down privileged permissions is the impact on developer velocity. The Sonrai Cloud Permissions Firewall addresses this through Permissions-on-Demand.
While restricting Privileged Permissions is the primary mechanism for stopping attacks, the Cloud Permissions Firewall also utilizes Region Lockdown and Unused Service protection as a critical safety net.
If an attacker attempts to launch resources in an obscure region (e.g., ap-northeast-3) or access a service the identity has never used before, the Firewall blocks the action immediately. Crucially, this block acts as a high-fidelity early warning alarm. Because legitimate users rarely veer into unused regions or services, a block event here is a strong indicator of a misbehaving identity or a compromised credential, allowing security teams to investigate before the attacker can find a valid path to execution.
This recent campaign serves as a reminder that identity is the new perimeter. While detection is necessary, it is no longer sufficient against automated resource theft. By deploying a Cloud Permissions Firewall to actively manage privileged permissions, organizations move from a reactive posture—cleaning up after a breach—to a preventative one, stopping the cryptomining kill chain at the very first API call.
*** This is a Security Bloggers Network syndicated blog from Sonrai | Enterprise Cloud Security Platform authored by Nigel Sood. Read the original post at: https://sonraisecurity.com/blog/preventing-this-weeks-aws-cryptomining-attacks-why-detection-fails-and-permissions-matter/