Join our Newsletter — 33% off our NHI Course
Home› Guides› Cryptojacking Incident Response Playbook: Contain Miners, Cap Costs…
Template Incident Response & Forensics

Cryptojacking Incident Response Playbook: Contain Miners, Cap Costs and Find Root Cause

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 27 October 2026 10 min read
On this page

A cryptominer on a server or in a container is rarely the whole incident: it is the loudest sign that someone already has a way in. Mining raises bills and degrades service, but the access path that let it run (an exposed service, a stolen key, a writable image, a container that can escape) can be reused for data theft or ransomware. This template gives [Organisation] a ready-to-adopt response for cryptomining on hosts, virtual machines, containers and Kubernetes clusters, with cost containment and root cause on credentials built in. It is for incident responders, platform and cloud engineers. For the threat itself see the Cryptojacking Guide; where mining was launched through a stolen cloud access key creating new instances, run the Cloud Access Key Leak Playbook alongside this one.

How to use this template

  • Replace the placeholders: values in square brackets, such as [Organisation], [SOC on-call] and [4 hours], are for you to set.
  • Follow the structure of NIST SP 800-61 Rev. 3: the sections map to detection, response and recovery activities in the CSF 2.0 incident response profile.
  • Preserve before you kill: the first instinct is to terminate the miner. Section 4 explains how to stop the cost and the traffic while keeping the evidence that shows how it arrived.
  • Scope: mining on existing hosts and workloads. Mining on newly created cloud resources is primarily an access key incident; use both playbooks.

1. Scope and triggers

1.1 This playbook applies to unauthorised use of [Organisation]'s compute for cryptocurrency mining (MITRE ATT&CK T1496.001 Compute Hijacking) on Linux and Windows servers, cloud virtual machines, container hosts, Kubernetes clusters, CI runners and managed notebook or ML platforms.

1.2 Triggers include:

TriggerExample sourceInitial severity
Cloud threat detection finding for miningAWS GuardDuty CryptoCurrency:EC2/BitcoinTool.B, CryptoCurrency:EC2/BitcoinTool.B!DNS, Impact:EC2/BitcoinDomainRequest.Reputation; Google Security Command Center Execution: Cryptomining Hash Match, Execution: Cryptomining YARA Rule, Malware: Bad DomainHigh
EDR or runtime security alert for a known miner or mining behaviourEndpoint or container runtime sensorHigh
DNS or network connection to known mining pools, or Stratum protocol trafficDNS logs, proxy, NDRHigh
Sustained unexplained CPU or GPU saturationMonitoring, Kubernetes metricsMedium until confirmed
Billing or quota anomaly on existing resourcesCloud cost alertsMedium until confirmed
Precursor finding on the same identity or projectGoogle SCC Account_Has_Leaked_Credentials, Initial Access: Dormant Service Account ActionRaise to High if mining follows

1.3 Raise severity to Critical if the affected host or cluster holds production data, privileged credentials, or if there is evidence of container escape (T1611) or access beyond the mining workload.

2. Roles and contacts

RoleResponsibilityContact
Incident leadOwns severity, decisions and timeline[SOC on-call]
Platform or cluster ownerIsolation, node cordoning, workload rebuild[Team, on-call number]
Cloud securityCloud logs, IAM review, key revocation[Name]
ForensicsMemory and disk capture, analysis[Internal or retainer contact]
Finance or FinOpsCost impact, provider billing dispute[Name]
Application ownerService impact and recovery testing[Name]
Cloud provider supportAbuse reports, billing adjustment requests[Support plan and case route]

Use team mailing lists, not individuals, for cloud provider security contacts and monitor them around the clock; Google lists this as a requirement of its cryptomining protection programme.

3. Detection and triage

  1. Confirm it is unauthorised. Check with the owner that the workload is not sanctioned (some research, blockchain or test workloads mine legitimately). If it is legitimate, record it and add a scoped suppression, for example a GuardDuty suppression rule on finding type and instance ID.
  2. Identify the unit: host, instance ID, container image and digest, pod, namespace, node, service account, and the cloud identity attached to the instance or pod.
  3. Establish how it started. Typical entry points: an exploited internet-facing service (T1190), weak or exposed SSH and remote services, an unauthenticated container or Kubernetes API or dashboard, a malicious or poisoned image (T1525), stolen credentials (T1078), or a CI job.
  4. Look for persistence: cron entries (T1053.003), new systemd services (T1543.002), added SSH authorized keys (T1098.004), modified ld.so.preload or other hiding (T1574.006, T1014), privileged DaemonSets or new deployments (T1610), and use of kubectl exec (T1609).
  5. Check credential exposure. Did the workload or host have access to the instance metadata service (T1552.005), mounted service account tokens, environment variables or files with secrets (T1552.001)? List every credential reachable from the compromised context.
  6. Set severity using 1.3 and open the incident record.

4. Containment

