Skip to content

Commit 2616b64

Browse files
authored
Apply the standard nomenclature to the stacktrace configs (#8244)
What Does This Do Add STACK_TRACE config properties and set them as principal key in Config class Keep legacy STACKTRACE config properties and set them as alias Motivation Standarize APPSEC and IAST STACK_TRACE config properties
1 parent cc8f172 commit 2616b64

File tree

3 files changed

+33
-10
lines changed

3 files changed

+33
-10
lines changed

dd-trace-api/src/main/java/datadog/trace/api/config/AppSecConfig.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,15 @@ public final class AppSecConfig {
3030

3131
public static final String APPSEC_SCA_ENABLED = "appsec.sca.enabled";
3232
public static final String APPSEC_RASP_ENABLED = "appsec.rasp.enabled";
33-
public static final String APPSEC_STACK_TRACE_ENABLED = "appsec.stacktrace.enabled";
34-
public static final String APPSEC_MAX_STACK_TRACES = "appsec.max.stacktraces";
35-
public static final String APPSEC_MAX_STACK_TRACE_DEPTH = "appsec.max.stacktrace.depth";
33+
public static final String APPSEC_STACK_TRACE_ENABLED = "appsec.stack-trace.enabled";
34+
public static final String APPSEC_STACKTRACE_ENABLED_DEPRECATED =
35+
"appsec.stacktrace.enabled"; // old non-standard as a fallback alias
36+
public static final String APPSEC_MAX_STACK_TRACES = "appsec.max.stack-traces";
37+
public static final String APPSEC_MAX_STACKTRACES_DEPRECATED =
38+
"appsec.max.stacktraces"; // old non-standard as a fallback alias
39+
public static final String APPSEC_MAX_STACK_TRACE_DEPTH = "appsec.max.stack-trace.depth";
40+
public static final String APPSEC_MAX_STACKTRACE_DEPTH_DEPRECATED =
41+
"appsec.max.stacktrace.depth"; // old non-standard as a fallback alias
3642

3743
public static final String APPSEC_STANDALONE_ENABLED = "experimental.appsec.standalone.enabled";
3844

dd-trace-api/src/main/java/datadog/trace/api/config/IastConfig.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ public final class IastConfig {
1616
public static final String IAST_REDACTION_ENABLED = "iast.redaction.enabled";
1717
public static final String IAST_REDACTION_NAME_PATTERN = "iast.redaction.name.pattern";
1818
public static final String IAST_REDACTION_VALUE_PATTERN = "iast.redaction.value.pattern";
19-
public static final String IAST_STACKTRACE_LEAK_SUPPRESS = "iast.stacktrace-leak.suppress";
19+
public static final String IAST_STACK_TRACE_LEAK_SUPPRESS = "iast.stack-trace-leak.suppress";
20+
public static final String IAST_STACKTRACE_LEAK_SUPPRESS_DEPRECATED =
21+
"iast.stacktrace-leak.suppress"; // old non-standard as a fallback alias
2022
public static final String IAST_HARDCODED_SECRET_ENABLED = "iast.hardcoded-secret.enabled";
2123
public static final String IAST_MAX_RANGE_COUNT = "iast.max-range-count";
2224
public static final String IAST_TRUNCATION_MAX_VALUE_LENGTH = "iast.truncation.max.value.length";
@@ -26,7 +28,9 @@ public final class IastConfig {
2628
public static final String IAST_SOURCE_MAPPING_MAX_SIZE = "iast.source-mapping.max-size";
2729
public static final String IAST_EXPERIMENTAL_PROPAGATION_ENABLED =
2830
"iast.experimental.propagation.enabled";
29-
public static final String IAST_STACK_TRACE_ENABLED = "iast.stacktrace.enabled";
31+
public static final String IAST_STACK_TRACE_ENABLED = "iast.stack-trace.enabled";
32+
public static final String IAST_STACKTRACE_ENABLED_DEPRECATED =
33+
"iast.stacktrace.enabled"; // old non-standard as a fallback alias
3034
public static final String IAST_SECURITY_CONTROLS_CONFIGURATION =
3135
"iast.security-controls.configuration";
3236
public static final String IAST_DB_ROWS_TO_TAINT = "iast.db.rows-to-taint";

internal-api/src/main/java/datadog/trace/api/Config.java

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,12 +1284,20 @@ PROFILING_DATADOG_PROFILER_ENABLED, isDatadogProfilerSafeInCurrentEnvironment())
12841284
appSecStandaloneEnabled = configProvider.getBoolean(APPSEC_STANDALONE_ENABLED, false);
12851285
appSecRaspEnabled = configProvider.getBoolean(APPSEC_RASP_ENABLED, DEFAULT_APPSEC_RASP_ENABLED);
12861286
appSecStackTraceEnabled =
1287-
configProvider.getBoolean(APPSEC_STACK_TRACE_ENABLED, DEFAULT_APPSEC_STACK_TRACE_ENABLED);
1287+
configProvider.getBoolean(
1288+
APPSEC_STACK_TRACE_ENABLED,
1289+
DEFAULT_APPSEC_STACK_TRACE_ENABLED,
1290+
APPSEC_STACKTRACE_ENABLED_DEPRECATED);
12881291
appSecMaxStackTraces =
1289-
configProvider.getInteger(APPSEC_MAX_STACK_TRACES, DEFAULT_APPSEC_MAX_STACK_TRACES);
1292+
configProvider.getInteger(
1293+
APPSEC_MAX_STACK_TRACES,
1294+
DEFAULT_APPSEC_MAX_STACK_TRACES,
1295+
APPSEC_MAX_STACKTRACES_DEPRECATED);
12901296
appSecMaxStackTraceDepth =
12911297
configProvider.getInteger(
1292-
APPSEC_MAX_STACK_TRACE_DEPTH, DEFAULT_APPSEC_MAX_STACK_TRACE_DEPTH);
1298+
APPSEC_MAX_STACK_TRACE_DEPTH,
1299+
DEFAULT_APPSEC_MAX_STACK_TRACE_DEPTH,
1300+
APPSEC_MAX_STACKTRACE_DEPTH_DEPRECATED);
12931301
apiSecurityEnabled =
12941302
configProvider.getBoolean(
12951303
API_SECURITY_ENABLED, DEFAULT_API_SECURITY_ENABLED, API_SECURITY_ENABLED_EXPERIMENTAL);
@@ -1330,7 +1338,9 @@ PROFILING_DATADOG_PROFILER_ENABLED, isDatadogProfilerSafeInCurrentEnvironment())
13301338
iastMaxRangeCount = iastDetectionMode.getIastMaxRangeCount(configProvider);
13311339
iastStacktraceLeakSuppress =
13321340
configProvider.getBoolean(
1333-
IAST_STACKTRACE_LEAK_SUPPRESS, DEFAULT_IAST_STACKTRACE_LEAK_SUPPRESS);
1341+
IAST_STACK_TRACE_LEAK_SUPPRESS,
1342+
DEFAULT_IAST_STACKTRACE_LEAK_SUPPRESS,
1343+
IAST_STACKTRACE_LEAK_SUPPRESS_DEPRECATED);
13341344
iastHardcodedSecretEnabled =
13351345
configProvider.getBoolean(
13361346
IAST_HARDCODED_SECRET_ENABLED, DEFAULT_IAST_HARDCODED_SECRET_ENABLED);
@@ -1340,7 +1350,10 @@ PROFILING_DATADOG_PROFILER_ENABLED, isDatadogProfilerSafeInCurrentEnvironment())
13401350
iastSourceMappingEnabled = configProvider.getBoolean(IAST_SOURCE_MAPPING_ENABLED, false);
13411351
iastSourceMappingMaxSize = configProvider.getInteger(IAST_SOURCE_MAPPING_MAX_SIZE, 1000);
13421352
iastStackTraceEnabled =
1343-
configProvider.getBoolean(IAST_STACK_TRACE_ENABLED, DEFAULT_IAST_STACK_TRACE_ENABLED);
1353+
configProvider.getBoolean(
1354+
IAST_STACK_TRACE_ENABLED,
1355+
DEFAULT_IAST_STACK_TRACE_ENABLED,
1356+
IAST_STACKTRACE_ENABLED_DEPRECATED);
13441357
iastExperimentalPropagationEnabled =
13451358
configProvider.getBoolean(IAST_EXPERIMENTAL_PROPAGATION_ENABLED, false);
13461359
iastSecurityControlsConfiguration =

0 commit comments

Comments
 (0)