Skip to content

Conversation

grahamc
Copy link
Contributor

@grahamc grahamc commented Oct 5, 2021

Sometimes people will give you an AWS access key and secret and not
be interested in setting up a better approach for key exchange.

In cases like this, options are limited for distributing access to
the key material. However, AWS's STS GetSessionToken can be used
to general ephemeral credentials "underneath" that token. This
at least limits the spread of that root key, and the duration of
its users' access.

It should almost definitely not be used for other use cases, since
it does not limit behavior on an otherwise probably administrative
key.

Closes #12734

@grahamc grahamc requested a review from a team October 5, 2021 01:53
@hashicorp-cla
Copy link

hashicorp-cla commented Oct 5, 2021

CLA assistant check
All committers have signed the CLA.

@vercel vercel bot temporarily deployed to Preview – vault-storybook October 5, 2021 01:53 Inactive
@vercel vercel bot temporarily deployed to Preview – vault October 5, 2021 01:53 Inactive
@vercel vercel bot temporarily deployed to Preview – vault October 5, 2021 02:03 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook October 5, 2021 02:03 Inactive
@grahamc grahamc requested a review from taoism4504 as a code owner October 5, 2021 02:28
@vercel vercel bot temporarily deployed to Preview – vault October 5, 2021 02:29 Inactive
@grahamc
Copy link
Contributor Author

grahamc commented Oct 23, 2021

@taoism4504 Sorry to bother, but I have a changelog file -- did I mess up the process? Or does pr/no-changelog mean something different?

Sometimes people will give you an AWS access key and secret and not
be interested in setting up a better approach for key exchange.

In cases like this, options are limited for distributing access to
the key material. However, AWS's STS GetSessionToken can be used
to general ephemeral credentials "underneath" that token. This
at least limits the spread of that root key, and the duration of
its users' access.

It should almost definitely not be used for other use cases, since
it does not limit behavior on an otherwise probably administrative
key.

Closes hashicorp#12734
@grahamc
Copy link
Contributor Author

grahamc commented Oct 23, 2021

I just rebased against main, and all the checks are passing. The test failure from before was caused by the test infrastructure failing on the LetsEncrypt certificate expiration thing.

@amanjeev
Copy link

Thank you @grahamc for this work. This will really help us where we might have to pass stuff around for remote labs.

Copy link
Contributor

@hashishaw hashishaw left a comment

Choose a reason for hiding this comment

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

Thank you for adding the UI changes too, they look great!

@kalafut kalafut added this to the 1.10 milestone Oct 25, 2021
Copy link
Contributor

@taoism4504 taoism4504 left a comment

Choose a reason for hiding this comment

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

Reviewed the docs portion; LGTM

@grahamc
Copy link
Contributor Author

grahamc commented Feb 22, 2022

Is there something I can / should do here? I'm a bit surprised by the 2x approvals and then the drop of all the other review requests. I feel stuck.

@heatherezell
Copy link
Contributor

Hi @grahamc - apologies for that bad experience for you. We have several teams that have specialists to review specific parts of our PRs. For example, @taoism4504 reviewed your docs changes and @hashishaw reviewed your UI changes. I will get this in front of another engineer for the remaining code portions. In the meantime, can you resolve the merge conflicts? I appreciate your patience, and thank you so much for raising this up again.

@kalafut
Copy link
Contributor

kalafut commented Feb 25, 2022

Thanks for the PR, @grahamc! We’ve been discussing this internally and would like to understand a bit more about the usage. In particular, can you describe the case where a Session Token is needed and one of the other credential types (such as AssumeRole or Federation Token) can’t be used? By “not be interested in setting up a better approach for key exchange” are you referring to not configuring Vault for other types of credentials?

@heatherezell
Copy link
Contributor

As it has been some time since we've heard from you, I'm going to go ahead and close this PR and linked issue. Again, I apologize for what feels like a poor experience. Please feel free to re-open your issue or open a new one - we highly encourage contributors to open the issue first to discuss the problem and proposed solutions, so that any PR created to resolve the issue doesn't end up feeling like throw-away work. We appreciate your time and your desire to help make Vault a better product.

@grahamc
Copy link
Contributor Author

grahamc commented Jul 21, 2023

This problem persists. The S3 credentials are provided by an external organization, who is not able or willing to implement better key sharing.

