From 1b65820a753c6bd9a83f903d4a9f0cac2a75dc57 Mon Sep 17 00:00:00 2001 From: Ruben Mesquida <16049893+mesquidar@users.noreply.github.com> Date: Thu, 7 Nov 2024 20:12:36 +0100 Subject: [PATCH] Upgrade/Fixed Library --- Cervantes.CORE/Cervantes.CORE.csproj | 6 +-- .../Cervantes.Contracts.csproj | 2 +- Cervantes.DAL/Cervantes.DAL.csproj | 12 ++--- Cervantes.IFR/Cervantes.IFR.csproj | 12 ++--- Cervantes.IFR/Parsers/Burp/BurpParser.cs | 5 +- Cervantes.IFR/Parsers/CSV/CsvParser.cs | 2 + Cervantes.IFR/Parsers/CSV/VulnImportCsv.cs | 4 ++ Cervantes.IFR/Parsers/Nessus/NessusParser.cs | 5 +- Cervantes.IFR/Parsers/Pwndoc/PwndocParser.cs | 4 ++ Cervantes.Web/Cervantes.Web.csproj | 48 +++++++++---------- .../Pages/Projects/ReportDialog.razor.cs | 5 -- 11 files changed, 58 insertions(+), 47 deletions(-) diff --git a/Cervantes.CORE/Cervantes.CORE.csproj b/Cervantes.CORE/Cervantes.CORE.csproj index 36e8280..0f4b27d 100644 --- a/Cervantes.CORE/Cervantes.CORE.csproj +++ b/Cervantes.CORE/Cervantes.CORE.csproj @@ -9,9 +9,9 @@ - - - + + + diff --git a/Cervantes.Contracts/Cervantes.Contracts.csproj b/Cervantes.Contracts/Cervantes.Contracts.csproj index 36ac4ca..534ae7a 100644 --- a/Cervantes.Contracts/Cervantes.Contracts.csproj +++ b/Cervantes.Contracts/Cervantes.Contracts.csproj @@ -7,7 +7,7 @@ - + diff --git a/Cervantes.DAL/Cervantes.DAL.csproj b/Cervantes.DAL/Cervantes.DAL.csproj index 6f62338..d109a99 100644 --- a/Cervantes.DAL/Cervantes.DAL.csproj +++ b/Cervantes.DAL/Cervantes.DAL.csproj @@ -14,15 +14,15 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/Cervantes.IFR/Cervantes.IFR.csproj b/Cervantes.IFR/Cervantes.IFR.csproj index ef655f3..bfac828 100644 --- a/Cervantes.IFR/Cervantes.IFR.csproj +++ b/Cervantes.IFR/Cervantes.IFR.csproj @@ -15,19 +15,19 @@ - + - + - + - - - + + + diff --git a/Cervantes.IFR/Parsers/Burp/BurpParser.cs b/Cervantes.IFR/Parsers/Burp/BurpParser.cs index 87005ff..2b16276 100644 --- a/Cervantes.IFR/Parsers/Burp/BurpParser.cs +++ b/Cervantes.IFR/Parsers/Burp/BurpParser.cs @@ -135,6 +135,8 @@ public void Parse(Guid? project, string user, string path) vuln.OWASPImpact = "No Data"; vuln.OWASPLikehood = "No Data"; vuln.OWASPVector = "No Data"; + vuln.MitreTechniques = ""; + vuln.MitreValues = ""; vulnManager.Add(vuln); vulnManager.Context.SaveChanges(); @@ -248,7 +250,8 @@ public void Parse(Guid? project, string user, string path) vuln.OWASPImpact = "No Data"; vuln.OWASPLikehood = "No Data"; vuln.OWASPVector = "No Data"; - + vuln.MitreTechniques = ""; + vuln.MitreValues = ""; vulnManager.Add(vuln); vulnManager.Context.SaveChanges(); diff --git a/Cervantes.IFR/Parsers/CSV/CsvParser.cs b/Cervantes.IFR/Parsers/CSV/CsvParser.cs index 1769a6d..a2655b4 100644 --- a/Cervantes.IFR/Parsers/CSV/CsvParser.cs +++ b/Cervantes.IFR/Parsers/CSV/CsvParser.cs @@ -125,6 +125,8 @@ public void Parse(Guid? project, string user, string path) continue; } vuln.FindingId = "No Project"; + vuln.MitreTechniques = vul.MitreTechniques == "" ? "" : sanitizer.Sanitize(HttpUtility.HtmlDecode(vul.MitreTechniques)); + vuln.MitreValues = vul.MitreValues == "" ? "" : sanitizer.Sanitize(HttpUtility.HtmlDecode(vul.MitreValues)); vulnManager.Add(vuln); vulnManager.Context.SaveChanges(); } diff --git a/Cervantes.IFR/Parsers/CSV/VulnImportCsv.cs b/Cervantes.IFR/Parsers/CSV/VulnImportCsv.cs index 5090f73..609fa2f 100644 --- a/Cervantes.IFR/Parsers/CSV/VulnImportCsv.cs +++ b/Cervantes.IFR/Parsers/CSV/VulnImportCsv.cs @@ -44,4 +44,8 @@ public class VulnImportCsv public string OwaspLikehood { get; set; } [Index(17)] public string OwaspImpact { get; set; } + [Index(18)] + public string MitreTechniques { get; set; } + [Index(19)] + public string MitreValues { get; set; } } \ No newline at end of file diff --git a/Cervantes.IFR/Parsers/Nessus/NessusParser.cs b/Cervantes.IFR/Parsers/Nessus/NessusParser.cs index 8c2443a..a05db9f 100644 --- a/Cervantes.IFR/Parsers/Nessus/NessusParser.cs +++ b/Cervantes.IFR/Parsers/Nessus/NessusParser.cs @@ -146,6 +146,8 @@ public void Parse(Guid? project, string user, string path) vuln.OWASPImpact = "No Data"; vuln.OWASPLikehood = "No Data"; vuln.OWASPVector = "No Data"; + vuln.MitreTechniques = ""; + vuln.MitreValues = ""; vulnManager.Add(vuln); vulnManager.Context.SaveChanges(); @@ -257,7 +259,8 @@ public void Parse(Guid? project, string user, string path) vuln.OWASPImpact = "No Data"; vuln.OWASPLikehood = "No Data"; vuln.OWASPVector = "No Data"; - + vuln.MitreTechniques = ""; + vuln.MitreValues = ""; vulnManager.Add(vuln); vulnManager.Context.SaveChanges(); diff --git a/Cervantes.IFR/Parsers/Pwndoc/PwndocParser.cs b/Cervantes.IFR/Parsers/Pwndoc/PwndocParser.cs index ba50788..c282983 100644 --- a/Cervantes.IFR/Parsers/Pwndoc/PwndocParser.cs +++ b/Cervantes.IFR/Parsers/Pwndoc/PwndocParser.cs @@ -110,6 +110,8 @@ public void Parse(Guid? project, string user, string path) vuln.OWASPImpact = "No Data"; vuln.OWASPLikehood = "No Data"; vuln.OWASPVector = "No Data"; + vuln.MitreTechniques = ""; + vuln.MitreValues = ""; vulnManager.Add(vuln); vulnManager.Context.SaveChanges(); i++; @@ -188,6 +190,8 @@ public void Parse(Guid? project, string user, string path) vuln.OWASPImpact = "No Data"; vuln.OWASPLikehood = "No Data"; vuln.OWASPVector = "No Data"; + vuln.MitreTechniques = ""; + vuln.MitreValues = ""; vulnManager.Add(vuln); vulnManager.Context.SaveChanges(); i++; diff --git a/Cervantes.Web/Cervantes.Web.csproj b/Cervantes.Web/Cervantes.Web.csproj index 420ef6e..ee9ccab 100644 --- a/Cervantes.Web/Cervantes.Web.csproj +++ b/Cervantes.Web/Cervantes.Web.csproj @@ -11,54 +11,54 @@ - + - + - - - - - - + + + + + + - - - - + + + + - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - - + + - - - + + + diff --git a/Cervantes.Web/Components/Pages/Projects/ReportDialog.razor.cs b/Cervantes.Web/Components/Pages/Projects/ReportDialog.razor.cs index 0f01f66..fe4fb05 100644 --- a/Cervantes.Web/Components/Pages/Projects/ReportDialog.razor.cs +++ b/Cervantes.Web/Components/Pages/Projects/ReportDialog.razor.cs @@ -55,11 +55,6 @@ protected override async Task OnInitializedAsync() CurrentUser = _UserController.GetUser(_accessor.HttpContext.User?.FindFirstValue(ClaimTypes.NameIdentifier)); } - if (CurrentUser != null) - { - var rol = await _userManager.GetRolesAsync(CurrentUser); - rolUser = rol.First(); - } aiEnabled = _aiService.IsEnabled(); await base.OnInitializedAsync();