AWS Security Token Service (AWS STS)
Cloud service · AWS · Updated

AWS Security Token Service (AWS STS)

In short

AWS Security Token Service (AWS 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).

Cloud Services Hub →

Free AWS Security Token Service (AWS STS) tools

6 key features of AWS Security Token Service (AWS STS)

AWS Security Token Service (AWS STS) features include the creation of temporary credentials, permission control through fine-grained access, integration with external identity providers for federated access, facilitation of cross-account access, support for multi-factor authentication, and operation as a globally available service.

01
Temporary Credentials

AWS Security Token Service allows the creation of temporary, short-term credentials that can be used to access AWS resources. These temporary credentials are a more secure alternative to using long-term access keys.

02
Permission Control

With AWS STS, you can define specific permissions for the temporary credentials, ensuring that applications and users have only the access they need, thus following the principle of least privilege.

03
Active Directory Integration

AWS STS supports federated identities, allowing users to authenticate with external identity providers (like Active Directory or LinkedIn) and then assume an IAM role with permissions for accessing AWS resources.

04
Cross-Account Access

It facilitates cross-account access, enabling the creation of trust relationships between AWS accounts or between an AWS account and an external identity provider. This simplifies managing permissions across AWS accounts.

05
Multi-Factor Authentication Support

AWS STS supports multi-factor authentication (MFA), adding an extra layer of security by requiring users to provide additional verification before being granted the temporary credentials.

06
Global Service

Session tokens from Regional AWS STS endpoints are valid in all Regions. Tokens from the global endpoint are valid only in Regions enabled by default unless that endpoint is configured to issue tokens valid in all Regions.

Where AWS Security Token Service (AWS STS) is used

AWS Security Token Service (AWS STS) use cases include providing temporary access to AWS resources, enabling secure cross-account access, facilitating federation with external identity systems, and enhancing security with support for Multi-factor Authentication (MFA).

  1. 01
    Temporary Access for Users

    AWS STS allows the creation of temporary security credentials for users who need to access AWS resources for a short-term project or task. This eliminates the need to manage long-term credentials for every user, enhancing security by automatically expiring credentials.

  2. 02
    Cross-account Access

    It enables secure delegation of access to resources across different AWS accounts without having to share long-term access keys. By using AWS STS, administrators can grant users from one AWS account permissions to access resources in another account in a secure and controlled manner.

  3. 03
    Federation with Identity Systems

    AWS STS facilitates federation with external identity systems such as Active Directory, SAML 2.0-compliant identity providers, or other OpenID Connect (OIDC) compliant providers, enabling users to sign in using their existing corporate credentials to access AWS resources.

  4. 04
    Multi-factor Authentication (MFA) for Enhanced Security

    AWS STS supports the use of Multi-factor Authentication (MFA), adding an additional layer of security. When temporary security credentials are requested, requiring MFA can significantly reduce the risk of unauthorized access.

How AWS Security Token Service (AWS STS) is priced

AWS STS is free for use, with no direct charges for the service itself, but costs may be incurred for requests over 100,000 per month outside of free tier regions and for using the temporary credentials with other AWS services.

AWS Security Token Service (AWS STS) Pricing

AWS Security Token Service (AWS STS) is essentially a free-to-use feature for AWS account holders. However, while there is no direct charge for using AWS STS, any requests made to AWS services using the temporary security credentials generated by AWS STS will incur standard AWS service fees according to the particular service’s pricing model.

Services AWS Security Token Service (AWS STS) works with

Amazon S3Amazon S3

Uses temporary security credentials from AWS STS to grant access to S3 buckets and objects securely.

Amazon EC2Amazon EC2

Allows EC2 instances to assume roles and gain temporary credentials to perform various tasks.

Amazon RDSAmazon RDS

Enables RDS instances or users to get temporary credentials for accessing databases securely.

Amazon DynamoDBAmazon DynamoDB

Grants temporary security credentials to interact with DynamoDB tables while adhering to the principle of least privilege.

AWS LambdaAWS Lambda

Lambda functions can assume roles and get temporary security credentials to access other AWS services.

AWS GlueAWS Glue

Provides temporary security credentials to access data stored in S3, DynamoDB, and other resources for ETL jobs.

What is AWS Security Token Service (AWS STS)

3 min read

AWS Security Token Service (AWS 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). Its primary function is to enhance the security posture of your AWS environment by enforcing the principle of least privilege, ensuring that entities within your environment have only the permissions they absolutely need to accomplish their tasks, and only for a limited period. This mitigates the risks associated with long-standing credentials which, if compromised, could lead to unauthorized access to your resources. 

AWS STS plays a crucial role in the management of temporary credentials. It allows the creation of unique, temporary credentials that can be assigned to users or systems, automatically expiring after a definable period. This effectively reduces the risk of credential leakage or misuse since these credentials, even if compromised, are only valid for a short duration. Additionally, AWS STS provides the ability to grant cross-account access without the need to share long-term credentials, but the assumed role must have a trust policy authorizing the caller. This facilitates secure collaboration between different business units or companies while maintaining tight control over resource access. 

For cross-account AssumeRole requests, only the calling account's STS quota is consumed; the target account's quota is not consumed.

One of the distinguished features of AWS STS is its integration with other AWS services and identity providers. It facilitates the federation of user identities by enabling users to sign in with their credentials from external identity providers like corporate directories, thus avoiding the need to create separate IAM users in AWS. This capability not only streamlines user access management but also leverages the security mechanisms of the external identity providers, such as multi-factor authentication. 

AWS STS supports several use cases, including granting access to AWS resources from applications running on EC2 instances, managing permissions for applications on mobile devices or IoT devices, and providing access to AWS resources for users from external systems. By granting temporary access, AWS STS ensures that the principle of least privilege can be applied more effectively and securely across these diversified environments. 

In operational terms, AWS STS is easy to implement through the AWS Management Console, the AWS Command Line Interface (CLI), or the AWS SDKs. It allows the generation of credentials dynamically, thereby enabling automation and integration into various application flows. The service itself is designed to be highly available and resilient, ensuring that the mechanism for generating and distributing temporary credentials does not become a bottleneck or single point of failure in your architecture. 

AWS recommends using Regional STS endpoints rather than the global (legacy) endpoint to reduce latency and build in redundancy.

For requests made using AWS credentials, the default STS request quota is 600 requests per second per account per Region, shared by AssumeRole, DecodeAuthorizationMessage, GetAccessKeyInfo, GetCallerIdentity, GetFederationToken, and GetSessionToken.

STS requests made by AWS service principals do not consume your accounts' STS requests-per-second quota.

In conclusion, AWS Security Token Service is a critical component of AWS's security and identity services, offering a robust mechanism for managing temporary credentials and enabling secure, efficient access management across AWS environments. Its capabilities support the core security principles of least privilege and defense in depth, making it an indispensable tool for architects and developers looking to design secure cloud-based solutions.

AWS architecture icons are the property of Amazon Web Services. BlowStack is not affiliated with or endorsed by AWS.