Secure server_data_dir creation with nested temp dir#173
Secure server_data_dir creation with nested temp dir#173minrk merged 2 commits intojupyterhub:mainfrom
Conversation
Resolves jupyterhub#172 Wrap server_data_dir in another temporary directory to maintain security.
|
I'm a bit puzzled as to why |
| # we create the server_data_dir inside another temp dir, | ||
| # as rserver seems to insists on changing its permissions to 777. | ||
| # wrapping it in the first tempdir insists the contents of server_data_dir stay secure. | ||
| server_data_dir = tempfile.mkdtemp(dir=tempfile.mkdtemp()) |
There was a problem hiding this comment.
Do we want to explicitly make the outer dir private, then, if this is the reason? As it is, umask will usually set the default permissions, which are often world-readable by default (umask 022).
There was a problem hiding this comment.
Happy to change, but according to the mkdtemp docs, the directory is readable, writable, and searchable only by the creating user ID.
|
Still waiting for feedback on this PR. Anything I can do to help this get merged? |
|
Thanks for merging this! ❤️ Would it be possible to do a new release that includes these changes? |
Resolves #172
Wrap server_data_dir in another temporary directory to maintain security.