new(rules): detect GPU/accelerator cryptojacking and device access (T1496) - #373
Open
DevamShah wants to merge 1 commit into
Open
new(rules): detect GPU/accelerator cryptojacking and device access (T1496)#373DevamShah wants to merge 1 commit into
DevamShah wants to merge 1 commit into
Conversation
…1496) Add three maturity_sandbox artifacts to falco-sandbox_rules.yaml that detect GPU/accelerator cryptojacking, closing a gap the existing CPU/network-centric cryptominer rules do not cover: - list gpu_device_files + macro open_gpu_device + rule "Container Accessing GPU Device" (disabled by default): flags a container opening an NVIDIA/AMD compute device (/dev/nvidia*, /dev/nvidiactl, /dev/nvidia-uvm, /dev/kfd, /dev/dri/renderD*). The device open is the chokepoint a GPU miner cannot avoid even when it renames its binary and hides its pool traffic. - list gpu_management_binaries + rule "GPU Management Tool Run in Container": flags nvidia-smi/rocm-smi and friends running in a non-allowlisted container, a common pre-mining reconnaissance step. - macro user_known_gpu_workloads (never_true) as the documented tuning hook. Conventions mirror the sibling T1496 rules and the existing "Privileged Container Device Access" rule, which uses the same (open_read or open_write) + fd.name device-prefix pattern. Priority CRITICAL to match sibling T1496 rules; output uses the established bare key=%val template. Signed-off-by: Devam Shah <devamshah91@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: DevamShah The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @DevamShah! It looks like this is your first PR to falcosecurity/rules 🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
/kind feature
/area rules
/area maturity-sandbox
What type of PR is this?
Any specific area of the project related to this PR?
What this PR does / why we need it
Adds three
maturity_sandboxartifacts torules/falco-sandbox_rules.yamlthat detect GPU/accelerator cryptojacking — a container opening an NVIDIA/AMD compute device, and GPU management tooling (nvidia-smi,rocm-smi) running inside a container — closing a coverage gap the existing CPU/network-centric cryptominer rules do not address.Problem / motivation
Falco's current cryptominer coverage in
falco-sandbox_rules.yamlis CPU- and network-centric:proc.cmdlineforstratum+tcp/stratum+ssl.xmrig,ethminer, ...).All three are trivially evaded by a GPU miner. An attacker who has compromised a GPU-equipped node (common in ML/AI and rendering fleets, where idle accelerator capacity is a high-value cryptojacking target) can use a renamed or custom miner binary, connect over an encrypted/proxied channel to an unknown pool, and avoid the
stratumURI scheme entirely.What the miner cannot avoid is opening a GPU character device to submit work to the hardware (
/dev/nvidia*,/dev/nvidiactl,/dev/nvidia-uvmfor CUDA;/dev/kfdand/dev/dri/renderD*for AMD ROCm). That device open is the chokepoint this PR instruments. This is GPU compute, distinct from the existing Privileged Container Device Access rule, which targets raw block/storage devices (/dev/sd,/dev/nvme,/dev/mem) for container escape (T1611) — no overlap with GPU compute devices.Change
list: gpu_device_files—/dev/nvidiactl,/dev/nvidia-uvm,/dev/nvidia-uvm-tools,/dev/kfd.macro: open_gpu_device— anopen_read/open_writeon agpu_device_filesentry, any/dev/nvidia*per-GPU node, or a/dev/dri/renderD*DRM render node.list: gpu_management_binaries—nvidia-smi,nvidia-debugdump,nvidia-persistenced,nvidia-cuda-mps-control,rocm-smi,rocminfo.macro: user_known_gpu_workloads(defaults tonever_true) — the documented tuning hook for clusters with legitimate ML/HPC/rendering workloads, overridable by image (e.g.container.image.repository in (my_ml_images)).rule: Container Accessing GPU Device(priorityCRITICAL, disabled by default) — behavioral signal: a container opens a GPU compute device and is not an allowlisted workload. Shipped disabled because it is noisy untiluser_known_gpu_workloadsis tuned to the images expected to use the GPU.rule: GPU Management Tool Run in Container(priorityCRITICAL) — signature signal: GPU fingerprinting tooling runs in a non-allowlisted container.Conventions mirror the adjacent rules: first tag is the maturity level (
maturity_sandbox);containerscope, killchain phase (mitre_impact) and TTP (T1496) tags match the sibling stratum and miner-binary rules; both rules use anever_true-backeduser_known_*tuning macro and the establishedevt_type / user / process / proc_exepath / parent / command / terminaloutput template. The device-open rule deliberately reuses the exact(open_read or open_write) and container and fd.name startswith /dev/...pattern already used by the existing Privileged Container Device Access rule in this same file.Security rationale
user_known_gpu_workloadstuning macro. The behavioral rule shipsenabled: falseper repo precedent for noisy-by-default rules.Testing / validation
falco --validate rules/falco-sandbox_rules.yamlinfalcosecurity/falco:0.44.1→Ok.modern_ebpfdriver and the rule temporarily enabled, then opened character-device nodes at the matched paths inside a separate container:Container Accessing GPU Devicefired CRITICAL oncat /dev/nvidia0andhead -c1 /dev/nvidiactlfrom abusyboxcontainer:Critical Container accessing GPU device | device=/dev/nvidia0 image=busybox evt_type=openat ... process=cat ... container_name=gpu-trigger2GPU Management Tool Run in Containerfired CRITICAL on executingnvidia-smiinside a container:Critical GPU management tool run in container | image=busybox evt_type=execve process=nvidia-smi ...open_read/open_writemacros (fd.typechar='f',fd.num>=0) do match successful character-device opens, exactly as the sibling block-device rule relies on.Special notes for your reviewer
Submitted as
maturity_sandboxper the maturity framework — an experimental detection that pairs a behavioral and a signature signal. Happy to split the two rules, adjust the device/management-binary lists, or change the default-enabled state based on maintainer preference.