MLA-C01 Practice Question 39: Least Privilege Invoke Endpoint
AWS Certified Machine Learning Engineer – Associate (MLA-C01) · Test 4 · question 9 of 10
A web application running on Amazon ECS needs to call a single SageMaker AI real-time endpoint named churn-prod. The account hosts a dozen other endpoints, some of which serve confidential models. A security review requires that the application be able to get predictions from churn-prod and do nothing else in SageMaker AI.
How should the engineer grant this access?
Show answer and explanation
Answer:
Least privilege means granting exactly one action on exactly one resource. InvokeEndpoint supports resource-level permissions, so an identity-based policy on the ECS task role can name the churn-prod endpoint's ARN in its Resource element. The application can then call that endpoint and nothing else (option A).
- B is wrong on two counts. The read-only managed policy grants describe and list access across SageMaker AI that the application does not need, and allowing InvokeEndpoint on all resources lets it query the confidential models. - C is wrong because SageMaker AI does not support resource-based policies. Permissions for SageMaker AI resources are granted through identity-based policies attached to the calling principal. - D is wrong because that ARN pattern matches every endpoint in every Region of the account, including the confidential ones. It is a wildcard dressed up as a scoped policy.
Reference: How Amazon SageMaker AI works with IAM