From d288174dbb3d237579d9a798680484db8731dcd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=BBebrak?= <mzebrak@syncad.com> Date: Thu, 4 Jul 2024 15:35:07 +0200 Subject: [PATCH] Add exclude-dir to check_is_private_key_nor_password_is_not_logged script Because as can be observed there: https://gitlab.syncad.com/hive/clive/-/jobs/1260490#L88 test-tools seems to log all envrionment variables which also include CI_COMMIT_MESSAGE during CI and when e.g "password" text is used in the commit name, there will be a false positive. --- scripts/check_is_private_key_nor_password_is_not_logged.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/check_is_private_key_nor_password_is_not_logged.bash b/scripts/check_is_private_key_nor_password_is_not_logged.bash index 160d429b03..379d598b58 100755 --- a/scripts/check_is_private_key_nor_password_is_not_logged.bash +++ b/scripts/check_is_private_key_nor_password_is_not_logged.bash @@ -3,6 +3,7 @@ function find_password_private_keys() { grep \ --include="latest.log*" \ + --exclude-dir="*Node[0-9]" \ -r -i -w -E '(pass(word)?|[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51})' | grep "$@" -v -E '(Error in response from url|Problem occurred during communication with|test_tools.__private.logger)' } -- GitLab