Skip to content

Use STS getCallerIdentity instead of IAM getUser - #3152

Merged
pmuens merged 1 commit into
serverless:masterfrom
erikerikson:bug-fix-use-sts-instead-of-iam-to-get-account-id
Jan 27, 2017
Merged

pmuens merged 1 commit into
serverless:masterfrom
erikerikson:bug-fix-use-sts-instead-of-iam-to-get-account-id

Conversation

@erikerikson

Copy link
Copy Markdown
Contributor

What did you implement:

A possible fix for #3151

How did you implement it:

Switch from using IAM getUser to get the account ID of the current user to calling STS getCallerIdentity. It is expected that this is a less protected segment of rights and will, as a result, impact fewer users. Of course, this is hard to guarantee.
Changes tests appropriately

Related Docs:
http://docs.aws.amazon.com/STS/latest/APIReference/API_Operations.html
http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/STS.html#getCallerIdentity-property

How can we verify it:

See awsProvider.spec.js tests. Use this to deploy any project.

Todos:

  • Write tests
  • Write documentation (N/A)
  • Fix linting errors
  • Make sure code coverage hasn't dropped
  • Provide verification config/commands/resources
  • Enable "Allow edits from maintainers" for this PR
  • Change ready for review message below

Is this ready for review?: YES
Is it a breaking change?: NO

A possible fix for serverless#3151
Switch from using IAM `getUser` to get the account ID of the current user to calling STS `getCallerIdentity`.  It is expected that this is a less protected segment of rights and will, as a result, impact fewer users.  Of course, this is hard to guarantee.
Changes tests appropriately

Related Docs:
http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/STS.html#getCallerIdentity-property
@erikerikson

Copy link
Copy Markdown
Contributor Author

It may be worth polling the VIP group to ensure that everyone has sts:getCallerIdentity rights available.

@pmuens

pmuens commented Jan 27, 2017

Copy link
Copy Markdown
Contributor

Thanks @erikerikson /cc @serverless/vip ☝️

@pmuens pmuens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix! Thanks @erikerikson
Tested it and it works great!

Thanks for saving our ability to deploy! 🥇

@pmuens
pmuens merged commit 69671a2 into serverless:master Jan 27, 2017
@pmuens pmuens mentioned this pull request Jan 27, 2017
@paulSambolin

Copy link
Copy Markdown
Contributor

+1 thank you @erikerikson

@erikerikson
erikerikson deleted the bug-fix-use-sts-instead-of-iam-to-get-account-id branch January 27, 2017 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants