Created
May 18, 2021 12:54
-
-
Save keymon/3b33b8e10919833a29dacecc7ac603c0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Ensure we redact credentials in output | |
redact_creds() { | |
sed 's/\(password[:="\\ ]*\)[^" ]*/\1<REDACTED>/ig' | |
} | |
exec > >(redact_creds) 2>&1 | |
## Example code | |
set -x | |
PASSWORD='secret_stuff@##/#@' | |
export KAFKA_SASL_JAAS_CONFIG="org.apache.kafka.common.security.plain.PlainLoginModule\ required\ username\=\"${USERNAME}\"\ password\=\"${PASSWORD}\";" | |
echo "KAFKA_SASL_JAAS_CONFIG=$KAFKA_SASL_JAAS_CONFIG" | |
echo "KAFKA_SASL_JAAS_CONFIG=$KAFKA_SASL_JAAS_CONFIG" 1>&2 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment