Bun Script Attempted to Access IMDS Metadata
Description
Identifies Bun scripting interpreter establishing a network connection to the link-local instance metadata service address (169.254.169.254). Adversaries and cloud malware often query the instance metadata API to harvest IAM credentials, tokens, and other secrets from cloud-hosted workloads.
Query · eql
sequence by process.entity_id with maxspan=1m
[process where event.type == "start" and event.action in ("start", "exec") and process.name : ("bun", "bun.exe") and
not process.command_line like ("bun --watch src/app.ts",
"bun test src/integrations/__tests__/*",
"bun run scripts/ingest-resilience-retrospectives.ts --ingest",
"bun packages/product-config/codegen/api-codegen.ts",
"bun run apps/backend/probe-pagination.ts")]
[network where event.action == "connection_attempted" and destination.address == "169.254.169.254" and destination.port == 80]