> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/aws-s3-bucket-is-utilized-for-aws-sagemaker-training-job-data.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# AWS S3 bucket is utilized for AWS Sagemaker training job data

### Synopsis

| Field               | Value                                                         |
| ------------------- | ------------------------------------------------------------- |
| Rule Type           | Detection                                                     |
| Finding Type        | AWS S3 bucket is utilized for AWS Sagemaker training job data |
| Finding ID          | 60000927                                                      |
| Generates a Finding | This detection rule also generates a finding                  |
| Severity            | Medium                                                        |
| Category            | CONFIGURATION                                                 |
| Cloud Providers     | AWS                                                           |
| Platform Module     | CSPM                                                          |
| Asset Types         | S3\_BUCKET                                                    |
| ATT\&CK Tactic      | TA0112 (TA0112)                                               |
| ATT\&CK Technique   | T1685 (T1685)                                                 |

### Description

Improperly configured AWS S3 buckets storing AWS SageMaker training data expose sensitive information to unauthorized access. These buckets often contain large datasets crucial for model training, making them prime targets for data breaches.

AWS SageMaker uses S3 buckets to store training data. Misconfiguration, such as overly permissive access controls, or a lack of encryption, allows attackers to download, modify, or delete training data. Untrusted IPs accessing these buckets could exfiltrate sensitive information or disrupt the training process.

Data breaches resulting from this misconfiguration can lead to significant financial losses, reputational damage, and regulatory penalties. Implementing strong access controls and encryption protects sensitive training data, ensuring only authorized users and services can access it, thus mitigating data loss and security breaches.

Mitigate this risk by restricting access to only necessary users and services using IAM roles and policies. Enable server-side encryption (SSE-S3 or SSE-KMS) to protect data at rest. Regularly review and audit bucket permissions to identify and remediate any unnecessary or overly permissive access controls.

### Remediation

**Manual steps:**

S3 Bucket - This finding identifies an AWS S3 bucket used to store training data for an AWS Sagemaker training job. Improperly configured S3 buckets can lead to unauthorized access, data breaches, and potential loss of sensitive information. This remediation plan focuses on enhancing the security of the identified S3 bucket to protect the training data:

1. **Implement Strict Access Controls:**

   **Restrict Access:** Configure bucket policies and access control lists (ACLs) to limit access to the S3 bucket to only authorized users and services. This can be achieved by granting specific permissions to individual users or groups, or by using IAM roles to provide temporary access to specific resources.

   **Principle of Least Privilege:** Grant only the minimum permissions required for each user or service to access the S3 bucket. Avoid granting broad permissions like 's3:GetObject\*' or 's3:PutObject\*' unless absolutely necessary.
2. **Enable Encryption:**

   **Server-Side Encryption (SSE):** Configure the S3 bucket to use server-side encryption (SSE) to encrypt data at rest. Choose between AWS KMS-managed keys or S3-managed keys based on your security requirements.

   **Client-Side Encryption:** Consider using client-side encryption to encrypt data before uploading it to the S3 bucket. This provides an additional layer of security, especially if the data is sensitive.
3. **Audit Permissions:**

   **CloudTrail:** Enable CloudTrail logging to track all API calls made to the S3 bucket. This allows you to monitor access patterns and identify any suspicious activity.

   **CloudWatch:** Configure CloudWatch alarms to alert you if there are any unusual access patterns or security events related to the S3 bucket.
4. **Review and Update Policies:**

**Regularly review and update bucket policies and ACLs:** Ensure that the access controls are still appropriate and that no unnecessary permissions are granted.

**Use AWS Config:** Configure AWS Config rules to monitor the S3 bucket configuration and alert you if any changes are made that violate your security policies.

**Note:** Carefully review and test these steps before implementing them in your production environment. Incorrect configuration can lead to unintended consequences and data loss. Refer to the AWS documentation for detailed instructions and best practices: <https://docs.aws.amazon.com/AmazonS3/latest/userguide/security-best-practices.html>

**CLI code:**

S3 Bucket - This command sets the access control list (ACL) of the S3 bucket to private, restricting access to only the bucket owner. This helps prevent unauthorized access to the training data stored in the bucket:

```bash
aws s3api put-bucket-acl --bucket ${entity} --acl private --region ${entity}
```

**Terraform code:**

S3 Bucket - This Terraform code will remediate the policy violation "AWS S3 bucket is utilized for AWS Sagemaker training job data":

```hcl
resource "aws_s3_bucket" "sagemaker_training_data_bucket" {
  bucket = "sagemaker-training-data-bucket"

  # Configure server-side encryption using AWS KMS
  server_side_encryption_configuration {
    rule {
      apply_server_side_encryption_by_default {
        sse_algorithm     = "aws:kms"
        kms_master_key_id = aws_kms_key.sagemaker_training_data_bucket_kms_key.arn
      }
    }
  }

  # Configure bucket policy to restrict access to only the Sagemaker training job role
  policy = jsonencode({
    "Version": "2012-10-17",
    "Statement": [
      {
        "Sid": "AllowSagemakerTrainingJobAccess",
        "Effect": "Allow",
        "Principal": {
          "AWS": aws_iam_role.sagemaker_training_job_role.arn
        },
        "Action": [
          "s3:GetObject",
          "s3:PutObject",
          "s3:DeleteObject",
          "s3:ListBucket"
        ],
        "Resource": [
          "arn:aws:s3:::${entity}",
          "arn:aws:s3:::${entity}/*"
        ]
      }
    ]
  })
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/aws-s3-bucket-is-utilized-for-aws-sagemaker-training-job-data.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
