Suppose I have a public/private keypair, which I would like to use to serve HTTPS from a webserver. The part I'm worried about is this: the private key is encrypted with a passphrase, so that if an attacker gains access to my webserver he doesn't get the private key. But I want some automated system to launch the webserver: say, monit to restart the server if it crashes, or puppet to deploy it to many different machines. Is this possible? It seems to me that I have three choices:
- Decrypt the private key and store it in plain text somewhere on the machine, in an area that I hope an attacker will be unable to compromise.
- Store and use the encrypted key, but also store the passphrase for use by automated systems. This doesn't seem fundamentally any more secure than (1).
- Store only the encrypted key, and require manual intervention anytime a server needs to be started.
Are there any options I'm missing? I can't imagine large-scale websites like Wikipedia or Google require manual intervention to start a server, so I'm guessing they must be storing the cleartext keys; but that seems like it must be a bad security practice.