r/aws • • 6d ago

technical resource STS Get Scoped Credentials API

https://aws.amazon.com/about-aws/whats-new/2026/11/sts-getscopedcredentials/

Scoped/reduced permissions without assuming a role!

75 Upvotes

9 comments sorted by

3

u/FormalComplaints 4d ago

Barring small technicalities this seems to be the same as an AssumeRole call with a Session Policy set. Unless I misunderstood something.

1

u/Zenin 4d ago

Basically, yes. You're not misunderstanding.

But while it may seem small and obvious, it's a big deal architecturally.

3

u/rowanu 3d ago

The best way I saw it described (by Liam@AWS) "Assume Role is to give the something different permissions, GetScopedCredentials is for giving yourself or things acting on your behalf less permissions."

1

u/Zenin 3d ago

I like that.

7

u/hegardian 6d ago

You can only call GetScopedCredentials with temporary security credentials, for example, credentials from an assumed role or a federated session.

https://docs.aws.amazon.com/STS/latest/APIReference/API_GetScopedCredentials.html

1

u/Zenin 5d ago

Why does this matter? Either you're starting with temp credentials or you're starting with an IAM User credential in which case you can call GetFederationToken instead which also allows you to pass a scoped down policy for the same effect.

1

u/hegardian 4d ago

Its important to be careful because the GetScopedCredentials only makes sense when the component generating the credentials is isolated from the environment that will use them. For example, if Scoped Credentials are generated using an EC2 instance profile role, compromising the EC2 environment would make little difference from a security perspective, since the instance profile already has the broader permissions. This is why AWS emphasizes its use primarily for agents and workers running in isolated environments, rather than as a complete replacement for AssumeRole.

2

u/Zenin 4d ago

Certainly. These are all tools to be used in a credential vending pattern, not self-use.

You're correct it doesn't completely replace AssumeRole, but it does drastically cleanup the identity chain model quite a bit. With AssumeRole you're effectively using your own workload identity rather than a user or client identity. That's both a much more coarse permissions model and much less attributable (weaker chain of custody both in force and in audit).

If instead your caller is working from the user's identity and uses GetScopedCredentials to scope that identity down before passing it downstream for use (by an an agent, a lambda, a task, etc) you're both naturally limited by that user's specific permissions (rather than a wider set of workload Role permissions) and you retain that user's identity for all API actions*.* The pattern is assured by the architecture, intrinsically auditable, with any escalation risk limited to the scope of the user's permissions rather than any wider scope a workload role would require to be able to service any standard requeste.

BTW this is basically the standard OIDC pattern, just applied to AWS IAM.

The alternative, using a privileged role and scoping it in code at assumerole time is at risk of code bugs and cyber attack vectors that can potentially allow privilege escalation to any user's action not just the one caller.

The code implementing the scoped credential exchange can have bugs/attacks with either design, but one limits blast radius to the caller's scope while the other's blast radius is the entire service.

3

u/its4thecatlol 5d ago

Oh wow this is actually a really big deal. I hope they make some noise about it at Re:Invent. It's a pretty nifty way to avoid having to create new roles.