Security Token Service
Q. What is AWS STS?
-
AWS Security Token Service(STS) is a web service that enables you to request temporary, limited-privilege credentials for following users
-
AWS Identity and Access Management (IAM) users
-
Federated users
-
Q. Is AWS STS global service?
-
YES, default it is a global service with a single endpoint at
https://sts.amazonaws.com
, However , we can also choose to make STS API calls to endpoints in any other supported regions (refer) to reduce latency(server lag) by sending the request to servers in a region that geographically closer to us.
Q. What are the types of access can AWS Users have?
-
Two types of access possible.
-
Programmatic access
- Enables an access Key ID and secret access key for the AWS API, CLI, SDK and other development tools -
AWS Management Console access
- Enables a password that allows users to sign-in to the AWS Management console.
-
Q. What are the common scenarios to go for Temporary Credentials?
-
Following are common scenarios for temporary credentials
-
Identity Federation
-
Enterprise Identity Federation - Used when you want to use organization existing authentication system to grant access to AWS resources
-
Custom federation broker
-
Federation using SAML 2.0
-
-
Web Identity Federation - authenticate using well known third party identity providers
-
-
Delegation
-
Cross account access
-
IAM Roles
-
Q. Which STS API Action used to get temporary credentials ( access key ID, secret access key, security token). To access resources in Another AWS account
-
Use
AssumeRole
action
Note
|
We can’t use AWS account root credentials to call AssumeRole action. You can also call GetFederationToken using the security credentials of an AWS account root user, but we do not recommend it. |
Things to remember about STS API actions
1. AssumeRole used to get short-term temporary credentials. it is assoicated with role, if you have multiple AWS accounts and want to access resource from one acccount to other use this
2. GetFederationToken doesn't associated with role. it gives long-lived access token. used proxy-based apps
3. AssumeRoleWithWebIdentity used with thiry party providers to grant access
4. AssumeRoleWithSAML used with your organization authentication system to get AWS resource access
5. GetSessionToken used with MFA devices
Q: How do I assume an IAM role?
-
You assume an IAM role by calling the AWS Security Token Service (STS) AssumeRole APIs (in other words,
-
AssumeRole,
-
AssumeRoleWithWebIdentity,
-
AssumeRoleWithSAML).
-
These APIs return a set of temporary security credentials that applications can then use to sign requests to AWS service APIs.
Q: How many IAM roles can I create?
-
You are limited to 1,000 IAM roles under your AWS account. If you need more roles, submit the IAM limit increase request form with your use case, and AWS will consider your request.
Q: How can I request temporary security credentials for federated users?
-
The following are the STS API operations that you can use to acquire temporary credentials for use in your AWS environment and applications.
-
GetFederationToken
-
AssumeRole
-
AssumeRoleWithSAML
-
AssumeRoleWithWebIdentity
-
AssumeRole
Q. How does AssumeRole works?
-
Cross-Account Delegation and Federation Through a Custom Identity Broker
This API action is useful for allowing existing IAM users to access AWS resources that they don’t already have access to, such as resources in another AWS account. It is also useful for existing IAM users as a means to temporarily gain privileged access.
AssumeRoleWithWebIdentity
Q. How does AssumeRoleWithWebIdentity works?
-
Federation Through a Web-based Identity Provider
This API operation returns a set of temporary security credentials for federated users who are authenticated through a public identity provider.
Examples of public identity providers include Login with Amazon, Facebook, Google, or any OpenID Connect (OIDC)-compatible identity provider.
Note
|
Instead of directly calling AssumeRoleWithWebIdentity, we recommend that you use Amazon Cognito and the Amazon Cognito credentials provider with the AWS SDKs for mobile development. |
AssumeRoleWithSAML
Q. How does AssumeRoleWithSAML works?
-
Federation Through an Enterprise Identity Provider Compatible with SAML 2.0
This API returns a set of temporary security credentials for federated users who are authenticated by your organization’s existing identity system. The users must also use SAML 2.0 (Security Assertion Markup Language) to pass authentication and authorization information to AWS.
GetFederationToken
Q. How does GetFederationToken works?
-
Federation Through a Custom Identity Broker
This API returns a set of temporary security credentials for federated users.
This API differs from AssumeRole in that the default expiration period is substantially longer (12 hours instead of one hour).
Additionally, you can use the DurationSeconds parameter to specify a duration for the temporary security credentials to remain valid.
The resulting credentials are valid for the specified duration, between 900 seconds (15 minutes) to 129,600 seconds (36 hours).
GetSessionToken
Q. How does GetSessionToken works?
-
Returns a set of temporary credentials for an AWS account or IAM user.
The credentials consist of an access key ID, a secret access key, and a security token.
Typically, you use GetSessionToken if you want to use MFA to protect programmatic calls to specific AWS API operations like Amazon EC2 StopInstances.
MFA-enabled IAM users would need to call GetSessionToken and submit an MFA code that is associated with their MFA device.
Using the temporary security credentials that are returned from the call, IAM users can then make programmatic calls to API operations that require MFA authentication.
If you do not supply a correct MFA code, then the API returns an access denied error.
Comments
Post a Comment