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 permissions #42

Closed
znz opened this issue Apr 4, 2016 · 2 comments
Closed

private key permissions #42

znz opened this issue Apr 4, 2016 · 2 comments

Comments

@znz
Copy link

znz commented Apr 4, 2016

kuba/simp_le#29 says that simp_le creates private key as world readable.
dokku uses the files by root user. So I think they can set more secure permissions.

How about this patch?

diff --git a/functions b/functions
index 67e092a..7685bb3 100755
--- a/functions
+++ b/functions
@@ -68,6 +68,7 @@ letsencrypt_create_root () {
   # Set up folders
   if [ ! -d "$LETSENCRYPT_ROOT" ]; then
     mkdir -p "$LETSENCRYPT_ROOT"
+    chmod 600 "$LETSENCRYPT_ROOT"
   fi
 }

or this one?

diff --git a/functions b/functions
index 67e092a..a965ee4 100755
--- a/functions
+++ b/functions
@@ -69,6 +69,7 @@ letsencrypt_create_root () {
   if [ ! -d "$LETSENCRYPT_ROOT" ]; then
     mkdir -p "$LETSENCRYPT_ROOT"
   fi
+  chmod 600 "$LETSENCRYPT_ROOT"
 }

 letsencrypt_get() {
@sseemayer
Copy link
Contributor

Welcome @znz and thanks for the suggestion, I agree that we should protect the keys as much as we can! There was some previous discussion in #6 but since a lot has changed since then we can definitely re-visit this.

Permissions-wise, the following things need access to the certificates/keys:

  • The dokku letsencrypt command (write access to certs + key + settings)
  • The certificate-using dokku commands such as certs:info letsencrypt:ls, etc. (read access to certs)
  • The nginx process (read access to certs + key)

I'm not sure at this point what users these processes are running under and how far we can restrict permissions. Have you tried changing the permissions you suggest manually and do the aforementioned bullet points still work for you?

@sseemayer
Copy link
Contributor

Closing for inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants