Lesson 2 of 5 Securing ML and AI Workloads

Restricting Access to ML Artifacts

This lesson explains how datasets, features, model files, images, prompts, vector indexes and evaluation results are made readable and writable only by the identities that need them.

Learning outcomes

After completing this lesson, you will be able to:

  • Restrict S3 data and model artefacts by prefix.
  • Separate registry, feature store and image permissions.
  • Scale access with ABAC.

Data and model artefacts in S3

Organize buckets and prefixes by team, project and stage (raw, curated, models), then grant each role access only to its prefixes with IAM policies and bucket policies. Use SSE-KMS with customer managed keys whose key policies allow only the needed roles to decrypt; this adds a second, independent control, because a role needs both S3 and KMS permissions. Bucket policies can require encryption, deny non-TLS requests (aws:SecureTransport) and restrict access to specific VPC endpoints. S3 Block Public Access should be on everywhere.

The following diagram shows which role may perform each action in the SageMaker Model Registry, so that no single person can deploy a model alone.

Separation of duties in the Model Registry. Only the pipeline's execution role may create model package versions, and only the model-risk reviewer role may change their approval status. Data scientists can view packages and metrics but are denied both actions, so no single person can deploy an untested model.
The scenario is illustrative.
Scenario questions

Lock down the artefacts

Exam skills 4.3.2

Choose the control that limits access to ML artefacts.

Log in to try this activity Interactive activities are free with an account.

Registries, feature stores and images

Restrict Model Registry actions so only the MLOps pipeline role can register versions and only approvers can change approval status (sagemaker:UpdateModelPackage). Limit Feature Store read and write per feature group. ECR repository policies control who can push and pull images. For generative AI, restrict who can edit prompts in Prompt Management, update knowledge bases or guardrails, and read invocation logs, which may contain sensitive prompts.

Attribute-based access

As the number of projects grows, attribute-based access control (ABAC) with tags scales better than one policy per resource. Resources and roles are tagged with a project, and policies allow actions when aws:ResourceTag/project equals aws:PrincipalTag/project. SageMaker AI supports tag-based conditions on many resources, and requiring tags on creation (aws:RequestTag) keeps the scheme consistent. The following table summarises the controls.

ArtifactControls
Training data, models in S3Prefix-scoped IAM, bucket policies, SSE-KMS key policies
Model RegistryRestrict register and approval actions to specific roles
Feature groupsPer-feature-group read and write permissions
Container imagesECR repository policies, image scanning
Prompts, guardrails, knowledge basesRestrict edit permissions; review changes
Many projectsABAC with resource and principal tags
True or false

Attribute-based access

Exam skills 4.3.2 · 4.3.3

Check how attribute-based access control (ABAC) works for ML resources.

Log in to try this activity Interactive activities are free with an account.
Worked example

Separating approval from training

An auditor finds that data scientists can both register models and approve them, so a single person could deploy an untested model.

  • Allow sagemaker:CreateModelPackage only to the pipeline's execution role.
  • Allow sagemaker:UpdateModelPackage (approval status) only to a model-risk reviewer role.
  • Deny both actions to data scientist roles, who can still view packages and metrics.

This separation of duties ensures every production model passes through the pipeline and an independent review.

Check yourself

Why separate who registers models from who approves them?

Show answer

So no single person can both create and release a model, which adds an independent check.

Exam Tips

Remember for the exam

  • Scope S3 access by prefix and add KMS key policies as a second control.
  • Separate who registers models from who approves them.
  • ECR repository policies control image push and pull.
  • Scale access control with tags (ABAC).
  • Treat prompts, guardrails and invocation logs as sensitive artefacts.