Empirical: a stale Terraform key opened every secret in the runner account
On Nov 28, 2026 a static terraform IAM key with AdministratorAccess was used from two addresses over about six hours. It read every secret in the account, created a probe Lambda and enabled Bedrock models. Stolen LLM keys cost about $450 before provider abuse emails raised the alarm. The account was only the runner plane, so the control plane was out of reach.
How they got in
The attacker had a long-lived access key for an IAM user named terraform, attached to AdministratorAccess. Empirical created it in September 2024 for initial Terraform setup and reused it in GitHub Actions even after migrating to AWS CDK in 2025. Because 90 days of CloudTrail showed only GitHub Actions runner IPs before Nov 28, Empirical suspects the key leaked from a stale .env file on a developer laptop. That source is a suspicion, not a finding, so it is marked inferred on the diagram.
The first call, at 06:04 UTC from 111.88.126.50 using Python urllib, only called sts:GetCallerIdentity to check whose key it was. Twelve minutes later an automated boto3 script inspected the IAM user policies and read every Secrets Manager entry and three decrypted SSM parameters across two regions. Nothing in AWS noticed.
The static terraform key, with AdministratorAccess, checks its identity with sts:GetCallerIdentity from 111.88.126.50.
AttackerIAM user terraformAll 8 Secrets Manager entries and 3 decrypted SSM parameters are read across two regions with boto3.
AttackerIAM user terraformSSM Parameter StoreSecrets ManagerIn the same 06:16 UTC burst, a throwaway Python 3.12 Lambda, tmp-cred-validate, is created, invoked once and deleted.
IAM user terraformLambda probeFrom 139.162.62.217, five Bedrock Marketplace model agreements are accepted and retention mode is changed.
AttackerIAM user terraformBedrock MarketplaceAbout $450 is burned on stolen LLM keys: Anthropic $283, Gemini $130 across ~1,300 calls through 12:42 UTC, and OpenAI $35. Empirical deactivated the AWS admin key at 12:36 UTC and disabled the OpenAI and Google AI Studio keys at 12:45 UTC.
Secrets ManagerAnthropicGeminiOpenAI
Figure 1. How the attack unfolded, and what stayed isolated. Select any step or box for details.
What they took
Inside the account the key could do anything. In the same 06:16 UTC burst it created a throwaway Python 3.12 Lambda named tmp-cred-validate under tmp-cred-validate-role, invoked it once and deleted both, leaving behind the CloudWatch log group /aws/lambda/tmp-cred-validate. From a second address, 139.162.62.217, it accepted five Bedrock Marketplace model agreements at 08:55 UTC, changed Bedrock data retention mode and sent five probe prompts.
The stolen LLM keys came from retired tool-execute-service entries left alive since mid-2025. Within a minute of the dump the attacker tested the Gemini key with ListModels, then burned roughly $450 over four hours: $283 at Anthropic, $130 across roughly 1,300 Gemini calls through 12:42 UTC, and $35 at OpenAI. Empirical deactivated the AWS admin key at 12:36 UTC and disabled the stolen OpenAI and Google AI Studio keys at 12:45 UTC.
What stayed safe
The compromised account was only the runner plane: ECS task definitions, job queues and S3 buckets storing test videos and traces. Empirical’s control plane and LLM applications run outside AWS, so customer test repositories, Slack and GitHub integrations, agent sessions and organization data were completely unreachable.
S3 server access logs and multi-region CloudTrail checks confirmed zero attacker calls to S3 buckets or runner queues, and proxy logs confirmed the stolen static-IP egress-proxy signing secret was never used to mint tokens before rotation.
How to defend against this
OIDC roles only
CI assumes a short-lived role through GitHub OIDC, and an SCP denies iam:CreateAccessKey, so no static terraform key exists to leak.
Bulk-read alert
An EventBridge rule on GetSecretValue by any IAM user fires on the 06:16 UTC sweep, six hours before the provider emails.
Lambda deny
A permission boundary denies lambda:CreateFunction to every principal except the deploy role.
github-oidc-trust.jsonTrust policy for the deploy role. CI gets a one-hour session from GitHub OIDC pinned to the main branch instead of a stored IAM user key. Stops step 1.
{ "Version": "2012-10-17", "Statement": [ { "Sid": "GitHubActionsDeployOnly", "Effect": "Allow", "Principal": { "Federated": "arn:aws:iam::<account-id>:oidc-provider/token.actions.githubusercontent.com" }, "Action": "sts:AssumeRoleWithWebIdentity", "Condition": { "StringEquals": { "token.actions.githubusercontent.com:aud": "sts.amazonaws.com", "token.actions.githubusercontent.com:sub": "repo:<org>/<repo>:ref:refs/heads/main" } } } ]}Appendix
Evidence log: what’s confirmed and what’s withheld
| Claim | Status | Source |
|---|---|---|
A static key for IAM user terraform with AdministratorAccess was used from 111.88.126.50 at 06:04 UTC | Confirmed | Empirical disclosure, Nov 30 |
The key leaked from a stale .env file on a developer laptop | Inferred | Empirical’s stated suspicion |
| All 8 Secrets Manager entries and 3 decrypted SSM parameters were read at 06:16 UTC across two regions | Confirmed | Empirical disclosure |
tmp-cred-validate (Python 3.12, 128 MB) was created at 06:16 UTC to test stolen credentials or egress capability | Inferred | Function and timestamp confirmed in CloudTrail; purpose read from its name |
5 Bedrock Marketplace agreements were accepted from 139.162.62.217 at 08:55 UTC and retention mode altered | Confirmed | Empirical disclosure |
| About $450 of LLM usage on stolen keys ($283 Anthropic, $130 Gemini across ~1,300 calls through 12:42 UTC, $35 OpenAI) | Confirmed | Provider dashboards and abuse notices |
| Control plane and LLM apps run outside AWS and were never reached | Confirmed | Empirical disclosure |
| S3 report artifacts and SQS runner queue tokens were reachable and not used | Confirmed | S3 server access logs and CloudTrail checks |
| The static-IP egress-proxy signing secret was stolen and verified unused before rotation | Confirmed | Empirical proxy access logs |
Indicators of compromise
111.88.126.5006:04 UTC GetCallerIdentity (Python urllib), 06:16 UTC Secrets Manager and SSM dump (boto3) and tmp-cred-validate Lambda.
139.162.62.21708:55 UTC Bedrock model listing, 5 Marketplace agreement acceptances, retention flip and 5 test prompts.
tmp-cred-validate (runtime python3.12, memory 128 MB, role tmp-cred-validate-role)Throwaway execution role and function created, invoked once and deleted at 06:16 UTC.
McIbfRG0aZY8d+wfg3RXuijdtAklkzIRAWTuQOanu7o=Base64 SHA-256 code digest reported by AWS Lambda for tmp-cred-validate.
/aws/lambda/tmp-cred-validateCloudWatch log group left behind after function deletion.
Reproduction lab
Replays the exact CloudTrail discovery, secret-dump and throwaway Lambda sequence against LocalStack with decoy secrets, so you can test the OIDC trust policy and EventBridge rule without touching a real AWS account.
# 8 decoy secrets, 3 SSM parameters, one IAM user with a static key
docker run -d --name breachident-lab -p 4566:4566 localstack/localstack:3.8
AWS_ENDPOINT_URL=http://localhost:4566 aws secretsmanager create-secret \
--name tool-execute-service/llm-keys --secret-string '{"ANTHROPIC":"sk-decoy"}'
# replay steps 1 to 3 against LocalStack and verify the EventBridge rule fires
python3 simulate_probe.py --endpoint http://localhost:4566