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

Set tight permissions for key files #7

Closed
zenhack opened this issue Jan 2, 2017 · 5 comments
Closed

Set tight permissions for key files #7

zenhack opened this issue Jan 2, 2017 · 5 comments

Comments

@zenhack
Copy link
Owner

zenhack commented Jan 2, 2017

Issue by Lekensteyn
Saturday Dec 05, 2015 at 15:11 GMT
Originally opened as kuba/simp_le#34


Ensure that key files are not world-readable.

temp_umask is based on test.support.temp_umask.

Fixes #29


If older Python versions do not have to be supported, then the test code could become something like:

@temp_umask(0o022)
def test_it():
    ...

Lekensteyn included the following code: https://github.com/kuba/simp_le/pull/34/commits

@zenhack
Copy link
Owner Author

zenhack commented Jan 2, 2017

Comment by danmilon
Tuesday Dec 08, 2015 at 10:01 GMT


World readable private key? ouch!
LGTM.

@zenhack
Copy link
Owner Author

zenhack commented Jan 2, 2017

Comment by Lekensteyn
Tuesday Dec 08, 2015 at 16:14 GMT


Updated patchset against latest master, added a rough separate test case as AccountKey got removed.

@zenhack
Copy link
Owner Author

zenhack commented Jan 2, 2017

Comment by kuba
Tuesday Dec 08, 2015 at 20:43 GMT


There are 3 parties potentially involved with the typical usage scenario:

  1. user under which the client is run
  2. user that runs httpd
  3. root

If we assume that those three parties are different users (say nobody, nginx, root), then there are some usability problems, because:

  • (1) needs to open and write: account key, chain, cert and key
  • (2) needs to read chain, cert and key
  • we don't run as root, so we cannot chmod or chown

Restricting key file to 0o600 would mean that httpd is not able to read necessary files :(

I would like those kind of cases to be clearly sorted out (and by that I mean short design doc, possibly included in the repo itself) before merging.

@zenhack
Copy link
Owner Author

zenhack commented Jan 2, 2017

Comment by danmilon
Tuesday Dec 08, 2015 at 21:31 GMT


AFAIK apache runs as root to bind to privilaged ports and/or read the private key, and then spawns other processes as a non-privilaged user (e.g. www-data) to do the actual request handling.

I don't know if other web servers work similarly.

@zenhack
Copy link
Owner Author

zenhack commented Apr 2, 2018

This PR doesn't look like quite the right solution, so I'm going to close. For reference, this was intended to solve kuba/simp_le#29 which corresponds to #6.

@zenhack zenhack closed this as completed Jun 17, 2019
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

1 participant