Skip to content

Commit

Permalink
Allow custom umask setting
Browse files Browse the repository at this point in the history
To provide a way to add more security regarding file/folder permissions
this PR adds a way to allow setting a custom `UMASK` variable.

This allows people to set a more secure default like only allowing the
owner the the process/container to read/write files and folders.

Examples:
 - `UMASK=022` File: 644 | Folder: 755 (Default of the containers)
   This means Owner read/write and group/world read-only
 - `UMASK=027` File: 640 | Folder: 750
   This means Owner read/write, group read-only, world no access
 - `UMASK=077` File: 600 | Folder: 700
   This measn Owner read/write and group/world no access

resolves dani-garcia#4571

Signed-off-by: BlackDex <black.dex@gmail.com>
  • Loading branch information
BlackDex committed Aug 26, 2024
1 parent 2b824e8 commit 6f7d7a6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docker/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/sh

if [ -n "${UMASK}" ]; then
umask "${UMASK}"
fi

if [ -r /etc/vaultwarden.sh ]; then
. /etc/vaultwarden.sh
elif [ -r /etc/bitwarden_rs.sh ]; then
Expand Down

0 comments on commit 6f7d7a6

Please sign in to comment.