Skip to main content
Back
IntrusionAWS
2 min read

A GitLab compromise led to cryptomining in five AWS regions

Victim
An unnamed Permiso customer
When
Incident dates not reportedDisclosed Jun 20, 2022
Entry
A vulnerable GitLab server exposed an AWS access key with administrator-level privileges.

Permiso traced the intrusion from a GitLab server to a customer’s AWS account. The intruder listed S3 buckets, created a second IAM user and launched EC2 instances for cryptomining. Some launch attempts hit resource limits. Permiso did not report the cost.

What happened

Internet
AWS APIAccess key
GitLab server
Customer AWS account
Application data
S3 buckets
IAM users
EC2 instances

The GitLab and AWS cryptomining intrusion / Permiso published its investigation in June 2022.

  1. 1

    A GitLab flaw exposes an AWS key

    Before AWS access

    The GitLab compromise exposed an AWS key with administrator-level permissions.

  2. 2

    The original key lists buckets

    First AWS request

    Permiso saw the exposed key list S3 buckets from a public address in Indonesia.

  3. 3

    IAM issues a second key

    After the first listing

    The intruder created a second IAM user with its own key. Both keys were used to enumerate S3 buckets, and the new user accessed the AWS console.

  4. 4

    EC2 launches span five regions

    Launches began about 31 minutes later

    Resource limits stopped some attempts. The intruder launched 13 EC2 instances for cryptomining in five regions.

Impact

The intruder launched 13 Amazon EC2 instances across five regions for cryptomining.

Could this have been prevented?

Block the second key and revoke the first

If your users and workloads can use temporary credentials, an AWS Organizations service control policy can block new IAM user keys in covered member accounts. It would refuse the second key there. The exposed key still needed to be deactivated.

Incident control assessments

1
Prevented
2
Contained
1
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.

Internet
AWS APIAccess key
GitLab server
Customer AWS account
Application data
S3 buckets
IAM users
EC2 instances

The GitLab and AWS cryptomining intrusion / Permiso published its investigation in June 2022.

1 · A GitLab flaw exposes an AWS key

1 Not covered

2 · The original key lists buckets

1 Contained

3 · IAM issues a second key

1 Prevented

4 · EC2 launches span five regions

1 Contained

Key facts

  • The first recorded AWS request listed S3 buckets from a public address in Indonesia.
  • The intruder used both the original key and a newly issued key to enumerate S3 buckets.
  • Resource limits stopped some EC2 launches. Thirteen instances launched across five regions.

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.
    Anatomy of an Attack: Exposed keys to Crypto MiningPermiso · Jun 20, 2022 · ResearchGitLab compromise, bucket listing, new identity, regional compute use and elapsed time
  2. 2.
    Action needed by self-managed customers in response to CVE-2021-22205GitLab · Nov 4, 2021 · AdvisoryGitLab security updates and advice to self-managed operators

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