spring-cloud-aws
spring-cloud-aws copied to clipboard
Support STS session Token
Type: Feature
Is your feature request related to a problem? Please describe. spring cloud aws does not support session token for the credentials manager. This will be useful to add for aws integrations using STS.
Describe the solution you'd like
- Add support under
org.springframework.cloud.aws.autoconfigure.context.properties.AwsCredentialsProperties
forcloud.aws.credentials.sessionToken
- Add support under
org.springframework.cloud.aws.autoconfigure.context.ContextCredentialsAutoConfiguration
for sessionToken to be provided to the credentials manager. - Support STS token rotation with spring cloud vault. (See issue linked below) Necessary bean's holding creds will need to be rebound/refreshed to pick up new accesskey, secretKey and sessionToken.
Describe alternatives you've considered NA
Additional context Related issue for vault: https://github.com/spring-cloud/spring-cloud-vault/issues/572
I can't seem to get spring-cloud-aws to pick up my session token still - does the vault fix only apply if you are using Vault? If I am using spring-cloud-aws will I need to implement spring-cloud/spring-cloud-vault#575 on this repo as well?
That is expected and hence this issue. The referenced vault PR adds the capability to set the session token when using STS with vault. spring cloud aws already supported creds but not session token. Will have to implement something similar to what i have in the description to not only pick up session tokens but also support rotation.
Are you using vault to solve this problem, or do you still have this problem with spring-cloud-aws? If I can use vault, so that when using spring-cloud-aws I can use an assumed role/session token that would be a good workaround, or I could look to implement what you originally described in the issue above
Vault aws backend was enhanced to support STS session tokens. As far as picking up these tokens and rotation is concerned, i am just using a custom refresh scope bean that is refreshed upon lease rotation. I have described the solution here - https://hmh.engineering/aws-sts-with-spring-cloud-vault-2d7fb0b82aaf Will be nice to implement the same within spring cloud aws.
I didn't realise this was still open/I had re-poened it, Just raised #149 to track making this change with proposed changes.
Fixed in https://github.com/awspring/spring-cloud-aws/commit/d8b2fcdae59ef927eff61de088120b24e6e74f54