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

Make PKI generate-root idempotent #3086

Closed
matthewceroni opened this issue Jul 31, 2017 · 1 comment
Closed

Make PKI generate-root idempotent #3086

matthewceroni opened this issue Jul 31, 2017 · 1 comment

Comments

@matthewceroni
Copy link

I was under the impression that API calls are idempotent (as stated here https://www.hashicorp.com/blog/codifying-vault-policies-and-configuration/).

In attempting to follow the above configuration guide I am trying to setup the PKI backend. Part of the configuration is to generate the root certificate.

vault write pki/root/generate/internal common_name=xxxx ttl=87600

However if I run this multiple times it generates a new root certificate each time. That isn't idempotent and presents a problem in provisioning of Vault via Infrastructure as Code. Now I need to determine whether something has been done or not.

The version of Vault I am using is 0.7.0.

@jefferai
Copy link
Member

Vault calls are not idempotent. Some of them are, and it's a nice thing to strive for, but not all can be. In that blog post, the specific calls that Seth was using were idempotent, but it is not a guarantee across Vault.

I'm happy to have the generate-root endpoint not create a cert if one already exists but there would also need to be a delete method added. If you're interested in adding such a feature it wouldn't be hard.

@jefferai jefferai changed the title idempotent API calls Make PKI generate-root idempotent Jul 31, 2017
@jefferai jefferai added this to the near-term milestone Jul 31, 2017
@pbernal pbernal removed this from the near-term milestone May 15, 2020
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

No branches or pull requests

3 participants