More Info:
SageMaker Notebook Instance is missing active execution rolesRisk 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/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 “SageMaker Notebook Instance Missing Active Execution Roles” using the AWS Management Console, you either attach an existing IAM role or create/attach a new one.
After these steps, the notebook instance will have an active execution role, resolving the “Missing Active Execution Roles” misconfiguration.
1. Identify the affected Notebook Instance
- Sign in to the AWS Management Console.
- Go to Amazon SageMaker.
- In the left pane, select Notebook instances.
- Find the notebook instance that has the missing execution role issue.
2. Check if a role is currently associated
- Click the name of the notebook instance.
- In the Details section, look for IAM role:
- If it says “None” or the role is not valid, you must assign a new/existing role.
Note: If the notebook is InService, you must stop it before changing the role.
3. Stop the notebook instance (if running)
- On the notebook instance details page, choose Stop.
- Wait until the Status changes to Stopped.
4A. Option 1 – Attach an existing IAM role
Use this if you already have a valid SageMaker execution role.- In the notebook instance details page, choose Edit (or Edit notebook instance).
- Under Permissions and encryption (or IAM role section):
- For IAM role, select Use an existing role.
- From the dropdown, choose a valid SageMaker execution role (for example,
AmazonSageMaker-ExecutionRole-...).
- Choose Save changes (or Update notebook instance).
- After the update is complete, choose Start to restart the notebook instance.
4B. Option 2 – Create a new IAM execution role and attach it
Use this if no suitable role exists.- In the same Edit notebook instance screen:
- For IAM role, select Create a new role.
- A dialog appears:
- For S3 buckets you specify:
- Choose Any S3 bucket (broad access) or
- Specific S3 buckets (more secure), and list the bucket(s) you need.
- Click Create role.
- For S3 buckets you specify:
- SageMaker will create an IAM role (e.g.,
AmazonSageMaker-ExecutionRole-YYYYMMDDTHHMMSS). - Ensure that role is selected in the IAM role dropdown.
- Choose Save changes (or Update notebook instance).
- After the update, choose Start to restart the notebook instance.
5. (Optional) Refine the IAM role permissions
If you need to further restrict permissions:- In the AWS console, go to IAM > Roles.
- Search for and select the role attached to the notebook instance.
- Under Permissions, adjust the attached policies:
- Ensure at minimum a SageMaker execution policy (e.g.,
AmazonSageMakerFullAccessor a custom, least-privilege policy for your use case). - Ensure required S3, CloudWatch Logs, and other service permissions as needed.
- Ensure at minimum a SageMaker execution policy (e.g.,
After these steps, the notebook instance will have an active execution role, resolving the “Missing Active Execution Roles” misconfiguration.
Using CLI
Using CLI
To remediate “SageMaker Notebook Instance Missing Active Execution Roles” using AWS CLI, you need to (1) ensure a valid IAM role exists, (2) attach appropriate policies, and (3) associate the role with the notebook instance.Below is a concise step‑by‑step:
Pick the Check the
Save as Note the returned
Common additions (optional; tighten as needed):(Prefer custom least‑privilege policies in production.)
Wait until it’s Repeat until it returns
Optionally verify:You should see
This clears the “missing active execution role” issue: the notebook is now in service and bound to a valid, policy‑backed IAM execution role.
1. Identify the Notebook Instance and Its Role
NotebookInstanceName you care about, then:RoleArn field:- If it’s missing or empty → you must create and attach a role.
- If present but the role is deleted/disabled/misconfigured → fix that role or create a new one, then reattach.
2. Create an IAM Role for SageMaker (if you don’t have one)
2.1 Create the trust policy JSON (trust-sagemaker.json)trust-sagemaker.json, then run:Arn, e.g. arn:aws:iam::<ACCOUNT_ID>:role/SageMakerExecutionRole.3. Attach Required Policies to the Role
Minimum: access to SageMaker and any data sources (S3, etc.). As a quick fix, you can attach AWS-managed policies (adjust to your security requirements later):4. Stop the Notebook Instance (required before updating role)
Stopped:"Stopped".5. Attach/Update the Execution Role on the Notebook
Use the role ARN from step 2:6. Restart the Notebook Instance
["InService", "arn:aws:iam::<ACCOUNT_ID>:role/SageMakerExecutionRole"].This clears the “missing active execution role” issue: the notebook is now in service and bound to a valid, policy‑backed IAM execution role.
Using Python
Using Python
Here’s how to remediate a SageMaker Notebook Instance with a missing or inactive execution role using Python (boto3).
If you already have a role you want to reuse, skip creation and just set
You can then loop over that list and apply the update steps from sections 2–4 to remediate each notebook.
1. Prerequisites
boto3installed and configured (aws configure)- Permissions to manage IAM roles and SageMaker:
iam:CreateRole,iam:AttachRolePolicysagemaker:UpdateNotebookInstance,sagemaker:StartNotebookInstance,sagemaker:DescribeNotebookInstance
2. Create (or Recreate) an Execution Role
Use an IAM role trusted by SageMaker with appropriate policies.role_arn to that role’s ARN.3. Update the Notebook Instance to Use the Role
You can change the execution role of an existing notebook instance viaUpdateNotebookInstance.
