Skip to content

Commit ced68a0

Browse files
committed
[SPARK-52412][INFRA] Redact sensitive information in log files at release workflow
### What changes were proposed in this pull request? This PR proposes to redact sensitive information in log files at release workflow. ### Why are the changes needed? The output files are already protected by ZipCrypto but this PR makes it even safer by redacting sensitive information in log files. ### Does this PR introduce _any_ user-facing change? No, dev-only. ### How was this patch tested? Manually tested in https://github.com/HyukjinKwon/spark/actions/runs/15481551209/job/43588217131 ### Was this patch authored or co-authored using generative AI tooling? No. Closes #51102 from HyukjinKwon/redact-sensitive-info-in-logs. Authored-by: Hyukjin Kwon <gurwls223@apache.org> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
1 parent b196c24 commit ced68a0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,19 @@ jobs:
228228
wait $RELEASE_PID
229229
kill $TAIL_PID1 $TAIL_PID2 || true
230230
231+
# Redact sensitive information in log files
232+
shopt -s globstar nullglob
233+
FILES=("$RELEASE_DIR/docker-build.log" "$OUTPUT_DIR/"*.log)
234+
PATTERNS=("$ASF_USERNAME" "$ASF_PASSWORD" "$GPG_PRIVATE_KEY" "$GPG_PASSPHRASE" "$PYPI_API_TOKEN")
235+
for file in "${FILES[@]}"; do
236+
[ -f "$file" ] || continue
237+
cp "$file" "$file.bak"
238+
for pattern in "${PATTERNS[@]}"; do
239+
regex="${pattern//\*/.*}"
240+
sed -i "s/$regex/***/g" "$file"
241+
done
242+
done
243+
231244
# Zip logs/output
232245
if [ "$DRYRUN_MODE" = "1" ]; then
233246
zip logs.zip "$RELEASE_DIR/docker-build.log" "$OUTPUT_DIR/"*.log

0 commit comments

Comments
 (0)