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

Private key stored in node attributes #15

Closed
troyready opened this issue Feb 3, 2016 · 10 comments
Closed

Private key stored in node attributes #15

troyready opened this issue Feb 3, 2016 · 10 comments

Comments

@troyready
Copy link

Does the private key need to persist on the node attributes, since it can be read from disk? It would be nice to be able to remove it.

(btw -- thanks for all of your great work on this)

@thoutenbos
Copy link
Collaborator

There is actually two different private keys. The one in the node attributes is used to authenticate the client to the Boulder API and to sign the API requests. It's saved to be persistent once generated.

The private key for the certificate is a different key, and is saved in the key file, not in the node attributes.

@troyready
Copy link
Author

Ah, got it. Thanks for the explanation.

Would you be interested in a PR to optionally save that key on the filesystem as well? Would that make sense as something controlled by an attribute?

@sbotman
Copy link

sbotman commented Feb 4, 2016

Sounds like a nice option...

@acoulton
Copy link
Contributor

acoulton commented Mar 1, 2016

Saving this to filesystem would help me too, happy to look at a PR. It looks most logical to trigger this within the acme_client library method, but that implies using plain ruby File.read / File.write to manage the key file rather than defining it as a chef file resource. Would that be OK?

Alternatively, I could look at refactoring the key creation out of the acme_client - possibly it could be defined as a resource in its own right in the default recipe?

@thoutenbos
Copy link
Collaborator

Using the file resource would be the preferred way for me, but I wouldn't want the runlist order getting in to play with adding it to the default recipe. How about adding it in the certificate provider, similar to the way the certificate private key is generated if it doesn't exist yet.

Then it would become something like:

  1. Use the key from the node attribute if it is set
  2. Use the key from the file if it exists
  3. Generate a new key and save it to attribute/file

Does that sound sensible?

@runningman84
Copy link

What about backing up certs/keys to s3?

It would be really cool if I could destroy a webserver and rebuild it and the ssl keys would be gathered from s3...

@cixelsyd
Copy link

cixelsyd commented Jul 5, 2016

Another method would be to save the API key to an encrypted data bag. You could keep it there, and that would provide a small amount of protection. This would cause a specific round-trip to the chef server to retrieve it on each run, however. There's also chef-vault as well.

@axos88
Copy link
Contributor

axos88 commented Nov 27, 2016

Not sure what the upside of this would be since you can automatically regenerate the ssl keys anyways.

@thoutenbos
Copy link
Collaborator

Should be fixed once #63 is in

@acoulton
Copy link
Contributor

Great, thanks very much

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

7 participants