S3 bucket compromise detected

Provider: AwsService: S3Severity: Critical

Description

The listed S3 bucket has a high chance of being compromised based on recent activities in AWS GuardDuty and the present S3 bucket configuration. The threat rule checks for a combination of at least one GuardDuty S3 bucket finding for unauthorized access and data exfiltration/manipulation with at least two or more native findings for the present S3 configuration that relate to network access, logging, versioning, bucket policy and encryption. Native S3 findings are based on the best practices established by current compliance frameworks, so correlating them with GuardDuty findings means the given activity has a high chance to be a malicious and needs a proper investigation.

Suggested Action

Secure and examine the resource in question to see if it is behaving in an expected manner. If the activity is expected, you can suppress the finding to prevent false positives on this resource. If the activity is unexpected, you should assume the resource is compromised and act accordingly per the remediation steps.

Remediation Steps

Follow these instructions to ensure future activity is appropriately monitored on your S3 buckets:

  1. Identify and audit all your Amazon S3 buckets.
  2. Implement monitoring using AWS monitoring tools.
  3. Enable Amazon S3 server access logging.
  4. Use AWS CloudTrail.

Follow these instructions to determine if the S3 bucket activity is malicious:

  1. Identify the affected S3 resource. A GuardDuty finding for S3 lists an S3 bucket, the bucket's Amazon Resource number (ARN) and a bucket owner in the finding details.
  2. Identify the source of the suspicious activity and the API call used. The API call used is listed as an API in the finding details. The source should be an IAM principal (either an IAM user, role, or account) with identifying details listed in the finding. Depending on the source type, Remote IP or source domain info will be available and can help you evaluate whether the source was authorized. If the finding involved credentials from an EC2 instance the details for that resource are also included.
  3. Determine whether the call source was authorized to access the identified resource. Contact the user of the credentials to determine if the activity was intentional.

If the access was authorized, you can ignore the finding. If you determine that your S3 data has been exposed or accessed by an unauthorized party review the following S3 security recommendations to tighten permissions and restrict access. Appropriate remediation solutions depend on the needs of your specific environment.

Compliance Controls

FrameworkControl #Control description
MITRE ATT&CK CloudCollection-T1530Adversaries may access data objects from improperly secured cloud storage. Many cloud service providers offer solutions for online data storage such as Amazon S3, Azure Storage, and Google Cloud Storage. These solutions differ from other storage solutions (such as SQL or Elasticsearch) in that there is no overarching application. Data from these solutions can be retrieved directly using the cloud provider's APIs. Solution providers typically offer security guides to help end users configure systems. Misconfiguration by end users is a common problem. There have been numerous incidents where cloud storage has been improperly secured (typically by unintentionally allowing public access by unauthenticated users or overly-broad access by all users), allowing open access to credit cards, personally identifiable information, medical records, and other sensitive information. Adversaries may also obtain leaked credentials in source repositories, logs, or other means as a way to gain access to cloud storage objects that have access permission controls.
MITRE ATT&CK CloudCollection-T1530Adversaries may access data objects from improperly secured cloud storage. Many cloud service providers offer solutions for online data storage such as Amazon S3, Azure Storage, and Google Cloud Storage. These solutions differ from other storage solutions (such as SQL or Elasticsearch) in that there is no overarching application. Data from these solutions can be retrieved directly using the cloud provider's APIs. Solution providers typically offer security guides to help end users configure systems. Misconfiguration by end users is a common problem. There have been numerous incidents where cloud storage has been improperly secured (typically by unintentionally allowing public access by unauthenticated users or overly-broad access by all users), allowing open access to credit cards, personally identifiable information, medical records, and other sensitive information. Adversaries may also obtain leaked credentials in source repositories, logs, or other means as a way to gain access to cloud storage objects that have access permission controls.
MITRE ATT&CK CloudExfiltration-T1537Adversaries may exfiltrate data by transferring the data, including backups of cloud environments, to another cloud account they control on the same service to avoid typical file transfers/downloads and network-based exfiltration detection. A defender who is monitoring for large transfers to outside the cloud environment through normal file transfers or over command and control channels may not be watching for data transfers to another account within the same cloud provider. Such transfers may utilize existing cloud provider APIs and the internal address space of the cloud provider to blend into normal traffic or avoid data transfers over external network interfaces. Incidents have been observed where adversaries have created backups of cloud instances and transferred them to separate accounts.
MITRE ATT&CK CloudExfiltration-T1537Adversaries may exfiltrate data by transferring the data, including backups of cloud environments, to another cloud account they control on the same service to avoid typical file transfers/downloads and network-based exfiltration detection. A defender who is monitoring for large transfers to outside the cloud environment through normal file transfers or over command and control channels may not be watching for data transfers to another account within the same cloud provider. Such transfers may utilize existing cloud provider APIs and the internal address space of the cloud provider to blend into normal traffic or avoid data transfers over external network interfaces. Incidents have been observed where adversaries have created backups of cloud instances and transferred them to separate accounts.

References

Check out these link for more information about remediating security issues discovered by GuardDuty