mirror of
https://github.com/restic/rest-server.git
synced 2025-10-19 07:33:21 +00:00
restrict umask of htpasswd file
This commit is contained in:
parent
0ed9de379e
commit
95538fe956
2 changed files with 14 additions and 1 deletions
13
changelog/unreleased/issue-318
Normal file
13
changelog/unreleased/issue-318
Normal file
|
@ -0,0 +1,13 @@
|
|||
Security: Fix world-readable permissions on new `.htpasswd` files
|
||||
|
||||
On startup the rest-server Docker container creates an empty `.htpasswd` file
|
||||
if none exists yet. This file was world-readable by default, which can be
|
||||
a security risk, even though the file only contains hashed passwords.
|
||||
|
||||
This has been fixed such that new `.htpasswd` files are no longer world-readabble.
|
||||
|
||||
The permissions of existing `.htpasswd` files must be manually changed
|
||||
if relevant in your setup.
|
||||
|
||||
https://github.com/restic/rest-server/issues/318
|
||||
https://github.com/restic/rest-server/pull/340
|
|
@ -6,7 +6,7 @@ if [ -n "$DISABLE_AUTHENTICATION" ]; then
|
|||
OPTIONS="--no-auth $OPTIONS"
|
||||
else
|
||||
if [ ! -f "$PASSWORD_FILE" ]; then
|
||||
touch "$PASSWORD_FILE"
|
||||
( umask 027 && touch "$PASSWORD_FILE" )
|
||||
fi
|
||||
|
||||
if [ ! -s "$PASSWORD_FILE" ]; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue