Skip to main content
Back
IntrusionAWS · SaaS
10 min read

EMERALDWHALE: exposed Git configuration files lead to private repositories and AWS keys

Victim
Unnamed owners of exposed Git repositories and the accounts behind more than 15,000 stolen credentials
When
August–September 2024Disclosed Oct 30, 2024
Entry
A misconfigured web server served its repository configuration directory to the internet, which exposed a source-control token embedded in a repository remote.

Sysdig's Threat Research Team found the EMERALDWHALE operation's storage bucket, open to anyone, while watching a cloud honeypot. Its logs show a scan of internet address ranges for exposed repository configuration files across August and September 2024; the tokens read from those files were used to copy public and private repositories, and the long-term AWS keys and mail credentials in them were collected, more than 15,000 credentials in all. The tooling can create administrator users and send spam with the keys, though which accounts it reached is not stated.

What happened

External Parties
Sysdig
Underground marketplaces
Telegram list seller
Internet
AWS APIlong-term access keys
Exposed Web Servers
Victim AWS Accounts
+ GitHub, GitLab, Bitbucket
+ private repositories
+ AWS keys in files
Source-Control Repositories
+ over a terabyte of data
+ stolen credentials
+ tools and logs
Earlier Victim's Open Bucket
Victim Web App
Exposed Repo Config
IAM User Access Key
New Admin IAM User
SES + SNS

Replaying the EMERALDWHALE intrusion, Aug–Sep 2024

  1. 1

    Exposed configs read

    August–September 2024

    Scans of internet address ranges find web servers that serve their source-control configuration to anyone, and the access tokens embedded in it are collected and checked against the Git platform.

  2. 2

    Private repositories copied

    August–September 2024

    The exposed tokens let the operators copy public and private repositories on GitHub, GitLab and Bitbucket and search their files for long-term AWS keys and mail credentials.

  3. 3

    Stolen cloud keys used

    August–September 2024

    Cloud keys found in the code are used to list identities and sending quotas, and the tooling can create an administrator identity and send spam and phishing through SES and SNS; which accounts it reached is not stated.

  4. 4

    The haul in an open bucket

    Found before the October 30, 2024 report

    More than a terabyte of stolen credentials, tools and logs is stored in a publicly exposed S3 bucket of an earlier victim, where Sysdig finds it from its cloud honeypot; how the operators got write access and what made the bucket public are not stated.

Impact

More than 15,000 cloud and service credentials were stolen and credentials for over 10,000 private repositories collected, mainly for spam and phishing; which victim accounts the AWS keys reached is not stated; the haul sat in a publicly exposed S3 bucket of an earlier victim.

Outcome

Where cloud-provider controls fit

On AWS, an AWS WAF protection pack (web ACL) that blocks requests for the repository configuration directory covers only the sites whose traffic passes through a resource the pack protects; the sources do not say where the exposed servers ran or what stood in front of them. No cloud-provider control reaches a Git platform's token or a key committed to a repository: there, a GitHub IP allow list or a GitLab group IP restriction bounds where a stolen token works, and push protection refuses a key at push time, with a bypass and only for keys not already committed. With an AWS key in hand, a service control policy that denies IAM user calls without MFA bounds what the key of an IAM user in a member account can do, though a key check may still answer; the sources do not say which keys belonged to IAM users or which accounts were member accounts of an organization. Service control policies that keep the IAM write actions to your approved administrators and deny SES and SNS in member accounts that do not send mail cap the rest. S3 Block Public Access would have kept the staging bucket from being opened to anyone, but not a write the owner's account authorizes, and only where that account applies it.

Could this have been prevented?

In hindsight, no control would have stopped it. 14 controls would have limited how far it went. 2 steps have no cloud-provider control. The counts below are control assessments, not attack stages: several can address the same step. The same replay with the controls in place before the incident shows where each phase would have been refused or bounded.

0
Prevented
14
Contained
2
Not covered

How it could have been prevented

The same replay with the controls in place. Green marks where a step is refused, blue where it is bounded, and red where no control reaches it. Open a row to read the control, why it acts, and its caveat.

External Parties
Sysdig
Underground marketplaces
Telegram list seller
Internet
AWS APIlong-term access keys
Exposed Web Servers
Victim AWS Accounts
+ GitHub, GitLab, Bitbucket
+ private repositories
+ AWS keys in files
Source-Control Repositories
+ over a terabyte of data
+ stolen credentials
+ tools and logs
Earlier Victim's Open Bucket
Victim Web App
Exposed Repo Config
IAM User Access Key
New Admin IAM User
SES + SNS

Replaying the EMERALDWHALE intrusion, Aug–Sep 2024

1 · Exposed configs read

3 Contained1 Not covered3 on other clouds

2 · Private repositories copied

2 Contained1 Not covered

3 · Stolen cloud keys used

7 Contained7 on other clouds

4 · The haul in an open bucket

2 Contained3 on other clouds

Key facts

  • The operation's logs showed a scan of internet address ranges for exposed repository configuration files between August and September 2024; one target list alone yielded more than 67,000 exposed URLs, and Sysdig found that list offered for sale for $100
  • More than 15,000 cloud and service credentials were stolen and credentials for over 10,000 private repositories were collected; Sysdig did not verify the credentials beyond pattern matching and deduplication
  • Most repositories were on GitHub, Bitbucket and GitLab; in a limited sample, roughly 2,000 of about 6,000 GitHub tokens were valid
  • The tooling checked each AWS key's identity and email-sending quota and could create an IAM user with full administrator permissions; whether such users were created in victim accounts is unconfirmed
  • Sysdig assessed spam and phishing as the primary goal; its senior research director said each credential can sell for $500 to $700
  • Over a terabyte of stolen data and tools sat in a publicly exposed S3 bucket of an earlier victim; Sysdig reported it to AWS, which took it down on a date the sources do not give

Sources

Every fact in this breakdown comes from the public reporting below. The replay is a model of that reporting, not a reconstruction of the environment it describes.

  1. 1.
    EMERALDWHALE: 15k Cloud credentials stolen in operation targeting exposed Git config filesSysdig Threat Research Team · Oct 30, 2024 · ResearchDiscovery from a cloud honeypot, scanning window, exposed repository configuration files, token extraction and validation, repository cloning, AWS key extraction and use, IAM user creation, SES and SNS abuse, the earlier victim's open S3 bucket, counts, takedown
  2. 2.
    Gang gobbles 15K credentials from cloud and email providers' garbage Git configsThe Register · Oct 31, 2024 · NewsCredential resale value, accidental discovery, attribution assessment

The estate in the replay is illustrative and drawn at the level of attack stages; the victim's real environment is not public. Verdicts describe what a control does when it is in place before the incident. They are not an assessment of the victim's security program.

More cloud attack breakdowns

All breakdowns