STS
Last updated
Was this helpful?
Last updated
Was this helpful?
AWS Security Token Service (STS) is a web service that enables you to request temporary, limited-privilege credentials for AWS Identity and Access Management (IAM) users or for users that you authenticate (federated users).
STS integrates with pther AWS Services:
IAM: Works closely with IAM for role definitions and permissions.
Cognito: Can use STS for providing temporary credentials to mobile or web app users.
AWS Organizations: Can be used in conjunction with STS for cross-account access.
Key Features:
Temporary Credentials: STS issues short-term security credentials that are valid for a specified duration.
Limited Privileges: These credentials can have restricted permissions compared to the original IAM user.
No Long-term Secrets: Since credentials are temporary, there's no need to rotate or revoke long-term security credentials.
Use Cases:
Federation: Integrate with external identity providers (e.g., Active Directory, Facebook).
Cross-Account Access: Allow users from one AWS account to access resources in another.
Enhanced Security: Implement the principle of least privilege by providing temporary, limited-scope credentials.
Core API Calls:
AssumeRole: Obtain temporary credentials for cross-account access or enhanced security.
AssumeRoleWithWebIdentity: Used for web identity federation (e.g., login with Google, Facebook).
AssumeRoleWithSAML: Used for SAML-based federation (e.g., Active Directory).
GetSessionToken: Obtain temporary credentials for an IAM user or AWS account root user.
Components:
IAM Roles: Define the permissions that STS will use to generate temporary credentials.
Trust Relationships: Specify who can assume a role (e.g., IAM users, external accounts, services).
Temporary Security Credentials: Consist of an access key ID, a secret access key, and a security token.
Security Best Practices:
Use STS instead of creating IAM users with long-term credentials.
Implement the principle of least privilege when defining permissions for roles.
Set appropriate expiration periods for temporary credentials.