概念 · 基于 AIF-C01
Bedrock access control
IAM decides which models and profiles a caller may invoke. SCPs and a guardrail condition enforce the rules for everyone.
本课尚未翻译,暂以英文显示。
你在AI Practitioner中已学过
- IAM policies decide which Bedrock models an identity may call.
- Applications use IAM roles with temporary permissions, not keys in code.
- Least privilege: an app may invoke one named model and nothing else.
IAM policy
- Where
- Role or user
- Does
- Allows named models and profiles
SCP
- Where
- Organization
- Does
- Denies models or Regions for all accounts
GuardrailIdentifier condition
- Where
- IAM Deny
- Does
- Forces use of a guardrail
Service role trust policy
- Where
- Knowledge Base or agent
- Does
- Lets only Bedrock assume it
PrivateLink endpoint
- Where
- VPC
- Does
- Private path to Bedrock
| Control | Where | Does |
|---|---|---|
| IAM policy | Role or user | Allows named models and profiles |
| SCP | Organization | Denies models or Regions for all accounts |
| GuardrailIdentifier condition | IAM Deny | Forces use of a guardrail |
| Service role trust policy | Knowledge Base or agent | Lets only Bedrock assume it |
| PrivateLink endpoint | VPC | Private path to Bedrock |
1 / 2
IAM policy
- Where
- Role or user
- Does
- Allows named models and profiles
SCP
- Where
- Organization
- Does
- Denies models or Regions for all accounts
GuardrailIdentifier condition
- Where
- IAM Deny
- Does
- Forces use of a guardrail
| Control | Where | Does |
|---|---|---|
| IAM policy | Role or user | Allows named models and profiles |
| SCP | Organization | Denies models or Regions for all accounts |
| GuardrailIdentifier condition | IAM Deny | Forces use of a guardrail |
2 / 2
Service role trust policy
- Where
- Knowledge Base or agent
- Does
- Lets only Bedrock assume it
PrivateLink endpoint
- Where
- VPC
- Does
- Private path to Bedrock
| Control | Where | Does |
|---|---|---|
| Service role trust policy | Knowledge Base or agent | Lets only Bedrock assume it |
| PrivateLink endpoint | VPC | Private path to Bedrock |
是什么
bedrock:InvokeModel (and InvokeModelWithResponseStream) covers the Converse API too. The resource is a foundation model ARN, which has no account ID, or an inference profile ARN, which does. To allow a cross-Region inference profile, allow the profile and the foundation model in every Region it can route to. The console has no Model access page any more: serverless models are enabled by default, and you control use with IAM and service control policies (SCPs). Some third-party models are subscribed through AWS Marketplace on first call, so the caller needs Marketplace permissions. To block a model, deny bedrock:InvokeModel on it.
是什么
Service roles let Bedrock act for you. A Knowledge Base role trusts bedrock.amazonaws.com and may call the embedding model, read the S3 data source and write to the vector store. An agent role may invoke the model, query Knowledge Bases and run its action group Lambda functions. Add aws:SourceAccount and aws:SourceArn conditions to the trust policy so no other account can misuse the role.
是什么
To make every call use your guardrail, add a Deny with the condition key bedrock:GuardrailIdentifier: deny InvokeModel and Converse unless the request names that guardrail. Limits: input tags can skip the check on the prompt, and APIs that call the model for you, such as RetrieveAndGenerate and InvokeAgent, make internal calls without the guardrail, so they can fail under that role.
是什么
An SCP applies a rule across an organization, for example allowing only approved models and Regions. To enforce one guardrail across many accounts, use an Amazon Bedrock policy in AWS Organizations. An account-level setting does the same for one account. A VPC interface endpoint (AWS PrivateLink) for Bedrock keeps traffic off the internet, and an endpoint policy limits what passes through it.
要记住
- bedrock:InvokeModel covers Converse and streaming. Deny it to block a model.
- Enforce a guardrail with a Deny on bedrock:GuardrailIdentifier. For many accounts, use a Bedrock policy in Organizations.
考试中
- “Allow one team to invoke only Claude models” points to an IAM policy with those model ARNs as resources.
- “Block all unapproved models across every account” points to an SCP that denies bedrock:InvokeModel except for approved models.
- “Every request must use the company guardrail” points to a Deny with the bedrock:GuardrailIdentifier condition.
别和这些弄混
- IAM roles for SageMaker and ML workloadsTwo identities are involved: the person or app who calls the API, and the execution role SageMaker assumes. PassRole joins them.
- Credential types for BedrockProduction uses IAM roles. A Bedrock API key is a bearer token: short-term for tools, long-term for trying things out.
- Isolating ML systems with VPCsRun ML in private subnets, reach AWS services through endpoints, and turn on network isolation where code must not call out.
本任务内容 · 4.3
- Scanning code and images in CI/CD
- Least privilege for ML artifacts
- IAM roles for SageMaker and ML workloads
- Bedrock access control
- Credential types for Bedrock
- Auditing, logging and compliance for ML
- Troubleshooting ML security issues
- Isolating ML systems with VPCs
- Encryption and data protection for ML
- AI and ML security risks
Guardrails