trufflehog
trufflehog copied to clipboard
[FR] Redact detected secrets from files (Rewriting them)
Hi,
I couldn't find an option to auto redact detected secrets from logfiles.
Example: My build script generates a log: "${TEMP_LOG}", I had like to use trufflehog to redact all detected secrets with ***** or another string.
Currently, I have to do something like:
trufflehog filesystem "${TEMP_LOG}" --no-fail --no-update --json 2>/dev/null | jq -r '.Raw' | sed '/{/d' | xargs -I "{}" sh -c 'echo "{}" | tr -d " \t\r\f\v"' | xargs -I "{}" sed "s/{}/ /g" -i "${TEMP_LOG}"