@robmonte robmonte reopened this Jul 21, 2023
@robmonte robmonte requested a review from a team as a code owner July 21, 2023 22:12
@robmonte
Copy link
Member

Hi @grahamc. Our thinking was perhaps your issue was solved by other means after our last check-in. Since you've reported that the problem persists I've reopened it. Any further context or details you can provide to walk us through the use case here would also assist any future reviewers. Thank you!

@grahamc
Copy link
Contributor Author

grahamc commented Jul 21, 2023 via email

@robmonte
Copy link
Member

I don’t know how to be more clear about the use case. Can you share what is unclear to help me out?

Sorry, it may be my own personal unfamiliarity with AWS session tokens for why I am asking. Can you explain why STS credentials are unable to solve the problem you have?

@grahamc
Copy link
Contributor Author

grahamc commented Jul 22, 2023

I'm confused: this addition adds support for session tokens. The user loads a long term key and secret, where the key/secret has highly restricted access within AWS, and allows users to get short lived, unique session tokens back.

Copy link
Contributor

@schavis schavis left a comment

Choose a reason for hiding this comment

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

Thanks for submitting an update to the docs. I made some suggestions to keep the language in line with our style guide. Let me know if you have any questions.

Comment on lines +167 to +169
~> **Note:** Due to AWS eventual consistency, after calling this endpoint,
subsequent calls from Vault to AWS may fail for a few seconds until AWS
becomes consistent again. See the [AWS secrets engine API](/api/secret/aws#rotate-root-iam-credentials) for further information on rotate-root functionality.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
~> **Note:** Due to AWS eventual consistency, after calling this endpoint,
subsequent calls from Vault to AWS may fail for a few seconds until AWS
becomes consistent again. See the [AWS secrets engine API](/api/secret/aws#rotate-root-iam-credentials) for further information on rotate-root functionality.
<Note>
Calls from Vault to AWS may fail immediately after calling
`aws/config/rotate-root` until AWS becomes consistent again.
Refer to the
<a href="/api/secret/aws#rotate-root-iam-credentials">AWS secrets engine API</a>
reference for additional information on rotating IAM credentials.
</Note>

style correction: use new aside notation (<Note>) and active voice.

Comment on lines +341 to +344
~> **Notice:** Due to limitations in AWS, in order to use the `session_token`
credential type, Vault **must** be configured with IAM user credentials. AWS
does not allow temporary credentials (such as those from an IAM instance
profile) to be used.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
~> **Notice:** Due to limitations in AWS, in order to use the `session_token`
credential type, Vault **must** be configured with IAM user credentials. AWS
does not allow temporary credentials (such as those from an IAM instance
profile) to be used.
<Important>
AWS does not allow temporary credentials like those from an IAM instance
profile. To use session tokens with Vault and AWS, you must configure Vault
to use IAM user credentials.
</Important>

style correction: use new aside notation, mark the aside as important, and use active voice

Comment on lines +346 to +347
An STS session token inherits the exact same set of permissions which are
granted to the `aws/config/root` credentials.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
An STS session token inherits the exact same set of permissions which are
granted to the `aws/config/root` credentials.
STS session tokens inherit whatever permissions are granted to the `aws/config/root` credentials.

style correction: active voice

Comment on lines +349 to +350
A `root_access` role would then assign an inline policy with the same `ec2:*`
permissions.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
A `root_access` role would then assign an inline policy with the same `ec2:*`
permissions.
Then the `root_access` role assigns an inline policy with the same `ec2:*` permissions.

style correction: active voice

Comment on lines +357 to +358
To generate a new set of STS federation token credentials, we simply write to
the role using the aws/creds endpoint:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
To generate a new set of STS federation token credentials, we simply write to
the role using the aws/creds endpoint:
To generate a new set of STS federation token credentials, write to the `root_access` role using the `aws/creds` endpoint:

style correction: accessibility, compassionate lanugage

@grahamc
Copy link
Contributor Author

grahamc commented Aug 10, 2023

Thanks for the edits, they're on point. The saga of trying to contribute what amounts to less than 200loc, being bounced between various statuses, labels, edits, rebases, and misunderstandings has left me pretty tired and disenchanted. I understand Hashicorp's projects have a lot of PR activity, and it is hard to keep up, so no worries at all. Y'all own the code now, though, so feel free to pick up the mantle if you'd like. I hope some day the feature offers enough utility to enough customers for my use case to be addressed upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support issuing AWS Session Tokens via GetSessionToken