Skip to content

Commit f2f9f0e

Browse files
authored
Merge pull request #1032 from buildkite/dont-leak-tokens-to-logs
Don't accidentally send the token to logs on startup
2 parents 4400a2e + b7fcda6 commit f2f9f0e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packer/linux/conf/bin/bk-install-elastic-stack.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ then
161161
fi
162162
chown buildkite-agent: "${BUILDKITE_AGENT_BUILD_PATH}"
163163

164+
set +x # Don't leak the agent token into logs
165+
echo "Setting \$BUILDKITE_AGENT_TOKEN to the value stored in the SSM Parameter $BUILDKITE_AGENT_TOKEN_PATH"
164166
BUILDKITE_AGENT_TOKEN="$(aws ssm get-parameter --name "${BUILDKITE_AGENT_TOKEN_PATH}" --with-decryption --query Parameter.Value --output text)"
167+
set -x
165168

166169
cat << EOF > /etc/buildkite-agent/buildkite-agent.cfg
167170
name="${BUILDKITE_STACK_NAME}-${INSTANCE_ID}-%spawn"

0 commit comments

Comments
 (0)