# Leaked Cloud Credentials > Exposed long-lived cloud keys (AWS IAM access keys, GCP service-account keys, Bedrock/Gemini/LLM API keys, GitHub PATs that bridge into the cloud) and the automated harvesting that turns them into cryptojacking, extortion, LLMjacking or full account takeover within minutes. ## How it works AWS's own incident-response team names exposed long-term credentials as the top initial access vector it sees. Attackers run continuous pipelines that clone public repos, crawl websites for `.env`, pull Docker Hub images and package tarballs, then validate and enumerate: ```text TIME (UTC) EVENT NOTE 21:27:59 iam:AttachUserPolicy AWSCompromisedKeyQuarantineV3 attached by AWS 21:33:23 sts:GetCallerIdentity TruffleHog user agent (validation) 21:35:00 secretsmanager:ListSecrets Boto3 21:35:00 secretsmanager:GetSecretValue 2 values returned ``` That is a 2026 canary experiment (Tachyon): a pushed `.env` was used within ~5 minutes and Secrets Manager drained within 7, **after** AWS's quarantine policy was attached — the policy denies selected high-cost/IAM actions but neither revokes the key nor blocks `GetSecretValue`. ### Where cloud credentials come from - Source and history: see [[Hardcoded Secrets]], [[Secrets in Git History]]. - Web-exposed `.env` files ([[Content Discovery]]). - Container images: Flare found 10,000+ Docker Hub images leaking secrets in one month; LLM keys were the most common (~4,000); 75% of developers who removed a leaked secret never rotated it. - Runtime credential providers an attacker can query after code execution or SSRF: env vars (`AWS_ACCESS_KEY_ID`/`AWS_SESSION_TOKEN` in Lambda), `~/.aws/credentials`, `/etc/boto.cfg`, IMDS `169.254.169.254`, ECS/CodeBuild `169.254.170.2` via `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI`, EKS Pod Identity `169.254.170.23` with `AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE`, IRSA token at `/var/run/secrets/eks.amazonaws.com/serviceaccount/token`. See [[Cloud Metadata Service Exploitation]] and [[IMDSv2]]. - Developer endpoints and CI runners via infostealers and worms: [[Developer Workstation Secrets]], [[Shai-Hulud Worm]]; in Nov 2026 the hijacked `agent-framework` PyPI releases also requested Azure managed-identity tokens for twelve resources and instance metadata ([[raw/medium.com/the-credential-was-valid-the-publisher-was-not-15854|VeritasChain on Wiz findings]]). - **Prompts in transit through AI inference providers.** Dragos seeded ~2M prompts (Jul–Nov 2026) with unique links and credentials. Three providers had been breached for months; ~200 planted AWS keys, each sent once, were all stolen during late-October windows, including from requests rejected before inference (traffic copied at first arrival). The thief tested keys within hours, listed S3, searched Secrets Manager and Parameter Store, and tried to create Bedrock API keys and IAM users for persistence (tens of thousands of API calls). On 1 Nov the actor used the ARTEX framework to confirm keys were live; user agents `artex-agent` and `artex-judge-r121` are worth detections. Marketplace sellers logged traffic and tested keys by hand; a Chinese lab's scraper fetched secret links from more than half of seeded prompts, including ZDR-flagged ones. Together AI lost stored prompt samples after an AI coding agent committed a credential to its public GitHub repo ([[raw/thehackernews.com/openrouter-drops-3-providers-after-researchers-catch-months-of-prompt-15915|THN]]). ### AI-era key types - **Bedrock API keys** — long-term keys create an IAM user `BedrockAPIKey-xxxx` with `AmazonBedrockLimitedAccess` (over half of Bedrock privileges) via `iam:CreateServiceSpecificCredential`; format `ABSK` + base64 that decodes to user name and account ID. They are bearer tokens (no SigV4). Seen leaked on GitHub within two weeks of launch. Short-term keys are client-side presigned URLs (`bedrock-api-key-…`), invisible at creation in CloudTrail. Detection: `CreateServiceSpecificCredential` with `service=bedrock.amazonaws.com`; usage carries `"callWithBearerToken": true`. Wiz recommends an SCP denying IAM users and `bedrock:CallWithBearerToken`. - **Google `AIza…` keys** — formerly low-impact, now often enable Gemini and other billable APIs; GitHub dorks like `/AIza[0-9A-Za-z_-]{35}/ path:/.env`. See [[Google Dorking]]. - GitGuardian counted 1,275,105 leaked AI-service secrets in 2025 (+81% YoY), incl. 113,000 DeepSeek keys. ## Notable cases / campaigns | Campaign | Entry | Outcome | |---|---|---| | **EleKtra-Leak** (Unit 42) | AWS keys in public GitHub, used within 5 min; actor blocklists accounts that repeatedly leak (researcher canaries) | Long-running EC2 Monero cryptojacking (474 miners observed) | | **.env extortion** (Unit 42) | 110,000 domains' exposed `.env` (90,000 vars, 7,000 cloud) | Exfil from S3, ransom note left in bucket; infrastructure built inside victims' AWS | | **LLMjacking** (GTIG/Mandiant) | Stolen IAM keys, SA keys, PATs, LLM keys from GitHub | >$100k/day spikes, up to $1M cumulative; UNC6993 via misconfigured SA key | | **GitHub PAT → cloud** (Wiz CIRT) | Read-scope PAT code-searches `${{ secrets.NAME }}`; write-scope PAT adds a workflow, exfils double-base64'd secrets past log masking or creates fresh cloud keys | Cross-cloud lateral movement; deletes workflow runs/logs. 73% of orgs using Actions secrets store CSP creds there | | **AWS crypto-mining (2025)** | Compromised admin-like IAM keys; validated quietly with `ec2:RunInstances` `DryRun` | ECS/Lambda roles, image `yenik65958/secret:user`, `ModifyInstanceAttribute` to disable API termination for persistence | | **AI token jacking** (Unit 42) | AI keys from dev accounts, repos, Shai-Hulud/Miasma-style supply chain | Keys resold through "transfer station" proxies (new-api, one-api) | | **ARTEX** (Microsoft) | Agentic AI framework scanning public GitHub for secrets | Azure Key Vault and Storage exfil, Azure AI abuse | | **CISA Private-CISA** | Contractor's public repo, `importantAWStokens` | Admin on three AWS GovCloud accounts; keys valid 48h after takedown | | **Rackspace Spot** (17 Nov 2026) | Leaked credentials used to act as legitimate users in customer orgs | Created pods, read every Kubernetes Secret in affected clusters plus Spot API/refresh tokens, listed nodes and volumes; IoCs `23.224.0.0/15`, pod prefixes `i1`, `glm-`, `probe`; console outage blocked customer rotation until 21 Nov | | **AI inference prompt theft** (Dragos/OpenRouter, Jul–Nov 2026) | Breached providers and logging resellers copying prompts | Canary AWS keys abused within hours; OpenRouter dropped 3 providers and 125 ZDR endpoints | | **UNC6426** | GitHub token stolen by nx/QUIETVAULT stealer | Abused GitHub→AWS OIDC trust to create admin role in 72h ([[Workload Identity Federation]]) | ## Defenses - Remove IAM users and long-term keys; use roles, [[Workload Identity Federation]], IAM Roles Anywhere. Credential reports + IAM Access Analyzer unused-access findings to prune what remains. - Data perimeter: SCPs/RCPs that deny use of org credentials from outside expected networks and deny outside principals on S3 etc., so a leaked key fails off-network. - Monitor `iam:AttachUserPolicy` where `policyArn` contains `AWSCompromisedKeyQuarantine` — the quarantine email often goes to cloud engineering, not security. - Do not treat quarantine as revocation: deactivate the key, rotate, review CloudTrail from the exposure time ([[Credential Rotation and Revocation]]). - **Canary credentials as tripwires**: seed fake keys (e.g. Thinkst Canarytokens) into repos, prompts and agent context and treat any use as an incident; a planted secret has exactly one place it could have been read ([[raw/thehackernews.com/openrouter-drops-3-providers-after-researchers-catch-months-of-prompt-15915|THN]]). - After a platform breach that exposes cluster Secrets, rotate the platform tokens *and* every credential stored in the clusters, then review downstream logs (DBs, registries, Git, storage) from the exposure start ([[raw/bleepingcomputer.com/rackspace-spot-breach-let-hackers-access-customer-kubernetes-secrets-15960|BleepingComputer]]). - Least privilege on whatever key exists; tight budgets/alerts on AI services against LLMjacking. ## Related - [[Secrets Management]] - [[Cloud Metadata Service Exploitation]] · [[IMDSv2]] · [[Capital One Breach]] - [[Secret Scanning]] · [[Credential Rotation and Revocation]] · [[Developer Workstation Secrets]] - [[GitHub Actions Security]] · [[Software Supply Chain Security]] - [[LLMjacking]] ## Sources - [[raw/tachyon.so/what-happened-after-we-pushed-our-env-to-a-public-repo-10676|What happened after we pushed our .env to a public repo]] - [[raw/isc.sans.edu/what-happens-when-you-leak-aws-api-keys-4068|What Happens When You Leak AWS API Keys?]] - [[raw/unit42.paloaltonetworks.com/from-exposure-to-lockdown-how-aws-neutralizes-compromised-iam-credenti-12067|From Exposure to Lockdown: How AWS Neutralizes Compromised IAM Credentials]] - [[raw/unit42.paloaltonetworks.com/cloudkeys-in-the-air-exposed-iam-keys-cryptojacking-4069|CloudKeys in the Air: Exposed IAM Keys Cryptojacking]] - [[raw/unit42.paloaltonetworks.com/leaked-env-variables-allow-large-scale-cloud-extortion-4063|Leaked Env Variables Allow Large-Scale Cloud Extortion]] - [[raw/aws.amazon.com/practical-steps-to-minimize-key-exposure-using-aws-security-aws-4495|Practical steps to minimize key exposure using AWS Security services]] - [[raw/wiz.io/the-many-ways-to-obtain-credentials-in-aws-9488|The many ways to obtain credentials in AWS]] - [[raw/wiz.io/a-new-type-of-long-lived-key-on-aws-bedrock-api-keys-9228|A new type of long-lived key on AWS: Bedrock API keys]] - [[raw/wiz.io/code-to-cloud-attacks-from-github-pat-to-cloud-control-plane-9098|Code to Cloud Attacks: From GitHub PAT to Cloud Control Plane]] - [[raw/thehackernews.com/google-warns-llmjacking-attacks-are-costing-some-enterprises-up-to-1-m-13136|Google Warns LLMjacking Attacks Are Costing Some Enterprises Up to $1M]] - [[raw/thehackernews.com/unc6426-exploits-nx-npm-supply-chain-attack-to-gain-aws-admin-access-i-4935|UNC6426 Exploits nx npm Supply-Chain Attack to Gain AWS Admin Access]] - [[raw/krebsonsecurity.com/cisa-admin-leaked-aws-govcloud-keys-on-github-8102|CISA Admin Leaked AWS GovCloud Keys on Github]] - [[raw/flare.io/thousands-of-secrets-exposed-on-docker-hub-4067|Thousands of Secrets Exposed on Docker Hub]] - [[raw/medium.com/your-api-key-is-not-a-secret-how-i-turn-leaked-google-keys-into-bug-bo-15372|Your API Key Is Not a Secret: How I Turn Leaked Google Keys Into Bug Bounty Payouts]] - [[raw/blog.gitguardian.com/the-state-of-secrets-sprawl-2026-ai-service-leaks-surge-81-3771|The State of Secrets Sprawl 2026: AI-Service Leaks Surge 81%]] - [[raw/thehackernews.com/compromised-iam-credentials-power-large-aws-crypto-mining-campaign-4707|Compromised IAM Credentials Power Large AWS Crypto Mining Campaign]] - [[raw/unit42.paloaltonetworks.com/token-jacking-cybercriminals-could-be-stealing-your-ai-resources-11151|Token Jacking: Cybercriminals Could Be Stealing Your AI Resources]] - [[raw/microsoft.com/threat-actors-use-agentic-ai-tooling-to-find-and-abuse-exposed-secrets-13575|Threat actors use agentic AI tooling to find and abuse exposed secrets]] - [[raw/bleepingcomputer.com/rackspace-spot-breach-let-hackers-access-customer-kubernetes-secrets-15960|Rackspace Spot breach let hackers access customer Kubernetes secrets]] - [[raw/thehackernews.com/openrouter-drops-3-providers-after-researchers-catch-months-of-prompt-15915|OpenRouter Drops 3 Providers After Researchers Catch Months of Prompt Theft at AI Hosting Firms]] - [[raw/medium.com/the-credential-was-valid-the-publisher-was-not-15854|The Credential Was Valid. The Publisher Was Not.]]