diff --git a/tracer/build/_build/Honeypot/IntegrationGroups.cs b/tracer/build/_build/Honeypot/IntegrationGroups.cs index 1549ed68195c..959d99b99f7a 100644 --- a/tracer/build/_build/Honeypot/IntegrationGroups.cs +++ b/tracer/build/_build/Honeypot/IntegrationGroups.cs @@ -95,6 +95,7 @@ static IntegrationMap() NugetPackages.Add("OpenTelemetry", new [] { "OpenTelemetry" }); NugetPackages.Add("Microsoft.AspNetCore.Server.IIS", new[] { "Microsoft.AspNetCore.Server.IIS" }); NugetPackages.Add("Microsoft.AspNetCore.Server.Kestrel.Core", new string[] { "Microsoft.AspNetCore.Server.Kestrel.Core" }); + NugetPackages.Add("Microsoft.AspNetCore.Diagnostics", new[] { "Microsoft.AspNetCore.Diagnostics" }); NugetPackages.Add("Azure.Messaging.ServiceBus", new string[] { "Azure.Messaging.ServiceBus" }); NugetPackages.Add("amqmdnetstd", new [] { "IBMMQDotnetClient" }); NugetPackages.Add("Yarp.ReverseProxy", new [] { "Yarp.ReverseProxy" }); diff --git a/tracer/src/Datadog.Trace.Trimming/build/Datadog.Trace.Trimming.xml b/tracer/src/Datadog.Trace.Trimming/build/Datadog.Trace.Trimming.xml index 2227317b3a92..43e4a91d8f9b 100644 --- a/tracer/src/Datadog.Trace.Trimming/build/Datadog.Trace.Trimming.xml +++ b/tracer/src/Datadog.Trace.Trimming/build/Datadog.Trace.Trimming.xml @@ -20,6 +20,7 @@ + diff --git a/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/StackTraceLeak/DeveloperExceptionPageMiddlewareIntegration.cs b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/StackTraceLeak/DeveloperExceptionPageMiddlewareIntegration.cs new file mode 100644 index 000000000000..7f9620599ca0 --- /dev/null +++ b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/StackTraceLeak/DeveloperExceptionPageMiddlewareIntegration.cs @@ -0,0 +1,49 @@ +// +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc. +// + +#nullable enable + +#if !NETFRAMEWORK + +using System; +using System.ComponentModel; +using Datadog.Trace.ClrProfiler.CallTarget; +using Datadog.Trace.Configuration; +using Microsoft.AspNetCore.Http; + +namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak; + +/// +/// DeveloperExceptionPageMiddleware integration +/// +[InstrumentMethod( + AssemblyName = "Microsoft.AspNetCore.Diagnostics", + TypeName = "Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware", + ParameterTypeNames = new[] { "Microsoft.AspNetCore.Http.HttpContext", ClrNames.Exception }, + MethodName = "DisplayException", + ReturnTypeName = ClrNames.Task, + MinimumVersion = "2.0.0", + MaximumVersion = "2.*.*", + IntegrationName = nameof(IntegrationId.StackTraceLeak), + InstrumentationCategory = InstrumentationCategory.Iast)] + +[Browsable(false)] +[EditorBrowsable(EditorBrowsableState.Never)] +public static class DeveloperExceptionPageMiddlewareIntegration +{ + /// + /// OnMethodBegin callback + /// + /// Instance value, aka `this` of the instrumented method. + /// The context of the error. + /// The exception to be shown. + /// Type of the target + /// Calltarget state value + internal static CallTargetState OnMethodBegin(TTarget instance, HttpContext context, Exception exception) + { + return StackTraceLeakIntegrationCommon.OnExceptionLeak(IntegrationId.StackTraceLeak, exception); + } +} +#endif diff --git a/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/StackTraceLeak/DeveloperExceptionPageMiddlewareIntegration_Pre_3_0_0.cs b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/StackTraceLeak/DeveloperExceptionPageMiddlewareIntegration_Pre_3_0_0.cs new file mode 100644 index 000000000000..5690cb215d2b --- /dev/null +++ b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/StackTraceLeak/DeveloperExceptionPageMiddlewareIntegration_Pre_3_0_0.cs @@ -0,0 +1,70 @@ +// +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc. +// + +#nullable enable + +#if !NETFRAMEWORK + +using System; +using System.ComponentModel; +using System.Reflection; +using Datadog.Trace.ClrProfiler.CallTarget; +using Datadog.Trace.Configuration; +using Datadog.Trace.DuckTyping; + +namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak; + +/// +/// DeveloperExceptionPageMiddlewareImpl integration +/// +[InstrumentMethod( + AssemblyName = "Microsoft.AspNetCore.Diagnostics", + TypeName = "Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware", + ParameterTypeNames = new[] { "Microsoft.AspNetCore.Diagnostics.ErrorContext" }, + MethodName = "DisplayException", + ReturnTypeName = ClrNames.Task, + MinimumVersion = "3.0.0", + MaximumVersion = "6.*.*", + IntegrationName = nameof(IntegrationId.StackTraceLeak), + InstrumentationCategory = InstrumentationCategory.Iast)] +[InstrumentMethod( + AssemblyName = "Microsoft.AspNetCore.Diagnostics", + TypeName = "Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl", + ParameterTypeNames = new[] { "Microsoft.AspNetCore.Diagnostics.ErrorContext" }, + MethodName = "DisplayException", + ReturnTypeName = ClrNames.Task, + MinimumVersion = "7.0.0", + MaximumVersion = "8.*.*", + IntegrationName = nameof(IntegrationId.StackTraceLeak), + InstrumentationCategory = InstrumentationCategory.Iast)] + +[Browsable(false)] +[EditorBrowsable(EditorBrowsableState.Never)] +public static class DeveloperExceptionPageMiddlewareIntegration_Pre_3_0_0 +{ + internal interface IErrorContext + { + public Exception Exception { get; } + } + + /// + /// OnMethodBegin callback + /// + /// Instance value, aka `this` of the instrumented method. + /// The context of the error. + /// Type of the target + /// ErrorContext type + /// Calltarget state value + internal static CallTargetState OnMethodBegin(TTarget instance, TContext errorContext) + where TContext : IErrorContext + { + // In the current implementation ErrorContext is always non-null, as is Exception + // so this should be safe + var exception = errorContext.Exception; + return StackTraceLeakIntegrationCommon.OnExceptionLeak(IntegrationId.StackTraceLeak, exception); + } +} + +#endif diff --git a/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/StackTraceLeak/HttpResponseIntegration.cs b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/StackTraceLeak/HttpResponseIntegration.cs new file mode 100644 index 000000000000..f101b0534135 --- /dev/null +++ b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/StackTraceLeak/HttpResponseIntegration.cs @@ -0,0 +1,55 @@ +// +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc. +// + +#nullable enable + +#if NETFRAMEWORK + +using System; +using System.ComponentModel; +using System.Web; +using Datadog.Trace.ClrProfiler.CallTarget; +using Datadog.Trace.Configuration; + +namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak; + +/// +/// HttpResponseIntegration integration +/// +[InstrumentMethod( + AssemblyName = "System.Web", + TypeName = "System.Web.HttpResponse", + ParameterTypeNames = new[] { ClrNames.Exception, ClrNames.Bool }, + MethodName = "WriteErrorMessage", + ReturnTypeName = ClrNames.Void, + MinimumVersion = "4.0.0", + MaximumVersion = "4.*.*", + IntegrationName = nameof(IntegrationId.StackTraceLeak), + InstrumentationCategory = InstrumentationCategory.Iast)] + +[Browsable(false)] +[EditorBrowsable(EditorBrowsableState.Never)] +public static class HttpResponseIntegration +{ + /// + /// OnMethodBegin callback + /// + /// Instance value, aka `this` of the instrumented method. + /// The exception to be shown. + /// The dontShowSensitiveErrors parameter of WriteErrorMessage. + /// Type of the target + /// Calltarget state value + internal static CallTargetState OnMethodBegin(TTarget instance, Exception exception, bool dontShowSensitiveErrors) + { + if (HttpRuntime.UsingIntegratedPipeline && !dontShowSensitiveErrors) + { + return StackTraceLeakIntegrationCommon.OnExceptionLeak(IntegrationId.StackTraceLeak, exception); + } + + return CallTargetState.GetDefault(); + } +} + +#endif diff --git a/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/StackTraceLeak/StackTraceLeakIntegrationCommon.cs b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/StackTraceLeak/StackTraceLeakIntegrationCommon.cs new file mode 100644 index 000000000000..d7cd1615eef5 --- /dev/null +++ b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/StackTraceLeak/StackTraceLeakIntegrationCommon.cs @@ -0,0 +1,40 @@ +// +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc. +// + +using System; +using Datadog.Trace.ClrProfiler.CallTarget; +using Datadog.Trace.Configuration; +using Datadog.Trace.Iast; +using Datadog.Trace.Logging; + +namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak; + +#nullable enable +internal static class StackTraceLeakIntegrationCommon +{ + private static readonly IDatadogLogger Log = DatadogLogging.GetLoggerFor(typeof(StackTraceLeakIntegrationCommon)); + + internal static CallTargetState OnExceptionLeak(IntegrationId integrationId, Exception exception) + { + if (!Tracer.Instance.Settings.IsIntegrationEnabled(integrationId)) + { + return CallTargetState.GetDefault(); + } + + try + { + if (exception is not null) + { + return new CallTargetState(IastModule.OnStackTraceLeak(exception, integrationId).SingleSpan); + } + } + catch (Exception ex) + { + Log.Error(ex, $"Error in {nameof(OnExceptionLeak)}."); + } + + return CallTargetState.GetDefault(); + } +} diff --git a/tracer/src/Datadog.Trace/ClrProfiler/ClrNames.cs b/tracer/src/Datadog.Trace/ClrProfiler/ClrNames.cs index 5c636640771b..4e599025f669 100644 --- a/tracer/src/Datadog.Trace/ClrProfiler/ClrNames.cs +++ b/tracer/src/Datadog.Trace/ClrProfiler/ClrNames.cs @@ -48,6 +48,7 @@ internal static class ClrNames public const string Int32Task = "System.Threading.Tasks.Task`1[System.Int32]"; public const string Type = "System.Type"; + public const string Exception = "System.Exception"; public const string Activity = "System.Diagnostics.Activity"; public const string ByteArray = "System.Byte[]"; diff --git a/tracer/src/Datadog.Trace/Configuration/IntegrationId.cs b/tracer/src/Datadog.Trace/Configuration/IntegrationId.cs index a7456f215688..d7faae7f0e1d 100644 --- a/tracer/src/Datadog.Trace/Configuration/IntegrationId.cs +++ b/tracer/src/Datadog.Trace/Configuration/IntegrationId.cs @@ -72,5 +72,6 @@ internal enum IntegrationId TrustBoundaryViolation, UnvalidatedRedirect, TestPlatformAssemblyResolver, + StackTraceLeak } } diff --git a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IastInstrumentedSinksExtensions_EnumExtensions.g.cs b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IastInstrumentedSinksExtensions_EnumExtensions.g.cs index 5f13ad3e53f8..2cf8de5762fc 100644 --- a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IastInstrumentedSinksExtensions_EnumExtensions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IastInstrumentedSinksExtensions_EnumExtensions.g.cs @@ -17,7 +17,7 @@ internal static partial class IastInstrumentedSinksExtensions /// The number of members in the enum. /// This is a non-distinct count of defined names. /// - public const int Length = 18; + public const int Length = 19; /// /// Returns the string representation of the value. @@ -48,6 +48,7 @@ public static string ToStringFast(this Datadog.Trace.Telemetry.Metrics.MetricTag Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.TrustBoundaryViolation => "vulnerability_type:trust_boundary_violation", Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.HstsHeaderMissing => "vulnerability_type:hsts_header_missing", Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.HeaderInjection => "vulnerability_type:header_injection", + Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.StackTraceLeak => "vulnerability_type:stacktrace_leak", _ => value.ToString(), }; @@ -79,6 +80,7 @@ public static Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks[] Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.TrustBoundaryViolation, Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.HstsHeaderMissing, Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.HeaderInjection, + Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.StackTraceLeak, }; /// @@ -110,6 +112,7 @@ public static string[] GetNames() nameof(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.TrustBoundaryViolation), nameof(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.HstsHeaderMissing), nameof(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.HeaderInjection), + nameof(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.StackTraceLeak), }; /// @@ -141,5 +144,6 @@ public static string[] GetDescriptions() "vulnerability_type:trust_boundary_violation", "vulnerability_type:hsts_header_missing", "vulnerability_type:header_injection", + "vulnerability_type:stacktrace_leak", }; } \ No newline at end of file diff --git a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs index eb55b75ec1c7..776afcdb9814 100644 --- a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs @@ -17,7 +17,7 @@ internal static partial class IntegrationIdExtensions /// The number of members in the enum. /// This is a non-distinct count of defined names. /// - public const int Length = 60; + public const int Length = 61; /// /// Returns the string representation of the value. @@ -90,6 +90,7 @@ public static string ToStringFast(this Datadog.Trace.Configuration.IntegrationId Datadog.Trace.Configuration.IntegrationId.TrustBoundaryViolation => nameof(Datadog.Trace.Configuration.IntegrationId.TrustBoundaryViolation), Datadog.Trace.Configuration.IntegrationId.UnvalidatedRedirect => nameof(Datadog.Trace.Configuration.IntegrationId.UnvalidatedRedirect), Datadog.Trace.Configuration.IntegrationId.TestPlatformAssemblyResolver => nameof(Datadog.Trace.Configuration.IntegrationId.TestPlatformAssemblyResolver), + Datadog.Trace.Configuration.IntegrationId.StackTraceLeak => nameof(Datadog.Trace.Configuration.IntegrationId.StackTraceLeak), _ => value.ToString(), }; @@ -163,6 +164,7 @@ public static Datadog.Trace.Configuration.IntegrationId[] GetValues() Datadog.Trace.Configuration.IntegrationId.TrustBoundaryViolation, Datadog.Trace.Configuration.IntegrationId.UnvalidatedRedirect, Datadog.Trace.Configuration.IntegrationId.TestPlatformAssemblyResolver, + Datadog.Trace.Configuration.IntegrationId.StackTraceLeak, }; /// @@ -236,5 +238,6 @@ public static string[] GetNames() nameof(Datadog.Trace.Configuration.IntegrationId.TrustBoundaryViolation), nameof(Datadog.Trace.Configuration.IntegrationId.UnvalidatedRedirect), nameof(Datadog.Trace.Configuration.IntegrationId.TestPlatformAssemblyResolver), + nameof(Datadog.Trace.Configuration.IntegrationId.StackTraceLeak), }; } \ No newline at end of file diff --git a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs index 64551b20ee21..58d10ebce533 100644 --- a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs @@ -464,6 +464,9 @@ static InstrumentationDefinitions() new (NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("StackExchange.Redis.StrongName"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("StackExchange.Redis.RedisTransaction"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("ExecuteAsync"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16StringArray("System.Threading.Tasks.Task`1", "StackExchange.Redis.Message", "StackExchange.Redis.ResultProcessor`1[!!0]", "StackExchange.Redis.ServerEndPoint"), 4, 1, 0, 0, 2, 65535, 65535, NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(assemblyFullName), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Datadog.Trace.ClrProfiler.AutoInstrumentation.Redis.StackExchange.RedisExecuteAsyncIntegration"), 0, 1), new (NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("StackExchange.Redis.StrongName"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("StackExchange.Redis.RedisTransaction"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("ExecuteAsync"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16StringArray("System.Threading.Tasks.Task`1", "StackExchange.Redis.Message", "StackExchange.Redis.ResultProcessor`1[!!0]", "!!0", "StackExchange.Redis.ServerEndPoint"), 5, 2, 0, 0, 2, 65535, 65535, NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(assemblyFullName), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Datadog.Trace.ClrProfiler.AutoInstrumentation.Redis.StackExchange.RedisExecuteAsyncIntegration_2_6_48"), 0, 1), + // StackTraceLeak + new (NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("System.Web"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("System.Web.HttpResponse"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("WriteErrorMessage"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16StringArray("System.Void", "System.Exception", "System.Boolean"), 3, 4, 0, 0, 4, 65535, 65535, NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(assemblyFullName), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak.HttpResponseIntegration"), 0, 4), + // TestPlatformAssemblyResolver new (NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Microsoft.VisualStudio.TestPlatform.Common"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Microsoft.VisualStudio.TestPlatform.Common.Utilities.AssemblyResolver"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(".ctor"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16StringArray("System.Void", "System.Collections.Generic.IEnumerable`1[System.String]"), 2, 15, 0, 0, 15, 65535, 65535, NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(assemblyFullName), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Datadog.Trace.ClrProfiler.AutoInstrumentation.Testing.AssemblyResolverCtorIntegration"), 0, 1), @@ -825,6 +828,8 @@ internal static bool IsInstrumentedAssembly(string assemblyName) or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Redis.StackExchange.RedisExecuteAsyncIntegration" or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Redis.StackExchange.RedisExecuteAsyncIntegration_2_6_48" => Datadog.Trace.Configuration.IntegrationId.StackExchangeRedis, + "Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak.HttpResponseIntegration" + => Datadog.Trace.Configuration.IntegrationId.StackTraceLeak, "Datadog.Trace.ClrProfiler.AutoInstrumentation.Testing.AssemblyResolverCtorIntegration" => Datadog.Trace.Configuration.IntegrationId.TestPlatformAssemblyResolver, "Datadog.Trace.ClrProfiler.AutoInstrumentation.Wcf.AsyncMethodInvoker_InvokeBegin_Integration" diff --git a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs index 560c942a2af2..f979f1c6ccd8 100644 --- a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs @@ -11,7 +11,7 @@ namespace Datadog.Trace.Telemetry; internal partial class CiVisibilityMetricsTelemetryCollector { - private const int CountSharedLength = 195; + private const int CountSharedLength = 198; /// /// Creates the buffer for the values. @@ -215,6 +215,9 @@ private static AggregatedMetric[] GetCountSharedBuffer() new(new[] { "integration_name:testplatformassemblyresolver", "error_type:duck_typing" }), new(new[] { "integration_name:testplatformassemblyresolver", "error_type:invoker" }), new(new[] { "integration_name:testplatformassemblyresolver", "error_type:execution" }), + new(new[] { "integration_name:stacktraceleak", "error_type:duck_typing" }), + new(new[] { "integration_name:stacktraceleak", "error_type:invoker" }), + new(new[] { "integration_name:stacktraceleak", "error_type:execution" }), }; /// @@ -223,7 +226,7 @@ private static AggregatedMetric[] GetCountSharedBuffer() /// It is equal to the cardinality of the tag combinations (or 1 if there are no tags) /// private static int[] CountSharedEntryCounts { get; } - = new int[]{ 195, }; + = new int[]{ 198, }; public void RecordCountSharedIntegrationsError(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.InstrumentationError tag2, int increment = 1) { diff --git a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs index d3c27a8828d4..6fc71bd737dc 100644 --- a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs @@ -11,7 +11,7 @@ namespace Datadog.Trace.Telemetry; internal partial class MetricsTelemetryCollector { - private const int CountLength = 332; + private const int CountLength = 335; /// /// Creates the buffer for the values. @@ -90,35 +90,36 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "integration_name:trustboundaryviolation" }), new(new[] { "integration_name:unvalidatedredirect" }), new(new[] { "integration_name:testplatformassemblyresolver" }), - // spans_finished, index = 69 + new(new[] { "integration_name:stacktraceleak" }), + // spans_finished, index = 70 new(null), - // spans_enqueued_for_serialization, index = 70 + // spans_enqueued_for_serialization, index = 71 new(new[] { "reason:p0_keep" }), new(new[] { "reason:single_span_sampling" }), new(new[] { "reason:default" }), - // spans_dropped, index = 73 + // spans_dropped, index = 74 new(new[] { "reason:p0_drop" }), new(new[] { "reason:overfull_buffer" }), new(new[] { "reason:serialization_error" }), new(new[] { "reason:api_error" }), - // trace_segments_created, index = 77 + // trace_segments_created, index = 78 new(new[] { "new_continued:new" }), new(new[] { "new_continued:continued" }), - // trace_chunks_enqueued_for_serialization, index = 79 + // trace_chunks_enqueued_for_serialization, index = 80 new(new[] { "reason:p0_keep" }), new(new[] { "reason:default" }), - // trace_chunks_dropped, index = 81 + // trace_chunks_dropped, index = 82 new(new[] { "reason:p0_drop" }), new(new[] { "reason:overfull_buffer" }), new(new[] { "reason:serialization_error" }), new(new[] { "reason:api_error" }), - // trace_chunks_sent, index = 85 + // trace_chunks_sent, index = 86 new(null), - // trace_segments_closed, index = 86 + // trace_segments_closed, index = 87 new(null), - // trace_api.requests, index = 87 + // trace_api.requests, index = 88 new(null), - // trace_api.responses, index = 88 + // trace_api.responses, index = 89 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -141,26 +142,26 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // trace_api.errors, index = 110 + // trace_api.errors, index = 111 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // trace_partial_flush.count, index = 113 + // trace_partial_flush.count, index = 114 new(new[] { "reason:large_trace" }), new(new[] { "reason:single_span_ingestion" }), - // context_header_style.injected, index = 115 + // context_header_style.injected, index = 116 new(new[] { "header_style:tracecontext" }), new(new[] { "header_style:datadog" }), new(new[] { "header_style:b3multi" }), new(new[] { "header_style:b3single" }), - // context_header_style.extracted, index = 119 + // context_header_style.extracted, index = 120 new(new[] { "header_style:tracecontext" }), new(new[] { "header_style:datadog" }), new(new[] { "header_style:b3multi" }), new(new[] { "header_style:b3single" }), - // stats_api.requests, index = 123 + // stats_api.requests, index = 124 new(null), - // stats_api.responses, index = 124 + // stats_api.responses, index = 125 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -183,14 +184,14 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // stats_api.errors, index = 146 + // stats_api.errors, index = 147 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // telemetry_api.requests, index = 149 + // telemetry_api.requests, index = 150 new(new[] { "endpoint:agent" }), new(new[] { "endpoint:agentless" }), - // telemetry_api.responses, index = 151 + // telemetry_api.responses, index = 152 new(new[] { "endpoint:agent", "status_code:200" }), new(new[] { "endpoint:agent", "status_code:201" }), new(new[] { "endpoint:agent", "status_code:202" }), @@ -235,16 +236,16 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "endpoint:agentless", "status_code:503" }), new(new[] { "endpoint:agentless", "status_code:504" }), new(new[] { "endpoint:agentless", "status_code:5xx" }), - // telemetry_api.errors, index = 195 + // telemetry_api.errors, index = 196 new(new[] { "endpoint:agent", "type:timeout" }), new(new[] { "endpoint:agent", "type:network" }), new(new[] { "endpoint:agent", "type:status_code" }), new(new[] { "endpoint:agentless", "type:timeout" }), new(new[] { "endpoint:agentless", "type:network" }), new(new[] { "endpoint:agentless", "type:status_code" }), - // version_conflict_tracers_created, index = 201 + // version_conflict_tracers_created, index = 202 new(null), - // direct_log_logs, index = 202 + // direct_log_logs, index = 203 new(new[] { "integration_name:datadog" }), new(new[] { "integration_name:opentracing" }), new(new[] { "integration_name:ciapp" }), @@ -310,9 +311,10 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "integration_name:trustboundaryviolation" }), new(new[] { "integration_name:unvalidatedredirect" }), new(new[] { "integration_name:testplatformassemblyresolver" }), - // direct_log_api.requests, index = 267 + new(new[] { "integration_name:stacktraceleak" }), + // direct_log_api.requests, index = 269 new(null), - // direct_log_api.responses, index = 268 + // direct_log_api.responses, index = 270 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -335,21 +337,21 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // direct_log_api.errors, index = 290 + // direct_log_api.errors, index = 292 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // waf.init, index = 293 + // waf.init, index = 295 new(null), - // waf.updates, index = 294 + // waf.updates, index = 296 new(null), - // waf.requests, index = 295 + // waf.requests, index = 297 new(new[] { "waf_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:false", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:true", "request_blocked:false", "waf_timeout:false", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:true", "request_blocked:true", "waf_timeout:false", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:true", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:false", "request_excluded:true" }), - // executed.source, index = 300 + // executed.source, index = 302 new(new[] { "source_type:http.request.body" }), new(new[] { "source_type:http.request.path" }), new(new[] { "source_type:http.request.parameter.name" }), @@ -362,9 +364,9 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "source_type:http.request.cookie.value" }), new(new[] { "source_type:http.request.matrix.parameter" }), new(new[] { "source_type:http.request.uri" }), - // executed.propagation, index = 312 + // executed.propagation, index = 314 new(null), - // executed.sink, index = 313 + // executed.sink, index = 315 new(new[] { "vulnerability_type:none" }), new(new[] { "vulnerability_type:weak_cipher" }), new(new[] { "vulnerability_type:weak_hash" }), @@ -383,7 +385,8 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "vulnerability_type:trust_boundary_violation" }), new(new[] { "vulnerability_type:hsts_header_missing" }), new(new[] { "vulnerability_type:header_injection" }), - // request.tainted, index = 331 + new(new[] { "vulnerability_type:stacktrace_leak" }), + // request.tainted, index = 334 new(null), }; @@ -393,7 +396,7 @@ private static AggregatedMetric[] GetCountBuffer() /// It is equal to the cardinality of the tag combinations (or 1 if there are no tags) /// private static int[] CountEntryCounts { get; } - = new int[]{ 4, 65, 1, 3, 4, 2, 2, 4, 1, 1, 1, 22, 3, 2, 4, 4, 1, 22, 3, 2, 44, 6, 1, 65, 1, 22, 3, 1, 1, 5, 12, 1, 18, 1, }; + = new int[]{ 4, 66, 1, 3, 4, 2, 2, 4, 1, 1, 1, 22, 3, 2, 4, 4, 1, 22, 3, 2, 44, 6, 1, 66, 1, 22, 3, 1, 1, 5, 12, 1, 19, 1, }; public void RecordCountLogCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.LogLevel tag, int increment = 1) { @@ -409,182 +412,182 @@ public void RecordCountSpanCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.In public void RecordCountSpanFinished(int increment = 1) { - Interlocked.Add(ref _buffer.Count[69], increment); + Interlocked.Add(ref _buffer.Count[70], increment); } public void RecordCountSpanEnqueuedForSerialization(Datadog.Trace.Telemetry.Metrics.MetricTags.SpanEnqueueReason tag, int increment = 1) { - var index = 70 + (int)tag; + var index = 71 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountSpanDropped(Datadog.Trace.Telemetry.Metrics.MetricTags.DropReason tag, int increment = 1) { - var index = 73 + (int)tag; + var index = 74 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceSegmentCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.TraceContinuation tag, int increment = 1) { - var index = 77 + (int)tag; + var index = 78 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceChunkEnqueued(Datadog.Trace.Telemetry.Metrics.MetricTags.TraceChunkEnqueueReason tag, int increment = 1) { - var index = 79 + (int)tag; + var index = 80 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceChunkDropped(Datadog.Trace.Telemetry.Metrics.MetricTags.DropReason tag, int increment = 1) { - var index = 81 + (int)tag; + var index = 82 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceChunkSent(int increment = 1) { - Interlocked.Add(ref _buffer.Count[85], increment); + Interlocked.Add(ref _buffer.Count[86], increment); } public void RecordCountTraceSegmentsClosed(int increment = 1) { - Interlocked.Add(ref _buffer.Count[86], increment); + Interlocked.Add(ref _buffer.Count[87], increment); } public void RecordCountTraceApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[87], increment); + Interlocked.Add(ref _buffer.Count[88], increment); } public void RecordCountTraceApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 88 + (int)tag; + var index = 89 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 110 + (int)tag; + var index = 111 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTracePartialFlush(Datadog.Trace.Telemetry.Metrics.MetricTags.PartialFlushReason tag, int increment = 1) { - var index = 113 + (int)tag; + var index = 114 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountContextHeaderStyleInjected(Datadog.Trace.Telemetry.Metrics.MetricTags.ContextHeaderStyle tag, int increment = 1) { - var index = 115 + (int)tag; + var index = 116 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountContextHeaderStyleExtracted(Datadog.Trace.Telemetry.Metrics.MetricTags.ContextHeaderStyle tag, int increment = 1) { - var index = 119 + (int)tag; + var index = 120 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountStatsApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[123], increment); + Interlocked.Add(ref _buffer.Count[124], increment); } public void RecordCountStatsApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 124 + (int)tag; + var index = 125 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountStatsApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 146 + (int)tag; + var index = 147 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTelemetryApiRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag, int increment = 1) { - var index = 149 + (int)tag; + var index = 150 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTelemetryApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag2, int increment = 1) { - var index = 151 + ((int)tag1 * 22) + (int)tag2; + var index = 152 + ((int)tag1 * 22) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTelemetryApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag2, int increment = 1) { - var index = 195 + ((int)tag1 * 3) + (int)tag2; + var index = 196 + ((int)tag1 * 3) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountVersionConflictTracerCreated(int increment = 1) { - Interlocked.Add(ref _buffer.Count[201], increment); + Interlocked.Add(ref _buffer.Count[202], increment); } public void RecordCountDirectLogLogs(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag, int increment = 1) { - var index = 202 + (int)tag; + var index = 203 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountDirectLogApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[267], increment); + Interlocked.Add(ref _buffer.Count[269], increment); } public void RecordCountDirectLogApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 268 + (int)tag; + var index = 270 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountDirectLogApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 290 + (int)tag; + var index = 292 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountWafInit(int increment = 1) { - Interlocked.Add(ref _buffer.Count[293], increment); + Interlocked.Add(ref _buffer.Count[295], increment); } public void RecordCountWafUpdates(int increment = 1) { - Interlocked.Add(ref _buffer.Count[294], increment); + Interlocked.Add(ref _buffer.Count[296], increment); } public void RecordCountWafRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.WafAnalysis tag, int increment = 1) { - var index = 295 + (int)tag; + var index = 297 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastExecutedSources(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSources tag, int increment = 1) { - var index = 300 + (int)tag; + var index = 302 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastExecutedPropagations(int increment = 1) { - Interlocked.Add(ref _buffer.Count[312], increment); + Interlocked.Add(ref _buffer.Count[314], increment); } public void RecordCountIastExecutedSinks(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks tag, int increment = 1) { - var index = 313 + (int)tag; + var index = 315 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastRequestTainted(int increment = 1) { - Interlocked.Add(ref _buffer.Count[331], increment); + Interlocked.Add(ref _buffer.Count[334], increment); } } \ No newline at end of file diff --git a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs index cc6fdef6a8aa..7e0ebaa784f9 100644 --- a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs @@ -11,7 +11,7 @@ namespace Datadog.Trace.Telemetry; internal partial class MetricsTelemetryCollector { - private const int CountSharedLength = 195; + private const int CountSharedLength = 198; /// /// Creates the buffer for the values. @@ -215,6 +215,9 @@ private static AggregatedMetric[] GetCountSharedBuffer() new(new[] { "integration_name:testplatformassemblyresolver", "error_type:duck_typing" }), new(new[] { "integration_name:testplatformassemblyresolver", "error_type:invoker" }), new(new[] { "integration_name:testplatformassemblyresolver", "error_type:execution" }), + new(new[] { "integration_name:stacktraceleak", "error_type:duck_typing" }), + new(new[] { "integration_name:stacktraceleak", "error_type:invoker" }), + new(new[] { "integration_name:stacktraceleak", "error_type:execution" }), }; /// @@ -223,7 +226,7 @@ private static AggregatedMetric[] GetCountSharedBuffer() /// It is equal to the cardinality of the tag combinations (or 1 if there are no tags) /// private static int[] CountSharedEntryCounts { get; } - = new int[]{ 195, }; + = new int[]{ 198, }; public void RecordCountSharedIntegrationsError(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.InstrumentationError tag2, int increment = 1) { diff --git a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IastInstrumentedSinksExtensions_EnumExtensions.g.cs b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IastInstrumentedSinksExtensions_EnumExtensions.g.cs index 5f13ad3e53f8..2cf8de5762fc 100644 --- a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IastInstrumentedSinksExtensions_EnumExtensions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IastInstrumentedSinksExtensions_EnumExtensions.g.cs @@ -17,7 +17,7 @@ internal static partial class IastInstrumentedSinksExtensions /// The number of members in the enum. /// This is a non-distinct count of defined names. /// - public const int Length = 18; + public const int Length = 19; /// /// Returns the string representation of the value. @@ -48,6 +48,7 @@ public static string ToStringFast(this Datadog.Trace.Telemetry.Metrics.MetricTag Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.TrustBoundaryViolation => "vulnerability_type:trust_boundary_violation", Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.HstsHeaderMissing => "vulnerability_type:hsts_header_missing", Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.HeaderInjection => "vulnerability_type:header_injection", + Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.StackTraceLeak => "vulnerability_type:stacktrace_leak", _ => value.ToString(), }; @@ -79,6 +80,7 @@ public static Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks[] Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.TrustBoundaryViolation, Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.HstsHeaderMissing, Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.HeaderInjection, + Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.StackTraceLeak, }; /// @@ -110,6 +112,7 @@ public static string[] GetNames() nameof(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.TrustBoundaryViolation), nameof(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.HstsHeaderMissing), nameof(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.HeaderInjection), + nameof(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.StackTraceLeak), }; /// @@ -141,5 +144,6 @@ public static string[] GetDescriptions() "vulnerability_type:trust_boundary_violation", "vulnerability_type:hsts_header_missing", "vulnerability_type:header_injection", + "vulnerability_type:stacktrace_leak", }; } \ No newline at end of file diff --git a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs index eb55b75ec1c7..776afcdb9814 100644 --- a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs @@ -17,7 +17,7 @@ internal static partial class IntegrationIdExtensions /// The number of members in the enum. /// This is a non-distinct count of defined names. /// - public const int Length = 60; + public const int Length = 61; /// /// Returns the string representation of the value. @@ -90,6 +90,7 @@ public static string ToStringFast(this Datadog.Trace.Configuration.IntegrationId Datadog.Trace.Configuration.IntegrationId.TrustBoundaryViolation => nameof(Datadog.Trace.Configuration.IntegrationId.TrustBoundaryViolation), Datadog.Trace.Configuration.IntegrationId.UnvalidatedRedirect => nameof(Datadog.Trace.Configuration.IntegrationId.UnvalidatedRedirect), Datadog.Trace.Configuration.IntegrationId.TestPlatformAssemblyResolver => nameof(Datadog.Trace.Configuration.IntegrationId.TestPlatformAssemblyResolver), + Datadog.Trace.Configuration.IntegrationId.StackTraceLeak => nameof(Datadog.Trace.Configuration.IntegrationId.StackTraceLeak), _ => value.ToString(), }; @@ -163,6 +164,7 @@ public static Datadog.Trace.Configuration.IntegrationId[] GetValues() Datadog.Trace.Configuration.IntegrationId.TrustBoundaryViolation, Datadog.Trace.Configuration.IntegrationId.UnvalidatedRedirect, Datadog.Trace.Configuration.IntegrationId.TestPlatformAssemblyResolver, + Datadog.Trace.Configuration.IntegrationId.StackTraceLeak, }; /// @@ -236,5 +238,6 @@ public static string[] GetNames() nameof(Datadog.Trace.Configuration.IntegrationId.TrustBoundaryViolation), nameof(Datadog.Trace.Configuration.IntegrationId.UnvalidatedRedirect), nameof(Datadog.Trace.Configuration.IntegrationId.TestPlatformAssemblyResolver), + nameof(Datadog.Trace.Configuration.IntegrationId.StackTraceLeak), }; } \ No newline at end of file diff --git a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs index 9ab1bfab42a6..95f475f46388 100644 --- a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs @@ -477,6 +477,11 @@ static InstrumentationDefinitions() new (NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("StackExchange.Redis.StrongName"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("StackExchange.Redis.RedisTransaction"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("ExecuteAsync"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16StringArray("System.Threading.Tasks.Task`1", "StackExchange.Redis.Message", "StackExchange.Redis.ResultProcessor`1[!!0]", "StackExchange.Redis.ServerEndPoint"), 4, 1, 0, 0, 2, 65535, 65535, NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(assemblyFullName), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Datadog.Trace.ClrProfiler.AutoInstrumentation.Redis.StackExchange.RedisExecuteAsyncIntegration"), 0, 1), new (NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("StackExchange.Redis.StrongName"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("StackExchange.Redis.RedisTransaction"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("ExecuteAsync"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16StringArray("System.Threading.Tasks.Task`1", "StackExchange.Redis.Message", "StackExchange.Redis.ResultProcessor`1[!!0]", "!!0", "StackExchange.Redis.ServerEndPoint"), 5, 2, 0, 0, 2, 65535, 65535, NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(assemblyFullName), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Datadog.Trace.ClrProfiler.AutoInstrumentation.Redis.StackExchange.RedisExecuteAsyncIntegration_2_6_48"), 0, 1), + // StackTraceLeak + new (NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Microsoft.AspNetCore.Diagnostics"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("DisplayException"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16StringArray("System.Threading.Tasks.Task", "Microsoft.AspNetCore.Http.HttpContext", "System.Exception"), 3, 2, 0, 0, 2, 65535, 65535, NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(assemblyFullName), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak.DeveloperExceptionPageMiddlewareIntegration"), 0, 4), + new (NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Microsoft.AspNetCore.Diagnostics"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("DisplayException"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16StringArray("System.Threading.Tasks.Task", "Microsoft.AspNetCore.Diagnostics.ErrorContext"), 2, 3, 0, 0, 6, 65535, 65535, NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(assemblyFullName), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak.DeveloperExceptionPageMiddlewareIntegration_Pre_3_0_0"), 0, 4), + new (NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Microsoft.AspNetCore.Diagnostics"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("DisplayException"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16StringArray("System.Threading.Tasks.Task", "Microsoft.AspNetCore.Diagnostics.ErrorContext"), 2, 7, 0, 0, 8, 65535, 65535, NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(assemblyFullName), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak.DeveloperExceptionPageMiddlewareIntegration_Pre_3_0_0"), 0, 4), + // SymmetricAlgorithm new (NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("System.Security.Cryptography"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("System.Security.Cryptography.SymmetricAlgorithm"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(".ctor"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16StringArray("System.Void"), 1, 7, 0, 0, 8, 65535, 65535, NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(assemblyFullName), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Datadog.Trace.ClrProfiler.AutoInstrumentation.CryptographyAlgorithm.SymmetricAlgorithmIntegration"), 0, 4), new (NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("System.Security.Cryptography.Primitives"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("System.Security.Cryptography.SymmetricAlgorithm"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(".ctor"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16StringArray("System.Void"), 1, 1, 0, 0, 6, 65535, 65535, NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(assemblyFullName), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Datadog.Trace.ClrProfiler.AutoInstrumentation.CryptographyAlgorithm.SymmetricAlgorithmIntegration"), 0, 4), @@ -852,6 +857,10 @@ internal static bool IsInstrumentedAssembly(string assemblyName) or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Redis.StackExchange.RedisExecuteAsyncIntegration" or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Redis.StackExchange.RedisExecuteAsyncIntegration_2_6_48" => Datadog.Trace.Configuration.IntegrationId.StackExchangeRedis, + "Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak.DeveloperExceptionPageMiddlewareIntegration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak.DeveloperExceptionPageMiddlewareIntegration_Pre_3_0_0" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak.DeveloperExceptionPageMiddlewareIntegration_Pre_3_0_0" + => Datadog.Trace.Configuration.IntegrationId.StackTraceLeak, "Datadog.Trace.ClrProfiler.AutoInstrumentation.CryptographyAlgorithm.SymmetricAlgorithmIntegration" or "Datadog.Trace.ClrProfiler.AutoInstrumentation.CryptographyAlgorithm.SymmetricAlgorithmIntegration" => Datadog.Trace.Configuration.IntegrationId.SymmetricAlgorithm, diff --git a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs index 560c942a2af2..f979f1c6ccd8 100644 --- a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs @@ -11,7 +11,7 @@ namespace Datadog.Trace.Telemetry; internal partial class CiVisibilityMetricsTelemetryCollector { - private const int CountSharedLength = 195; + private const int CountSharedLength = 198; /// /// Creates the buffer for the values. @@ -215,6 +215,9 @@ private static AggregatedMetric[] GetCountSharedBuffer() new(new[] { "integration_name:testplatformassemblyresolver", "error_type:duck_typing" }), new(new[] { "integration_name:testplatformassemblyresolver", "error_type:invoker" }), new(new[] { "integration_name:testplatformassemblyresolver", "error_type:execution" }), + new(new[] { "integration_name:stacktraceleak", "error_type:duck_typing" }), + new(new[] { "integration_name:stacktraceleak", "error_type:invoker" }), + new(new[] { "integration_name:stacktraceleak", "error_type:execution" }), }; /// @@ -223,7 +226,7 @@ private static AggregatedMetric[] GetCountSharedBuffer() /// It is equal to the cardinality of the tag combinations (or 1 if there are no tags) /// private static int[] CountSharedEntryCounts { get; } - = new int[]{ 195, }; + = new int[]{ 198, }; public void RecordCountSharedIntegrationsError(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.InstrumentationError tag2, int increment = 1) { diff --git a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs index d3c27a8828d4..6fc71bd737dc 100644 --- a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs @@ -11,7 +11,7 @@ namespace Datadog.Trace.Telemetry; internal partial class MetricsTelemetryCollector { - private const int CountLength = 332; + private const int CountLength = 335; /// /// Creates the buffer for the values. @@ -90,35 +90,36 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "integration_name:trustboundaryviolation" }), new(new[] { "integration_name:unvalidatedredirect" }), new(new[] { "integration_name:testplatformassemblyresolver" }), - // spans_finished, index = 69 + new(new[] { "integration_name:stacktraceleak" }), + // spans_finished, index = 70 new(null), - // spans_enqueued_for_serialization, index = 70 + // spans_enqueued_for_serialization, index = 71 new(new[] { "reason:p0_keep" }), new(new[] { "reason:single_span_sampling" }), new(new[] { "reason:default" }), - // spans_dropped, index = 73 + // spans_dropped, index = 74 new(new[] { "reason:p0_drop" }), new(new[] { "reason:overfull_buffer" }), new(new[] { "reason:serialization_error" }), new(new[] { "reason:api_error" }), - // trace_segments_created, index = 77 + // trace_segments_created, index = 78 new(new[] { "new_continued:new" }), new(new[] { "new_continued:continued" }), - // trace_chunks_enqueued_for_serialization, index = 79 + // trace_chunks_enqueued_for_serialization, index = 80 new(new[] { "reason:p0_keep" }), new(new[] { "reason:default" }), - // trace_chunks_dropped, index = 81 + // trace_chunks_dropped, index = 82 new(new[] { "reason:p0_drop" }), new(new[] { "reason:overfull_buffer" }), new(new[] { "reason:serialization_error" }), new(new[] { "reason:api_error" }), - // trace_chunks_sent, index = 85 + // trace_chunks_sent, index = 86 new(null), - // trace_segments_closed, index = 86 + // trace_segments_closed, index = 87 new(null), - // trace_api.requests, index = 87 + // trace_api.requests, index = 88 new(null), - // trace_api.responses, index = 88 + // trace_api.responses, index = 89 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -141,26 +142,26 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // trace_api.errors, index = 110 + // trace_api.errors, index = 111 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // trace_partial_flush.count, index = 113 + // trace_partial_flush.count, index = 114 new(new[] { "reason:large_trace" }), new(new[] { "reason:single_span_ingestion" }), - // context_header_style.injected, index = 115 + // context_header_style.injected, index = 116 new(new[] { "header_style:tracecontext" }), new(new[] { "header_style:datadog" }), new(new[] { "header_style:b3multi" }), new(new[] { "header_style:b3single" }), - // context_header_style.extracted, index = 119 + // context_header_style.extracted, index = 120 new(new[] { "header_style:tracecontext" }), new(new[] { "header_style:datadog" }), new(new[] { "header_style:b3multi" }), new(new[] { "header_style:b3single" }), - // stats_api.requests, index = 123 + // stats_api.requests, index = 124 new(null), - // stats_api.responses, index = 124 + // stats_api.responses, index = 125 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -183,14 +184,14 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // stats_api.errors, index = 146 + // stats_api.errors, index = 147 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // telemetry_api.requests, index = 149 + // telemetry_api.requests, index = 150 new(new[] { "endpoint:agent" }), new(new[] { "endpoint:agentless" }), - // telemetry_api.responses, index = 151 + // telemetry_api.responses, index = 152 new(new[] { "endpoint:agent", "status_code:200" }), new(new[] { "endpoint:agent", "status_code:201" }), new(new[] { "endpoint:agent", "status_code:202" }), @@ -235,16 +236,16 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "endpoint:agentless", "status_code:503" }), new(new[] { "endpoint:agentless", "status_code:504" }), new(new[] { "endpoint:agentless", "status_code:5xx" }), - // telemetry_api.errors, index = 195 + // telemetry_api.errors, index = 196 new(new[] { "endpoint:agent", "type:timeout" }), new(new[] { "endpoint:agent", "type:network" }), new(new[] { "endpoint:agent", "type:status_code" }), new(new[] { "endpoint:agentless", "type:timeout" }), new(new[] { "endpoint:agentless", "type:network" }), new(new[] { "endpoint:agentless", "type:status_code" }), - // version_conflict_tracers_created, index = 201 + // version_conflict_tracers_created, index = 202 new(null), - // direct_log_logs, index = 202 + // direct_log_logs, index = 203 new(new[] { "integration_name:datadog" }), new(new[] { "integration_name:opentracing" }), new(new[] { "integration_name:ciapp" }), @@ -310,9 +311,10 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "integration_name:trustboundaryviolation" }), new(new[] { "integration_name:unvalidatedredirect" }), new(new[] { "integration_name:testplatformassemblyresolver" }), - // direct_log_api.requests, index = 267 + new(new[] { "integration_name:stacktraceleak" }), + // direct_log_api.requests, index = 269 new(null), - // direct_log_api.responses, index = 268 + // direct_log_api.responses, index = 270 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -335,21 +337,21 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // direct_log_api.errors, index = 290 + // direct_log_api.errors, index = 292 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // waf.init, index = 293 + // waf.init, index = 295 new(null), - // waf.updates, index = 294 + // waf.updates, index = 296 new(null), - // waf.requests, index = 295 + // waf.requests, index = 297 new(new[] { "waf_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:false", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:true", "request_blocked:false", "waf_timeout:false", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:true", "request_blocked:true", "waf_timeout:false", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:true", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:false", "request_excluded:true" }), - // executed.source, index = 300 + // executed.source, index = 302 new(new[] { "source_type:http.request.body" }), new(new[] { "source_type:http.request.path" }), new(new[] { "source_type:http.request.parameter.name" }), @@ -362,9 +364,9 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "source_type:http.request.cookie.value" }), new(new[] { "source_type:http.request.matrix.parameter" }), new(new[] { "source_type:http.request.uri" }), - // executed.propagation, index = 312 + // executed.propagation, index = 314 new(null), - // executed.sink, index = 313 + // executed.sink, index = 315 new(new[] { "vulnerability_type:none" }), new(new[] { "vulnerability_type:weak_cipher" }), new(new[] { "vulnerability_type:weak_hash" }), @@ -383,7 +385,8 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "vulnerability_type:trust_boundary_violation" }), new(new[] { "vulnerability_type:hsts_header_missing" }), new(new[] { "vulnerability_type:header_injection" }), - // request.tainted, index = 331 + new(new[] { "vulnerability_type:stacktrace_leak" }), + // request.tainted, index = 334 new(null), }; @@ -393,7 +396,7 @@ private static AggregatedMetric[] GetCountBuffer() /// It is equal to the cardinality of the tag combinations (or 1 if there are no tags) /// private static int[] CountEntryCounts { get; } - = new int[]{ 4, 65, 1, 3, 4, 2, 2, 4, 1, 1, 1, 22, 3, 2, 4, 4, 1, 22, 3, 2, 44, 6, 1, 65, 1, 22, 3, 1, 1, 5, 12, 1, 18, 1, }; + = new int[]{ 4, 66, 1, 3, 4, 2, 2, 4, 1, 1, 1, 22, 3, 2, 4, 4, 1, 22, 3, 2, 44, 6, 1, 66, 1, 22, 3, 1, 1, 5, 12, 1, 19, 1, }; public void RecordCountLogCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.LogLevel tag, int increment = 1) { @@ -409,182 +412,182 @@ public void RecordCountSpanCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.In public void RecordCountSpanFinished(int increment = 1) { - Interlocked.Add(ref _buffer.Count[69], increment); + Interlocked.Add(ref _buffer.Count[70], increment); } public void RecordCountSpanEnqueuedForSerialization(Datadog.Trace.Telemetry.Metrics.MetricTags.SpanEnqueueReason tag, int increment = 1) { - var index = 70 + (int)tag; + var index = 71 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountSpanDropped(Datadog.Trace.Telemetry.Metrics.MetricTags.DropReason tag, int increment = 1) { - var index = 73 + (int)tag; + var index = 74 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceSegmentCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.TraceContinuation tag, int increment = 1) { - var index = 77 + (int)tag; + var index = 78 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceChunkEnqueued(Datadog.Trace.Telemetry.Metrics.MetricTags.TraceChunkEnqueueReason tag, int increment = 1) { - var index = 79 + (int)tag; + var index = 80 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceChunkDropped(Datadog.Trace.Telemetry.Metrics.MetricTags.DropReason tag, int increment = 1) { - var index = 81 + (int)tag; + var index = 82 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceChunkSent(int increment = 1) { - Interlocked.Add(ref _buffer.Count[85], increment); + Interlocked.Add(ref _buffer.Count[86], increment); } public void RecordCountTraceSegmentsClosed(int increment = 1) { - Interlocked.Add(ref _buffer.Count[86], increment); + Interlocked.Add(ref _buffer.Count[87], increment); } public void RecordCountTraceApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[87], increment); + Interlocked.Add(ref _buffer.Count[88], increment); } public void RecordCountTraceApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 88 + (int)tag; + var index = 89 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 110 + (int)tag; + var index = 111 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTracePartialFlush(Datadog.Trace.Telemetry.Metrics.MetricTags.PartialFlushReason tag, int increment = 1) { - var index = 113 + (int)tag; + var index = 114 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountContextHeaderStyleInjected(Datadog.Trace.Telemetry.Metrics.MetricTags.ContextHeaderStyle tag, int increment = 1) { - var index = 115 + (int)tag; + var index = 116 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountContextHeaderStyleExtracted(Datadog.Trace.Telemetry.Metrics.MetricTags.ContextHeaderStyle tag, int increment = 1) { - var index = 119 + (int)tag; + var index = 120 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountStatsApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[123], increment); + Interlocked.Add(ref _buffer.Count[124], increment); } public void RecordCountStatsApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 124 + (int)tag; + var index = 125 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountStatsApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 146 + (int)tag; + var index = 147 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTelemetryApiRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag, int increment = 1) { - var index = 149 + (int)tag; + var index = 150 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTelemetryApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag2, int increment = 1) { - var index = 151 + ((int)tag1 * 22) + (int)tag2; + var index = 152 + ((int)tag1 * 22) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTelemetryApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag2, int increment = 1) { - var index = 195 + ((int)tag1 * 3) + (int)tag2; + var index = 196 + ((int)tag1 * 3) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountVersionConflictTracerCreated(int increment = 1) { - Interlocked.Add(ref _buffer.Count[201], increment); + Interlocked.Add(ref _buffer.Count[202], increment); } public void RecordCountDirectLogLogs(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag, int increment = 1) { - var index = 202 + (int)tag; + var index = 203 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountDirectLogApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[267], increment); + Interlocked.Add(ref _buffer.Count[269], increment); } public void RecordCountDirectLogApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 268 + (int)tag; + var index = 270 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountDirectLogApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 290 + (int)tag; + var index = 292 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountWafInit(int increment = 1) { - Interlocked.Add(ref _buffer.Count[293], increment); + Interlocked.Add(ref _buffer.Count[295], increment); } public void RecordCountWafUpdates(int increment = 1) { - Interlocked.Add(ref _buffer.Count[294], increment); + Interlocked.Add(ref _buffer.Count[296], increment); } public void RecordCountWafRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.WafAnalysis tag, int increment = 1) { - var index = 295 + (int)tag; + var index = 297 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastExecutedSources(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSources tag, int increment = 1) { - var index = 300 + (int)tag; + var index = 302 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastExecutedPropagations(int increment = 1) { - Interlocked.Add(ref _buffer.Count[312], increment); + Interlocked.Add(ref _buffer.Count[314], increment); } public void RecordCountIastExecutedSinks(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks tag, int increment = 1) { - var index = 313 + (int)tag; + var index = 315 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastRequestTainted(int increment = 1) { - Interlocked.Add(ref _buffer.Count[331], increment); + Interlocked.Add(ref _buffer.Count[334], increment); } } \ No newline at end of file diff --git a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs index cc6fdef6a8aa..7e0ebaa784f9 100644 --- a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs @@ -11,7 +11,7 @@ namespace Datadog.Trace.Telemetry; internal partial class MetricsTelemetryCollector { - private const int CountSharedLength = 195; + private const int CountSharedLength = 198; /// /// Creates the buffer for the values. @@ -215,6 +215,9 @@ private static AggregatedMetric[] GetCountSharedBuffer() new(new[] { "integration_name:testplatformassemblyresolver", "error_type:duck_typing" }), new(new[] { "integration_name:testplatformassemblyresolver", "error_type:invoker" }), new(new[] { "integration_name:testplatformassemblyresolver", "error_type:execution" }), + new(new[] { "integration_name:stacktraceleak", "error_type:duck_typing" }), + new(new[] { "integration_name:stacktraceleak", "error_type:invoker" }), + new(new[] { "integration_name:stacktraceleak", "error_type:execution" }), }; /// @@ -223,7 +226,7 @@ private static AggregatedMetric[] GetCountSharedBuffer() /// It is equal to the cardinality of the tag combinations (or 1 if there are no tags) /// private static int[] CountSharedEntryCounts { get; } - = new int[]{ 195, }; + = new int[]{ 198, }; public void RecordCountSharedIntegrationsError(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.InstrumentationError tag2, int increment = 1) { diff --git a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IastInstrumentedSinksExtensions_EnumExtensions.g.cs b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IastInstrumentedSinksExtensions_EnumExtensions.g.cs index 5f13ad3e53f8..2cf8de5762fc 100644 --- a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IastInstrumentedSinksExtensions_EnumExtensions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IastInstrumentedSinksExtensions_EnumExtensions.g.cs @@ -17,7 +17,7 @@ internal static partial class IastInstrumentedSinksExtensions /// The number of members in the enum. /// This is a non-distinct count of defined names. /// - public const int Length = 18; + public const int Length = 19; /// /// Returns the string representation of the value. @@ -48,6 +48,7 @@ public static string ToStringFast(this Datadog.Trace.Telemetry.Metrics.MetricTag Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.TrustBoundaryViolation => "vulnerability_type:trust_boundary_violation", Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.HstsHeaderMissing => "vulnerability_type:hsts_header_missing", Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.HeaderInjection => "vulnerability_type:header_injection", + Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.StackTraceLeak => "vulnerability_type:stacktrace_leak", _ => value.ToString(), }; @@ -79,6 +80,7 @@ public static Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks[] Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.TrustBoundaryViolation, Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.HstsHeaderMissing, Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.HeaderInjection, + Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.StackTraceLeak, }; /// @@ -110,6 +112,7 @@ public static string[] GetNames() nameof(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.TrustBoundaryViolation), nameof(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.HstsHeaderMissing), nameof(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.HeaderInjection), + nameof(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.StackTraceLeak), }; /// @@ -141,5 +144,6 @@ public static string[] GetDescriptions() "vulnerability_type:trust_boundary_violation", "vulnerability_type:hsts_header_missing", "vulnerability_type:header_injection", + "vulnerability_type:stacktrace_leak", }; } \ No newline at end of file diff --git a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs index eb55b75ec1c7..776afcdb9814 100644 --- a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs @@ -17,7 +17,7 @@ internal static partial class IntegrationIdExtensions /// The number of members in the enum. /// This is a non-distinct count of defined names. /// - public const int Length = 60; + public const int Length = 61; /// /// Returns the string representation of the value. @@ -90,6 +90,7 @@ public static string ToStringFast(this Datadog.Trace.Configuration.IntegrationId Datadog.Trace.Configuration.IntegrationId.TrustBoundaryViolation => nameof(Datadog.Trace.Configuration.IntegrationId.TrustBoundaryViolation), Datadog.Trace.Configuration.IntegrationId.UnvalidatedRedirect => nameof(Datadog.Trace.Configuration.IntegrationId.UnvalidatedRedirect), Datadog.Trace.Configuration.IntegrationId.TestPlatformAssemblyResolver => nameof(Datadog.Trace.Configuration.IntegrationId.TestPlatformAssemblyResolver), + Datadog.Trace.Configuration.IntegrationId.StackTraceLeak => nameof(Datadog.Trace.Configuration.IntegrationId.StackTraceLeak), _ => value.ToString(), }; @@ -163,6 +164,7 @@ public static Datadog.Trace.Configuration.IntegrationId[] GetValues() Datadog.Trace.Configuration.IntegrationId.TrustBoundaryViolation, Datadog.Trace.Configuration.IntegrationId.UnvalidatedRedirect, Datadog.Trace.Configuration.IntegrationId.TestPlatformAssemblyResolver, + Datadog.Trace.Configuration.IntegrationId.StackTraceLeak, }; /// @@ -236,5 +238,6 @@ public static string[] GetNames() nameof(Datadog.Trace.Configuration.IntegrationId.TrustBoundaryViolation), nameof(Datadog.Trace.Configuration.IntegrationId.UnvalidatedRedirect), nameof(Datadog.Trace.Configuration.IntegrationId.TestPlatformAssemblyResolver), + nameof(Datadog.Trace.Configuration.IntegrationId.StackTraceLeak), }; } \ No newline at end of file diff --git a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs index 7dd2bbc9052a..52b568ab3c6d 100644 --- a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs @@ -473,6 +473,11 @@ static InstrumentationDefinitions() new (NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("StackExchange.Redis.StrongName"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("StackExchange.Redis.RedisTransaction"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("ExecuteAsync"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16StringArray("System.Threading.Tasks.Task`1", "StackExchange.Redis.Message", "StackExchange.Redis.ResultProcessor`1[!!0]", "StackExchange.Redis.ServerEndPoint"), 4, 1, 0, 0, 2, 65535, 65535, NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(assemblyFullName), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Datadog.Trace.ClrProfiler.AutoInstrumentation.Redis.StackExchange.RedisExecuteAsyncIntegration"), 0, 1), new (NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("StackExchange.Redis.StrongName"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("StackExchange.Redis.RedisTransaction"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("ExecuteAsync"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16StringArray("System.Threading.Tasks.Task`1", "StackExchange.Redis.Message", "StackExchange.Redis.ResultProcessor`1[!!0]", "!!0", "StackExchange.Redis.ServerEndPoint"), 5, 2, 0, 0, 2, 65535, 65535, NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(assemblyFullName), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Datadog.Trace.ClrProfiler.AutoInstrumentation.Redis.StackExchange.RedisExecuteAsyncIntegration_2_6_48"), 0, 1), + // StackTraceLeak + new (NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Microsoft.AspNetCore.Diagnostics"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("DisplayException"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16StringArray("System.Threading.Tasks.Task", "Microsoft.AspNetCore.Http.HttpContext", "System.Exception"), 3, 2, 0, 0, 2, 65535, 65535, NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(assemblyFullName), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak.DeveloperExceptionPageMiddlewareIntegration"), 0, 4), + new (NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Microsoft.AspNetCore.Diagnostics"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("DisplayException"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16StringArray("System.Threading.Tasks.Task", "Microsoft.AspNetCore.Diagnostics.ErrorContext"), 2, 3, 0, 0, 6, 65535, 65535, NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(assemblyFullName), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak.DeveloperExceptionPageMiddlewareIntegration_Pre_3_0_0"), 0, 4), + new (NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Microsoft.AspNetCore.Diagnostics"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("DisplayException"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16StringArray("System.Threading.Tasks.Task", "Microsoft.AspNetCore.Diagnostics.ErrorContext"), 2, 7, 0, 0, 8, 65535, 65535, NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(assemblyFullName), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak.DeveloperExceptionPageMiddlewareIntegration_Pre_3_0_0"), 0, 4), + // SymmetricAlgorithm new (NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("System.Security.Cryptography"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("System.Security.Cryptography.SymmetricAlgorithm"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(".ctor"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16StringArray("System.Void"), 1, 7, 0, 0, 8, 65535, 65535, NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(assemblyFullName), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Datadog.Trace.ClrProfiler.AutoInstrumentation.CryptographyAlgorithm.SymmetricAlgorithmIntegration"), 0, 4), new (NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("System.Security.Cryptography.Primitives"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("System.Security.Cryptography.SymmetricAlgorithm"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(".ctor"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16StringArray("System.Void"), 1, 1, 0, 0, 6, 65535, 65535, NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(assemblyFullName), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Datadog.Trace.ClrProfiler.AutoInstrumentation.CryptographyAlgorithm.SymmetricAlgorithmIntegration"), 0, 4), @@ -843,6 +848,10 @@ internal static bool IsInstrumentedAssembly(string assemblyName) or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Redis.StackExchange.RedisExecuteAsyncIntegration" or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Redis.StackExchange.RedisExecuteAsyncIntegration_2_6_48" => Datadog.Trace.Configuration.IntegrationId.StackExchangeRedis, + "Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak.DeveloperExceptionPageMiddlewareIntegration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak.DeveloperExceptionPageMiddlewareIntegration_Pre_3_0_0" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak.DeveloperExceptionPageMiddlewareIntegration_Pre_3_0_0" + => Datadog.Trace.Configuration.IntegrationId.StackTraceLeak, "Datadog.Trace.ClrProfiler.AutoInstrumentation.CryptographyAlgorithm.SymmetricAlgorithmIntegration" or "Datadog.Trace.ClrProfiler.AutoInstrumentation.CryptographyAlgorithm.SymmetricAlgorithmIntegration" => Datadog.Trace.Configuration.IntegrationId.SymmetricAlgorithm, diff --git a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs index 560c942a2af2..f979f1c6ccd8 100644 --- a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs @@ -11,7 +11,7 @@ namespace Datadog.Trace.Telemetry; internal partial class CiVisibilityMetricsTelemetryCollector { - private const int CountSharedLength = 195; + private const int CountSharedLength = 198; /// /// Creates the buffer for the values. @@ -215,6 +215,9 @@ private static AggregatedMetric[] GetCountSharedBuffer() new(new[] { "integration_name:testplatformassemblyresolver", "error_type:duck_typing" }), new(new[] { "integration_name:testplatformassemblyresolver", "error_type:invoker" }), new(new[] { "integration_name:testplatformassemblyresolver", "error_type:execution" }), + new(new[] { "integration_name:stacktraceleak", "error_type:duck_typing" }), + new(new[] { "integration_name:stacktraceleak", "error_type:invoker" }), + new(new[] { "integration_name:stacktraceleak", "error_type:execution" }), }; /// @@ -223,7 +226,7 @@ private static AggregatedMetric[] GetCountSharedBuffer() /// It is equal to the cardinality of the tag combinations (or 1 if there are no tags) /// private static int[] CountSharedEntryCounts { get; } - = new int[]{ 195, }; + = new int[]{ 198, }; public void RecordCountSharedIntegrationsError(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.InstrumentationError tag2, int increment = 1) { diff --git a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs index d3c27a8828d4..6fc71bd737dc 100644 --- a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs @@ -11,7 +11,7 @@ namespace Datadog.Trace.Telemetry; internal partial class MetricsTelemetryCollector { - private const int CountLength = 332; + private const int CountLength = 335; /// /// Creates the buffer for the values. @@ -90,35 +90,36 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "integration_name:trustboundaryviolation" }), new(new[] { "integration_name:unvalidatedredirect" }), new(new[] { "integration_name:testplatformassemblyresolver" }), - // spans_finished, index = 69 + new(new[] { "integration_name:stacktraceleak" }), + // spans_finished, index = 70 new(null), - // spans_enqueued_for_serialization, index = 70 + // spans_enqueued_for_serialization, index = 71 new(new[] { "reason:p0_keep" }), new(new[] { "reason:single_span_sampling" }), new(new[] { "reason:default" }), - // spans_dropped, index = 73 + // spans_dropped, index = 74 new(new[] { "reason:p0_drop" }), new(new[] { "reason:overfull_buffer" }), new(new[] { "reason:serialization_error" }), new(new[] { "reason:api_error" }), - // trace_segments_created, index = 77 + // trace_segments_created, index = 78 new(new[] { "new_continued:new" }), new(new[] { "new_continued:continued" }), - // trace_chunks_enqueued_for_serialization, index = 79 + // trace_chunks_enqueued_for_serialization, index = 80 new(new[] { "reason:p0_keep" }), new(new[] { "reason:default" }), - // trace_chunks_dropped, index = 81 + // trace_chunks_dropped, index = 82 new(new[] { "reason:p0_drop" }), new(new[] { "reason:overfull_buffer" }), new(new[] { "reason:serialization_error" }), new(new[] { "reason:api_error" }), - // trace_chunks_sent, index = 85 + // trace_chunks_sent, index = 86 new(null), - // trace_segments_closed, index = 86 + // trace_segments_closed, index = 87 new(null), - // trace_api.requests, index = 87 + // trace_api.requests, index = 88 new(null), - // trace_api.responses, index = 88 + // trace_api.responses, index = 89 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -141,26 +142,26 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // trace_api.errors, index = 110 + // trace_api.errors, index = 111 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // trace_partial_flush.count, index = 113 + // trace_partial_flush.count, index = 114 new(new[] { "reason:large_trace" }), new(new[] { "reason:single_span_ingestion" }), - // context_header_style.injected, index = 115 + // context_header_style.injected, index = 116 new(new[] { "header_style:tracecontext" }), new(new[] { "header_style:datadog" }), new(new[] { "header_style:b3multi" }), new(new[] { "header_style:b3single" }), - // context_header_style.extracted, index = 119 + // context_header_style.extracted, index = 120 new(new[] { "header_style:tracecontext" }), new(new[] { "header_style:datadog" }), new(new[] { "header_style:b3multi" }), new(new[] { "header_style:b3single" }), - // stats_api.requests, index = 123 + // stats_api.requests, index = 124 new(null), - // stats_api.responses, index = 124 + // stats_api.responses, index = 125 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -183,14 +184,14 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // stats_api.errors, index = 146 + // stats_api.errors, index = 147 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // telemetry_api.requests, index = 149 + // telemetry_api.requests, index = 150 new(new[] { "endpoint:agent" }), new(new[] { "endpoint:agentless" }), - // telemetry_api.responses, index = 151 + // telemetry_api.responses, index = 152 new(new[] { "endpoint:agent", "status_code:200" }), new(new[] { "endpoint:agent", "status_code:201" }), new(new[] { "endpoint:agent", "status_code:202" }), @@ -235,16 +236,16 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "endpoint:agentless", "status_code:503" }), new(new[] { "endpoint:agentless", "status_code:504" }), new(new[] { "endpoint:agentless", "status_code:5xx" }), - // telemetry_api.errors, index = 195 + // telemetry_api.errors, index = 196 new(new[] { "endpoint:agent", "type:timeout" }), new(new[] { "endpoint:agent", "type:network" }), new(new[] { "endpoint:agent", "type:status_code" }), new(new[] { "endpoint:agentless", "type:timeout" }), new(new[] { "endpoint:agentless", "type:network" }), new(new[] { "endpoint:agentless", "type:status_code" }), - // version_conflict_tracers_created, index = 201 + // version_conflict_tracers_created, index = 202 new(null), - // direct_log_logs, index = 202 + // direct_log_logs, index = 203 new(new[] { "integration_name:datadog" }), new(new[] { "integration_name:opentracing" }), new(new[] { "integration_name:ciapp" }), @@ -310,9 +311,10 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "integration_name:trustboundaryviolation" }), new(new[] { "integration_name:unvalidatedredirect" }), new(new[] { "integration_name:testplatformassemblyresolver" }), - // direct_log_api.requests, index = 267 + new(new[] { "integration_name:stacktraceleak" }), + // direct_log_api.requests, index = 269 new(null), - // direct_log_api.responses, index = 268 + // direct_log_api.responses, index = 270 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -335,21 +337,21 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // direct_log_api.errors, index = 290 + // direct_log_api.errors, index = 292 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // waf.init, index = 293 + // waf.init, index = 295 new(null), - // waf.updates, index = 294 + // waf.updates, index = 296 new(null), - // waf.requests, index = 295 + // waf.requests, index = 297 new(new[] { "waf_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:false", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:true", "request_blocked:false", "waf_timeout:false", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:true", "request_blocked:true", "waf_timeout:false", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:true", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:false", "request_excluded:true" }), - // executed.source, index = 300 + // executed.source, index = 302 new(new[] { "source_type:http.request.body" }), new(new[] { "source_type:http.request.path" }), new(new[] { "source_type:http.request.parameter.name" }), @@ -362,9 +364,9 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "source_type:http.request.cookie.value" }), new(new[] { "source_type:http.request.matrix.parameter" }), new(new[] { "source_type:http.request.uri" }), - // executed.propagation, index = 312 + // executed.propagation, index = 314 new(null), - // executed.sink, index = 313 + // executed.sink, index = 315 new(new[] { "vulnerability_type:none" }), new(new[] { "vulnerability_type:weak_cipher" }), new(new[] { "vulnerability_type:weak_hash" }), @@ -383,7 +385,8 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "vulnerability_type:trust_boundary_violation" }), new(new[] { "vulnerability_type:hsts_header_missing" }), new(new[] { "vulnerability_type:header_injection" }), - // request.tainted, index = 331 + new(new[] { "vulnerability_type:stacktrace_leak" }), + // request.tainted, index = 334 new(null), }; @@ -393,7 +396,7 @@ private static AggregatedMetric[] GetCountBuffer() /// It is equal to the cardinality of the tag combinations (or 1 if there are no tags) /// private static int[] CountEntryCounts { get; } - = new int[]{ 4, 65, 1, 3, 4, 2, 2, 4, 1, 1, 1, 22, 3, 2, 4, 4, 1, 22, 3, 2, 44, 6, 1, 65, 1, 22, 3, 1, 1, 5, 12, 1, 18, 1, }; + = new int[]{ 4, 66, 1, 3, 4, 2, 2, 4, 1, 1, 1, 22, 3, 2, 4, 4, 1, 22, 3, 2, 44, 6, 1, 66, 1, 22, 3, 1, 1, 5, 12, 1, 19, 1, }; public void RecordCountLogCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.LogLevel tag, int increment = 1) { @@ -409,182 +412,182 @@ public void RecordCountSpanCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.In public void RecordCountSpanFinished(int increment = 1) { - Interlocked.Add(ref _buffer.Count[69], increment); + Interlocked.Add(ref _buffer.Count[70], increment); } public void RecordCountSpanEnqueuedForSerialization(Datadog.Trace.Telemetry.Metrics.MetricTags.SpanEnqueueReason tag, int increment = 1) { - var index = 70 + (int)tag; + var index = 71 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountSpanDropped(Datadog.Trace.Telemetry.Metrics.MetricTags.DropReason tag, int increment = 1) { - var index = 73 + (int)tag; + var index = 74 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceSegmentCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.TraceContinuation tag, int increment = 1) { - var index = 77 + (int)tag; + var index = 78 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceChunkEnqueued(Datadog.Trace.Telemetry.Metrics.MetricTags.TraceChunkEnqueueReason tag, int increment = 1) { - var index = 79 + (int)tag; + var index = 80 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceChunkDropped(Datadog.Trace.Telemetry.Metrics.MetricTags.DropReason tag, int increment = 1) { - var index = 81 + (int)tag; + var index = 82 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceChunkSent(int increment = 1) { - Interlocked.Add(ref _buffer.Count[85], increment); + Interlocked.Add(ref _buffer.Count[86], increment); } public void RecordCountTraceSegmentsClosed(int increment = 1) { - Interlocked.Add(ref _buffer.Count[86], increment); + Interlocked.Add(ref _buffer.Count[87], increment); } public void RecordCountTraceApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[87], increment); + Interlocked.Add(ref _buffer.Count[88], increment); } public void RecordCountTraceApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 88 + (int)tag; + var index = 89 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 110 + (int)tag; + var index = 111 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTracePartialFlush(Datadog.Trace.Telemetry.Metrics.MetricTags.PartialFlushReason tag, int increment = 1) { - var index = 113 + (int)tag; + var index = 114 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountContextHeaderStyleInjected(Datadog.Trace.Telemetry.Metrics.MetricTags.ContextHeaderStyle tag, int increment = 1) { - var index = 115 + (int)tag; + var index = 116 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountContextHeaderStyleExtracted(Datadog.Trace.Telemetry.Metrics.MetricTags.ContextHeaderStyle tag, int increment = 1) { - var index = 119 + (int)tag; + var index = 120 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountStatsApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[123], increment); + Interlocked.Add(ref _buffer.Count[124], increment); } public void RecordCountStatsApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 124 + (int)tag; + var index = 125 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountStatsApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 146 + (int)tag; + var index = 147 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTelemetryApiRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag, int increment = 1) { - var index = 149 + (int)tag; + var index = 150 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTelemetryApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag2, int increment = 1) { - var index = 151 + ((int)tag1 * 22) + (int)tag2; + var index = 152 + ((int)tag1 * 22) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTelemetryApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag2, int increment = 1) { - var index = 195 + ((int)tag1 * 3) + (int)tag2; + var index = 196 + ((int)tag1 * 3) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountVersionConflictTracerCreated(int increment = 1) { - Interlocked.Add(ref _buffer.Count[201], increment); + Interlocked.Add(ref _buffer.Count[202], increment); } public void RecordCountDirectLogLogs(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag, int increment = 1) { - var index = 202 + (int)tag; + var index = 203 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountDirectLogApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[267], increment); + Interlocked.Add(ref _buffer.Count[269], increment); } public void RecordCountDirectLogApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 268 + (int)tag; + var index = 270 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountDirectLogApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 290 + (int)tag; + var index = 292 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountWafInit(int increment = 1) { - Interlocked.Add(ref _buffer.Count[293], increment); + Interlocked.Add(ref _buffer.Count[295], increment); } public void RecordCountWafUpdates(int increment = 1) { - Interlocked.Add(ref _buffer.Count[294], increment); + Interlocked.Add(ref _buffer.Count[296], increment); } public void RecordCountWafRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.WafAnalysis tag, int increment = 1) { - var index = 295 + (int)tag; + var index = 297 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastExecutedSources(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSources tag, int increment = 1) { - var index = 300 + (int)tag; + var index = 302 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastExecutedPropagations(int increment = 1) { - Interlocked.Add(ref _buffer.Count[312], increment); + Interlocked.Add(ref _buffer.Count[314], increment); } public void RecordCountIastExecutedSinks(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks tag, int increment = 1) { - var index = 313 + (int)tag; + var index = 315 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastRequestTainted(int increment = 1) { - Interlocked.Add(ref _buffer.Count[331], increment); + Interlocked.Add(ref _buffer.Count[334], increment); } } \ No newline at end of file diff --git a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs index cc6fdef6a8aa..7e0ebaa784f9 100644 --- a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs @@ -11,7 +11,7 @@ namespace Datadog.Trace.Telemetry; internal partial class MetricsTelemetryCollector { - private const int CountSharedLength = 195; + private const int CountSharedLength = 198; /// /// Creates the buffer for the values. @@ -215,6 +215,9 @@ private static AggregatedMetric[] GetCountSharedBuffer() new(new[] { "integration_name:testplatformassemblyresolver", "error_type:duck_typing" }), new(new[] { "integration_name:testplatformassemblyresolver", "error_type:invoker" }), new(new[] { "integration_name:testplatformassemblyresolver", "error_type:execution" }), + new(new[] { "integration_name:stacktraceleak", "error_type:duck_typing" }), + new(new[] { "integration_name:stacktraceleak", "error_type:invoker" }), + new(new[] { "integration_name:stacktraceleak", "error_type:execution" }), }; /// @@ -223,7 +226,7 @@ private static AggregatedMetric[] GetCountSharedBuffer() /// It is equal to the cardinality of the tag combinations (or 1 if there are no tags) /// private static int[] CountSharedEntryCounts { get; } - = new int[]{ 195, }; + = new int[]{ 198, }; public void RecordCountSharedIntegrationsError(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.InstrumentationError tag2, int increment = 1) { diff --git a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IastInstrumentedSinksExtensions_EnumExtensions.g.cs b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IastInstrumentedSinksExtensions_EnumExtensions.g.cs index 5f13ad3e53f8..2cf8de5762fc 100644 --- a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IastInstrumentedSinksExtensions_EnumExtensions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IastInstrumentedSinksExtensions_EnumExtensions.g.cs @@ -17,7 +17,7 @@ internal static partial class IastInstrumentedSinksExtensions /// The number of members in the enum. /// This is a non-distinct count of defined names. /// - public const int Length = 18; + public const int Length = 19; /// /// Returns the string representation of the value. @@ -48,6 +48,7 @@ public static string ToStringFast(this Datadog.Trace.Telemetry.Metrics.MetricTag Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.TrustBoundaryViolation => "vulnerability_type:trust_boundary_violation", Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.HstsHeaderMissing => "vulnerability_type:hsts_header_missing", Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.HeaderInjection => "vulnerability_type:header_injection", + Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.StackTraceLeak => "vulnerability_type:stacktrace_leak", _ => value.ToString(), }; @@ -79,6 +80,7 @@ public static Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks[] Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.TrustBoundaryViolation, Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.HstsHeaderMissing, Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.HeaderInjection, + Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.StackTraceLeak, }; /// @@ -110,6 +112,7 @@ public static string[] GetNames() nameof(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.TrustBoundaryViolation), nameof(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.HstsHeaderMissing), nameof(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.HeaderInjection), + nameof(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks.StackTraceLeak), }; /// @@ -141,5 +144,6 @@ public static string[] GetDescriptions() "vulnerability_type:trust_boundary_violation", "vulnerability_type:hsts_header_missing", "vulnerability_type:header_injection", + "vulnerability_type:stacktrace_leak", }; } \ No newline at end of file diff --git a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs index eb55b75ec1c7..776afcdb9814 100644 --- a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs @@ -17,7 +17,7 @@ internal static partial class IntegrationIdExtensions /// The number of members in the enum. /// This is a non-distinct count of defined names. /// - public const int Length = 60; + public const int Length = 61; /// /// Returns the string representation of the value. @@ -90,6 +90,7 @@ public static string ToStringFast(this Datadog.Trace.Configuration.IntegrationId Datadog.Trace.Configuration.IntegrationId.TrustBoundaryViolation => nameof(Datadog.Trace.Configuration.IntegrationId.TrustBoundaryViolation), Datadog.Trace.Configuration.IntegrationId.UnvalidatedRedirect => nameof(Datadog.Trace.Configuration.IntegrationId.UnvalidatedRedirect), Datadog.Trace.Configuration.IntegrationId.TestPlatformAssemblyResolver => nameof(Datadog.Trace.Configuration.IntegrationId.TestPlatformAssemblyResolver), + Datadog.Trace.Configuration.IntegrationId.StackTraceLeak => nameof(Datadog.Trace.Configuration.IntegrationId.StackTraceLeak), _ => value.ToString(), }; @@ -163,6 +164,7 @@ public static Datadog.Trace.Configuration.IntegrationId[] GetValues() Datadog.Trace.Configuration.IntegrationId.TrustBoundaryViolation, Datadog.Trace.Configuration.IntegrationId.UnvalidatedRedirect, Datadog.Trace.Configuration.IntegrationId.TestPlatformAssemblyResolver, + Datadog.Trace.Configuration.IntegrationId.StackTraceLeak, }; /// @@ -236,5 +238,6 @@ public static string[] GetNames() nameof(Datadog.Trace.Configuration.IntegrationId.TrustBoundaryViolation), nameof(Datadog.Trace.Configuration.IntegrationId.UnvalidatedRedirect), nameof(Datadog.Trace.Configuration.IntegrationId.TestPlatformAssemblyResolver), + nameof(Datadog.Trace.Configuration.IntegrationId.StackTraceLeak), }; } \ No newline at end of file diff --git a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs index 7dd2bbc9052a..52b568ab3c6d 100644 --- a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs @@ -473,6 +473,11 @@ static InstrumentationDefinitions() new (NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("StackExchange.Redis.StrongName"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("StackExchange.Redis.RedisTransaction"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("ExecuteAsync"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16StringArray("System.Threading.Tasks.Task`1", "StackExchange.Redis.Message", "StackExchange.Redis.ResultProcessor`1[!!0]", "StackExchange.Redis.ServerEndPoint"), 4, 1, 0, 0, 2, 65535, 65535, NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(assemblyFullName), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Datadog.Trace.ClrProfiler.AutoInstrumentation.Redis.StackExchange.RedisExecuteAsyncIntegration"), 0, 1), new (NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("StackExchange.Redis.StrongName"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("StackExchange.Redis.RedisTransaction"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("ExecuteAsync"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16StringArray("System.Threading.Tasks.Task`1", "StackExchange.Redis.Message", "StackExchange.Redis.ResultProcessor`1[!!0]", "!!0", "StackExchange.Redis.ServerEndPoint"), 5, 2, 0, 0, 2, 65535, 65535, NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(assemblyFullName), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Datadog.Trace.ClrProfiler.AutoInstrumentation.Redis.StackExchange.RedisExecuteAsyncIntegration_2_6_48"), 0, 1), + // StackTraceLeak + new (NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Microsoft.AspNetCore.Diagnostics"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("DisplayException"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16StringArray("System.Threading.Tasks.Task", "Microsoft.AspNetCore.Http.HttpContext", "System.Exception"), 3, 2, 0, 0, 2, 65535, 65535, NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(assemblyFullName), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak.DeveloperExceptionPageMiddlewareIntegration"), 0, 4), + new (NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Microsoft.AspNetCore.Diagnostics"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("DisplayException"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16StringArray("System.Threading.Tasks.Task", "Microsoft.AspNetCore.Diagnostics.ErrorContext"), 2, 3, 0, 0, 6, 65535, 65535, NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(assemblyFullName), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak.DeveloperExceptionPageMiddlewareIntegration_Pre_3_0_0"), 0, 4), + new (NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Microsoft.AspNetCore.Diagnostics"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("DisplayException"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16StringArray("System.Threading.Tasks.Task", "Microsoft.AspNetCore.Diagnostics.ErrorContext"), 2, 7, 0, 0, 8, 65535, 65535, NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(assemblyFullName), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak.DeveloperExceptionPageMiddlewareIntegration_Pre_3_0_0"), 0, 4), + // SymmetricAlgorithm new (NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("System.Security.Cryptography"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("System.Security.Cryptography.SymmetricAlgorithm"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(".ctor"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16StringArray("System.Void"), 1, 7, 0, 0, 8, 65535, 65535, NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(assemblyFullName), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Datadog.Trace.ClrProfiler.AutoInstrumentation.CryptographyAlgorithm.SymmetricAlgorithmIntegration"), 0, 4), new (NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("System.Security.Cryptography.Primitives"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("System.Security.Cryptography.SymmetricAlgorithm"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(".ctor"), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16StringArray("System.Void"), 1, 1, 0, 0, 6, 65535, 65535, NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String(assemblyFullName), NativeCallTargetUnmanagedMemoryHelper.AllocateAndWriteUtf16String("Datadog.Trace.ClrProfiler.AutoInstrumentation.CryptographyAlgorithm.SymmetricAlgorithmIntegration"), 0, 4), @@ -843,6 +848,10 @@ internal static bool IsInstrumentedAssembly(string assemblyName) or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Redis.StackExchange.RedisExecuteAsyncIntegration" or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Redis.StackExchange.RedisExecuteAsyncIntegration_2_6_48" => Datadog.Trace.Configuration.IntegrationId.StackExchangeRedis, + "Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak.DeveloperExceptionPageMiddlewareIntegration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak.DeveloperExceptionPageMiddlewareIntegration_Pre_3_0_0" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak.DeveloperExceptionPageMiddlewareIntegration_Pre_3_0_0" + => Datadog.Trace.Configuration.IntegrationId.StackTraceLeak, "Datadog.Trace.ClrProfiler.AutoInstrumentation.CryptographyAlgorithm.SymmetricAlgorithmIntegration" or "Datadog.Trace.ClrProfiler.AutoInstrumentation.CryptographyAlgorithm.SymmetricAlgorithmIntegration" => Datadog.Trace.Configuration.IntegrationId.SymmetricAlgorithm, diff --git a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs index 560c942a2af2..f979f1c6ccd8 100644 --- a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs @@ -11,7 +11,7 @@ namespace Datadog.Trace.Telemetry; internal partial class CiVisibilityMetricsTelemetryCollector { - private const int CountSharedLength = 195; + private const int CountSharedLength = 198; /// /// Creates the buffer for the values. @@ -215,6 +215,9 @@ private static AggregatedMetric[] GetCountSharedBuffer() new(new[] { "integration_name:testplatformassemblyresolver", "error_type:duck_typing" }), new(new[] { "integration_name:testplatformassemblyresolver", "error_type:invoker" }), new(new[] { "integration_name:testplatformassemblyresolver", "error_type:execution" }), + new(new[] { "integration_name:stacktraceleak", "error_type:duck_typing" }), + new(new[] { "integration_name:stacktraceleak", "error_type:invoker" }), + new(new[] { "integration_name:stacktraceleak", "error_type:execution" }), }; /// @@ -223,7 +226,7 @@ private static AggregatedMetric[] GetCountSharedBuffer() /// It is equal to the cardinality of the tag combinations (or 1 if there are no tags) /// private static int[] CountSharedEntryCounts { get; } - = new int[]{ 195, }; + = new int[]{ 198, }; public void RecordCountSharedIntegrationsError(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.InstrumentationError tag2, int increment = 1) { diff --git a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs index d3c27a8828d4..6fc71bd737dc 100644 --- a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs @@ -11,7 +11,7 @@ namespace Datadog.Trace.Telemetry; internal partial class MetricsTelemetryCollector { - private const int CountLength = 332; + private const int CountLength = 335; /// /// Creates the buffer for the values. @@ -90,35 +90,36 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "integration_name:trustboundaryviolation" }), new(new[] { "integration_name:unvalidatedredirect" }), new(new[] { "integration_name:testplatformassemblyresolver" }), - // spans_finished, index = 69 + new(new[] { "integration_name:stacktraceleak" }), + // spans_finished, index = 70 new(null), - // spans_enqueued_for_serialization, index = 70 + // spans_enqueued_for_serialization, index = 71 new(new[] { "reason:p0_keep" }), new(new[] { "reason:single_span_sampling" }), new(new[] { "reason:default" }), - // spans_dropped, index = 73 + // spans_dropped, index = 74 new(new[] { "reason:p0_drop" }), new(new[] { "reason:overfull_buffer" }), new(new[] { "reason:serialization_error" }), new(new[] { "reason:api_error" }), - // trace_segments_created, index = 77 + // trace_segments_created, index = 78 new(new[] { "new_continued:new" }), new(new[] { "new_continued:continued" }), - // trace_chunks_enqueued_for_serialization, index = 79 + // trace_chunks_enqueued_for_serialization, index = 80 new(new[] { "reason:p0_keep" }), new(new[] { "reason:default" }), - // trace_chunks_dropped, index = 81 + // trace_chunks_dropped, index = 82 new(new[] { "reason:p0_drop" }), new(new[] { "reason:overfull_buffer" }), new(new[] { "reason:serialization_error" }), new(new[] { "reason:api_error" }), - // trace_chunks_sent, index = 85 + // trace_chunks_sent, index = 86 new(null), - // trace_segments_closed, index = 86 + // trace_segments_closed, index = 87 new(null), - // trace_api.requests, index = 87 + // trace_api.requests, index = 88 new(null), - // trace_api.responses, index = 88 + // trace_api.responses, index = 89 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -141,26 +142,26 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // trace_api.errors, index = 110 + // trace_api.errors, index = 111 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // trace_partial_flush.count, index = 113 + // trace_partial_flush.count, index = 114 new(new[] { "reason:large_trace" }), new(new[] { "reason:single_span_ingestion" }), - // context_header_style.injected, index = 115 + // context_header_style.injected, index = 116 new(new[] { "header_style:tracecontext" }), new(new[] { "header_style:datadog" }), new(new[] { "header_style:b3multi" }), new(new[] { "header_style:b3single" }), - // context_header_style.extracted, index = 119 + // context_header_style.extracted, index = 120 new(new[] { "header_style:tracecontext" }), new(new[] { "header_style:datadog" }), new(new[] { "header_style:b3multi" }), new(new[] { "header_style:b3single" }), - // stats_api.requests, index = 123 + // stats_api.requests, index = 124 new(null), - // stats_api.responses, index = 124 + // stats_api.responses, index = 125 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -183,14 +184,14 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // stats_api.errors, index = 146 + // stats_api.errors, index = 147 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // telemetry_api.requests, index = 149 + // telemetry_api.requests, index = 150 new(new[] { "endpoint:agent" }), new(new[] { "endpoint:agentless" }), - // telemetry_api.responses, index = 151 + // telemetry_api.responses, index = 152 new(new[] { "endpoint:agent", "status_code:200" }), new(new[] { "endpoint:agent", "status_code:201" }), new(new[] { "endpoint:agent", "status_code:202" }), @@ -235,16 +236,16 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "endpoint:agentless", "status_code:503" }), new(new[] { "endpoint:agentless", "status_code:504" }), new(new[] { "endpoint:agentless", "status_code:5xx" }), - // telemetry_api.errors, index = 195 + // telemetry_api.errors, index = 196 new(new[] { "endpoint:agent", "type:timeout" }), new(new[] { "endpoint:agent", "type:network" }), new(new[] { "endpoint:agent", "type:status_code" }), new(new[] { "endpoint:agentless", "type:timeout" }), new(new[] { "endpoint:agentless", "type:network" }), new(new[] { "endpoint:agentless", "type:status_code" }), - // version_conflict_tracers_created, index = 201 + // version_conflict_tracers_created, index = 202 new(null), - // direct_log_logs, index = 202 + // direct_log_logs, index = 203 new(new[] { "integration_name:datadog" }), new(new[] { "integration_name:opentracing" }), new(new[] { "integration_name:ciapp" }), @@ -310,9 +311,10 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "integration_name:trustboundaryviolation" }), new(new[] { "integration_name:unvalidatedredirect" }), new(new[] { "integration_name:testplatformassemblyresolver" }), - // direct_log_api.requests, index = 267 + new(new[] { "integration_name:stacktraceleak" }), + // direct_log_api.requests, index = 269 new(null), - // direct_log_api.responses, index = 268 + // direct_log_api.responses, index = 270 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -335,21 +337,21 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // direct_log_api.errors, index = 290 + // direct_log_api.errors, index = 292 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // waf.init, index = 293 + // waf.init, index = 295 new(null), - // waf.updates, index = 294 + // waf.updates, index = 296 new(null), - // waf.requests, index = 295 + // waf.requests, index = 297 new(new[] { "waf_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:false", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:true", "request_blocked:false", "waf_timeout:false", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:true", "request_blocked:true", "waf_timeout:false", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:true", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:false", "request_excluded:true" }), - // executed.source, index = 300 + // executed.source, index = 302 new(new[] { "source_type:http.request.body" }), new(new[] { "source_type:http.request.path" }), new(new[] { "source_type:http.request.parameter.name" }), @@ -362,9 +364,9 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "source_type:http.request.cookie.value" }), new(new[] { "source_type:http.request.matrix.parameter" }), new(new[] { "source_type:http.request.uri" }), - // executed.propagation, index = 312 + // executed.propagation, index = 314 new(null), - // executed.sink, index = 313 + // executed.sink, index = 315 new(new[] { "vulnerability_type:none" }), new(new[] { "vulnerability_type:weak_cipher" }), new(new[] { "vulnerability_type:weak_hash" }), @@ -383,7 +385,8 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "vulnerability_type:trust_boundary_violation" }), new(new[] { "vulnerability_type:hsts_header_missing" }), new(new[] { "vulnerability_type:header_injection" }), - // request.tainted, index = 331 + new(new[] { "vulnerability_type:stacktrace_leak" }), + // request.tainted, index = 334 new(null), }; @@ -393,7 +396,7 @@ private static AggregatedMetric[] GetCountBuffer() /// It is equal to the cardinality of the tag combinations (or 1 if there are no tags) /// private static int[] CountEntryCounts { get; } - = new int[]{ 4, 65, 1, 3, 4, 2, 2, 4, 1, 1, 1, 22, 3, 2, 4, 4, 1, 22, 3, 2, 44, 6, 1, 65, 1, 22, 3, 1, 1, 5, 12, 1, 18, 1, }; + = new int[]{ 4, 66, 1, 3, 4, 2, 2, 4, 1, 1, 1, 22, 3, 2, 4, 4, 1, 22, 3, 2, 44, 6, 1, 66, 1, 22, 3, 1, 1, 5, 12, 1, 19, 1, }; public void RecordCountLogCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.LogLevel tag, int increment = 1) { @@ -409,182 +412,182 @@ public void RecordCountSpanCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.In public void RecordCountSpanFinished(int increment = 1) { - Interlocked.Add(ref _buffer.Count[69], increment); + Interlocked.Add(ref _buffer.Count[70], increment); } public void RecordCountSpanEnqueuedForSerialization(Datadog.Trace.Telemetry.Metrics.MetricTags.SpanEnqueueReason tag, int increment = 1) { - var index = 70 + (int)tag; + var index = 71 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountSpanDropped(Datadog.Trace.Telemetry.Metrics.MetricTags.DropReason tag, int increment = 1) { - var index = 73 + (int)tag; + var index = 74 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceSegmentCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.TraceContinuation tag, int increment = 1) { - var index = 77 + (int)tag; + var index = 78 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceChunkEnqueued(Datadog.Trace.Telemetry.Metrics.MetricTags.TraceChunkEnqueueReason tag, int increment = 1) { - var index = 79 + (int)tag; + var index = 80 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceChunkDropped(Datadog.Trace.Telemetry.Metrics.MetricTags.DropReason tag, int increment = 1) { - var index = 81 + (int)tag; + var index = 82 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceChunkSent(int increment = 1) { - Interlocked.Add(ref _buffer.Count[85], increment); + Interlocked.Add(ref _buffer.Count[86], increment); } public void RecordCountTraceSegmentsClosed(int increment = 1) { - Interlocked.Add(ref _buffer.Count[86], increment); + Interlocked.Add(ref _buffer.Count[87], increment); } public void RecordCountTraceApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[87], increment); + Interlocked.Add(ref _buffer.Count[88], increment); } public void RecordCountTraceApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 88 + (int)tag; + var index = 89 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 110 + (int)tag; + var index = 111 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTracePartialFlush(Datadog.Trace.Telemetry.Metrics.MetricTags.PartialFlushReason tag, int increment = 1) { - var index = 113 + (int)tag; + var index = 114 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountContextHeaderStyleInjected(Datadog.Trace.Telemetry.Metrics.MetricTags.ContextHeaderStyle tag, int increment = 1) { - var index = 115 + (int)tag; + var index = 116 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountContextHeaderStyleExtracted(Datadog.Trace.Telemetry.Metrics.MetricTags.ContextHeaderStyle tag, int increment = 1) { - var index = 119 + (int)tag; + var index = 120 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountStatsApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[123], increment); + Interlocked.Add(ref _buffer.Count[124], increment); } public void RecordCountStatsApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 124 + (int)tag; + var index = 125 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountStatsApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 146 + (int)tag; + var index = 147 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTelemetryApiRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag, int increment = 1) { - var index = 149 + (int)tag; + var index = 150 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTelemetryApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag2, int increment = 1) { - var index = 151 + ((int)tag1 * 22) + (int)tag2; + var index = 152 + ((int)tag1 * 22) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTelemetryApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag2, int increment = 1) { - var index = 195 + ((int)tag1 * 3) + (int)tag2; + var index = 196 + ((int)tag1 * 3) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountVersionConflictTracerCreated(int increment = 1) { - Interlocked.Add(ref _buffer.Count[201], increment); + Interlocked.Add(ref _buffer.Count[202], increment); } public void RecordCountDirectLogLogs(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag, int increment = 1) { - var index = 202 + (int)tag; + var index = 203 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountDirectLogApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[267], increment); + Interlocked.Add(ref _buffer.Count[269], increment); } public void RecordCountDirectLogApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 268 + (int)tag; + var index = 270 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountDirectLogApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 290 + (int)tag; + var index = 292 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountWafInit(int increment = 1) { - Interlocked.Add(ref _buffer.Count[293], increment); + Interlocked.Add(ref _buffer.Count[295], increment); } public void RecordCountWafUpdates(int increment = 1) { - Interlocked.Add(ref _buffer.Count[294], increment); + Interlocked.Add(ref _buffer.Count[296], increment); } public void RecordCountWafRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.WafAnalysis tag, int increment = 1) { - var index = 295 + (int)tag; + var index = 297 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastExecutedSources(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSources tag, int increment = 1) { - var index = 300 + (int)tag; + var index = 302 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastExecutedPropagations(int increment = 1) { - Interlocked.Add(ref _buffer.Count[312], increment); + Interlocked.Add(ref _buffer.Count[314], increment); } public void RecordCountIastExecutedSinks(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks tag, int increment = 1) { - var index = 313 + (int)tag; + var index = 315 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastRequestTainted(int increment = 1) { - Interlocked.Add(ref _buffer.Count[331], increment); + Interlocked.Add(ref _buffer.Count[334], increment); } } \ No newline at end of file diff --git a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs index cc6fdef6a8aa..7e0ebaa784f9 100644 --- a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs @@ -11,7 +11,7 @@ namespace Datadog.Trace.Telemetry; internal partial class MetricsTelemetryCollector { - private const int CountSharedLength = 195; + private const int CountSharedLength = 198; /// /// Creates the buffer for the values. @@ -215,6 +215,9 @@ private static AggregatedMetric[] GetCountSharedBuffer() new(new[] { "integration_name:testplatformassemblyresolver", "error_type:duck_typing" }), new(new[] { "integration_name:testplatformassemblyresolver", "error_type:invoker" }), new(new[] { "integration_name:testplatformassemblyresolver", "error_type:execution" }), + new(new[] { "integration_name:stacktraceleak", "error_type:duck_typing" }), + new(new[] { "integration_name:stacktraceleak", "error_type:invoker" }), + new(new[] { "integration_name:stacktraceleak", "error_type:execution" }), }; /// @@ -223,7 +226,7 @@ private static AggregatedMetric[] GetCountSharedBuffer() /// It is equal to the cardinality of the tag combinations (or 1 if there are no tags) /// private static int[] CountSharedEntryCounts { get; } - = new int[]{ 195, }; + = new int[]{ 198, }; public void RecordCountSharedIntegrationsError(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.InstrumentationError tag2, int increment = 1) { diff --git a/tracer/src/Datadog.Trace/Iast/IastModule.cs b/tracer/src/Datadog.Trace/Iast/IastModule.cs index 68ccb9f29402..ae265d5c0915 100644 --- a/tracer/src/Datadog.Trace/Iast/IastModule.cs +++ b/tracer/src/Datadog.Trace/Iast/IastModule.cs @@ -24,6 +24,7 @@ namespace Datadog.Trace.Iast; internal static class IastModule { public const string HeaderInjectionEvidenceSeparator = ": "; + private const string OperationNameStackTraceLeak = "stacktrace_leak"; private const string OperationNameWeakHash = "weak_hashing"; private const string OperationNameWeakCipher = "weak_cipher"; private const string OperationNameSqlInjection = "sql_injection"; @@ -288,6 +289,15 @@ public static IastModuleResponse OnCipherAlgorithm(Type type, IntegrationId inte return GetScope(algorithm, integrationId, VulnerabilityTypeName.WeakCipher, OperationNameWeakCipher); } + public static IastModuleResponse OnStackTraceLeak(Exception ex, IntegrationId integrationId) + { + OnExecutedSinkTelemetry(IastInstrumentedSinks.StackTraceLeak); + var evidence = $"{ex.Source},{ex.GetType().Name}"; + // We report the stack of the exception instead of the current stack + var stack = new StackTrace(ex, true); + return GetScope(evidence, integrationId, VulnerabilityTypeName.StackTraceLeak, OperationNameStackTraceLeak, externalStack: stack); + } + public static IastModuleResponse OnHashingAlgorithm(string? algorithm, IntegrationId integrationId) { OnExecutedSinkTelemetry(IastInstrumentedSinks.WeakHash); @@ -384,7 +394,7 @@ public static bool AddRequestVulnerabilitiesAllowed() return isRequest && traceContext?.IastRequestContext?.AddVulnerabilitiesAllowed() == true; } - private static IastModuleResponse GetScope(string evidenceValue, IntegrationId integrationId, string vulnerabilityType, string operationName, Func? taintValidator = null, bool addLocation = true, int? hash = null) + private static IastModuleResponse GetScope(string evidenceValue, IntegrationId integrationId, string vulnerabilityType, string operationName, Func? taintValidator = null, bool addLocation = true, int? hash = null, StackTrace? externalStack = null) { var tracer = Tracer.Instance; if (!iastSettings.Enabled || !tracer.Settings.IsIntegrationEnabled(integrationId)) @@ -425,7 +435,7 @@ private static IastModuleResponse GetScope(string evidenceValue, IntegrationId i if (addLocation) { - var frameInfo = StackWalker.GetFrame(); + var frameInfo = StackWalker.GetFrame(externalStack); if (!frameInfo.IsValid) { diff --git a/tracer/src/Datadog.Trace/Iast/StackWalker.cs b/tracer/src/Datadog.Trace/Iast/StackWalker.cs index 148d85fadc25..69cf000e9e73 100644 --- a/tracer/src/Datadog.Trace/Iast/StackWalker.cs +++ b/tracer/src/Datadog.Trace/Iast/StackWalker.cs @@ -40,9 +40,9 @@ internal static class StackWalker private static readonly Dictionary ExcludedAssemblyCache = new Dictionary(); - public static StackFrameInfo GetFrame() + public static StackFrameInfo GetFrame(StackTrace? externalStack = null) { - var stackTrace = new StackTrace(DefaultSkipFrames, true); + var stackTrace = externalStack ?? new StackTrace(DefaultSkipFrames, true); foreach (var frame in stackTrace.GetFrames()) { diff --git a/tracer/src/Datadog.Trace/Iast/Telemetry/ExecutedTelemetryHelper.cs b/tracer/src/Datadog.Trace/Iast/Telemetry/ExecutedTelemetryHelper.cs index f1469c60b989..cf095005bc03 100644 --- a/tracer/src/Datadog.Trace/Iast/Telemetry/ExecutedTelemetryHelper.cs +++ b/tracer/src/Datadog.Trace/Iast/Telemetry/ExecutedTelemetryHelper.cs @@ -145,6 +145,7 @@ private string GetExecutedSinkTag(IastInstrumentedSinks vulnerability) IastInstrumentedSinks.TrustBoundaryViolation => BasicExecutedTag + SinkExecutedTag + "trust_boundary_violation", IastInstrumentedSinks.HstsHeaderMissing => BasicExecutedTag + SinkExecutedTag + "hsts_header_missing", IastInstrumentedSinks.HeaderInjection => BasicExecutedTag + SinkExecutedTag + "header_injection", + IastInstrumentedSinks.StackTraceLeak => BasicExecutedTag + SinkExecutedTag + "stacktrace_leak", IastInstrumentedSinks.None => throw new System.Exception($"Undefined vulnerability name for value {vulnerability}."), _ => throw new System.Exception($"Undefined vulnerability name for value {vulnerability}."), }; diff --git a/tracer/src/Datadog.Trace/Iast/VulnerabilityType.cs b/tracer/src/Datadog.Trace/Iast/VulnerabilityType.cs index bd386f89af7e..f94c630aa814 100644 --- a/tracer/src/Datadog.Trace/Iast/VulnerabilityType.cs +++ b/tracer/src/Datadog.Trace/Iast/VulnerabilityType.cs @@ -64,4 +64,7 @@ internal enum VulnerabilityType /// HEADER_INJECTION vulnerability HeaderInjection = 17, + + /// STACKTRACE_LEAK vulnerability + StackTraceLeak = 18, } diff --git a/tracer/src/Datadog.Trace/Iast/VulnerabilityTypeName.cs b/tracer/src/Datadog.Trace/Iast/VulnerabilityTypeName.cs index 53d176157f95..4a204b5e7ab5 100644 --- a/tracer/src/Datadog.Trace/Iast/VulnerabilityTypeName.cs +++ b/tracer/src/Datadog.Trace/Iast/VulnerabilityTypeName.cs @@ -67,6 +67,9 @@ internal static class VulnerabilityTypeName /// HEADER_INJECTION vulnerability public const string HeaderInjection = "HEADER_INJECTION"; + /// STACKTRACE_LEAK vulnerability + public const string StackTraceLeak = "STACKTRACE_LEAK"; + public static string GetName(VulnerabilityType vulnerability) { return vulnerability switch @@ -89,6 +92,7 @@ public static string GetName(VulnerabilityType vulnerability) VulnerabilityType.TrustBoundaryViolation => TrustBoundaryViolation, VulnerabilityType.HstsHeaderMissing => HstsHeaderMissing, VulnerabilityType.HeaderInjection => HeaderInjection, + VulnerabilityType.StackTraceLeak => StackTraceLeak, _ => throw new System.ArgumentException($"VulnerabilityName for VulnerabilityType.{vulnerability} missing.", "vulnerability"), }; } diff --git a/tracer/src/Datadog.Trace/Telemetry/Metrics/IntegrationIdExtensions.cs b/tracer/src/Datadog.Trace/Telemetry/Metrics/IntegrationIdExtensions.cs index f7fd9542ebf2..bdec5f784911 100644 --- a/tracer/src/Datadog.Trace/Telemetry/Metrics/IntegrationIdExtensions.cs +++ b/tracer/src/Datadog.Trace/Telemetry/Metrics/IntegrationIdExtensions.cs @@ -73,6 +73,7 @@ public static MetricTags.IntegrationName GetMetricTag(this IntegrationId integra IntegrationId.TrustBoundaryViolation => MetricTags.IntegrationName.TrustBoundaryViolation, IntegrationId.UnvalidatedRedirect => MetricTags.IntegrationName.UnvalidatedRedirect, IntegrationId.TestPlatformAssemblyResolver => MetricTags.IntegrationName.TestPlatformAssemblyResolver, + IntegrationId.StackTraceLeak => MetricTags.IntegrationName.StackTraceLeak, _ => throw new InvalidOperationException($"Unknown IntegrationID {integrationId}"), // dangerous, but we test it will never be called }; } diff --git a/tracer/src/Datadog.Trace/Telemetry/Metrics/MetricTags.cs b/tracer/src/Datadog.Trace/Telemetry/Metrics/MetricTags.cs index 16f1d7205886..1203ad1eaf61 100644 --- a/tracer/src/Datadog.Trace/Telemetry/Metrics/MetricTags.cs +++ b/tracer/src/Datadog.Trace/Telemetry/Metrics/MetricTags.cs @@ -218,6 +218,7 @@ internal enum IntegrationName [Description("integration_name:trustboundaryviolation")] TrustBoundaryViolation, [Description("integration_name:unvalidatedredirect")] UnvalidatedRedirect, [Description("integration_name:testplatformassemblyresolver")] TestPlatformAssemblyResolver, + [Description("integration_name:stacktraceleak")] StackTraceLeak, } public enum InstrumentationError @@ -278,6 +279,7 @@ public enum IastInstrumentedSinks [Description("vulnerability_type:trust_boundary_violation")] TrustBoundaryViolation = 15, [Description("vulnerability_type:hsts_header_missing")] HstsHeaderMissing = 16, [Description("vulnerability_type:header_injection")] HeaderInjection = 17, + [Description("vulnerability_type:stacktrace_leak")] StackTraceLeak = 18, } public enum CIVisibilityTestFramework diff --git a/tracer/test/Datadog.Trace.ClrProfiler.Managed.Tests/TypeNameTests.cs b/tracer/test/Datadog.Trace.ClrProfiler.Managed.Tests/TypeNameTests.cs index 3c051c1399f1..57a84df0ba5b 100644 --- a/tracer/test/Datadog.Trace.ClrProfiler.Managed.Tests/TypeNameTests.cs +++ b/tracer/test/Datadog.Trace.ClrProfiler.Managed.Tests/TypeNameTests.cs @@ -48,6 +48,7 @@ public static IEnumerable GetConstTypeAssociations() yield return new object[] { ClrNames.Activity, "System.Diagnostics.Activity" }; yield return new object[] { ClrNames.Process, "System.Diagnostics.Process" }; yield return new object[] { ClrNames.ByteArray, typeof(byte[]) }; + yield return new object[] { ClrNames.Exception, typeof(Exception) }; } [Fact] diff --git a/tracer/test/Datadog.Trace.Security.IntegrationTests/IAST/AspNetCore2IastTests.cs b/tracer/test/Datadog.Trace.Security.IntegrationTests/IAST/AspNetCore2IastTests.cs index 7558bb694766..8dd22bf5e95d 100644 --- a/tracer/test/Datadog.Trace.Security.IntegrationTests/IAST/AspNetCore2IastTests.cs +++ b/tracer/test/Datadog.Trace.Security.IntegrationTests/IAST/AspNetCore2IastTests.cs @@ -88,6 +88,7 @@ public class AspNetCore2IastTestsFullSamplingEnabled : AspNetCore2IastTestsFullS public AspNetCore2IastTestsFullSamplingEnabled(AspNetCoreTestFixture fixture, ITestOutputHelper outputHelper) : base(fixture, outputHelper, enableIast: true, testName: "AspNetCore2IastTestsEnabled", isIastDeduplicationEnabled: false, vulnerabilitiesPerRequest: 200) { + SetEnvironmentVariable("ASPNETCORE_ENVIRONMENT", "Development"); } [SkippableTheory] @@ -155,6 +156,25 @@ await VerifyHelper.VerifySpans(spans, settings) .UseFileName(filename) .DisableRequireUniquePrefix(); } + + [Fact] + [Trait("Category", "ArmUnsupported")] + [Trait("RunOnWindows", "True")] + public async Task TestStackTraceLeak() + { + var filename = "Iast.StackTraceLeak.AspNetCore2"; + var url = "/Iast/StackTraceLeak"; + IncludeAllHttpSpans = true; + await TryStartApp(); + var agent = Fixture.Agent; + var spans = await SendRequestsAsync(agent, [url]); + + var settings = VerifyHelper.GetSpanVerifierSettings(); + settings.AddIastScrubbing(); + await VerifyHelper.VerifySpans(spans, settings) + .UseFileName(filename) + .DisableRequireUniquePrefix(); + } } public class AspNetCore2IastTestsFullSamplingDisabled : AspNetCore2IastTestsFullSampling diff --git a/tracer/test/Datadog.Trace.Security.IntegrationTests/IAST/AspNetCore5IastTests.cs b/tracer/test/Datadog.Trace.Security.IntegrationTests/IAST/AspNetCore5IastTests.cs index 0334a719913a..bb8abd532e91 100644 --- a/tracer/test/Datadog.Trace.Security.IntegrationTests/IAST/AspNetCore5IastTests.cs +++ b/tracer/test/Datadog.Trace.Security.IntegrationTests/IAST/AspNetCore5IastTests.cs @@ -103,6 +103,25 @@ await VerifyHelper.VerifySpans(spansFiltered, settings) .UseFileName(filename) .DisableRequireUniquePrefix(); } + + [Fact] + [Trait("Category", "ArmUnsupported")] + [Trait("RunOnWindows", "True")] + public async Task TestStackTraceLeak() + { + var filename = "Iast.StackTraceLeak.AspNetCore5.NotVulnerable"; + var url = "/Iast/StackTraceLeak"; + IncludeAllHttpSpans = true; + await TryStartApp(); + var agent = Fixture.Agent; + var spans = await SendRequestsAsync(agent, [url]); + + var settings = VerifyHelper.GetSpanVerifierSettings(); + settings.AddIastScrubbing(); + await VerifyHelper.VerifySpans(spans, settings) + .UseFileName(filename) + .DisableRequireUniquePrefix(); + } } public class AspNetCore5IastTestsOneVulnerabilityPerRequestIastEnabled : AspNetCore5IastTestsVariableVulnerabilityPerRequestIastEnabled @@ -159,6 +178,7 @@ public class AspNetCore5IastTestsFullSamplingIastEnabled : AspNetCore5IastTestsF public AspNetCore5IastTestsFullSamplingIastEnabled(AspNetCoreTestFixture fixture, ITestOutputHelper outputHelper) : base(fixture, outputHelper, enableIast: true, vulnerabilitiesPerRequest: 200, isIastDeduplicationEnabled: false, testName: "AspNetCore5IastTestsEnabled") { + SetEnvironmentVariable("ASPNETCORE_ENVIRONMENT", "Development"); } // When the request is finished without this X-Content-Type-Options: nosniff header and the content-type of the request looks @@ -233,6 +253,25 @@ await VerifyHelper.VerifySpans(spans, settings) .UseFileName(filename) .DisableRequireUniquePrefix(); } + + [Fact] + [Trait("Category", "ArmUnsupported")] + [Trait("RunOnWindows", "True")] + public async Task TestStackTraceLeak() + { + var filename = "Iast.StackTraceLeak.AspNetCore5"; + var url = "/Iast/StackTraceLeak"; + IncludeAllHttpSpans = true; + await TryStartApp(); + var agent = Fixture.Agent; + var spans = await SendRequestsAsync(agent, [url]); + + var settings = VerifyHelper.GetSpanVerifierSettings(); + settings.AddIastScrubbing(); + await VerifyHelper.VerifySpans(spans, settings) + .UseFileName(filename) + .DisableRequireUniquePrefix(); + } } public class AspNetCore5IastTestsFullSamplingIastDisabled : AspNetCore5IastTestsFullSampling diff --git a/tracer/test/Datadog.Trace.Security.IntegrationTests/IAST/AspNetMvc5IastTests.cs b/tracer/test/Datadog.Trace.Security.IntegrationTests/IAST/AspNetMvc5IastTests.cs index 105f024358e6..34abf13a91d3 100644 --- a/tracer/test/Datadog.Trace.Security.IntegrationTests/IAST/AspNetMvc5IastTests.cs +++ b/tracer/test/Datadog.Trace.Security.IntegrationTests/IAST/AspNetMvc5IastTests.cs @@ -88,6 +88,16 @@ public async Task TestIastHeaderInjectionRequest(string testCase, string[] heade { await TestIastHeaderInjectionRequestVulnerability(testCase, headers, cookies, useValueFromOriginHeader); } + + [Trait("Category", "EndToEnd")] + [Trait("RunOnWindows", "True")] + [Trait("LoadFromGAC", "True")] + [SkippableTheory] + [InlineData(AddressesConstants.RequestQuery, "/Iast/StackTraceLeak")] + public async Task TestStackTraceLeak(string test, string url) + { + await TestStrictTransportSecurityHeaderMissingVulnerability(test, url); + } } [Collection("IisTests")] @@ -453,6 +463,19 @@ await VerifyHelper.VerifySpans(spansFiltered, settings) .DisableRequireUniquePrefix(); } + protected async Task TestStrictTransportSecurityHeaderMissingVulnerability(string test, string url) + { + var sanitisedUrl = VerifyHelper.SanitisePathsForVerify(url); + var settings = VerifyHelper.GetSpanVerifierSettings(test, sanitisedUrl); + var spans = await SendRequestsAsync(_iisFixture.Agent, [url]); + var filename = GetFileName("StackTraceLeak"); + var spansFiltered = spans.Where(x => x.Type == SpanTypes.Web).ToList(); + settings.AddIastScrubbing(); + await VerifyHelper.VerifySpans(spansFiltered, settings) + .UseFileName(filename) + .DisableRequireUniquePrefix(); + } + protected async Task TestStrictTransportSecurityHeaderMissingVulnerability(string contentType, int returnCode, string hstsHeaderValue, string xForwardedProto, string testName) { var queryParams = "?contentType=" + contentType + "&returnCode=" + returnCode + diff --git a/tracer/test/snapshots/Iast.StackTraceLeak.AspNetCore2.verified.txt b/tracer/test/snapshots/Iast.StackTraceLeak.AspNetCore2.verified.txt new file mode 100644 index 000000000000..e3274240d6ae --- /dev/null +++ b/tracer/test/snapshots/Iast.StackTraceLeak.AspNetCore2.verified.txt @@ -0,0 +1,71 @@ +[ + { + TraceId: Id_1, + SpanId: Id_2, + Name: aspnet_core.request, + Resource: GET /iast/stacktraceleak, + Service: Samples.Security.AspNetCore2, + Type: web, + Error: 1, + Tags: { + aspnet_core.route: iast/stacktraceleak, + component: aspnet_core, + env: integration_tests, + error.msg: Custom exception message, + error.stack: +System.SystemException: Custom exception message +at Samples.Security.AspNetCore5.Controllers.IastController.StackTraceLeak(), + error.type: System.SystemException, + http.method: GET, + http.request.headers.host: localhost:00000, + http.route: iast/stacktraceleak, + http.status_code: 500, + http.url: http://localhost:00000/Iast/StackTraceLeak, + http.useragent: Mistake Not..., + language: dotnet, + runtime-id: Guid_1, + span.kind: server, + _dd.git.commit.sha: aaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbb, + _dd.git.repository_url: https://github.com/DataDog/dd-trace-dotnet, + _dd.iast.enabled: 1, + _dd.iast.json: +{ + "vulnerabilities": [ + { + "type": "STACKTRACE_LEAK", + "evidence": { + "value": "Samples.Security.AspNetCore2,SystemException" + } + } + ] +} + }, + Metrics: { + process_id: 0, + _dd.agent_psr: 1.0, + _dd.top_level: 1.0, + _dd.tracer_kr: 1.0, + _sampling_priority_v1: 1.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_3, + Name: aspnet_core_mvc.request, + Resource: GET /iast/stacktraceleak, + Service: Samples.Security.AspNetCore2, + Type: web, + ParentId: Id_2, + Tags: { + aspnet_core.action: stacktraceleak, + aspnet_core.controller: iast, + aspnet_core.route: iast/stacktraceleak, + component: aspnet_core, + env: integration_tests, + language: dotnet, + span.kind: server, + _dd.git.commit.sha: aaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbb, + _dd.git.repository_url: https://github.com/DataDog/dd-trace-dotnet + } + } +] \ No newline at end of file diff --git a/tracer/test/snapshots/Iast.StackTraceLeak.AspNetCore5.NotVulnerable.verified.txt b/tracer/test/snapshots/Iast.StackTraceLeak.AspNetCore5.NotVulnerable.verified.txt new file mode 100644 index 000000000000..ac082d4b61e5 --- /dev/null +++ b/tracer/test/snapshots/Iast.StackTraceLeak.AspNetCore5.NotVulnerable.verified.txt @@ -0,0 +1,71 @@ +[ + { + TraceId: Id_1, + SpanId: Id_2, + Name: aspnet_core.request, + Resource: GET /iast/stacktraceleak, + Service: Samples.Security.AspNetCore5, + Type: web, + Error: 1, + Tags: { + aspnet_core.endpoint: Samples.Security.AspNetCore5.Controllers.IastController.StackTraceLeak (Samples.Security.AspNetCore5), + aspnet_core.route: iast/stacktraceleak, + component: aspnet_core, + env: integration_tests, + error.msg: Custom exception message, + error.stack: +System.SystemException: Custom exception message +at Samples.Security.AspNetCore5.Controllers.IastController.StackTraceLeak(), + error.type: System.SystemException, + http.method: GET, + http.request.headers.host: localhost:00000, + http.route: iast/stacktraceleak, + http.status_code: 500, + http.url: http://localhost:00000/Iast/StackTraceLeak, + http.useragent: Mistake Not..., + language: dotnet, + runtime-id: Guid_1, + span.kind: server, + _dd.git.commit.sha: aaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbb, + _dd.git.repository_url: https://github.com/DataDog/dd-trace-dotnet, + _dd.iast.enabled: 1 + }, + Metrics: { + process_id: 0, + _dd.agent_psr: 1.0, + _dd.iast.telemetry.executed.source.http_request_cookie_name: 1.0, + _dd.iast.telemetry.executed.source.http_request_cookie_value: 1.0, + _dd.iast.telemetry.executed.source.http_request_header: 1.0, + _dd.iast.telemetry.executed.source.http_request_header_name: 1.0, + _dd.iast.telemetry.executed.source.http_request_parameter: 1.0, + _dd.iast.telemetry.executed.source.http_request_parameter_name: 1.0, + _dd.iast.telemetry.executed.source.http_request_path: 1.0, + _dd.iast.telemetry.executed.source.http_request_path_parameter: 1.0, + _dd.iast.telemetry.executed.source.http_request_query: 1.0, + _dd.iast.telemetry.request.tainted:, + _dd.top_level: 1.0, + _dd.tracer_kr: 1.0, + _sampling_priority_v1: 1.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_3, + Name: aspnet_core_mvc.request, + Resource: GET /iast/stacktraceleak, + Service: Samples.Security.AspNetCore5, + Type: web, + ParentId: Id_2, + Tags: { + aspnet_core.action: stacktraceleak, + aspnet_core.controller: iast, + aspnet_core.route: iast/stacktraceleak, + component: aspnet_core, + env: integration_tests, + language: dotnet, + span.kind: server, + _dd.git.commit.sha: aaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbb, + _dd.git.repository_url: https://github.com/DataDog/dd-trace-dotnet + } + } +] \ No newline at end of file diff --git a/tracer/test/snapshots/Iast.StackTraceLeak.AspNetCore5.verified.txt b/tracer/test/snapshots/Iast.StackTraceLeak.AspNetCore5.verified.txt new file mode 100644 index 000000000000..c38de0ee8f91 --- /dev/null +++ b/tracer/test/snapshots/Iast.StackTraceLeak.AspNetCore5.verified.txt @@ -0,0 +1,72 @@ +[ + { + TraceId: Id_1, + SpanId: Id_2, + Name: aspnet_core.request, + Resource: GET /iast/stacktraceleak, + Service: Samples.Security.AspNetCore5, + Type: web, + Error: 1, + Tags: { + aspnet_core.endpoint: Samples.Security.AspNetCore5.Controllers.IastController.StackTraceLeak (Samples.Security.AspNetCore5), + aspnet_core.route: iast/stacktraceleak, + component: aspnet_core, + env: integration_tests, + error.msg: Custom exception message, + error.stack: +System.SystemException: Custom exception message +at Samples.Security.AspNetCore5.Controllers.IastController.StackTraceLeak(), + error.type: System.SystemException, + http.method: GET, + http.request.headers.host: localhost:00000, + http.route: iast/stacktraceleak, + http.status_code: 500, + http.url: http://localhost:00000/Iast/StackTraceLeak, + http.useragent: Mistake Not..., + language: dotnet, + runtime-id: Guid_1, + span.kind: server, + _dd.git.commit.sha: aaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbb, + _dd.git.repository_url: https://github.com/DataDog/dd-trace-dotnet, + _dd.iast.enabled: 1, + _dd.iast.json: +{ + "vulnerabilities": [ + { + "type": "STACKTRACE_LEAK", + "evidence": { + "value": "Samples.Security.AspNetCore5,SystemException" + } + } + ] +} + }, + Metrics: { + process_id: 0, + _dd.agent_psr: 1.0, + _dd.top_level: 1.0, + _dd.tracer_kr: 1.0, + _sampling_priority_v1: 1.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_3, + Name: aspnet_core_mvc.request, + Resource: GET /iast/stacktraceleak, + Service: Samples.Security.AspNetCore5, + Type: web, + ParentId: Id_2, + Tags: { + aspnet_core.action: stacktraceleak, + aspnet_core.controller: iast, + aspnet_core.route: iast/stacktraceleak, + component: aspnet_core, + env: integration_tests, + language: dotnet, + span.kind: server, + _dd.git.commit.sha: aaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbb, + _dd.git.repository_url: https://github.com/DataDog/dd-trace-dotnet + } + } +] \ No newline at end of file diff --git a/tracer/test/snapshots/Iast.StackTraceLeak.AspNetMvc5.IastEnabled.verified.txt b/tracer/test/snapshots/Iast.StackTraceLeak.AspNetMvc5.IastEnabled.verified.txt new file mode 100644 index 000000000000..e1ee5cfb99dc --- /dev/null +++ b/tracer/test/snapshots/Iast.StackTraceLeak.AspNetMvc5.IastEnabled.verified.txt @@ -0,0 +1,75 @@ +[ + { + TraceId: Id_1, + SpanId: Id_2, + Name: aspnet.request, + Resource: GET /iast/stacktraceleak, + Service: sample, + Type: web, + Error: 1, + Tags: { + env: integration_tests, + error.msg: Custom exception message, + error.stack: +System.SystemException: Custom exception message +at Samples.Security.AspNetCore5.Controllers.IastController.StackTraceLeak(), + error.type: System.SystemException, + http.method: GET, + http.request.headers.host: localhost:00000, + http.route: {controller}/{action}/{id}, + http.status_code: 500, + http.url: http://localhost:00000/Iast/StackTraceLeak, + http.useragent: Mistake Not..., + language: dotnet, + runtime-id: Guid_1, + span.kind: server, + _dd.iast.enabled: 1, + _dd.iast.json: +{ + "vulnerabilities": [ + { + "type": "STACKTRACE_LEAK", + "evidence": { + "value": "Samples.Security.AspNetMvc5,SystemException" + } + } + ] +} + }, + Metrics: { + process_id: 0, + _dd.agent_psr: 1.0, + _dd.top_level: 1.0, + _dd.tracer_kr: 1.0, + _sampling_priority_v1: 1.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_3, + Name: aspnet-mvc.request, + Resource: GET /iast/stacktraceleak, + Service: sample, + Type: web, + ParentId: Id_2, + Error: 1, + Tags: { + aspnet.action: stacktraceleak, + aspnet.controller: iast, + aspnet.route: {controller}/{action}/{id}, + env: integration_tests, + error.msg: Custom exception message, + error.stack: +System.SystemException: Custom exception message +at Samples.Security.AspNetCore5.Controllers.IastController.StackTraceLeak(), + error.type: System.SystemException, + http.method: GET, + http.request.headers.host: localhost:00000, + http.status_code: 500, + http.url: http://localhost:00000/Iast/StackTraceLeak, + http.useragent: Mistake Not..., + language: dotnet, + span.kind: server + } + } +] \ No newline at end of file diff --git a/tracer/test/test-applications/security/Samples.Security.AspNetCore5/Controllers/IastController.cs b/tracer/test/test-applications/security/Samples.Security.AspNetCore5/Controllers/IastController.cs index a2e3646ea123..3afc9db0012a 100644 --- a/tracer/test/test-applications/security/Samples.Security.AspNetCore5/Controllers/IastController.cs +++ b/tracer/test/test-applications/security/Samples.Security.AspNetCore5/Controllers/IastController.cs @@ -12,6 +12,7 @@ using System.Runtime.Versioning; using System.Security.Cryptography; using System.Text; +using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; @@ -625,6 +626,13 @@ public ActionResult StrictTransportSecurity(string contentType = "text/html", in } } + [HttpGet("StackTraceLeak")] + [Route("StackTraceLeak")] + public ActionResult StackTraceLeak() + { + throw new SystemException("Custom exception message"); + } + // We should exclude some headers to prevent false positives: // location: it is already reported in UNVALIDATED_REDIRECT vulnerability detection. // Sec-WebSocket-Location, Sec-WebSocket-Accept, Upgrade, Connection: Usually the framework gets info from request diff --git a/tracer/test/test-applications/security/Samples.Security.AspNetCore5/Views/Home/Index.cshtml b/tracer/test/test-applications/security/Samples.Security.AspNetCore5/Views/Home/Index.cshtml index e9436af57653..967b92940cf8 100644 --- a/tracer/test/test-applications/security/Samples.Security.AspNetCore5/Views/Home/Index.cshtml +++ b/tracer/test/test-applications/security/Samples.Security.AspNetCore5/Views/Home/Index.cshtml @@ -110,6 +110,8 @@ + +
diff --git a/tracer/test/test-applications/security/aspnet/Samples.Security.AspNetMvc5/Controllers/IastController.cs b/tracer/test/test-applications/security/aspnet/Samples.Security.AspNetMvc5/Controllers/IastController.cs index 2cfae88d3345..84823e4f7471 100644 --- a/tracer/test/test-applications/security/aspnet/Samples.Security.AspNetMvc5/Controllers/IastController.cs +++ b/tracer/test/test-applications/security/aspnet/Samples.Security.AspNetMvc5/Controllers/IastController.cs @@ -580,5 +580,11 @@ static string CopyStringAvoidTainting(string original) { return new string(original.AsEnumerable().ToArray()); } + + [Route("StackTraceLeak")] + public ActionResult StackTraceLeak() + { + throw new SystemException("Custom exception message"); + } } } diff --git a/tracer/test/test-applications/security/aspnet/Samples.Security.AspNetMvc5/Views/Home/Index.cshtml b/tracer/test/test-applications/security/aspnet/Samples.Security.AspNetMvc5/Views/Home/Index.cshtml index bfe8b64fae35..b2d1bf167d1e 100644 --- a/tracer/test/test-applications/security/aspnet/Samples.Security.AspNetMvc5/Views/Home/Index.cshtml +++ b/tracer/test/test-applications/security/aspnet/Samples.Security.AspNetMvc5/Views/Home/Index.cshtml @@ -90,6 +90,8 @@ + +