lasdf1234 commented on code in PR #14979:
URL: https://github.com/apache/gravitino/pull/14979#discussion_r4583051013
##########
core/src/main/java/org/apache/gravitino/job/local/SparkProcessBuilder.java:
##########
@@ -152,9 +153,11 @@ public Process start() {
builder.redirectOutput(outputFile);
builder.redirectError(errorFile);
+ // Mask --updater-options / --spark-conf for the log only; ProcessBuilder
keeps the plaintext
+ // commandList.
LOG.info(
"Starting local Spark job with command: {}, environment variable
names: {}",
- Joiner.on(" ").join(commandList),
+ Joiner.on("
").join(JobRuntimeTemplateMaskUtils.maskSensitiveArguments(commandList)),
Review Comment:
Thanks for the catch — addressed in the latest commit.
`maskSensitiveArguments` now also masks `--conf key=value` /
`--conf=key=value` when the key matches
`SecretPropertyUtils.isSensitivePropertyKey`. Local Spark/Shell INFO logging
already goes through that helper, so sensitive template `configs` emitted as
`--conf` are masked in the logged copy while `ProcessBuilder` still gets
plaintext.
##########
core/src/main/java/org/apache/gravitino/job/local/SparkProcessBuilder.java:
##########
@@ -152,9 +153,11 @@ public Process start() {
builder.redirectOutput(outputFile);
builder.redirectError(errorFile);
+ // Mask --updater-options / --spark-conf for the log only; ProcessBuilder
keeps the plaintext
+ // commandList.
LOG.info(
"Starting local Spark job with command: {}, environment variable
names: {}",
- Joiner.on(" ").join(commandList),
+ Joiner.on("
").join(JobRuntimeTemplateMaskUtils.maskSensitiveArguments(commandList)),
Review Comment:
Thanks — fixed in the latest commit.
Both `HiddenPropertyMaskUtils` and
`JobRuntimeTemplateMaskUtils.safeMaskSensitiveJsonValue` now emit fixed WARN
messages only (no `e.toString()` / exception text), so Jackson location text
cannot re-leak malformed credential JSON. Added
`testMalformedCredentialJsonDoesNotLeakInMaskingLogs` (log-capture) to assert
the secret/malformed input is absent from emitted messages. The same helpers
cover `ShellProcessBuilder` as well.
Also addressed the related `--conf` residual in the same change: sensitive
`--conf` keys are masked via `maskSensitiveArguments`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]