abstractdog commented on code in PR #539:
URL: https://github.com/apache/tez/pull/539#discussion_r4061890699
##########
tez-dag/src/test/java/org/apache/tez/dag/history/utils/TestDAGUtils.java:
##########
@@ -222,4 +222,32 @@ public void testConvertDAGPlanToATSMap() throws
IOException, JSONException {
}
}
+ @Test
+ public void testConvertConfigurationToATSMapRedactsSecrets() {
+ Configuration conf = new Configuration(false);
+ // Non-sensitive properties must pass through unchanged.
+ conf.set("tez.am.dag.scheduler.class",
+ "org.apache.tez.dag.app.dag.impl.DAGSchedulerNaturalOrder");
+ conf.set("mapreduce.job.name", "normal-job");
+ // 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"));
Review Comment:
ack, even if I like these realistic values
--
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]