Skip to content

Commit

Permalink
chore: Update create-secrets script to restrict file permissions
Browse files Browse the repository at this point in the history
The create-secrets script has been updated to restrict file permissions to 400, ensuring that the secrets file is only accessible by the owner. This improves the security of the secrets stored in the file.
  • Loading branch information
stephdl committed Jun 17, 2024
1 parent d04f677 commit 19e551b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions imageroot/bin/create-secrets
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@

set -e

# restict to 400
umask 266


if [[ ! -d ~/.config/state/secrets ]]; then
/usr/bin/mkdir -p ~/.config/state/secrets
fi

# restict to 400
umask 266

if [[ ! -f ~/.config/state/secrets/passwords.secret ]]; then
password_postgres=$(/usr/bin/openssl rand -hex 20)
/usr/bin/echo "POSTGRES_PASSWORD=$password_postgres" > ~/.config/state/secrets/passwords.secret
fi
fi

0 comments on commit 19e551b

Please sign in to comment.