概念
Credential types for Bedrock
Production uses IAM roles. A Bedrock API key is a bearer token: short-term for tools, long-term for trying things out.
このレッスンはまだ翻訳されていないため、英語で表示しています。
IAM role
- Lifetime
- Temporary, auto-renewed
- Use
- Production
Short-term API key
- Lifetime
- Up to 12 hours
- Use
- Short sessions and tools
Long-term API key
- Lifetime
- Until your expiry date
- Use
- Exploration only
| Credential | Lifetime | Use |
|---|---|---|
| IAM role | Temporary, auto-renewed | Production |
| Short-term API key | Up to 12 hours | Short sessions and tools |
| Long-term API key | Until your expiry date | Exploration only |
概要
The default credential for production is an IAM role. Code on EC2, ECS, EKS or Lambda gets temporary credentials from the role automatically and signs requests with them (Signature Version 4). People sign in through IAM Identity Center or a federated identity and also get temporary credentials. Nothing secret sits in the code, and credentials expire on their own.
概要
Amazon Bedrock also accepts an API key, which is a bearer token sent in an Authorization header or in the AWS_BEARER_TOKEN_BEDROCK variable. It is simple, which helps for a quick test or a tool that cannot sign requests. A short-term key lasts up to 12 hours or until the session that made it ends, whichever is shorter, inherits the permissions of the identity that made it, and works only in the Region where it was created. AWS recommends it for production use, with a refresh before it expires. A long-term key creates an IAM user and lasts until the expiry date you set. AWS recommends long-term keys only for exploration.
概要
Control keys with IAM. iam:CreateServiceSpecificCredential decides who can make long-term keys, and the condition key iam:ServiceSpecificCredentialAgeDays caps their lifetime. bedrock:CallWithBearerToken decides who can use a key, and bedrock:bearerTokenType picks short-term or long-term. A Deny on CallWithBearerToken blocks keys entirely. For rotation, set an expiry and replace keys before they expire. If a long-term key leaks, deactivate, reset or delete it. A short-term key cannot be deactivated. Invalidate the session that made it, or deny bedrock:CallWithBearerToken.
概要
Store any key you must keep in AWS Secrets Manager, with scheduled rotation, and read it at run time. CloudTrail logs the API calls, but the key itself is not logged.
覚えること
- Production: IAM role with temporary credentials.
- Short-term API key: up to 12 hours, Region-bound, inherits the creator’s permissions.
- Long-term API key: an IAM user with an expiry date. Exploration only.
- Limit keys with iam:CreateServiceSpecificCredential and bedrock:CallWithBearerToken.
覚えること
- Rotate by expiry and replacement. Long-term leak: deactivate or reset. Short-term leak: end the session or deny CallWithBearerToken.
- Keep keys in Secrets Manager, not in code.
試験では
- “Application on Lambda calls Bedrock” points to the Lambda execution role, not an API key.
- “Developer tests a model quickly from a script” points to a short-term API key, or long-term with a short expiry.
- “Stop anyone using long-lived Bedrock keys” points to a policy that limits or denies key creation and use.
- “Key must be stored and rotated” points to AWS Secrets Manager.
混同しやすいもの
- Bedrock access controlIAM decides which models and profiles a caller may invoke. SCPs and a guardrail condition enforce the rules for everyone.
- 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.
- Encryption and data protection for MLEncrypt data at rest with KMS in each place ML touches it, encrypt traffic in transit, and keep secrets out of code.
このタスクの内容 · 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