Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS Secrets Engine Key rotation #4385

Closed
martinssipenko opened this issue Apr 18, 2018 · 5 comments · Fixed by #5140
Closed

AWS Secrets Engine Key rotation #4385

martinssipenko opened this issue Apr 18, 2018 · 5 comments · Fixed by #5140

Comments

@martinssipenko
Copy link
Contributor

Hi,

Right now as part of configuring AWS Secrets Engine I am setting AWS credentials using access_key and secret_key. These AWS credentials essentially are "root" as they allow Vault to provision users under my AWS account.

What is your view on adding a feature that would:
a) Rotate the root keys at the time of configuration, so that only Vault knows the keys?
b) Perform a periodic root key rotation?

@jefferai
Copy link
Member

We don't support that now, however, if you're running on AWS it will pick up normal AWS cred chains (environment, credentials file, IAM-provided).

@martinssipenko
Copy link
Contributor Author

@jefferai I'm aware that it will, however, I don't want to use environment, creds file or IAM, as all three methods expose the creds in some way. I think passing them to Vault explicitly is the most secure option.

I opened this to start a discussion about a new feature, do you think it would make sense?

@jefferai
Copy link
Member

Sure, but @joelthompson should be a part of the discussion as he's already in the middle of a large overhaul of that engine. To be more specific (a) would make sense but it's not clear if we'd support (b) in any near term.

@jhmartin
Copy link
Contributor

jhmartin commented Aug 2, 2018

a+b makes a lot of sense -- Vault's entire purpose is to make ephemeral creds simpler, and the creds on which Vault relies also need to be rotated (particularly since they are so powerful). It is less maintenance overhead if Vault can rotate its own AWS credentials. EC2/ECS roles are preferable but a big selling point of the AWS engine is to grant AWS access to things not running in AWS.

joelthompson added a commit to joelthompson/vault that referenced this issue Aug 20, 2018
This allows the AWS Secret Engine to rotate its credentials used to
access AWS. This will only work when the AWS Secret Engine has been
provided explicit IAM credentials via the config/root endpoint, and
further, when the IAM credentials provided are the only access key on
the IAM user associated wtih the access key (because AWS allows a
maximum of 2 access keys per user).

Fixes hashicorp#4385
@joelthompson
Copy link
Contributor

I'm very much in love with this idea :) My refactor of the engine has been merged, and so now I'd love to get this feature supported. I've pushed a work-in-progress CR for this at #5140; everyone's feedback is welcome!

vishalnayak pushed a commit that referenced this issue Sep 26, 2018
* Add AWS Secret Engine Root Credential Rotation

This allows the AWS Secret Engine to rotate its credentials used to
access AWS. This will only work when the AWS Secret Engine has been
provided explicit IAM credentials via the config/root endpoint, and
further, when the IAM credentials provided are the only access key on
the IAM user associated wtih the access key (because AWS allows a
maximum of 2 access keys per user).

Fixes #4385

* Add test for AWS root credential rotation

Also fix a typo in the root credential rotation code

* Add docs for AWS root rotation

* Add locks around reading and writing config/root

And wire the backend up in a bunch of places so the config can get the
lock

* Respond to PR feedback

* Fix casing in error messages

* Fix merge errors

* Fix locking bugs
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 a pull request may close this issue.

4 participants