Join our Newsletter — 33% off our NHI Course

Cloud Malware

Cloud malware is malicious code that runs on or targets cloud-hosted resources such as virtual machines, containers, storage, and managed services. It can hide in files, persist on stopped instances, and spread through exposed credentials or lateral movement paths. In cloud environments, the threat is both runtime compromise and the risk relationships surrounding the workload.

How cloud malware behaves

Cloud malware is not limited to classic file-infection patterns. In cloud environments it can execute inside virtual machines, containers, managed services, or automation paths, which means the malicious payload may be ephemeral, containerized, or embedded in orchestration rather than sitting on a user endpoint.

That changes how defenders think about detection. A process that only lives for minutes, a container that is rebuilt repeatedly, or a workload that launches through infrastructure automation may still be malware if it is using cloud runtime resources to persist, execute, or reach sensitive data.

Cloud malware often blends with normal cloud activity, so the boundary between application behaviour, platform behaviour, and attacker activity can be hard to see. When an actor compromises cloud credentials, the malicious code may not need a traditional exploit chain; it can simply use valid cloud access to place, run, or move malware through the environment.

Where cloud malware enters and spreads

The main entry paths are exposed credentials, malicious packages, compromised build and deployment systems, and weakly controlled lateral paths between cloud resources. A cloud-hosted workload that can talk to storage, metadata services, CI/CD systems, or management APIs gives malware more ways to expand its reach.

This is why cloud malware often overlaps with supply-chain abuse and secret exposure. The malware may start in a single workload, but once it reaches a token, API key, or session credential, it can pivot into other services that trust that access. The Shai Hulud npm malware campaign and CircleCI Breach both show how malicious code and token theft can turn cloud-adjacent systems into an access bridge.

Persistence can also come from the cloud control plane itself. If the malware survives instance shutdown through attached storage, image tampering, or reused deployment artifacts, removing one infected host may not remove the threat path.

Security implications for cloud environments

Cloud malware is especially dangerous because the compromise can affect both the runtime workload and the surrounding trust relationships. Once code is executing in the cloud, the attacker may inherit access to data stores, queues, secrets managers, admin APIs, and service integrations that were never intended to be exposed to arbitrary code.

That is why overprivileged cloud permissions and exposed secrets are so often part of the impact chain. NHIMG’s Ultimate Guide to Non-Human Identities notes that 97% of NHIs carry excessive privileges, which helps explain how malware can escalate quickly once it reaches a usable credential or service identity.

Control failures around cloud malware therefore usually show up as weak segmentation, weak secret handling, poor runtime visibility, and poor revocation discipline. The malware is the payload, but the real security failure is often the trust structure that lets it move, persist, or exfiltrate.

What cloud malware means for detection and response

Defending against cloud malware requires cloud-native visibility, not just endpoint-style scanning. Practitioners need to correlate process activity, container lifecycle events, API calls, storage access, and authentication events so they can tell benign automation from malicious execution.

Response is also different in cloud settings because the affected object may be a container image, a snapshot, a deployment pipeline, or a credential chain rather than a single machine. The fastest containment path is often revoking access, quarantining the image or artifact, and checking whether the malware has already touched adjacent resources.

For practical control mapping, cloud malware aligns strongly with CIS Controls v8 for malware defence and account management, with the CSA Cloud Controls Matrix for cloud-specific governance, and with OWASP API Security Top 10 where API abuse is part of the spread path.

Risk and Threat Considerations

Cloud malware is risky because cloud resources are highly connected and often richly trusted. If an attacker lands code in one workload, the malware can exploit broad service permissions, shared secrets, or overly permissive network paths to move laterally and reach data or control-plane functions.

Failure mechanism: The compromise persists or expands when the infected workload can reach stored secrets, management APIs, CI/CD systems, or other cloud services that trust the same credentials or identity chain.

Impact: The result can be data theft, destructive actions, service disruption, secret exposure, or reuse of the compromised cloud trust path for further intrusion.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Agentic AI Top 10 and OWASP Non-Human Identity Top 10 address the attack and risk surface, while CIS Controls v8 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
CIS Controls v8 Control 10 — Malware Defenses Cloud malware is a malware-defense problem in cloud workloads and artifacts.
Control 6 — Access Control Management Cloud malware often spreads through exposed credentials and excessive cloud access.
Control 8 — Audit Log Management Cloud malware detection depends on correlating workload, API, and authentication activity.
Recommendation — Apply Control 10 to detect, block, and contain malicious code in cloud workloads and images. Use Control 6 to reduce lateral spread by tightening cloud access and revoking unnecessary permissions. Use Control 8 to centralize logs that reveal suspicious cloud execution and trust-path abuse.
OWASP Agentic AI Top 10 A2 — Identity and Privilege Abuse Cloud malware commonly abuses valid access paths, credentials, and delegated authority.
Recommendation — Audit tool and workload privilege paths to prevent malware from turning valid access into lateral movement.
OWASP Non-Human Identity Top 10 NHI-01 — Secret Sprawl Cloud malware often spreads by discovering secrets stored in code, pipelines, or cloud services.
NHI-03 — Excessive Privilege Overprivileged non-human access magnifies the damage cloud malware can do after compromise.
Recommendation — Eliminate secret sprawl so malware cannot harvest credentials from cloud-connected systems. Reduce excessive privileges so a compromised workload cannot move far or access sensitive cloud assets.

Practitioner Guidance

Why practitioners should care: Cloud malware is rarely just a single infected instance. The operational problem is the combination of execution, persistence, and access propagation across cloud services, so containment decisions should focus on credentials, artifacts, and trust paths as much as on the host itself.

What to watch for: Unexpected outbound calls from workloads, unusual use of cloud APIs, new or modified images, abnormal secret access, and activity that appears valid but does not match the workload’s normal purpose are all strong warning signals.

Practitioner takeaway: Treat cloud malware as a cloud trust incident, not only a malware incident, because the fastest path to containment is usually to break the access chain the payload depends on.