Back to Checks
aws

SageMaker notebook instance is encrypted with a KMS key

sagemaker_notebook_instance_encryption_enabled
Service: sagemakerSeverity: high
OfficialBuilt-inVerified
Categories:encryptiongen-ai
Resource Type:AwsSageMakerNotebookInstance

Amazon SageMaker notebook instances are assessed for at-rest encryption using an AWS KMS key. The finding reflects whether a KmsKeyId is configured for the notebook's ML volume encryption.

Risk

Without at-rest encryption using a customer-managed KMS key, data on notebook EBS volumes and snapshots can be exposed via storage access, copied backups, or host compromise, reducing confidentiality and limiting key rotation and revocation controls.

Run this check with Prowler

Run in Prowler Cloud
Run
prowler aws --checks sagemaker_notebook_instance_encryption_enabled

Recommendation

Use a customer-managed KMS key for notebook ML volumes by setting KmsKeyId, and apply KMS to related S3 inputs/outputs. Enforce least privilege on key usage, enable rotation, and align key access with defense in depth to protect data at rest.

Remediation

Terraform

# SageMaker notebook with KMS encryption
resource "aws_sagemaker_notebook_instance" "<example_resource_name>" {
  name          = "<example_resource_name>"
  role_arn      = "<example_resource_arn>"
  instance_type = "ml.t3.medium"
  kms_key_id    = "<example_resource_id>"  # Critical: enables EBS encryption using this KMS key
}

NativeIaC

# CloudFormation: SageMaker notebook with KMS encryption
Resources:
  <example_resource_name>:
    Type: AWS::SageMaker::NotebookInstance
    Properties:
      InstanceType: ml.t3.medium
      RoleArn: <example_resource_arn>
      KmsKeyId: <example_resource_id>  # Critical: encrypts the notebook's EBS volume with the specified KMS key

Other

1Open the AWS Console > Amazon SageMaker > Notebook instances
2Select the failing notebook instance and click Stop
3Click Create notebook instance
4Enter name, choose instance type and IAM role
5In Encryption key, select your KMS key
6Create the instance and verify it starts
7Migrate notebooks/data as needed (e.g., via S3)
8Delete the old unencrypted notebook instance

Check Code

from prowler.lib.check.models import Check, Check_Report_AWS
from prowler.providers.aws.services.sagemaker.sagemaker_client import sagemaker_client


class sagemaker_notebook_instance_encryption_enabled(Check):
    def execute(self):
        findings = []
        for notebook_instance in sagemaker_client.sagemaker_notebook_instances:
            report = Check_Report_AWS(
                metadata=self.metadata(), resource=notebook_instance
            )
            report.status = "PASS"
            report.status_extended = f"Sagemaker notebook instance {notebook_instance.name} has data encryption enabled."
            if not notebook_instance.kms_key_id:
                report.status = "FAIL"
                report.status_extended = f"Sagemaker notebook instance {notebook_instance.name} has data encryption disabled."

            findings.append(report)

        return findings