Skip to content

Commit 90ac496

Browse files
committed
feat(crashtracking): Simplify sys property filtering
Precisely this matches any `key` rather that composite terms like `app-key`, which covers more ground.
1 parent cd5b227 commit 90ac496

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/parsers/RuntimeArgs.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,7 @@
2020
*/
2121
final class RuntimeArgs {
2222
private static final String[] SECRET_PROPERTY_KEYWORDS = {
23-
"password",
24-
"passwd",
25-
"secret",
26-
"token",
27-
"apikey",
28-
"api-key",
29-
"accesskey",
30-
"access-key",
31-
"privatekey",
32-
"private-key",
33-
"credential"
23+
"password", "passwd", "secret", "token", "key", "credential"
3424
};
3525
private static final String[] MODULE_OPTIONS = {
3626
"--add-modules",

dd-java-agent/agent-crashtracking/src/test/java/datadog/crashtracking/parsers/RuntimeArgsTest.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,14 @@ public void testParseVmArgsHandlesQuotedArguments(String raw, String expectedInc
5555
}
5656

5757
@TableTest({
58-
"scenario | raw | isIncluded | vmArg ",
59-
"java password excluded | -Djava.net.password=hunter2 | false | -Djava.net.password=hunter2 ",
60-
"sun token excluded | -Dsun.auth.token=abc123 | false | -Dsun.auth.token=abc123 ",
61-
"dd api key excluded | -Ddd.api-key=deadbeef | false | -Ddd.api-key=deadbeef ",
62-
"java logging kept | -Djava.util.logging.config.file=x | true | -Djava.util.logging.config.file=x",
63-
"osgi install kept | -Dosgi.install.area=/opt/app | true | -Dosgi.install.area=/opt/app "
58+
"scenario | raw | isIncluded | vmArg ",
59+
"java password excluded | -Djava.net.password=hunter2 | false | -Djava.net.password=hunter2 ",
60+
"sun token excluded | -Dsun.auth.token=abc123 | false | -Dsun.auth.token=abc123 ",
61+
"dd api key excluded | -Ddd.api-key=deadbeef | false | -Ddd.api-key=deadbeef ",
62+
"dd app key excluded | -Ddd.app-key=deadbeef | false | -Ddd.app-key=deadbeef ",
63+
"dd application key excluded | -Ddd.application-key=deadbeef | false | -Ddd.application-key=deadbeef ",
64+
"java logging kept | -Djava.util.logging.config.file=x | true | -Djava.util.logging.config.file=x",
65+
"osgi install kept | -Dosgi.install.area=/opt/app | true | -Dosgi.install.area=/opt/app "
6466
})
6567
public void testParseVmArgsExcludesSecretLikeSystemProperties(
6668
String raw, boolean isIncluded, String vmArg) {

0 commit comments

Comments
 (0)