diff --git a/package/debian/postinst b/package/debian/postinst index 4f0d036668..05daa43d5a 100755 --- a/package/debian/postinst +++ b/package/debian/postinst @@ -81,7 +81,7 @@ case "$1" in addUser thehive "" thehive "thehive daemon-user" "/bin/false" # Generate secret key if ! test -e /etc/thehive/secret.conf; then - key=$(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 64 | head -n 1) + key=$(dd if=/dev/urandom bs=1024 count=1 | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1) echo "play.http.secret.key=\"$key\"" > /etc/thehive/secret.conf fi @@ -99,4 +99,4 @@ case "$1" in echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; -esac \ No newline at end of file +esac diff --git a/package/docker/entrypoint b/package/docker/entrypoint index cbf58c58ff..2f355f0668 100755 --- a/package/docker/entrypoint +++ b/package/docker/entrypoint @@ -81,7 +81,7 @@ then then if test -z "${SECRET}" then - SECRET=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1) + SECRET=$(dd if=/dev/urandom bs=1024 count=1 | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1) test "${SHOW_SECRET}" = 1 && echo Using secret: ${SECRET} fi echo "play.http.secret.key = \"${SECRET}\"" >> ${CONFIG_FILE}