More Info:
Sagemaker Notebook Instance should be encrypted with KMS Customer Managed KeysRisk Level
HighAddress
SecurityCompliance Standards
- APRA CPS 234 (Australia)
- BSI C5 (Germany)
- Brazil LGPD
- CCPA / CPRA (California)
- CIS Critical Security Controls v8
- CMMC 2.0
- CSA Cloud Controls Matrix v4
- DPDPA
- Digital Operational Resilience Act (EU)
- ISO 27001
- ISO/IEC 27018
- ISO/IEC 27701
- MAS Technology Risk Management (Singapore)
- MITRE ATT&CK (Cloud)
- NIST SP 800-171
- NYDFS 23 NYCRR 500
- SOC2
- SWIFT Customer Security Controls Framework
- Sarbanes-Oxley IT General Controls
- UK NCSC Cyber Assessment Framework
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
To remediate this in the AWS Management Console, you’ll usually need to create a new notebook instance that uses a customer-managed KMS key (CMK); the KMS key cannot be changed on an existing instance.
1. Create or Identify a Customer-Managed KMS Key
- Sign in to the AWS Management Console.
- Go to Key Management Service (KMS).
- In the left pane, choose Customer managed keys.
- Choose Create key (if you don’t already have a CMK you want to use):
- Key type: Symmetric.
- Key usage: Encrypt and decrypt.
- Configure Key administrators and Key users (include IAM roles/users used by SageMaker).
- Finish the wizard and note the Key ID or ARN.
2. Capture Configuration of Existing Notebook (for recreation)
- Go to Amazon SageMaker in the console.
- In the left pane, choose Notebook instances.
- Click your existing notebook instance.
- Note:
- Instance type
- VPC / subnets / security groups (if used)
- IAM role
- Lifecycle configuration (if any)
- Volume size
- Any other relevant settings.
3. Create a New Notebook Instance Encrypted with CMK
- In SageMaker Console → Notebook instances → click Create notebook instance.
- Set:
- Notebook instance name: A new name (or plan to rename later).
- Notebook instance type: Same as old (or as desired).
- IAM role: Same role as the old notebook (if appropriate).
- VPC, subnets, security groups: Match the previous configuration if used.
- Volume size in GB: Same or larger.
- Under Encryption key – optional:
- Choose Enter a KMS key ID or choose from your AWS KMS keys.
- Select the customer-managed KMS key created/identified in step 1.
- Configure Lifecycle configuration if needed.
- Click Create notebook instance and wait for the status to become InService.
4. Migrate Data (If Needed)
- Open the old notebook instance and ensure any notebooks/data are copied to S3 (or another storage), if you haven’t already.
- Open the new KMS-encrypted notebook.
- Pull your data back from S3 (or other backup location) into the new instance as required.
5. Decommission the Unencrypted Notebook
- In SageMaker Console → Notebook instances.
- Select the old notebook instance.
- Click Stop and wait until it is stopped.
- Once confirmed that all needed data has been migrated, select the old instance and choose Delete.
Using CLI
Using CLI
Below are step‑by‑step AWS CLI instructions to ensure a SageMaker notebook instance is encrypted with a customer-managed KMS key (CMK).Important limitation:
You cannot modify the KMS key of an existing SageMaker notebook instance. You must create a new notebook instance with a CMK and migrate any data.
Get the KeyId or ARN from the output, or list keys:Describe the key to confirm:You’ll use
Apply via:
Wait until status is Then delete:
(Adjust
You should see the CMK ARN/ID you provided.
These steps ensure the SageMaker notebook instance’s EBS volume is encrypted with your KMS customer-managed key using AWS CLI.
You cannot modify the KMS key of an existing SageMaker notebook instance. You must create a new notebook instance with a CMK and migrate any data.
1. Create (or identify) a KMS Customer Managed Key
If you already have a CMK you want to use, skip to step 2.<KEY_ARN> or <KEY_ID> in --kms-key-id later.2. (Optional but recommended) Update the CMK key policy for SageMaker use
Give SageMaker (and your users/roles) permission to use the key. Example key policy snippet (you’d merge this into your CMK’s key policy):3. Stop and delete the existing unencrypted notebook instance
First, stop it:Stopped:Ensure any notebooks are saved to S3 or source control; the EBS volume will be lost.
4. Create a new SageMaker notebook instance encrypted with CMK
--instance-type, --volume-size-in-gb, and add any other options you used previously, such as --security-group-ids, --subnet-id, --tags, --lifecycle-config-name, etc.)Start the notebook:5. Verify the notebook is using the CMK
6. Migrate notebooks/data (if needed)
If you had notebook files in the old instance:- If they were in S3: point your new notebook to the same S3 buckets.
- If they were only on the old EBS volume and you didn’t back them up, they are not recoverable after deletion.
For future, use:- Git integration (from the notebook UI) or
- Sync to S3 (e.g.,
aws s3 syncfrom a terminal in the notebook).
These steps ensure the SageMaker notebook instance’s EBS volume is encrypted with your KMS customer-managed key using AWS CLI.
Using Python
Using Python
Below are practical, step‑by‑step instructions and Python (boto3) snippets to ensure a SageMaker notebook instance is encrypted with a customer managed KMS key.
You can later refer to this key via either
If
Then start it:
If you share:
Key points up front
- The
KmsKeyIdof a SageMaker notebook instance cannot be changed in place. - To remediate:
- Create or identify a KMS CMK.
- Create a new notebook instance with
KmsKeyIdspecified. - Migrate any data from the old instance (S3, Git, or manual copy) and then delete the old one.
1. Prerequisites
2. Create or identify a customer managed KMS key
If you already have a CMK, skip to step 3.cmk_id or alias/sagemaker-notebook-cmk.3. Verify existing notebook’s encryption (to identify non‑compliant ones)
KmsKeyId is missing or using the default AWS managed key (rather than your CMK), it’s non‑compliant.4. Create a new encrypted notebook instance with KMS CMK
You must specifyKmsKeyId at creation time:5. Migrate content from old notebook to new
Common approaches (not strictly Python, but required for remediation):- If work is in S3 (recommended):
- Configure the old notebook to save notebooks and data to S3.
- In the new notebook, open from the same S3 location.
- Git-based projects:
- Commit/push from the old notebook.
- Clone/pull in the new notebook.
- Direct copy (manual):
- From the old notebook UI, download
.ipynband data. - Upload to the new notebook.
- From the old notebook UI, download
6. Stop and delete the old, unencrypted notebook
7. (Optional) Enforce CMK encryption for all future notebooks
You can run a simple Python check and auto‑remediate by creating compliant replacements for non‑compliant notebooks:If you share:
- how your notebooks are currently storing data (S3 path, EBS only, or Git), and
- whether you need an automated remediation script or a one-time migration,

