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

Race condition with ca clean #120

Open
defnull opened this issue Apr 18, 2024 · 1 comment
Open

Race condition with ca clean #120

defnull opened this issue Apr 18, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@defnull
Copy link

defnull commented Apr 18, 2024

Describe the Bug

We managed to accidentally delete an un-revoked certificate, because puppetserver ca clean is not atomic. As a result, we ended up with a valid certificate that can no longer be revoked and is not listed by puppetserver ca list.

How it probably happened (according to a user report and backed by logs):

  • A call to puppetserver ca clean should revoke and delete a certificate. The revoke-call succeeded, but for some unknown reason the delete-call was delayed for a full 51 seconds. I have no idea why or how or where it got stuck, but it happened.
  • While this delete-call was still pending, the user got impatient, called puppetserver ca clean again (successful this time), re-ran ssl-bootstrap on the host, called puppetserver ca sign and moved on.
  • Now the delete-call from the first puppetserver ca clean invocation came through and deleted the newly signed certificate without revoking it first.

Expected Behavior

A puppetserver ca clean call should not delete certificates it did not revoke. It should probably use the /puppet-ca/v1/clean API instead of issuing separate revoke and delete calls, as suggested by the API docs.

@anders-larsson
Copy link

Hello. I've created puppetlabs/puppetserver#2851. It looks to the be the same bug. If it is, it is not limited to the Puppet CA CLI tools and happens when you use the HTTP API as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants