Skip to content

TEZ-4756: DAGUtils: configuration handling improvements - #539

Open
abstractdog wants to merge 2 commits into
apache:masterfrom
abstractdog:TEZ-4756
Open

abstractdog wants to merge 2 commits into
apache:masterfrom
abstractdog:TEZ-4756

Conversation

@abstractdog

Copy link
Copy Markdown
Contributor

Route each key/value pair through Hadoop's ConfigRedactor when building the ATS configuration map, so values matching the cluster's configured sensitive-key pattern are masked in the map published to Timeline. Adds a unit test.

Route each key/value pair through Hadoop's ConfigRedactor when building
the ATS configuration map, so values matching the cluster's configured
sensitive-key pattern are masked in the map published to Timeline.
Adds a unit test.

Co-Authored-By: Claude Code <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new unit test includes credential-like strings that can trigger secret-scanning and it should be adjusted to use safe placeholders and more reliably exercise default redaction behavior.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Improves how Tez publishes AM configuration data to YARN Timeline/ATS by redacting sensitive configuration values (based on Hadoop’s sensitive-key patterns) before building the ATS configuration map, and adds a unit test covering redaction behavior.

Changes:

  • Route all configuration values through Hadoop ConfigRedactor in DAGUtils.convertConfigurationToATSMap.
  • Add a unit test verifying sensitive keys are masked and non-sensitive keys remain unchanged.
File summaries
File Description
tez-dag/src/main/java/org/apache/tez/dag/history/utils/DAGUtils.java Redacts configuration values via ConfigRedactor before publishing to ATS.
tez-dag/src/test/java/org/apache/tez/dag/history/utils/TestDAGUtils.java Adds a unit test validating redaction behavior for sensitive configuration keys.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.


@Test
public void testConvertConfigurationToATSMapRedactsSecrets() {
Configuration conf = new Configuration(false);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack, DAGAppMaster for example simply instantiates new Configuration(), so this makes sense

Comment on lines +232 to +250
// These keys are covered by Hadoop's default
// hadoop.security.sensitive-config-keys pattern.
conf.set("fs.s3a.secret.key", "wJalrXUtnFEMI/K7MDENG/bPxRfiCYSECRET");
conf.set("fs.s3a.access.key", "AKIAIOSFODNN7EXAMPLE");
conf.set("ssl.server.keystore.password", "SuperSecretKeystorePass!");
conf.set("hadoop.security.credential.provider.password", "credpass");

Map<String, String> ats = DAGUtils.convertConfigurationToATSMap(conf);

assertEquals("org.apache.tez.dag.app.dag.impl.DAGSchedulerNaturalOrder",
ats.get("tez.am.dag.scheduler.class"));
assertEquals("normal-job", ats.get("mapreduce.job.name"));
assertFalse(ats.get("fs.s3a.secret.key").contains("SECRET"),
"s3a secret key must be redacted, got: " + ats.get("fs.s3a.secret.key"));
assertFalse(ats.get("ssl.server.keystore.password").contains("SuperSecret"),
"keystore password must be redacted, got: " + ats.get("ssl.server.keystore.password"));
assertFalse(ats.get("hadoop.security.credential.provider.password").contains("credpass"),
"credential provider password must be redacted, got: "
+ ats.get("hadoop.security.credential.provider.password"));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack, even if I like these realistic values

@tez-yetus

Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 11m 49s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ master Compile Tests _
+1 💚 mvninstall 4m 45s master passed
+1 💚 compile 4m 2s master passed
+1 💚 checkstyle 0m 43s master passed
+1 💚 javadoc 0m 31s master passed
+0 🆗 spotbugs 1m 44s tez-dag in master has 537 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 44s the patch passed
+1 💚 codespell 1m 35s No new issues.
+1 💚 compile 4m 3s the patch passed
+1 💚 javac 4m 3s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 37s the patch passed
+1 💚 javadoc 0m 28s the patch passed
+1 💚 spotbugs 1m 54s the patch passed
_ Other Tests _
+1 💚 unit 77m 34s root in the patch passed.
+1 💚 asflicense 0m 34s The patch does not generate ASF License warnings.
115m 43s
Subsystem Report/Notes
Docker ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-539/1/artifact/out/Dockerfile
Optional Tests dupname compile unit asflicense javac javadoc spotbugs checkstyle codespell detsecrets
uname Linux 9ad9e79cb528 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality tez-personality.sh
git revision master / 0e9f756
Default Java Eclipse Adoptium-21.0.12+8-LTS
Test Results https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-539/1/testReport/
Max. process+thread count 1343 (vs. ulimit of 5500)
modules C: tez-dag U: tez-dag
Console output https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-539/1/console
versions git=2.43.0 maven=3.9.15 spotbugs=4.9.3 codespell=2.4.1
Powered by Apache Yetus 0.15.1 https://yetus.apache.org

This message was automatically generated.

@tez-yetus

Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 41s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ master Compile Tests _
+1 💚 mvninstall 4m 58s master passed
+1 💚 compile 4m 2s master passed
+1 💚 checkstyle 0m 43s master passed
+1 💚 javadoc 0m 31s master passed
+0 🆗 spotbugs 1m 40s tez-dag in master has 537 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 50s the patch passed
+1 💚 codespell 1m 34s No new issues.
+1 💚 compile 4m 2s the patch passed
+1 💚 javac 4m 2s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 38s the patch passed
+1 💚 javadoc 0m 30s the patch passed
+1 💚 spotbugs 1m 52s the patch passed
_ Other Tests _
-1 ❌ unit 75m 38s /patch-unit-root.txt root in the patch passed.
+1 💚 asflicense 0m 34s The patch does not generate ASF License warnings.
102m 55s
Reason Tests
Failed junit tests tez.history.TestHistoryParser
tez.dag.app.TestSpeculation
Subsystem Report/Notes
Docker ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-539/2/artifact/out/Dockerfile
Optional Tests dupname compile unit asflicense javac javadoc spotbugs checkstyle codespell detsecrets
uname Linux 564e25b4f947 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality tez-personality.sh
git revision master / 0e9f756
Default Java Eclipse Adoptium-21.0.12+8-LTS
Test Results https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-539/2/testReport/
Max. process+thread count 1544 (vs. ulimit of 5500)
modules C: tez-dag U: tez-dag
Console output https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-539/2/console
versions git=2.43.0 maven=3.9.15 spotbugs=4.9.3 codespell=2.4.1
Powered by Apache Yetus 0.15.1 https://yetus.apache.org

This message was automatically generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants