From 1c35fa803fd404792094945627b68d699a010e67 Mon Sep 17 00:00:00 2001 From: Flavien Darche Date: Mon, 30 Dec 2024 16:33:25 +0100 Subject: [PATCH] Update Iast Log Warning to Error --- .../Aspects/MongoDB/MongoDatabaseAspect.cs | 2 +- .../Newtonsoft.Json/NewtonsoftJsonAspects.cs | 6 +++--- .../DefaultInterpolatedStringHandlerAspect.cs | 18 +++++++++--------- .../System.Text.Json/JsonDocumentAspects.cs | 10 +++++----- .../JavaScriptSerializerAspects.cs | 2 +- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/tracer/src/Datadog.Trace/Iast/Aspects/MongoDB/MongoDatabaseAspect.cs b/tracer/src/Datadog.Trace/Iast/Aspects/MongoDB/MongoDatabaseAspect.cs index 76510f3c2447..3c8c3638fe8c 100644 --- a/tracer/src/Datadog.Trace/Iast/Aspects/MongoDB/MongoDatabaseAspect.cs +++ b/tracer/src/Datadog.Trace/Iast/Aspects/MongoDB/MongoDatabaseAspect.cs @@ -53,7 +53,7 @@ public class MongoDatabaseAspect } catch (global::System.Exception ex) { - IastModule.Log.Warning(ex, $"Error invoking {nameof(MongoDatabaseAspect)}.{nameof(AnalyzeCommand)}"); + IastModule.Log.Error(ex, $"Error invoking {nameof(MongoDatabaseAspect)}.{nameof(AnalyzeCommand)}"); return command; } } diff --git a/tracer/src/Datadog.Trace/Iast/Aspects/Newtonsoft.Json/NewtonsoftJsonAspects.cs b/tracer/src/Datadog.Trace/Iast/Aspects/Newtonsoft.Json/NewtonsoftJsonAspects.cs index 9d14c262b534..a815f23b7cfa 100644 --- a/tracer/src/Datadog.Trace/Iast/Aspects/Newtonsoft.Json/NewtonsoftJsonAspects.cs +++ b/tracer/src/Datadog.Trace/Iast/Aspects/Newtonsoft.Json/NewtonsoftJsonAspects.cs @@ -85,7 +85,7 @@ static NewtonsoftJsonAspects() } catch (Exception ex) { - IastModule.Log.Warning(ex, "Error while tainting the JObject"); + IastModule.Log.Error(ex, "Error while tainting the JObject"); } return result; @@ -113,7 +113,7 @@ static NewtonsoftJsonAspects() } catch (Exception ex) { - IastModule.Log.Warning(ex, "Error while tainting the JArray"); + IastModule.Log.Error(ex, "Error while tainting the JArray"); } return result; @@ -136,7 +136,7 @@ static NewtonsoftJsonAspects() } catch (Exception ex) { - IastModule.Log.Warning(ex, "Error while tainting the JToken"); + IastModule.Log.Error(ex, "Error while tainting the JToken"); } return result; diff --git a/tracer/src/Datadog.Trace/Iast/Aspects/System.Runtime/DefaultInterpolatedStringHandlerAspect.cs b/tracer/src/Datadog.Trace/Iast/Aspects/System.Runtime/DefaultInterpolatedStringHandlerAspect.cs index 9f38177b8c49..f8e612381607 100644 --- a/tracer/src/Datadog.Trace/Iast/Aspects/System.Runtime/DefaultInterpolatedStringHandlerAspect.cs +++ b/tracer/src/Datadog.Trace/Iast/Aspects/System.Runtime/DefaultInterpolatedStringHandlerAspect.cs @@ -38,7 +38,7 @@ public static void AppendFormatted1(ref DefaultInterpolatedStringHandler target, } catch (Exception ex) { - IastModule.Log.Warning(ex, $"Error invoking {nameof(DefaultInterpolatedStringHandlerAspect)}.{nameof(AppendFormatted1)}"); + IastModule.Log.Error(ex, $"Error invoking {nameof(DefaultInterpolatedStringHandlerAspect)}.{nameof(AppendFormatted1)}"); } } @@ -59,7 +59,7 @@ public static void AppendFormatted2(ref DefaultInterpolatedStringHandler target, } catch (Exception ex) { - IastModule.Log.Warning(ex, $"Error invoking {nameof(DefaultInterpolatedStringHandlerAspect)}.{nameof(AppendFormatted2)}"); + IastModule.Log.Error(ex, $"Error invoking {nameof(DefaultInterpolatedStringHandlerAspect)}.{nameof(AppendFormatted2)}"); } } @@ -83,7 +83,7 @@ public static void AppendFormatted3(ref DefaultInterpolatedStringHandler target, } catch (Exception ex) { - IastModule.Log.Warning(ex, $"Error invoking {nameof(DefaultInterpolatedStringHandlerAspect)}.{nameof(AppendFormatted3)}"); + IastModule.Log.Error(ex, $"Error invoking {nameof(DefaultInterpolatedStringHandlerAspect)}.{nameof(AppendFormatted3)}"); } } @@ -106,7 +106,7 @@ public static void AppendFormatted4(ref DefaultInterpolatedStringHandler targ } catch (Exception ex) { - IastModule.Log.Warning(ex, $"Error invoking {nameof(DefaultInterpolatedStringHandlerAspect)}.{nameof(AppendFormatted4)}"); + IastModule.Log.Error(ex, $"Error invoking {nameof(DefaultInterpolatedStringHandlerAspect)}.{nameof(AppendFormatted4)}"); } } @@ -130,7 +130,7 @@ public static void AppendFormatted5(ref DefaultInterpolatedStringHandler targ } catch (Exception ex) { - IastModule.Log.Warning(ex, $"Error invoking {nameof(DefaultInterpolatedStringHandlerAspect)}.{nameof(AppendFormatted5)}"); + IastModule.Log.Error(ex, $"Error invoking {nameof(DefaultInterpolatedStringHandlerAspect)}.{nameof(AppendFormatted5)}"); } } @@ -154,7 +154,7 @@ public static void AppendFormatted6(ref DefaultInterpolatedStringHandler targ } catch (Exception ex) { - IastModule.Log.Warning(ex, $"Error invoking {nameof(DefaultInterpolatedStringHandlerAspect)}.{nameof(AppendFormatted6)}"); + IastModule.Log.Error(ex, $"Error invoking {nameof(DefaultInterpolatedStringHandlerAspect)}.{nameof(AppendFormatted6)}"); } } @@ -179,7 +179,7 @@ public static void AppendFormatted7(ref DefaultInterpolatedStringHandler targ } catch (Exception ex) { - IastModule.Log.Warning(ex, $"Error invoking {nameof(DefaultInterpolatedStringHandlerAspect)}.{nameof(AppendFormatted7)}"); + IastModule.Log.Error(ex, $"Error invoking {nameof(DefaultInterpolatedStringHandlerAspect)}.{nameof(AppendFormatted7)}"); } } @@ -198,7 +198,7 @@ public static void AppendLiteral(ref DefaultInterpolatedStringHandler target, st } catch (Exception ex) { - IastModule.Log.Warning(ex, $"Error invoking {nameof(DefaultInterpolatedStringHandlerAspect)}.{nameof(AppendLiteral)}"); + IastModule.Log.Error(ex, $"Error invoking {nameof(DefaultInterpolatedStringHandlerAspect)}.{nameof(AppendLiteral)}"); } } @@ -217,7 +217,7 @@ public static string ToStringAndClear(ref DefaultInterpolatedStringHandler targe } catch (Exception ex) { - IastModule.Log.Warning(ex, $"Error invoking {nameof(DefaultInterpolatedStringHandlerAspect)}.{nameof(ToStringAndClear)}"); + IastModule.Log.Error(ex, $"Error invoking {nameof(DefaultInterpolatedStringHandlerAspect)}.{nameof(ToStringAndClear)}"); } return result; diff --git a/tracer/src/Datadog.Trace/Iast/Aspects/System.Text.Json/JsonDocumentAspects.cs b/tracer/src/Datadog.Trace/Iast/Aspects/System.Text.Json/JsonDocumentAspects.cs index fef66b38692f..a8b2cbc032a2 100644 --- a/tracer/src/Datadog.Trace/Iast/Aspects/System.Text.Json/JsonDocumentAspects.cs +++ b/tracer/src/Datadog.Trace/Iast/Aspects/System.Text.Json/JsonDocumentAspects.cs @@ -37,7 +37,7 @@ public static object Parse(string json, JsonDocumentOptions options) } catch (Exception ex) { - IastModule.Log.Warning(ex, "Error tainting JsonDocument.Parse result"); + IastModule.Log.Error(ex, "Error tainting JsonDocument.Parse result"); } return doc; @@ -60,7 +60,7 @@ public static object Parse(string json, JsonDocumentOptions options) } catch (Exception ex) { - IastModule.Log.Warning(ex, "Error casting to IJsonElement"); + IastModule.Log.Error(ex, "Error casting to IJsonElement"); return null; } @@ -77,7 +77,7 @@ public static object Parse(string json, JsonDocumentOptions options) } catch (Exception ex) { - IastModule.Log.Warning(ex, "Error tainting JsonElement.GetString result"); + IastModule.Log.Error(ex, "Error tainting JsonElement.GetString result"); } return str; @@ -101,7 +101,7 @@ public static object Parse(string json, JsonDocumentOptions options) } catch (Exception ex) { - IastModule.Log.Warning(ex, "Error casting to IJsonElement"); + IastModule.Log.Error(ex, "Error casting to IJsonElement"); return null; } @@ -118,7 +118,7 @@ public static object Parse(string json, JsonDocumentOptions options) } catch (Exception ex) { - IastModule.Log.Warning(ex, "Error tainting JsonElement.GetRawText result"); + IastModule.Log.Error(ex, "Error tainting JsonElement.GetRawText result"); } return str; diff --git a/tracer/src/Datadog.Trace/Iast/Aspects/System.Web.Extensions/JavaScriptSerializerAspects.cs b/tracer/src/Datadog.Trace/Iast/Aspects/System.Web.Extensions/JavaScriptSerializerAspects.cs index 3aaee1ba3683..2963fe2bff23 100644 --- a/tracer/src/Datadog.Trace/Iast/Aspects/System.Web.Extensions/JavaScriptSerializerAspects.cs +++ b/tracer/src/Datadog.Trace/Iast/Aspects/System.Web.Extensions/JavaScriptSerializerAspects.cs @@ -57,7 +57,7 @@ public class JavaScriptSerializerAspects } catch (Exception ex) { - IastModule.Log.Warning(ex, "Error while tainting json in DeserializeObject"); + IastModule.Log.Error(ex, "Error while tainting json in DeserializeObject"); } return result;