Skip to main content
emnode / learn
Compliance Medium severity

AWS Security Hub · SageMaker

SageMaker.8: Notebook instances should run supported platforms

Written and reviewed by Emnode · Last reviewed

What does AWS Security Hub SageMaker.8 check?

SageMaker.8 fails when a notebook instance is pinned to an unsupported `PlatformIdentifier` — for example the original Amazon Linux 1 platform — rather than a current one such as `notebook-al2-v3`.

Why does SageMaker.8 matter?

A managed notebook only changes platform when a human deletes and recreates it, so an instance born years ago keeps running an unpatched, end-of-support OS indefinitely. That notebook still carries an IAM role and data access, making it an unpatched box sitting inside your account — not just a cost line, but a real exposure.

How do I fix SageMaker.8?

  1. List notebook instances and check `PlatformIdentifier` against the supported platforms.
  2. Snapshot or commit the user's work, since the platform cannot be upgraded in place.
  3. Stop, delete and recreate each instance on `notebook-al2-v3`, reattaching the same lifecycle config to preserve the environment.
  4. Tag instances and review platform versions on a cadence so retirements are caught early.

Remediation script · bash

# Disable root across every notebook that has it on (mutable on a stopped instance).
for n in $(aws sagemaker list-notebook-instances \
    --query 'NotebookInstances[].NotebookInstanceName' --output text); do
  root=$(aws sagemaker describe-notebook-instance --notebook-instance-name "$n" \
    --query 'RootAccess' --output text)
  if [ "$root" = "Enabled" ]; then
    aws sagemaker stop-notebook-instance --notebook-instance-name "$n"
    aws sagemaker wait notebook-instance-stopped --notebook-instance-name "$n"
    aws sagemaker update-notebook-instance --notebook-instance-name "$n" --root-access Disabled
    aws sagemaker start-notebook-instance --notebook-instance-name "$n"
    echo "$n: root access disabled"
  fi
done

# Immutable settings need a rebuild. Recreate a notebook locked down: private subnet,
# no direct internet. (DirectInternetAccess and SubnetId cannot be changed in place.)
aws sagemaker create-notebook-instance \
  --notebook-instance-name ml-feature-exploration \
  --instance-type ml.t3.medium \
  --role-arn arn:aws:iam::111122223333:role/SageMakerExecution \
  --subnet-id subnet-0ab12cd34ef56 \
  --security-group-ids sg-0aa11bb22cc33 \
  --direct-internet-access Disabled \
  --root-access Disabled

Full walkthrough (console steps, edge cases and verification) in the lesson Harden SageMaker and ML workloads.

Part of the learning path Lock down access