From b18f43a9c259eb861289ccbea0afae22e28b81e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 25 Sep 2023 16:51:25 +0200 Subject: [PATCH] luks: don't leak secret in debug logs --- lib/types/luks.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/types/luks.nix b/lib/types/luks.nix index e9bf8f1..745e97d 100644 --- a/lib/types/luks.nix +++ b/lib/types/luks.nix @@ -4,7 +4,8 @@ let if lib.hasAttr "keyFile" config.settings then config.settings.keyFile else if config.passwordFile != null - then ''<(echo -n "$(cat ${config.passwordFile})")'' + # do not print the password to the console + then ''<(set +x; echo -n "$(cat ${config.passwordFile})"; set -x)'' else if config.keyFile != null then lib.warn