STS
Parity grade: A · SDK aws-sdk-go-v2/service/sts@v1.51.4 · last audited 2026-10-11 (0c0472570)
Category: Identity & Access · View PARITY.md on GitHub · All Services
In-memory STS: caller identity, role assumption, session tokens, federation.
Quick start
bash
export AWS_ENDPOINT_URL=http://localhost:8000
aws sts get-caller-identity
aws sts assume-role --role-arn arn:aws:iam::000000000000:role/MyRole \
--role-session-name my-session
aws sts get-session-token --duration-seconds 7200
aws sts get-federation-token --name my-federated-user
aws sts assume-role-with-web-identity \
--role-arn arn:aws:iam::000000000000:role/WebIdentityRole \
--role-session-name wi-session --web-identity-token "$JWT"
aws sts assume-role-with-saml \
--role-arn arn:aws:iam::000000000000:role/SAMLRole \
--principal-arn arn:aws:iam::000000000000:saml-provider/MyIdP \
--saml-assertion dGVzdA==Supported operations
AssumeRole, AssumeRoleWithSAML, AssumeRoleWithWebIdentity, AssumeRoot, GetCallerIdentity, GetSessionToken, GetFederationToken, GetAccessKeyInfo, DecodeAuthorizationMessage, GetDelegatedAccessToken, GetWebIdentityToken.
Behaviour
- Responses use the configured account (
--account-id/ACCOUNT_ID, default000000000000) and region (--region/REGION, defaultus-east-1). - Issued credentials are accepted by Gopherstack and are not valid on real AWS.
RoleArnandRoleSessionNameare validated as on AWS (session name 2-64 characters of[\w+=,.@:-]). Duration limits are checked per operation.- The role's trust policy is evaluated when the caller's ARN is known and the role has a trust policy. Otherwise the call is allowed.
ExternalIdand MFA conditions are checked. - Web-identity tokens are checked against registered OIDC providers.
- A background janitor evicts expired sessions every
STS_JANITOR_INTERVAL(default30s). GET /dashboard/api/sts/metricsreturns session counts, sweep counters and per-operation call counts.
Differences from AWS
WARNING
MFA codes are not validated. SerialNumber and TokenCode must both be present and well-formed, but any code satisfies aws:MultiFactorAuthPresent.
- Inline and managed session policies are validated and counted towards the packed-policy limit, but are not enforced.
JWTPayloadSizeExceededExceptionis not raised: no documented size limit exists to enforce.
Parity & Coverage
| Metric | Value |
|---|---|
| PARITY entries audited | 11 (11 ok) |
| Feature families | 3 (3 ok) |
| Known gaps | none |
| Structural gaps (can't be emulated) | 1 |
| Deferred items | 1 |
| Resource leaks | clean |
Structural Gaps
These do not block an A grade — no implementation could produce real data here because the underlying data source cannot exist in an emulator.
- JWTPayloadSizeExceededException has no numeric threshold in the SDK doc strings, validators or any AWS page checked (gopherstack-yewt); without a documented limit it cannot be enforced.
Deferred Items
- SESSION-POLICY EVALUATION: session Policy/PolicyArns are validated for shape/size (MalformedPolicyDocument, PackedPolicyTooLarge) and PackedPolicySize is computed, but the policy document's content is not enforced against subsequent API calls (no IAM policy-evaluation engine wired to session credentials). This mirrors the rest of the emulator's authz model and is out of scope for a service-local sts audit.
Audited Operations
11 audited operations
| Operation | Wire | Errors | State | Persist |
|---|---|---|---|---|
AssumeRole | fixed | ok | fixed | ok |
AssumeRoleWithSAML | fixed | ok | fixed | ok |
AssumeRoleWithWebIdentity | fixed | ok | fixed | ok |
AssumeRoot | fixed | ok | fixed | ok |
GetCallerIdentity | ok | ok | ok | ok |
GetDelegatedAccessToken | fixed | ok | fixed | ok |
GetFederationToken | ok | ok | ok | ok |
GetSessionToken | ok | ok | ok | ok |
GetWebIdentityToken | fixed | fixed | fixed | ok |
GetAccessKeyInfo | ok | ok | ok | ok |
DecodeAuthorizationMessage | ok | fixed | ok | n/a |
Audited Feature Families
| Feature Family | Status |
|---|---|
trust-policy-evaluation | ok |
session-tag-validation | ok |
locking | ok |
