aws-sagemaker-pass-role-create-notebook

iam:PassRole to sagemaker.amazonaws.com for notebook instance creation.

explicit aws emits CanPassIdentity

match (effective permission)

{ "action": "iam:PassRole", "resource_type": "AWS::IAM::Role" }

where

principal has sagemaker:CreateNotebookInstance iam:PassedToService condition (if present) includes sagemaker.amazonaws.com target role trust policy allows sagemaker.amazonaws.com

emit

source typeIdentity
target typeMachineIdentity
source<principal>
target<IAM Role passable to sagemaker.amazonaws.com>
permissionsiam:PassRole sagemaker:CreateNotebookInstance
conditionsiam_permission condition_expression role_compatibility

Narrative

{principal.name} can pass {role.name} to a new SageMaker notebook instance (iam:PassRole + sagemaker:CreateNotebookInstance), causing the notebook to run as that role.

Raw rule rules/explicit/aws/sagemaker.yaml

id: aws-sagemaker-pass-role-create-notebook
emits: CanPassIdentity
description: iam:PassRole to sagemaker.amazonaws.com for notebook instance creation.
match_effective_permission:
  action: iam:PassRole
  resource_type: AWS::IAM::Role
where:
- principal has sagemaker:CreateNotebookInstance
- iam:PassedToService condition (if present) includes sagemaker.amazonaws.com
- target role trust policy allows sagemaker.amazonaws.com
emit:
  source_type: Identity
  target_type: MachineIdentity
  source: <principal>
  target: <IAM Role passable to sagemaker.amazonaws.com>
  permissions:
  - iam:PassRole
  - sagemaker:CreateNotebookInstance
  conditions:
  - iam_permission
  - condition_expression
  - role_compatibility
  false_positive_note: "iam:PassRole scoped by iam:PassedToService: a role passable only to ec2.amazonaws.com\
    \ or lambda.amazonaws.com does NOT yield a SageMaker notebook execution role. Honor the condition.\
    \ If the role trust policy does not include sagemaker.amazonaws.com, CreateNotebookInstance fails\
    \ at the API level \u2014 downgrade to POTENTIAL(role_compatibility). Applies to UpdateNotebookInstance\
    \ (role swap on existing notebook) with the same PassRole semantics."
  narrative: '{principal.name} can pass {role.name} to a new SageMaker notebook instance (iam:PassRole
    + sagemaker:CreateNotebookInstance), causing the notebook to run as that role.'
move · open · esc close