Skip to content

Commit 8ca58b5

Browse files
Use bytes instead of strings in IAST metrics (DataDog#5872)
1 parent 7637ec5 commit 8ca58b5

87 files changed

Lines changed: 518 additions & 330 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

buildSrc/call-site-instrumentation-plugin/src/main/java/datadog/trace/plugin/csi/impl/ext/IastExtension.java

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
import com.github.javaparser.ast.expr.AnnotationExpr;
1717
import com.github.javaparser.ast.expr.AssignExpr;
1818
import com.github.javaparser.ast.expr.BooleanLiteralExpr;
19+
import com.github.javaparser.ast.expr.CastExpr;
1920
import com.github.javaparser.ast.expr.Expression;
2021
import com.github.javaparser.ast.expr.FieldAccessExpr;
22+
import com.github.javaparser.ast.expr.IntegerLiteralExpr;
2123
import com.github.javaparser.ast.expr.LambdaExpr;
2224
import com.github.javaparser.ast.expr.MemberValuePair;
2325
import com.github.javaparser.ast.expr.MethodCallExpr;
@@ -172,7 +174,7 @@ private void addTelemetryToAdvice(
172174
final TypeResolver resolver, final LambdaExpr adviceLambda, final AdviceMetadata metaData) {
173175
final BlockStmt lambdaBody = adviceLambda.getBody().asBlockStmt();
174176
final String metric = getMetricName(metaData);
175-
final String tagValue = getMetricTagValue(resolver, metaData);
177+
final Byte tagValue = getMetricTagValue(resolver, metaData);
176178
final String instrumentedMetric = "INSTRUMENTED_" + metric;
177179
final IfStmt instrumentedStatement =
178180
new IfStmt()
@@ -197,22 +199,24 @@ private static Expression isEnabledCondition(final String metric) {
197199
}
198200

199201
private static MethodCallExpr addTelemetryCollectorMethod(
200-
final String metric, final String tagValue) {
202+
final String metric, final Byte tagValue) {
201203
final MethodCallExpr method =
202204
new MethodCallExpr()
203205
.setScope(new NameExpr(IAST_METRIC_COLLECTOR_CLASS))
204206
.setName("add")
205207
.addArgument(
206208
new FieldAccessExpr().setScope(new NameExpr(IAST_METRIC_CLASS)).setName(metric));
207209
if (tagValue != null) {
208-
method.addArgument(new StringLiteralExpr(tagValue));
210+
method.addArgument(
211+
new CastExpr()
212+
.setExpression(new IntegerLiteralExpr(Byte.toString(tagValue)))
213+
.setType(byte.class));
209214
}
210215
method.addArgument(intLiteral(1));
211216
return method;
212217
}
213218

214-
private static BlockStmt addTelemetryCollectorByteCode(
215-
final String metric, final String tagValue) {
219+
private static BlockStmt addTelemetryCollectorByteCode(final String metric, final Byte tagValue) {
216220
final BlockStmt stmt = new BlockStmt();
217221
// this code generates the java source code needed to provide the bytecode for the statement
218222
// IastTelemetryCollector.add(${metric}, 1); or IastTelemetryCollector.add(${metric}, ${tag},
@@ -227,11 +231,7 @@ private static BlockStmt addTelemetryCollectorByteCode(
227231
.addArgument(new StringLiteralExpr(metric))
228232
.addArgument(new StringLiteralExpr("L" + IAST_METRIC_INTERNAL_NAME + ";")));
229233
if (tagValue != null) {
230-
stmt.addStatement(
231-
new MethodCallExpr()
232-
.setScope(new NameExpr("handler"))
233-
.setName("loadConstant")
234-
.addArgument(new StringLiteralExpr(tagValue)));
234+
stmt.addStatement(pushByteExpression(tagValue));
235235
}
236236
stmt.addStatement(
237237
new MethodCallExpr()
@@ -241,7 +241,7 @@ private static BlockStmt addTelemetryCollectorByteCode(
241241
new FieldAccessExpr().setScope(new NameExpr(OPCODES_FQDN)).setName("ICONST_1")));
242242
final String descriptor =
243243
tagValue != null
244-
? "(L" + IAST_METRIC_INTERNAL_NAME + ";Ljava/lang/String;I)V"
244+
? "(L" + IAST_METRIC_INTERNAL_NAME + ";BI)V"
245245
: "(L" + IAST_METRIC_INTERNAL_NAME + ";I)V";
246246
stmt.addStatement(
247247
new MethodCallExpr()
@@ -261,26 +261,26 @@ private static String getMetricName(final AdviceMetadata metaData) {
261261
return kind.getName().getId().toUpperCase();
262262
}
263263

264-
private static String getMetricTagValue(
264+
private static Byte getMetricTagValue(
265265
final TypeResolver resolver, final AdviceMetadata metadata) {
266266
if (metadata.getTag() == null) {
267267
return null;
268268
}
269269
final Expression tag = metadata.getTag();
270-
if (tag.isStringLiteralExpr()) {
271-
return tag.asStringLiteralExpr().getValue();
270+
if (tag.isIntegerLiteralExpr()) {
271+
return tag.asIntegerLiteralExpr().asNumber().byteValue();
272272
} else {
273273
return getFieldValue(resolver, tag.asFieldAccessExpr());
274274
}
275275
}
276276

277-
private static String getFieldValue(final TypeResolver resolver, final FieldAccessExpr tag) {
277+
private static Byte getFieldValue(final TypeResolver resolver, final FieldAccessExpr tag) {
278278
final FieldAccessExpr fieldAccessExpr = tag.asFieldAccessExpr();
279279
final ResolvedFieldDeclaration value = fieldAccessExpr.resolve().asField();
280280
try {
281281
final Field field = getField(value);
282282
field.setAccessible(true);
283-
return (String) field.get(field.getDeclaringClass());
283+
return (Byte) field.get(field.getDeclaringClass());
284284
} catch (Exception e) {
285285
throw new RuntimeException(e);
286286
}
@@ -420,6 +420,31 @@ private static Expression getAnnotationExpression(final AnnotationExpr expr) {
420420
}
421421
}
422422

423+
public static Expression pushByteExpression(final byte value) {
424+
final FieldAccessExpr opCodes = new FieldAccessExpr().setScope(new NameExpr(OPCODES_FQDN));
425+
final MethodCallExpr result =
426+
new MethodCallExpr().setScope(new NameExpr("handler")).setName("instruction");
427+
switch (value) {
428+
case -1:
429+
result.addArgument(opCodes.setName("ICONST_M1"));
430+
break;
431+
case 0:
432+
case 1:
433+
case 2:
434+
case 3:
435+
case 4:
436+
case 5:
437+
result.addArgument(opCodes.setName("ICONST_" + value));
438+
break;
439+
default:
440+
result
441+
.addArgument(opCodes.setName("BIPUSH"))
442+
.addArgument(new IntegerLiteralExpr(Integer.toString(value)));
443+
break;
444+
}
445+
return result;
446+
}
447+
423448
private static class AdviceMetadata {
424449
private final AnnotationExpr kind;
425450
private final Expression tag;

buildSrc/call-site-instrumentation-plugin/src/test/groovy/datadog/trace/plugin/csi/impl/ext/IastExtensionTest.groovy

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import datadog.trace.plugin.csi.impl.assertion.AdviceAssert
1313
import datadog.trace.plugin.csi.impl.assertion.AssertBuilder
1414
import datadog.trace.plugin.csi.impl.assertion.CallSiteAssert
1515
import datadog.trace.plugin.csi.impl.ext.tests.IastExtensionCallSite
16+
import datadog.trace.plugin.csi.impl.ext.tests.SourceTypes
1617
import groovy.transform.CompileDynamic
1718
import spock.lang.TempDir
1819

@@ -85,18 +86,32 @@ class IastExtensionTest extends BaseCsiPluginTest {
8586
advices(0) {
8687
pointcut('javax/servlet/http/HttpServletRequest', 'getHeader', '(Ljava/lang/String;)Ljava/lang/String;')
8788
instrumentedMetric('IastMetric.INSTRUMENTED_SOURCE') {
88-
metricStatements('IastMetricCollector.add(IastMetric.INSTRUMENTED_SOURCE, "http.request.header.name", 1);')
89+
metricStatements('IastMetricCollector.add(IastMetric.INSTRUMENTED_SOURCE, (byte) 3, 1);')
8990
}
9091
executedMetric('IastMetric.EXECUTED_SOURCE') {
9192
metricStatements(
9293
'handler.field(net.bytebuddy.jar.asm.Opcodes.GETSTATIC, "datadog/trace/api/iast/telemetry/IastMetric", "EXECUTED_SOURCE", "Ldatadog/trace/api/iast/telemetry/IastMetric;");',
93-
'handler.loadConstant("http.request.header.name");',
94+
'handler.instruction(net.bytebuddy.jar.asm.Opcodes.ICONST_3);',
9495
'handler.instruction(net.bytebuddy.jar.asm.Opcodes.ICONST_1);',
95-
'handler.method(net.bytebuddy.jar.asm.Opcodes.INVOKESTATIC, "datadog/trace/api/iast/telemetry/IastMetricCollector", "add", "(Ldatadog/trace/api/iast/telemetry/IastMetric;Ljava/lang/String;I)V", false);'
96+
'handler.method(net.bytebuddy.jar.asm.Opcodes.INVOKESTATIC, "datadog/trace/api/iast/telemetry/IastMetricCollector", "add", "(Ldatadog/trace/api/iast/telemetry/IastMetric;BI)V", false);'
9697
)
9798
}
9899
}
99100
advices(1) {
101+
pointcut('javax/servlet/http/HttpServletRequest', 'getInputStream', '()Ljavax/servlet/ServletInputStream;')
102+
instrumentedMetric('IastMetric.INSTRUMENTED_SOURCE') {
103+
metricStatements('IastMetricCollector.add(IastMetric.INSTRUMENTED_SOURCE, (byte) 127, 1);')
104+
}
105+
executedMetric('IastMetric.EXECUTED_SOURCE') {
106+
metricStatements(
107+
'handler.field(net.bytebuddy.jar.asm.Opcodes.GETSTATIC, "datadog/trace/api/iast/telemetry/IastMetric", "EXECUTED_SOURCE", "Ldatadog/trace/api/iast/telemetry/IastMetric;");',
108+
'handler.instruction(net.bytebuddy.jar.asm.Opcodes.BIPUSH, 127);',
109+
'handler.instruction(net.bytebuddy.jar.asm.Opcodes.ICONST_1);',
110+
'handler.method(net.bytebuddy.jar.asm.Opcodes.INVOKESTATIC, "datadog/trace/api/iast/telemetry/IastMetricCollector", "add", "(Ldatadog/trace/api/iast/telemetry/IastMetric;BI)V", false);'
111+
)
112+
}
113+
}
114+
advices(2) {
100115
pointcut('javax/servlet/ServletRequest', 'getReader', '()Ljava/io/BufferedReader;')
101116
instrumentedMetric('IastMetric.INSTRUMENTED_PROPAGATION') {
102117
metricStatements('IastMetricCollector.add(IastMetric.INSTRUMENTED_PROPAGATION, 1);')

buildSrc/call-site-instrumentation-plugin/src/test/java/datadog/trace/plugin/csi/impl/ext/tests/IastExtensionCallSite.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
import datadog.trace.agent.tooling.csi.CallSite;
44
import java.io.BufferedReader;
5+
import javax.servlet.ServletInputStream;
56
import javax.servlet.ServletRequest;
67
import javax.servlet.http.HttpServletRequest;
78

89
@CallSite(spi = IastCallSites.class)
910
public class IastExtensionCallSite {
1011

11-
@Source(SourceTypes.REQUEST_HEADER_NAME_STRING)
12+
@Source(SourceTypes.REQUEST_HEADER_NAME)
1213
@CallSite.After(
1314
"java.lang.String javax.servlet.http.HttpServletRequest.getHeader(java.lang.String)")
1415
public static String afterGetHeader(
@@ -18,6 +19,15 @@ public static String afterGetHeader(
1819
return headerValue;
1920
}
2021

22+
@Source(SourceTypes.REQUEST_BODY)
23+
@CallSite.After(
24+
"javax.servlet.ServletInputStream javax.servlet.http.HttpServletRequest.getInputStream()")
25+
public static ServletInputStream afterGetInputStream(
26+
@CallSite.This final HttpServletRequest self,
27+
@CallSite.Return final ServletInputStream stream) {
28+
return stream;
29+
}
30+
2131
@Propagation
2232
@CallSite.After("java.io.BufferedReader javax.servlet.ServletRequest.getReader()")
2333
public static BufferedReader afterGetReader(

buildSrc/call-site-instrumentation-plugin/src/test/java/datadog/trace/plugin/csi/impl/ext/tests/Source.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
@Retention(RetentionPolicy.RUNTIME)
1010
public @interface Source {
1111
/** Source type */
12-
String value();
12+
byte value();
1313
}

buildSrc/call-site-instrumentation-plugin/src/test/java/datadog/trace/plugin/csi/impl/ext/tests/SourceTypes.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22

33
public class SourceTypes {
44

5-
public static final String REQUEST_HEADER_NAME_STRING = "http.request.header.name";
5+
public static final byte REQUEST_HEADER_NAME = 3;
6+
7+
public static final byte REQUEST_BODY = 127;
68
}

dd-java-agent/agent-iast/src/main/java/com/datadog/iast/model/VulnerabilityType.java

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,55 +10,58 @@
1010

1111
public interface VulnerabilityType {
1212
VulnerabilityType WEAK_CIPHER =
13-
new VulnerabilityTypeImpl(VulnerabilityTypes.WEAK_CIPHER, NOT_MARKED);
14-
VulnerabilityType WEAK_HASH = new VulnerabilityTypeImpl(VulnerabilityTypes.WEAK_HASH, NOT_MARKED);
13+
new VulnerabilityTypeImpl(VulnerabilityTypes.WEAK_CIPHER_STRING, NOT_MARKED);
14+
VulnerabilityType WEAK_HASH =
15+
new VulnerabilityTypeImpl(VulnerabilityTypes.WEAK_HASH_STRING, NOT_MARKED);
1516
VulnerabilityType INSECURE_COOKIE =
16-
new VulnerabilityTypeImpl(VulnerabilityTypes.INSECURE_COOKIE, NOT_MARKED);
17+
new VulnerabilityTypeImpl(VulnerabilityTypes.INSECURE_COOKIE_STRING, NOT_MARKED);
1718
VulnerabilityType NO_HTTPONLY_COOKIE =
18-
new VulnerabilityTypeImpl(VulnerabilityTypes.NO_HTTPONLY_COOKIE, NOT_MARKED);
19+
new VulnerabilityTypeImpl(VulnerabilityTypes.NO_HTTPONLY_COOKIE_STRING, NOT_MARKED);
1920
VulnerabilityType HSTS_HEADER_MISSING =
20-
new VulnerabilityTypeImpl(VulnerabilityTypes.HSTS_HEADER_MISSING, NOT_MARKED);
21+
new VulnerabilityTypeImpl(VulnerabilityTypes.HSTS_HEADER_MISSING_STRING, NOT_MARKED);
2122
VulnerabilityType XCONTENTTYPE_HEADER_MISSING =
22-
new VulnerabilityTypeImpl(VulnerabilityTypes.XCONTENTTYPE_HEADER_MISSING, NOT_MARKED);
23+
new VulnerabilityTypeImpl(VulnerabilityTypes.XCONTENTTYPE_HEADER_MISSING_STRING, NOT_MARKED);
2324
VulnerabilityType NO_SAMESITE_COOKIE =
24-
new VulnerabilityTypeImpl(VulnerabilityTypes.NO_SAMESITE_COOKIE, NOT_MARKED);
25+
new VulnerabilityTypeImpl(VulnerabilityTypes.NO_SAMESITE_COOKIE_STRING, NOT_MARKED);
2526

2627
InjectionType SQL_INJECTION =
2728
new InjectionTypeImpl(
28-
VulnerabilityTypes.SQL_INJECTION, VulnerabilityMarks.SQL_INJECTION_MARK, ' ');
29+
VulnerabilityTypes.SQL_INJECTION_STRING, VulnerabilityMarks.SQL_INJECTION_MARK, ' ');
2930
InjectionType COMMAND_INJECTION =
3031
new InjectionTypeImpl(
31-
VulnerabilityTypes.COMMAND_INJECTION, VulnerabilityMarks.COMMAND_INJECTION_MARK, ' ');
32+
VulnerabilityTypes.COMMAND_INJECTION_STRING,
33+
VulnerabilityMarks.COMMAND_INJECTION_MARK,
34+
' ');
3235
InjectionType PATH_TRAVERSAL =
3336
new InjectionTypeImpl(
34-
VulnerabilityTypes.PATH_TRAVERSAL,
37+
VulnerabilityTypes.PATH_TRAVERSAL_STRING,
3538
VulnerabilityMarks.PATH_TRAVERSAL_MARK,
3639
File.separatorChar);
3740
InjectionType LDAP_INJECTION =
3841
new InjectionTypeImpl(
39-
VulnerabilityTypes.LDAP_INJECTION, VulnerabilityMarks.LDAP_INJECTION_MARK, ' ');
42+
VulnerabilityTypes.LDAP_INJECTION_STRING, VulnerabilityMarks.LDAP_INJECTION_MARK, ' ');
4043
InjectionType SSRF =
41-
new InjectionTypeImpl(VulnerabilityTypes.SSRF, VulnerabilityMarks.SSRF_MARK, ' ');
44+
new InjectionTypeImpl(VulnerabilityTypes.SSRF_STRING, VulnerabilityMarks.SSRF_MARK, ' ');
4245
InjectionType UNVALIDATED_REDIRECT =
4346
new InjectionTypeImpl(
44-
VulnerabilityTypes.UNVALIDATED_REDIRECT,
47+
VulnerabilityTypes.UNVALIDATED_REDIRECT_STRING,
4548
VulnerabilityMarks.UNVALIDATED_REDIRECT_MARK,
4649
' ');
4750
VulnerabilityType WEAK_RANDOMNESS =
48-
new VulnerabilityTypeImpl(VulnerabilityTypes.WEAK_RANDOMNESS, NOT_MARKED);
51+
new VulnerabilityTypeImpl(VulnerabilityTypes.WEAK_RANDOMNESS_STRING, NOT_MARKED);
4952

5053
InjectionType XPATH_INJECTION =
5154
new InjectionTypeImpl(
52-
VulnerabilityTypes.XPATH_INJECTION, VulnerabilityMarks.XPATH_INJECTION_MARK, ' ');
55+
VulnerabilityTypes.XPATH_INJECTION_STRING, VulnerabilityMarks.XPATH_INJECTION_MARK, ' ');
5356

5457
InjectionType TRUST_BOUNDARY_VIOLATION =
5558
new InjectionTypeImpl(
56-
VulnerabilityTypes.TRUST_BOUNDARY_VIOLATION,
59+
VulnerabilityTypes.TRUST_BOUNDARY_VIOLATION_STRING,
5760
VulnerabilityMarks.TRUST_BOUNDARY_VIOLATION,
5861
' ');
5962

6063
InjectionType XSS =
61-
new InjectionTypeImpl(VulnerabilityTypes.XSS, VulnerabilityMarks.XSS_MARK, ' ');
64+
new InjectionTypeImpl(VulnerabilityTypes.XSS_STRING, VulnerabilityMarks.XSS_MARK, ' ');
6265

6366
String name();
6467

dd-java-agent/agent-iast/src/test/groovy/com/datadog/iast/telemetry/TelemetryRequestEndedHandlerTest.groovy

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,14 @@ class TelemetryRequestEndedHandlerTest extends AbstractTelemetryCallbackTest {
6363
given:
6464
final handler = new TelemetryRequestEndedHandler(delegate)
6565
final metric = TAINTED_FLAT_MODE
66-
final tagValue = null
6766

6867
when:
69-
iastCtx.metricCollector.addMetric(metric, tagValue, 1)
68+
iastCtx.metricCollector.addMetric(metric, (byte) -1, 1)
7069
handler.apply(reqCtx, span)
7170

7271
then:
7372
1 * delegate.apply(reqCtx, span)
74-
1 * traceSegment.setTagTop(String.format(TRACE_METRIC_PATTERN, getSpanTagValue(metric, tagValue)), 1)
73+
1 * traceSegment.setTagTop(String.format(TRACE_METRIC_PATTERN, getSpanTagValue(metric)), 1)
7574

7675
when:
7776
globalCollector.prepareMetrics()
@@ -111,32 +110,36 @@ class TelemetryRequestEndedHandlerTest extends AbstractTelemetryCallbackTest {
111110
where:
112111
metrics | description
113112
[
114-
metric(REQUEST_TAINTED, null, 123),
115-
metric(EXECUTED_SOURCE, SourceTypes.REQUEST_PARAMETER_VALUE_STRING, 2),
116-
metric(EXECUTED_SOURCE, SourceTypes.REQUEST_HEADER_VALUE_STRING, 4),
113+
metric(REQUEST_TAINTED, 123),
114+
metric(EXECUTED_SOURCE, SourceTypes.REQUEST_PARAMETER_VALUE, 2),
115+
metric(EXECUTED_SOURCE, SourceTypes.REQUEST_HEADER_VALUE, 4),
117116
metric(EXECUTED_SINK, VulnerabilityTypes.SQL_INJECTION, 1),
118117
metric(EXECUTED_SINK, VulnerabilityTypes.COMMAND_INJECTION, 2),
119118
] | 'List of only request scoped metrics'
120119
[
121-
metric(REQUEST_TAINTED, null, 123),
122-
metric(INSTRUMENTED_SOURCE, SourceTypes.REQUEST_PARAMETER_VALUE_STRING, 2),
120+
metric(REQUEST_TAINTED, 123),
121+
metric(INSTRUMENTED_SOURCE, SourceTypes.REQUEST_PARAMETER_VALUE, 2),
123122
] | 'Mix between global and request scoped metrics'
124123
}
125124

126-
private static String getSpanTagValue(final IastMetric metric, final String tagValue) {
125+
private static String getSpanTagValue(final IastMetric metric, final Byte tagValue = null) {
127126
return metric.getTag() == null
128127
? metric.getName()
129-
: String.format("%s.%s", metric.getName(), tagValue.toLowerCase().replaceAll("\\.", "_"))
128+
: String.format("%s.%s", metric.getName(), metric.tag.toString(tagValue).toLowerCase().replaceAll("\\.", "_"))
130129
}
131130

132-
private static Data metric(final IastMetric metric, final String tagValue, final int value) {
131+
private static Data metric(final IastMetric metric, final byte tagValue, final int value) {
133132
return new Data(metric: metric, tagValue: tagValue, value: value)
134133
}
135134

135+
private static Data metric(final IastMetric metric, final int value) {
136+
return new Data(metric: metric, tagValue: (byte) -1, value: value)
137+
}
138+
136139
@ToString
137140
private static class Data {
138141
IastMetric metric
139-
String tagValue
142+
byte tagValue
140143
int value
141144
}
142145
}

dd-java-agent/agent-iast/src/test/groovy/com/datadog/iast/telemetry/taint/TaintedObjectsWithTelemetryTest.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class TaintedObjectsWithTelemetryTest extends DDSpecification {
6060

6161
then:
6262
if (IastMetric.REQUEST_TAINTED.isEnabled(verbosity)) {
63-
1 * mockCollector.addMetric(IastMetric.REQUEST_TAINTED, null, tainteds.size())
63+
1 * mockCollector.addMetric(IastMetric.REQUEST_TAINTED, _, tainteds.size())
6464
} else {
6565
0 * mockCollector.addMetric
6666
}
@@ -80,7 +80,7 @@ class TaintedObjectsWithTelemetryTest extends DDSpecification {
8080

8181
then:
8282
if (IastMetric.EXECUTED_TAINTED.isEnabled(verbosity)) {
83-
3 * mockCollector.addMetric(IastMetric.EXECUTED_TAINTED, null, 1) // two calls with one element
83+
3 * mockCollector.addMetric(IastMetric.EXECUTED_TAINTED, _, 1) // two calls with one element
8484
} else {
8585
0 * mockCollector.addMetric
8686
}
@@ -100,7 +100,7 @@ class TaintedObjectsWithTelemetryTest extends DDSpecification {
100100

101101
then:
102102
if (IastMetric.TAINTED_FLAT_MODE.isEnabled(verbosity) && taintedObjects.isFlat()) {
103-
1 * mockCollector.addMetric(IastMetric.TAINTED_FLAT_MODE, null, _)
103+
1 * mockCollector.addMetric(IastMetric.TAINTED_FLAT_MODE, _, _)
104104
} else {
105105
0 * mockCollector.addMetric
106106
}

0 commit comments

Comments
 (0)