AWS EC2 security group events observed with a suspicious naming convention

Goal

Detect when an AWS security group has been modified by a long-term access key that has a suspicious group naming convention.

Strategy

Monitor CloudTrail and detect when an AWS security group has been created or modified with one of the following API calls:

Datadog’s security research team has observed security group naming conventions that include a common noun followed by a string of alphanumeric characters. The attack pattern can indicate that the long term access key used has been compromised, {{@userIdentity.accessKeyId}}.

Triage and response

  1. Determine who was the user who made this API call.
  2. Contact the user and confirm this was an API call that they made.
  3. If the API call was not made by the user:
    • Rotate the user credentials and investigate what other API calls were made.
    • Determine what other API calls made by that user were not actually initiated directly by that user.