Contain in this order so that cost and spread stop before evidence is lost.

  1. Cut the network, not the power. For a cloud VM, attach an isolation security group that allows only your forensics IPs and remove all others; AWS notes that existing tracked connections survive a security group change, so add network ACL denies for the pool and command and control addresses. For on-premises hosts, isolate through EDR or switch port.
  2. Capture volatile evidence: memory, process list with command lines, network connections and the miner binary or script, then snapshot disks and record the image digest. See the Container and Kubernetes Forensics Guide and the Linux Forensics Guide.
  3. Kubernetes: cordon the node, label the pod for quarantine and apply a deny-all network policy to it rather than deleting it; scale down the owning deployment or DaemonSet only after capture. Check whether the attacker created other workloads in other namespaces.
  4. Stop the cost: after capture, stop or scale to zero the affected compute. Put temporary quotas or limits on the affected project, namespace or account so that a second wave cannot start.
  5. Contain the identities: revoke or rotate any credential reachable from the compromised context, starting with cloud roles and Kubernetes service account tokens. If the attached cloud role was used from outside the workload, switch to the cloud access key playbook immediately.
  6. Block indicators: pool domains and IPs at DNS and egress, image digests at the registry and admission controller.

5. Eradication

  • Rebuild, do not clean. Replace affected hosts and nodes from known-good images; attackers commonly add hiding and persistence that manual cleaning misses.
  • Fix the entry point: patch the exploited service, close the exposed API or dashboard, enforce authentication, remove the poisoned image and rebuild from source.
  • Remove persistence everywhere it could be: cron, systemd, SSH keys, cluster workloads, webhooks, CI secrets and registry images pushed during the window.
  • Replace secrets, not just rotate them: where a static secret was found in an image, pod spec or environment, replace it with workload identity or short-lived credentials. The Tesla Kubernetes cryptojacking case combined an unauthenticated console with cloud access keys stored in a pod, which turned a mining incident into a data exposure.
  • Hunt fleet-wide: search for the same binary hash, image digest, pool domains and persistence artefacts across all hosts and clusters.

6. Recovery

  1. Redeploy workloads from verified images with resource requests and limits, and namespace quotas, so that unexpected consumption is capped.
  2. Restore services in a monitored state, with heightened alerting on the affected identities, pool indicators and resource use for [30 days].
  3. Confirm cloud spend has returned to baseline and that no resources remain in other regions or projects.
  4. Rollback: if the rebuilt service fails, roll back to the previous known-good release, never to the compromised instance or image.
  5. Close the incident only when the entry point is fixed and every reachable credential has been rotated or replaced.

7. Communication and notification

  • Internal: service owners, platform teams and leadership, with impact, cost estimate and expected recovery time.
  • Cloud provider: open a support case; providers may review charges caused by abuse, but this is at their discretion and depends on your evidence and the controls you had in place.
  • Customers and regulators: mining alone rarely triggers personal data notification, but if the investigation shows data access, or the reachable credentials could read personal data and access cannot be ruled out, refer to legal for a notification decision under the incident response plan.
  • Upstream: if a public image or package carried the miner, report it to the registry or project maintainers.

8. Post-incident review

Record time from first mining activity to detection, detection to containment, total compute cost, entry point, credentials reachable and whether any were used outside the workload. Ask three questions: why the entry point was exposed, why the workload could reach the credentials it could, and why resource limits did not cap the impact. Feed fixes into hardening backlogs and detection rules.

Implementation guidance

Decision guidance

QuestionIf yesIf no
Did mining run on resources created by an identity, rather than on an existing workload?Treat as a credential compromise first: cloud access key playbook leadsThis playbook leads
Could the workload reach production data or privileged credentials?Critical; full forensics and credential rotationHigh; rebuild and fix entry point
Is the node shared with other tenants or workloads?Assume possible escape; rebuild the node and review neighboursRebuild the workload only
Is evidence needed for legal or insurance purposes?Full capture with chain of custody before stoppingCapture process, binary and image digest at minimum

Small and large organisations

  • Small teams: enable the provider's managed threat detection and billing alerts, keep this playbook printed with the isolation steps, and rebuild rather than investigate deeply unless credentials were reachable.
  • Large estates: automate isolation (security group swap, node cordon) from high-confidence findings, keep forensic capture tooling ready on every cluster, and track mining incidents as a measure of exposed attack surface.

Metrics

  • Mean time from first mining activity to detection, and from detection to network isolation.
  • Cost per incident and cost avoided by quotas.
  • Percentage of incidents with a confirmed root cause.
  • Percentage of incidents where reachable credentials were rotated within [24 hours].
  • Share of workloads with resource limits and namespace quotas.

Where identity fits

Most container and host mining cases end with a non-human identity question: what could the workload's identity do? A pod's mounted service account token, a node's cloud instance role, CI runner secrets and registry push credentials are all reachable from a compromised workload. Before closing, list each one, confirm from cloud and cluster audit logs whether it was used from anywhere other than its normal workload, and reduce its permissions so that the next compromise reaches less. See the Kubernetes Audit Log Detection Guide.

Evidence to preserve

  • Memory image and process list with command lines from the affected host or node.
  • Miner binary or script, its configuration (pool address and wallet), and file hashes.
  • Disk snapshots, container image digest and the pod or deployment specification.
  • Cloud audit logs, Kubernetes audit logs, DNS and flow logs from [14 days] before first activity.

Framework mapping

AreaReference
Incident responseNIST SP 800-61 Rev. 3; NIST SP 800-53 Rev. 5 IR-4 Incident Handling
MonitoringNIST SP 800-53 Rev. 5 SI-4; NIST CSF 2.0 DE.CM-09
TechniquesMITRE ATT&CK v20 T1496.001, T1190, T1610, T1609, T1611, T1525, T1552.005
Container controlsSee the NIST SP 800-190 Container Security Guide

References

Related NHI Mgmt Group resources: Cryptojacking Guide · Cloud Access Key Leak Playbook · Kubernetes Security Guide · Cloud Incident Response Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 27 October 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.