Updated on 2024-03-15 GMT+08:00

Security Token Service (STS)

The Organizations service provides Service Control Policies (SCPs) to set access control policies.

SCPs do not actually grant any permissions to a principal. They only set the permissions boundary for the principal. When SCPs are attached to a member account or an organizational unit (OU), they do not directly grant permissions to that member account or OU. Instead, the SCPs just determine what permissions are available for that member account or the member accounts under that OU.

This section describes the elements used by Organizations SCPs. The elements include actions, resources, and conditions.

For details about how to use these elements to edit a custom SCP, see Creating an SCP.

Actions

Actions are specific operations that are allowed or denied in an SCP.

  • The Access Level column describes how the action is classified (List, Read, or Write). This classification helps you understand the level of access that an action grants when you use it in an SCP.
  • The Resource Type column indicates whether the action supports resource-level permissions.
    • You can use a wildcard (*) to indicate all resource types. If this column is empty (-), the action does not support resource-level permissions, and you must specify all resources ("*") in your SCP statements.
    • If this column includes a resource type, you must specify the URN in the Resource element of your statements.
    • Required resources are marked with asterisks (*) in the table. If you specify a resource in a statement using this action, then it must be of this type.

    For details about the resource types defined by STS, see Resources.

  • The Condition Key column contains keys that you can specify in the Condition element of an SCP statement.
    • If the Resource Type column has values for an action, the condition key takes effect only for the listed resource types.
    • If the Resource Type column is empty (-) for an action, the condition key takes effect for all resources that action supports.
    • If the Condition Key column is empty (-) for an action, the action does not support any condition keys.

    For details about the condition keys defined by STS, see Conditions.

The following table lists the actions that you can define in SCP statements for STS.

Table 1 Actions supported by the STS

Action

Description

Access Level

Resource Type (*: required)

Condition Key

sts:agencies:assume

Grants permission to obtain a set of temporary credentials that you can use to access resources that you might not normally have access to.

write

agency *

g:ResourceTag/<tag-key>

-

  • sts:ExternalId
  • sts:SourceIdentity
  • sts:TransitiveTagKeys
  • sts:AgencySessionName
  • g:RequestTag/<tag-key>
  • g:TagKeys
  • g:SourceAccount
  • g:SourceUrn

sts::decodeAuthorizationMessage

Grants permission to decode additional information about the authorization status of a request from an encoded message returned in response to a request.

write

-

-

sts::setSourceIdentity

Grants permission to set a source identity on an STS session.

write

agency *

g:ResourceTag/<tag-key>

-

sts:SourceIdentity

sts::tagSession

Grants permission to add tags to an STS session.

tagging

agency *

g:ResourceTag/<tag-key>

-

  • sts:TransitiveTagKeys
  • g:RequestTag/<tag-key>
  • g:TagKeys

sts::getServiceBearerToken

Grants permission to get the service bearer token.

write

-

  • sts:DurationTimes
  • sts:ServiceName

Resources

A resource type indicates the resources that an SCP applies to. If you specify a resource type for any action in Table 2, the resource URN must be specified in the SCP statements using that action, and the SCP applies only to resources of this type. If no resource type is specified, the Resource element is marked with an asterisk (*) and the SCP applies to all resources. You can also set condition keys in an SCP to define resource types.

The following table lists the resource types that you can define in SCP statements for STS.

Table 2 Resource types supported by STS

Resource Type

URN

agency

iam::<account-id>:agency:<agency-name-with-path>

assumed-agency

sts::<account-id>:assumed-agency:<agency-name>/<session-name>

Conditions

A Condition element lets you specify conditions for when an SCP is in effect. It contains condition keys and operators.
  • The condition key that you specify can be a global condition key or a service-specific condition key.
    • Global condition keys (with the g: prefix) apply to all actions. Cloud services do not need to provide user identity information. Instead, the system automatically obtains such information and authenticates users. For details, see Global Condition Keys.
    • Service-specific condition keys (with the abbreviation of a service name plus a colon as the prefix, for example, sts:) only apply to operations of the STS service. For details, see en-us_topic_0000001819063794.html#EN-US_TOPIC_0000001819063794__en-us_topic_0000001492517298_table20369145455210.
    • The number of values associated with a condition key in the request context of an API call makes the condition key single-valued or multivalued. Single-valued condition keys have at most one value in the request context of an API call. Multivalued condition keys can have multiple values in the request context of an API call. For example, a request can originate from at most one VPC endpoint, so g:SourceVpce is a single-valued condition key. You can tag resources and include multiple tag key-value pairs in a request, so g:TagKeys is a multivalued condition key.
  • A condition operator, condition key, and a condition value together constitute a complete condition statement. An SCP can be applied only when its request conditions are met. For supported condition operators, see Condition operators.

The following table lists the condition keys that you can define in SCPs for STS. You can include these condition keys to specify conditions for when your SCP is in effect.

Table 3 Service-specific condition keys supported by STS

Service-specific Condition Key

Type

Single-valued/Multivalued

Description

sts:ExternalId

string

Single-valued

Filters access by the external ID that is passed in the request.

sts:SourceIdentity

string

Single-valued

Filters access by the source identity that is passed in the request.

sts:TransitiveTagKeys

string

Multivalued

Filters access by the transitive tag keys that are passed in the request.

sts:AgencySessionName

string

Single-valued

Filters access by the agency session name required when you assume an agency.

sts:DurationTimes

numeric

Single-valued

Filters access by the duration time when you create a bearer token.

sts:ServiceName

string

Single-valued

Filters access by the service name when you create a bearer token.