diff --git a/Samples/SampleExtensions/ExtensionLibrary.cs b/Samples/SampleExtensions/ExtensionLibrary.cs
index 0afe5834..bb003cc5 100644
--- a/Samples/SampleExtensions/ExtensionLibrary.cs
+++ b/Samples/SampleExtensions/ExtensionLibrary.cs
@@ -1,3 +1,3 @@
using ThreatsManager.Interfaces;
-[assembly: ExtensionsContainer("2.1.1")]
\ No newline at end of file
+[assembly: ExtensionsContainer("2.1.2")]
\ No newline at end of file
diff --git a/Samples/SampleExtensions/SampleExtensions.csproj b/Samples/SampleExtensions/SampleExtensions.csproj
index 7f20f789..6b50a824 100644
--- a/Samples/SampleExtensions/SampleExtensions.csproj
+++ b/Samples/SampleExtensions/SampleExtensions.csproj
@@ -75,20 +75,20 @@
-
- ..\packages\ThreatsManager.AutoGenRules.2.1.1\lib\net481\ThreatsManager.AutoGenRules.dll
+
+ ..\packages\ThreatsManager.AutoGenRules.2.1.2\lib\net481\ThreatsManager.AutoGenRules.dll
-
- ..\packages\ThreatsManager.AutoThreatGeneration.2.1.1\lib\net481\ThreatsManager.AutoThreatGeneration.dll
+
+ ..\packages\ThreatsManager.AutoThreatGeneration.2.1.2\lib\net481\ThreatsManager.AutoThreatGeneration.dll
- ..\packages\ThreatsManager.Utilities.2.1.1\lib\net481\ThreatsManager.Icons.dll
+ ..\packages\ThreatsManager.Utilities.2.1.2\lib\net481\ThreatsManager.Icons.dll
-
- ..\packages\ThreatsManager.Interfaces.2.1.1\lib\net481\ThreatsManager.Interfaces.dll
+
+ ..\packages\ThreatsManager.Interfaces.2.1.2\lib\net481\ThreatsManager.Interfaces.dll
-
- ..\packages\ThreatsManager.Utilities.2.1.1\lib\net481\ThreatsManager.Utilities.dll
+
+ ..\packages\ThreatsManager.Utilities.2.1.2\lib\net481\ThreatsManager.Utilities.dll
diff --git a/Samples/SampleExtensions/packages.config b/Samples/SampleExtensions/packages.config
index 9a65476a..78ed711b 100644
--- a/Samples/SampleExtensions/packages.config
+++ b/Samples/SampleExtensions/packages.config
@@ -10,8 +10,8 @@
-
-
-
-
+
+
+
+
\ No newline at end of file
diff --git a/Samples/SampleWinFormExtensions/ExtensionLibrary.cs b/Samples/SampleWinFormExtensions/ExtensionLibrary.cs
index 0afe5834..bb003cc5 100644
--- a/Samples/SampleWinFormExtensions/ExtensionLibrary.cs
+++ b/Samples/SampleWinFormExtensions/ExtensionLibrary.cs
@@ -1,3 +1,3 @@
using ThreatsManager.Interfaces;
-[assembly: ExtensionsContainer("2.1.1")]
\ No newline at end of file
+[assembly: ExtensionsContainer("2.1.2")]
\ No newline at end of file
diff --git a/Samples/SampleWinFormExtensions/SampleWinFormExtensions.csproj b/Samples/SampleWinFormExtensions/SampleWinFormExtensions.csproj
index 8d3d1b27..eb85078e 100644
--- a/Samples/SampleWinFormExtensions/SampleWinFormExtensions.csproj
+++ b/Samples/SampleWinFormExtensions/SampleWinFormExtensions.csproj
@@ -47,7 +47,7 @@
..\packages\Fizzler.1.3.0\lib\netstandard2.0\Fizzler.dll
- ..\packages\ThreatsManager.Utilities.WinForms.2.1.1\lib\net481\Keyoti.RapidSpell.NET4.dll
+ ..\packages\ThreatsManager.Utilities.WinForms.2.1.2\lib\net481\Keyoti.RapidSpell.NET4.dll
@@ -106,23 +106,23 @@
-
- ..\packages\ThreatsManager.Utilities.WinForms.2.1.1\lib\net481\ThreatsManager.AutoGenRules.dll
+
+ ..\packages\ThreatsManager.Utilities.WinForms.2.1.2\lib\net481\ThreatsManager.AutoGenRules.dll
-
- ..\packages\ThreatsManager.Extensions.Client.2.1.1\lib\net481\ThreatsManager.Extensions.Client.dll
+
+ ..\packages\ThreatsManager.Extensions.Client.2.1.2\lib\net481\ThreatsManager.Extensions.Client.dll
- ..\packages\ThreatsManager.Utilities.2.1.1\lib\net481\ThreatsManager.Icons.dll
+ ..\packages\ThreatsManager.Utilities.2.1.2\lib\net481\ThreatsManager.Icons.dll
-
- ..\packages\ThreatsManager.Interfaces.2.1.1\lib\net481\ThreatsManager.Interfaces.dll
+
+ ..\packages\ThreatsManager.Interfaces.2.1.2\lib\net481\ThreatsManager.Interfaces.dll
-
- ..\packages\ThreatsManager.Utilities.2.1.1\lib\net481\ThreatsManager.Utilities.dll
+
+ ..\packages\ThreatsManager.Utilities.2.1.2\lib\net481\ThreatsManager.Utilities.dll
-
- ..\packages\ThreatsManager.Utilities.WinForms.2.1.1\lib\net481\ThreatsManager.Utilities.WinForms.dll
+
+ ..\packages\ThreatsManager.Utilities.WinForms.2.1.2\lib\net481\ThreatsManager.Utilities.WinForms.dll
diff --git a/Samples/SampleWinFormExtensions/packages.config b/Samples/SampleWinFormExtensions/packages.config
index 41f6a3ca..bfd291ca 100644
--- a/Samples/SampleWinFormExtensions/packages.config
+++ b/Samples/SampleWinFormExtensions/packages.config
@@ -18,8 +18,8 @@
-
-
-
-
+
+
+
+
\ No newline at end of file
diff --git a/Samples/SimpleThreatModelAnalyzer/ExtensionLibrary.cs b/Samples/SimpleThreatModelAnalyzer/ExtensionLibrary.cs
index 0afe5834..bb003cc5 100644
--- a/Samples/SimpleThreatModelAnalyzer/ExtensionLibrary.cs
+++ b/Samples/SimpleThreatModelAnalyzer/ExtensionLibrary.cs
@@ -1,3 +1,3 @@
using ThreatsManager.Interfaces;
-[assembly: ExtensionsContainer("2.1.1")]
\ No newline at end of file
+[assembly: ExtensionsContainer("2.1.2")]
\ No newline at end of file
diff --git a/Samples/SimpleThreatModelAnalyzer/SimpleThreatModelAnalyzer.csproj b/Samples/SimpleThreatModelAnalyzer/SimpleThreatModelAnalyzer.csproj
index c6b7e9b2..854dd62c 100644
--- a/Samples/SimpleThreatModelAnalyzer/SimpleThreatModelAnalyzer.csproj
+++ b/Samples/SimpleThreatModelAnalyzer/SimpleThreatModelAnalyzer.csproj
@@ -93,17 +93,17 @@
-
- ..\packages\ThreatsManager.Engine.2.1.1\lib\net481\ThreatsManager.Engine.dll
+
+ ..\packages\ThreatsManager.Engine.2.1.2\lib\net481\ThreatsManager.Engine.dll
- ..\packages\ThreatsManager.Utilities.2.1.1\lib\net481\ThreatsManager.Icons.dll
+ ..\packages\ThreatsManager.Utilities.2.1.2\lib\net481\ThreatsManager.Icons.dll
-
- ..\packages\ThreatsManager.Interfaces.2.1.1\lib\net481\ThreatsManager.Interfaces.dll
+
+ ..\packages\ThreatsManager.Interfaces.2.1.2\lib\net481\ThreatsManager.Interfaces.dll
-
- ..\packages\ThreatsManager.Utilities.2.1.1\lib\net481\ThreatsManager.Utilities.dll
+
+ ..\packages\ThreatsManager.Utilities.2.1.2\lib\net481\ThreatsManager.Utilities.dll
diff --git a/Samples/SimpleThreatModelAnalyzer/packages.config b/Samples/SimpleThreatModelAnalyzer/packages.config
index 9c2042f1..37f6ee69 100644
--- a/Samples/SimpleThreatModelAnalyzer/packages.config
+++ b/Samples/SimpleThreatModelAnalyzer/packages.config
@@ -15,7 +15,7 @@
-
-
-
+
+
+
\ No newline at end of file
diff --git a/Sources/Extensions/ThreatsManager.AutoGenRules/ExtensionsContainer.cs b/Sources/Extensions/ThreatsManager.AutoGenRules/ExtensionsContainer.cs
index ade27606..f810ed4c 100644
--- a/Sources/Extensions/ThreatsManager.AutoGenRules/ExtensionsContainer.cs
+++ b/Sources/Extensions/ThreatsManager.AutoGenRules/ExtensionsContainer.cs
@@ -1,3 +1,3 @@
using ThreatsManager.Interfaces;
-[assembly: ExtensionsContainer("2.1.1")]
\ No newline at end of file
+[assembly: ExtensionsContainer("2.1.2")]
\ No newline at end of file
diff --git a/Sources/Extensions/ThreatsManager.AutoGenRules/ThreatsManager.AutoGenRules.csproj b/Sources/Extensions/ThreatsManager.AutoGenRules/ThreatsManager.AutoGenRules.csproj
index d79c1a24..ccdeca39 100644
--- a/Sources/Extensions/ThreatsManager.AutoGenRules/ThreatsManager.AutoGenRules.csproj
+++ b/Sources/Extensions/ThreatsManager.AutoGenRules/ThreatsManager.AutoGenRules.csproj
@@ -2,15 +2,15 @@
net481
Threats Manager Platform Auto Generation Rules library.
- 2.1.1.0
+ 2.1.2.0
Simone Curzi
Simone Curzi
Threats Manager Platform
Copyright © Simone Curzi, 2018-2023. All Rights Reserved.
https://www.nuget.org/packages/ThreatsManager.Engine/
https://github.com/simonec73/threatsmanager
- 2.1.1.0
- 2.1.1
+ 2.1.2.0
+ 2.1.2
true
..\..\ThreatsManager.Engine\ThreatsManager.snk
$(NoWarn);NU1505
diff --git a/Sources/Extensions/ThreatsManager.AutoThreatGeneration/ExtensionsContainer.cs b/Sources/Extensions/ThreatsManager.AutoThreatGeneration/ExtensionsContainer.cs
index ade27606..f810ed4c 100644
--- a/Sources/Extensions/ThreatsManager.AutoThreatGeneration/ExtensionsContainer.cs
+++ b/Sources/Extensions/ThreatsManager.AutoThreatGeneration/ExtensionsContainer.cs
@@ -1,3 +1,3 @@
using ThreatsManager.Interfaces;
-[assembly: ExtensionsContainer("2.1.1")]
\ No newline at end of file
+[assembly: ExtensionsContainer("2.1.2")]
\ No newline at end of file
diff --git a/Sources/Extensions/ThreatsManager.AutoThreatGeneration/ThreatsManager.AutoThreatGeneration.csproj b/Sources/Extensions/ThreatsManager.AutoThreatGeneration/ThreatsManager.AutoThreatGeneration.csproj
index e4d45afa..b9a59a9a 100644
--- a/Sources/Extensions/ThreatsManager.AutoThreatGeneration/ThreatsManager.AutoThreatGeneration.csproj
+++ b/Sources/Extensions/ThreatsManager.AutoThreatGeneration/ThreatsManager.AutoThreatGeneration.csproj
@@ -3,15 +3,15 @@
net481
Threats Manager Platform Auto Threat Generation library.
- 2.1.1.0
+ 2.1.2.0
Simone Curzi
Simone Curzi
Threats Manager Platform
Copyright © Simone Curzi, 2018-2023. All Rights Reserved.
https://www.nuget.org/packages/ThreatsManager.Engine/
https://github.com/simonec73/threatsmanager
- 2.1.1.0
- 2.1.1
+ 2.1.2.0
+ 2.1.2
true
..\..\ThreatsManager.Engine\ThreatsManager.snk
$(NoWarn);NU1505
diff --git a/Sources/Extensions/ThreatsManager.DevOps/DevOpsManager.cs b/Sources/Extensions/ThreatsManager.DevOps/DevOpsManager.cs
index 1bf1cc7a..e2cb4a46 100644
--- a/Sources/Extensions/ThreatsManager.DevOps/DevOpsManager.cs
+++ b/Sources/Extensions/ThreatsManager.DevOps/DevOpsManager.cs
@@ -6,16 +6,13 @@
using ThreatsManager.DevOps.Schemas;
using ThreatsManager.Interfaces.ObjectModel;
using ThreatsManager.Interfaces.ObjectModel.ThreatsMitigations;
+using ThreatsManager.Utilities;
namespace ThreatsManager.DevOps
{
public static class DevOpsManager
{
#region Private member variables.
- private static int _intervalMins;
- private static Task _updater;
- private static bool _stopUpdater;
- private static NotificationType _notificationType;
private static readonly Dictionary _connectors = new Dictionary();
#endregion
@@ -71,13 +68,13 @@ public static IDevOpsConnector GetConnector([NotNull] IThreatModel model)
return result;
}
- public static async Task UpdateAsync([NotNull] IThreatModel model)
+ public static int Update([NotNull] IThreatModel model)
{
int result = 0;
if (_connectors.TryGetValue(model.Id, out var connector) && (connector?.IsConnected() ?? false))
{
- result = await UpdateMitigationsAsync(model, connector);
+ result = UpdateMitigations(model, connector);
}
return result;
@@ -111,7 +108,7 @@ public static IDictionary GetMitigationsSummary([N
return result;
}
- public static async Task SetMitigationsStatusAsync([NotNull] IMitigation mitigation, WorkItemStatus status)
+ public static bool SetMitigationsStatus([NotNull] IMitigation mitigation, WorkItemStatus status)
{
bool result = false;
@@ -122,13 +119,13 @@ public static async Task SetMitigationsStatusAsync([NotNull] IMitigation m
var connector = GetConnector(model);
if (connector?.IsConnected() ?? false)
{
- var workItemInfo = await connector.GetWorkItemInfoAsync(mitigation).ConfigureAwait(false);
+ var workItemInfo = connector.GetWorkItemInfoAsync(mitigation).Result;
int id;
if (workItemInfo == null)
{
- id = await connector.CreateWorkItemAsync(mitigation).ConfigureAwait(false);
+ id = connector.CreateWorkItemAsync(mitigation).Result;
if (id >= 0)
- workItemInfo = await connector.GetWorkItemInfoAsync(id).ConfigureAwait(false);
+ workItemInfo = connector.GetWorkItemInfoAsync(id).Result;
}
else
{
@@ -137,10 +134,14 @@ public static async Task SetMitigationsStatusAsync([NotNull] IMitigation m
if (id >= 0)
{
- if (await connector.SetWorkItemStateAsync(id, status).ConfigureAwait(false))
+ if (connector.SetWorkItemStateAsync(id, status).Result)
{
- var schemaManager = new DevOpsPropertySchemaManager(model);
- schemaManager.SetDevOpsStatus(mitigation, connector, id, workItemInfo?.Url, status);
+ using (var scope = UndoRedoManager.OpenScope("Set DevOps Mitigation status"))
+ {
+ var schemaManager = new DevOpsPropertySchemaManager(model);
+ schemaManager.SetDevOpsStatus(mitigation, connector, id, workItemInfo?.Url, status);
+ scope?.Complete();
+ }
result = true;
}
else
@@ -159,27 +160,7 @@ public static async Task SetMitigationsStatusAsync([NotNull] IMitigation m
return result;
}
- public static void StartAutomaticUpdater([NotNull] IThreatModel model, [Range(1, 120)] int intervalMins, NotificationType notificationType)
- {
- _stopUpdater = false;
- _intervalMins = intervalMins;
- _notificationType = notificationType;
-
- if (_updater == null)
- {
-#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
- _updater = AutomaticUpdater(model);
-#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
- }
- }
-
- public static bool StopAutomaticUpdater()
- {
- _stopUpdater = true;
- return _updater?.Wait(3000) ?? true;
- }
-
- private static async Task UpdateMitigationsAsync([NotNull] IThreatModel model, [NotNull] IDevOpsConnector connector)
+ private static int UpdateMitigations([NotNull] IThreatModel model, [NotNull] IDevOpsConnector connector)
{
int result = 0;
@@ -190,95 +171,79 @@ private static async Task UpdateMitigationsAsync([NotNull] IThreatModel mod
.ToArray();
if (mitigations?.Any() ?? false)
{
- var infos = await connector
+ var infos = connector
.GetWorkItemsInfoAsync(mitigations
.Select(x => x.Value?.Id ?? -1)
.Where(x => x >= 0)
- );
+ ).Result;
- if (infos != null)
+ using (var scope = UndoRedoManager.OpenScope("Update Mitigations from DevOps"))
{
- foreach (var info in infos)
+ if (infos != null)
{
- var pairs = mitigations
- .Where(x => x.Value != null && x.Value.Id == info.Id)
- .ToArray();
-
- if (pairs.Any())
+ foreach (var info in infos)
{
- var pair = pairs.FirstOrDefault();
+ var pairs = mitigations
+ .Where(x => x.Value != null && x.Value.Id == info.Id)
+ .ToArray();
- if (pair.Value.Status != info.Status ||
- string.CompareOrdinal(pair.Value.AssignedTo, info.AssignedTo) != 0)
+ if (pairs.Any())
{
- schemaManager.SetDevOpsStatus(pair.Key, connector, info.Id, info.Url, info.Status, info.AssignedTo);
- result++;
- }
+ var pair = pairs.FirstOrDefault();
- MitigationStatus status;
- switch (info.Status)
- {
- case WorkItemStatus.Created:
- status = MitigationStatus.Approved;
- break;
- case WorkItemStatus.Planned:
- status = MitigationStatus.Planned;
- break;
- case WorkItemStatus.InProgress:
- status = MitigationStatus.Planned;
- break;
- case WorkItemStatus.Done:
- status = MitigationStatus.Implemented;
- break;
- default:
- status = MitigationStatus.Proposed;
- break;
- }
+ if (pair.Value.Status != info.Status ||
+ string.CompareOrdinal(pair.Value.AssignedTo, info.AssignedTo) != 0)
+ {
+ schemaManager.SetDevOpsStatus(pair.Key, connector, info.Id, info.Url, info.Status, info.AssignedTo);
+ result++;
+ }
- var tems = model.GetThreatEventMitigations(pair.Key);
- if (tems?.Any() ?? false)
- {
- foreach (var tem in tems)
+ MitigationStatus status;
+ switch (info.Status)
{
- if (tem.Status != status)
- tem.Status = status;
+ case WorkItemStatus.Created:
+ status = MitigationStatus.Approved;
+ break;
+ case WorkItemStatus.Planned:
+ status = MitigationStatus.Planned;
+ break;
+ case WorkItemStatus.InProgress:
+ status = MitigationStatus.Planned;
+ break;
+ case WorkItemStatus.Done:
+ status = MitigationStatus.Implemented;
+ break;
+ default:
+ status = MitigationStatus.Proposed;
+ break;
+ }
+
+ var tems = model.GetThreatEventMitigations(pair.Key);
+ if (tems?.Any() ?? false)
+ {
+ foreach (var tem in tems)
+ {
+ if (tem.Status != status)
+ tem.Status = status;
+ }
}
}
}
}
- }
- var missing = mitigations.Where(x => x.Value != null && (infos?.All(y => y.Id != x.Value.Id) ?? true)).ToArray();
- if (missing.Any())
- {
- foreach (var m in missing)
- schemaManager.RemoveDevOpsInfos(m.Key);
- }
- }
-
- return result;
- }
-
- private static async Task AutomaticUpdater([NotNull] IThreatModel model)
- {
- if (_intervalMins > 0 && _intervalMins <= 120)
- {
- do
- {
- var connector = GetConnector(model);
- if (connector != null)
+ var missing = mitigations.Where(x => x.Value != null && (infos?.All(y => y.Id != x.Value.Id) ?? true)).ToArray();
+ if (missing.Any())
{
- var changes = await UpdateAsync(model);
- if (_notificationType == NotificationType.Full ||
- (_notificationType == NotificationType.SuccessOnly && changes > 0))
- RefreshDone?.Invoke(model, changes);
+ foreach (var m in missing)
+ schemaManager.RemoveDevOpsInfos(m.Key);
}
- await Task.Delay(_intervalMins * 60000);
- } while (!_stopUpdater);
- _updater = null;
+ scope?.Complete();
+ }
}
+
+ return result;
}
}
}
diff --git a/Sources/Extensions/ThreatsManager.DevOps/Engines/AzureDevOps.cs b/Sources/Extensions/ThreatsManager.DevOps/Engines/AzureDevOps.cs
index 9b9f87f6..0e8a85f4 100644
--- a/Sources/Extensions/ThreatsManager.DevOps/Engines/AzureDevOps.cs
+++ b/Sources/Extensions/ThreatsManager.DevOps/Engines/AzureDevOps.cs
@@ -660,7 +660,6 @@ public async Task> GetWorkItemCommentsAsync(int id)
return result;
}
-
#endregion
#region Auxiliary methods.
diff --git a/Sources/Extensions/ThreatsManager.DevOps/ExtensionsContainer.cs b/Sources/Extensions/ThreatsManager.DevOps/ExtensionsContainer.cs
index ade27606..f810ed4c 100644
--- a/Sources/Extensions/ThreatsManager.DevOps/ExtensionsContainer.cs
+++ b/Sources/Extensions/ThreatsManager.DevOps/ExtensionsContainer.cs
@@ -1,3 +1,3 @@
using ThreatsManager.Interfaces;
-[assembly: ExtensionsContainer("2.1.1")]
\ No newline at end of file
+[assembly: ExtensionsContainer("2.1.2")]
\ No newline at end of file
diff --git a/Sources/Extensions/ThreatsManager.DevOps/IDevOpsConnector.cs b/Sources/Extensions/ThreatsManager.DevOps/IDevOpsConnector.cs
index b652c34a..5c62b00d 100644
--- a/Sources/Extensions/ThreatsManager.DevOps/IDevOpsConnector.cs
+++ b/Sources/Extensions/ThreatsManager.DevOps/IDevOpsConnector.cs
@@ -46,7 +46,6 @@ public interface IDevOpsConnector
///
/// Gets the projects associated to the current connection.
///
- ///
/// List of Projects that the user can connect to.
Task> GetProjectsAsync();
diff --git a/Sources/Extensions/ThreatsManager.DevOps/NotificationType.cs b/Sources/Extensions/ThreatsManager.DevOps/NotificationType.cs
deleted file mode 100644
index 63fe3898..00000000
--- a/Sources/Extensions/ThreatsManager.DevOps/NotificationType.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-namespace ThreatsManager.DevOps
-{
- public enum NotificationType
- {
- None,
- SuccessOnly,
- Full
- }
-}
diff --git a/Sources/Extensions/ThreatsManager.DevOps/ThreatsManager.DevOps.csproj b/Sources/Extensions/ThreatsManager.DevOps/ThreatsManager.DevOps.csproj
index 1765b632..fbcc5faf 100644
--- a/Sources/Extensions/ThreatsManager.DevOps/ThreatsManager.DevOps.csproj
+++ b/Sources/Extensions/ThreatsManager.DevOps/ThreatsManager.DevOps.csproj
@@ -3,15 +3,15 @@
net481
Threats Manager Platform DevOps Integration library.
- 2.1.1.0
+ 2.1.2.0
Simone Curzi
Simone Curzi
Threats Manager Platform
Copyright © Simone Curzi, 2018-2023. All Rights Reserved.
https://www.nuget.org/packages/ThreatsManager.Engine/
https://github.com/simonec73/threatsmanager
- 2.1.1.0
- 2.1.1
+ 2.1.2.0
+ 2.1.2
true
..\..\ThreatsManager.Engine\ThreatsManager.snk
$(NoWarn);NU1505
diff --git a/Sources/Extensions/ThreatsManager.Extensions.Client/Diagrams/PaletteItem.cs b/Sources/Extensions/ThreatsManager.Extensions.Client/Diagrams/PaletteItem.cs
index f1e8724e..e02f1ca6 100644
--- a/Sources/Extensions/ThreatsManager.Extensions.Client/Diagrams/PaletteItem.cs
+++ b/Sources/Extensions/ThreatsManager.Extensions.Client/Diagrams/PaletteItem.cs
@@ -20,8 +20,11 @@ public abstract class PaletteItem
/// Constructor.
///
/// Name of the item.
- public PaletteItem([Required] string name)
+ public PaletteItem(string name)
{
+ if (string.IsNullOrWhiteSpace(name))
+ name = "";
+
Name = name;
}
diff --git a/Sources/Extensions/ThreatsManager.Extensions.Client/ThreatsManager.Extensions.Client.csproj b/Sources/Extensions/ThreatsManager.Extensions.Client/ThreatsManager.Extensions.Client.csproj
index b4d5888a..a1b7b412 100644
--- a/Sources/Extensions/ThreatsManager.Extensions.Client/ThreatsManager.Extensions.Client.csproj
+++ b/Sources/Extensions/ThreatsManager.Extensions.Client/ThreatsManager.Extensions.Client.csproj
@@ -3,15 +3,15 @@
net481
Threats Manager Platform Extensions Client library.
- 2.1.1.0
+ 2.1.2.0
Simone Curzi
Simone Curzi
Threats Manager Platform
Copyright © Simone Curzi, 2018-2023. All Rights Reserved.
https://www.nuget.org/packages/ThreatsManager.Engine/
https://github.com/simonec73/threatsmanager
- 2.1.1.0
- 2.1.1
+ 2.1.2.0
+ 2.1.2
true
..\..\ThreatsManager.Engine\ThreatsManager.snk
ThreatsManager.Extensions
diff --git a/Sources/Extensions/ThreatsManager.Extensions/ExtensionsContainer.cs b/Sources/Extensions/ThreatsManager.Extensions/ExtensionsContainer.cs
index ade27606..f810ed4c 100644
--- a/Sources/Extensions/ThreatsManager.Extensions/ExtensionsContainer.cs
+++ b/Sources/Extensions/ThreatsManager.Extensions/ExtensionsContainer.cs
@@ -1,3 +1,3 @@
using ThreatsManager.Interfaces;
-[assembly: ExtensionsContainer("2.1.1")]
\ No newline at end of file
+[assembly: ExtensionsContainer("2.1.2")]
\ No newline at end of file
diff --git a/Sources/Extensions/ThreatsManager.Extensions/ThreatsManager.Extensions.csproj b/Sources/Extensions/ThreatsManager.Extensions/ThreatsManager.Extensions.csproj
index 3b1d0cd6..785556b9 100644
--- a/Sources/Extensions/ThreatsManager.Extensions/ThreatsManager.Extensions.csproj
+++ b/Sources/Extensions/ThreatsManager.Extensions/ThreatsManager.Extensions.csproj
@@ -3,15 +3,15 @@
net481
Threats Manager Platform Extensions library.
- 2.1.1.0
+ 2.1.2.0
Simone Curzi
Simone Curzi
Threats Manager Platform
Copyright © Simone Curzi, 2018-2023. All Rights Reserved.
https://www.nuget.org/packages/ThreatsManager.Engine/
https://github.com/simonec73/threatsmanager
- 2.1.1.0
- 2.1.1
+ 2.1.2.0
+ 2.1.2
true
..\..\ThreatsManager.Engine\ThreatsManager.snk
$(NoWarn);NU1505
diff --git a/Sources/Extensions/ThreatsManager.Mitre/ExtensionsContainer.cs b/Sources/Extensions/ThreatsManager.Mitre/ExtensionsContainer.cs
index ade27606..f810ed4c 100644
--- a/Sources/Extensions/ThreatsManager.Mitre/ExtensionsContainer.cs
+++ b/Sources/Extensions/ThreatsManager.Mitre/ExtensionsContainer.cs
@@ -1,3 +1,3 @@
using ThreatsManager.Interfaces;
-[assembly: ExtensionsContainer("2.1.1")]
\ No newline at end of file
+[assembly: ExtensionsContainer("2.1.2")]
\ No newline at end of file
diff --git a/Sources/Extensions/ThreatsManager.Mitre/ThreatsManager.Mitre.csproj b/Sources/Extensions/ThreatsManager.Mitre/ThreatsManager.Mitre.csproj
index 3b2194cd..26672f12 100644
--- a/Sources/Extensions/ThreatsManager.Mitre/ThreatsManager.Mitre.csproj
+++ b/Sources/Extensions/ThreatsManager.Mitre/ThreatsManager.Mitre.csproj
@@ -3,15 +3,15 @@
net481
Threats Manager Platform MITRE Extensions library.
- 2.1.1.0
+ 2.1.2.0
Simone Curzi
Simone Curzi
Threats Manager Platform
Copyright © Simone Curzi, 2018-2023. All Rights Reserved.
https://www.nuget.org/packages/ThreatsManager.Engine/
https://github.com/simonec73/threatsmanager
- 2.1.1.0
- 2.1.1
+ 2.1.2.0
+ 2.1.2
true
..\..\ThreatsManager.Engine\ThreatsManager.snk
$(NoWarn);NU1505
diff --git a/Sources/Extensions/ThreatsManager.MsTmt/ExtensionsContainer.cs b/Sources/Extensions/ThreatsManager.MsTmt/ExtensionsContainer.cs
index ade27606..f810ed4c 100644
--- a/Sources/Extensions/ThreatsManager.MsTmt/ExtensionsContainer.cs
+++ b/Sources/Extensions/ThreatsManager.MsTmt/ExtensionsContainer.cs
@@ -1,3 +1,3 @@
using ThreatsManager.Interfaces;
-[assembly: ExtensionsContainer("2.1.1")]
\ No newline at end of file
+[assembly: ExtensionsContainer("2.1.2")]
\ No newline at end of file
diff --git a/Sources/Extensions/ThreatsManager.MsTmt/Model/ThreatModel.Load.cs b/Sources/Extensions/ThreatsManager.MsTmt/Model/ThreatModel.Load.cs
index 88c4fa1c..14834be4 100644
--- a/Sources/Extensions/ThreatsManager.MsTmt/Model/ThreatModel.Load.cs
+++ b/Sources/Extensions/ThreatsManager.MsTmt/Model/ThreatModel.Load.cs
@@ -95,6 +95,10 @@ private void GetEntityTypes(bool isTemplate, bool isGeneric, IEnumerable
net481
Threats Manager Platform Microsoft Threat Modeling Tool Import library.
- 2.1.1.0
+ 2.1.2.0
Simone Curzi
Simone Curzi
Threats Manager Platform
Copyright © Simone Curzi, 2018-2023. All Rights Reserved.
https://www.nuget.org/packages/ThreatsManager.Engine/
https://github.com/simonec73/threatsmanager
- 2.1.1.0
- 2.1.1
+ 2.1.2.0
+ 2.1.2
true
..\..\ThreatsManager.Engine\ThreatsManager.snk
$(NoWarn);NU1505;CS3021
diff --git a/Sources/Extensions/ThreatsManager.PackageManagers/ExtensionsContainer.cs b/Sources/Extensions/ThreatsManager.PackageManagers/ExtensionsContainer.cs
index ade27606..f810ed4c 100644
--- a/Sources/Extensions/ThreatsManager.PackageManagers/ExtensionsContainer.cs
+++ b/Sources/Extensions/ThreatsManager.PackageManagers/ExtensionsContainer.cs
@@ -1,3 +1,3 @@
using ThreatsManager.Interfaces;
-[assembly: ExtensionsContainer("2.1.1")]
\ No newline at end of file
+[assembly: ExtensionsContainer("2.1.2")]
\ No newline at end of file
diff --git a/Sources/Extensions/ThreatsManager.PackageManagers/ThreatsManager.PackageManagers.csproj b/Sources/Extensions/ThreatsManager.PackageManagers/ThreatsManager.PackageManagers.csproj
index 3588fa64..7c222968 100644
--- a/Sources/Extensions/ThreatsManager.PackageManagers/ThreatsManager.PackageManagers.csproj
+++ b/Sources/Extensions/ThreatsManager.PackageManagers/ThreatsManager.PackageManagers.csproj
@@ -3,15 +3,15 @@
net481
Threats Manager Platform Package Managers library.
- 2.1.1.0
+ 2.1.2.0
Simone Curzi
Simone Curzi
Threats Manager Platform
Copyright © Simone Curzi, 2018-2023. All Rights Reserved.
https://www.nuget.org/packages/ThreatsManager.Engine/
https://github.com/simonec73/threatsmanager
- 2.1.1.0
- 2.1.1
+ 2.1.2.0
+ 2.1.2
true
..\..\ThreatsManager.Engine\ThreatsManager.snk
$(NoWarn);NU1505
diff --git a/Sources/Extensions/ThreatsManager.Quality/ExtensionsContainer.cs b/Sources/Extensions/ThreatsManager.Quality/ExtensionsContainer.cs
index ade27606..f810ed4c 100644
--- a/Sources/Extensions/ThreatsManager.Quality/ExtensionsContainer.cs
+++ b/Sources/Extensions/ThreatsManager.Quality/ExtensionsContainer.cs
@@ -1,3 +1,3 @@
using ThreatsManager.Interfaces;
-[assembly: ExtensionsContainer("2.1.1")]
\ No newline at end of file
+[assembly: ExtensionsContainer("2.1.2")]
\ No newline at end of file
diff --git a/Sources/Extensions/ThreatsManager.Quality/ThreatsManager.Quality.csproj b/Sources/Extensions/ThreatsManager.Quality/ThreatsManager.Quality.csproj
index 5a360abb..16437df4 100644
--- a/Sources/Extensions/ThreatsManager.Quality/ThreatsManager.Quality.csproj
+++ b/Sources/Extensions/ThreatsManager.Quality/ThreatsManager.Quality.csproj
@@ -3,15 +3,15 @@
net481
Threats Manager Platform Quality library.
- 2.1.1.0
+ 2.1.2.0
Simone Curzi
Simone Curzi
Threats Manager Platform
Copyright © Simone Curzi, 2018-2023. All Rights Reserved.
https://www.nuget.org/packages/ThreatsManager.Engine/
https://github.com/simonec73/threatsmanager
- 2.1.1.0
- 2.1.1
+ 2.1.2.0
+ 2.1.2
true
..\..\ThreatsManager.Engine\ThreatsManager.snk
$(NoWarn);NU1505
diff --git a/Sources/Extensions/ThreatsManager.QuantitativeRisk/ExtensionsContainer.cs b/Sources/Extensions/ThreatsManager.QuantitativeRisk/ExtensionsContainer.cs
index ade27606..f810ed4c 100644
--- a/Sources/Extensions/ThreatsManager.QuantitativeRisk/ExtensionsContainer.cs
+++ b/Sources/Extensions/ThreatsManager.QuantitativeRisk/ExtensionsContainer.cs
@@ -1,3 +1,3 @@
using ThreatsManager.Interfaces;
-[assembly: ExtensionsContainer("2.1.1")]
\ No newline at end of file
+[assembly: ExtensionsContainer("2.1.2")]
\ No newline at end of file
diff --git a/Sources/Extensions/ThreatsManager.QuantitativeRisk/ThreatsManager.QuantitativeRisk.csproj b/Sources/Extensions/ThreatsManager.QuantitativeRisk/ThreatsManager.QuantitativeRisk.csproj
index 18ed7f7e..c65c2d96 100644
--- a/Sources/Extensions/ThreatsManager.QuantitativeRisk/ThreatsManager.QuantitativeRisk.csproj
+++ b/Sources/Extensions/ThreatsManager.QuantitativeRisk/ThreatsManager.QuantitativeRisk.csproj
@@ -3,15 +3,15 @@
net481
Threats Manager Platform Quantitative Risk Extensions library.
- 2.1.1.0
+ 2.1.2.0
Simone Curzi
Simone Curzi
Threats Manager Platform
Copyright © Simone Curzi, 2018-2023. All Rights Reserved.
https://www.nuget.org/packages/ThreatsManager.Engine/
https://github.com/simonec73/threatsmanager
- 2.1.1.0
- 2.1.1
+ 2.1.2.0
+ 2.1.2
true
..\..\ThreatsManager.Engine\ThreatsManager.snk
$(NoWarn);NU1505
diff --git a/Sources/SBOM/_manifest/spdx_2.2/manifest.spdx.json b/Sources/SBOM/_manifest/spdx_2.2/manifest.spdx.json
index a0d68829..3357a648 100644
--- a/Sources/SBOM/_manifest/spdx_2.2/manifest.spdx.json
+++ b/Sources/SBOM/_manifest/spdx_2.2/manifest.spdx.json
@@ -2,8 +2,8 @@
"files": [],
"packages": [
{
- "name": "System.Drawing.Common",
- "SPDXID": "SPDXRef-Package-1E3F0DE5419CF41CE7DA18907406D8618A23E73477CED8A0A5B96FABC4B00C8E",
+ "name": "PostSharp",
+ "SPDXID": "SPDXRef-Package-4144998C3036BFEC1FEA421C96CDE225AB66255248559821A06971479C33432D",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -12,12 +12,12 @@
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
- "versionInfo": "7.0.0",
+ "versionInfo": "2023.0.8",
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/System.Drawing.Common%407.0.0"
+ "referenceLocator": "pkg:nuget/PostSharp%402023.0.8"
}
],
"supplier": "NOASSERTION"
@@ -44,8 +44,8 @@
"supplier": "NOASSERTION"
},
{
- "name": "PostSharp.Redist",
- "SPDXID": "SPDXRef-Package-BCFE9DA1E7CC86449FBC297FD5E46DE5F25F81F44FDCF934D81AE16272872CDE",
+ "name": "Newtonsoft.Json",
+ "SPDXID": "SPDXRef-Package-B886264C88915A93892AFBE3D28CD5B3C8B7990F0C6A47AD506184440C46436E",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -54,19 +54,19 @@
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
- "versionInfo": "2023.0.8",
+ "versionInfo": "13.0.3",
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/PostSharp.Redist%402023.0.8"
+ "referenceLocator": "pkg:nuget/Newtonsoft.Json%4013.0.3"
}
],
"supplier": "NOASSERTION"
},
{
- "name": "HtmlAgilityPack",
- "SPDXID": "SPDXRef-Package-C55EFD6CE543D43B7F9795E55B6CA46123F1759CF0A19BCC538E7160163FADA0",
+ "name": "Microsoft.AspNet.WebApi.Client",
+ "SPDXID": "SPDXRef-Package-FB8EF87A04ABBDDE238C1B9302C41D39A089FDC8A755C4F352B2784CD890726B",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -75,19 +75,19 @@
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
- "versionInfo": "1.11.52",
+ "versionInfo": "5.2.7",
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/HtmlAgilityPack%401.11.52"
+ "referenceLocator": "pkg:nuget/Microsoft.AspNet.WebApi.Client%405.2.7"
}
],
"supplier": "NOASSERTION"
},
{
- "name": "Microsoft.IdentityModel.Logging",
- "SPDXID": "SPDXRef-Package-7586D09A8638B087A9EAF8CB69F57344F906C42E0170B08E6D77EAB745F30092",
+ "name": "Microsoft.TeamFoundation.DistributedTask.Common.Contracts",
+ "SPDXID": "SPDXRef-Package-2D9FB638C8BBE3526B66E56E9B7C7A9977FB3A4A298A0B4BE68ACAEE7A19289E",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -96,19 +96,19 @@
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
- "versionInfo": "5.6.0",
+ "versionInfo": "16.205.1",
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/Microsoft.IdentityModel.Logging%405.6.0"
+ "referenceLocator": "pkg:nuget/Microsoft.TeamFoundation.DistributedTask.Common.Contracts%4016.205.1"
}
],
"supplier": "NOASSERTION"
},
{
- "name": "PostSharp.Patterns.Aggregation",
- "SPDXID": "SPDXRef-Package-645F4B71D4113C3DCFFBDD2B605CA3CA6803A4C69C4EA4F556B87089D1A90CCE",
+ "name": "System.Memory",
+ "SPDXID": "SPDXRef-Package-BA5D8D1B5043A468B09DDBF48DCFC7DDD44949EE05A23A14F02AE8AA5183745C",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -117,19 +117,19 @@
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
- "versionInfo": "2023.0.8",
+ "versionInfo": "4.5.4",
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/PostSharp.Patterns.Aggregation%402023.0.8"
+ "referenceLocator": "pkg:nuget/System.Memory%404.5.4"
}
],
"supplier": "NOASSERTION"
},
{
- "name": "Microsoft.IdentityModel.JsonWebTokens",
- "SPDXID": "SPDXRef-Package-0C8546CE2314CF899D167AFF76F9BD8A06486145BF8140335621323B26CE3211",
+ "name": "Microsoft.VisualStudio.Services.Client",
+ "SPDXID": "SPDXRef-Package-E9BC86A4FA227FAC309ACDBB94C7EB26CC82F04FCE538A0C9FFF7F7D4E5BAA01",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -138,19 +138,19 @@
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
- "versionInfo": "5.6.0",
+ "versionInfo": "16.205.1",
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/Microsoft.IdentityModel.JsonWebTokens%405.6.0"
+ "referenceLocator": "pkg:nuget/Microsoft.VisualStudio.Services.Client%4016.205.1"
}
],
"supplier": "NOASSERTION"
},
{
- "name": "Microsoft.VisualStudio.Services.InteractiveClient",
- "SPDXID": "SPDXRef-Package-96B5CDA69EC229F8890368C7FD907A10B449F813F071104E7F870121A128DE62",
+ "name": "PostSharp.Redist",
+ "SPDXID": "SPDXRef-Package-BCFE9DA1E7CC86449FBC297FD5E46DE5F25F81F44FDCF934D81AE16272872CDE",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -159,19 +159,19 @@
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
- "versionInfo": "16.205.1",
+ "versionInfo": "2023.0.8",
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/Microsoft.VisualStudio.Services.InteractiveClient%4016.205.1"
+ "referenceLocator": "pkg:nuget/PostSharp.Redist%402023.0.8"
}
],
"supplier": "NOASSERTION"
},
{
- "name": "Microsoft.IdentityModel.Clients.ActiveDirectory",
- "SPDXID": "SPDXRef-Package-DDF4BFE18445397B3B932FABBE666DB6312B84C2A9E5EBD0E7E5D1771ADD507B",
+ "name": "Microsoft.VisualStudio.Services.InteractiveClient",
+ "SPDXID": "SPDXRef-Package-96B5CDA69EC229F8890368C7FD907A10B449F813F071104E7F870121A128DE62",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -180,19 +180,19 @@
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
- "versionInfo": "5.2.6",
+ "versionInfo": "16.205.1",
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/Microsoft.IdentityModel.Clients.ActiveDirectory%405.2.6"
+ "referenceLocator": "pkg:nuget/Microsoft.VisualStudio.Services.InteractiveClient%4016.205.1"
}
],
"supplier": "NOASSERTION"
},
{
- "name": "PostSharp.Patterns.Threading",
- "SPDXID": "SPDXRef-Package-697815BD7D972ED14DE5BC80D93F622C78E844BB253F6D71E1D9DBA91049F942",
+ "name": "Azure.Core",
+ "SPDXID": "SPDXRef-Package-B627A9A962CA4EC270A6BB33055B6D932D9140ED98F117C25A3ACCD02894A5DE",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -201,19 +201,19 @@
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
- "versionInfo": "2023.0.8",
+ "versionInfo": "1.35.0",
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/PostSharp.Patterns.Threading%402023.0.8"
+ "referenceLocator": "pkg:nuget/Azure.Core%401.35.0"
}
],
"supplier": "NOASSERTION"
},
{
- "name": "Microsoft.AspNet.WebApi.Core",
- "SPDXID": "SPDXRef-Package-0036185CFC5D903DD9210D1FA4BAF6EACE18C961FBCA96B55969F2D0ADD1006E",
+ "name": "Microsoft.AspNet.WebApi.WebHost",
+ "SPDXID": "SPDXRef-Package-B6EB77607AF75F718E21D28F4BA0EE84239C8DE9830FF9719907EE090332AADF",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -227,14 +227,14 @@
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/Microsoft.AspNet.WebApi.Core%405.2.7"
+ "referenceLocator": "pkg:nuget/Microsoft.AspNet.WebApi.WebHost%405.2.7"
}
],
"supplier": "NOASSERTION"
},
{
- "name": "PostSharp.Patterns.Model.Redist",
- "SPDXID": "SPDXRef-Package-B2AD20C5DE6A3C17B50991CF6455943C6279EFFAA7399398D712EB3FAED31A32",
+ "name": "System.ValueTuple",
+ "SPDXID": "SPDXRef-Package-C1475C5380732C85127A15B8BADF74D2619786E90578875B650082AE4497BC14",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -243,19 +243,19 @@
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
- "versionInfo": "2023.0.8",
+ "versionInfo": "4.5.0",
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/PostSharp.Patterns.Model.Redist%402023.0.8"
+ "referenceLocator": "pkg:nuget/System.ValueTuple%404.5.0"
}
],
"supplier": "NOASSERTION"
},
{
- "name": "System.Security.Cryptography.ProtectedData",
- "SPDXID": "SPDXRef-Package-3E4ADA476CE4806493CB930B6302267AF817A496FCBC9259BC06584EF5194CC8",
+ "name": "System.Memory.Data",
+ "SPDXID": "SPDXRef-Package-836302A10D83B34AB15735A3BD20F9E5195E5C19F576DD54B2A803F042B4449F",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -264,19 +264,19 @@
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
- "versionInfo": "7.0.1",
+ "versionInfo": "1.0.2",
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/System.Security.Cryptography.ProtectedData%407.0.1"
+ "referenceLocator": "pkg:nuget/System.Memory.Data%401.0.2"
}
],
"supplier": "NOASSERTION"
},
{
- "name": "PostSharp.Patterns.Common.Redist",
- "SPDXID": "SPDXRef-Package-C452BF3C81B9ADDC3235B781278151D496D329BC14ABCDB02E9DCFB34FCBFF96",
+ "name": "PostSharp.Patterns.Model.Redist",
+ "SPDXID": "SPDXRef-Package-B2AD20C5DE6A3C17B50991CF6455943C6279EFFAA7399398D712EB3FAED31A32",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -290,14 +290,14 @@
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/PostSharp.Patterns.Common.Redist%402023.0.8"
+ "referenceLocator": "pkg:nuget/PostSharp.Patterns.Model.Redist%402023.0.8"
}
],
"supplier": "NOASSERTION"
},
{
- "name": "Microsoft.VisualStudio.Services.Client",
- "SPDXID": "SPDXRef-Package-E9BC86A4FA227FAC309ACDBB94C7EB26CC82F04FCE538A0C9FFF7F7D4E5BAA01",
+ "name": "System.Security.AccessControl",
+ "SPDXID": "SPDXRef-Package-BD5D3E09B5B6D3451EDDD1D32105D059705408E4BF509FF6EA91ABE0158BBCFC",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -306,19 +306,19 @@
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
- "versionInfo": "16.205.1",
+ "versionInfo": "6.0.0",
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/Microsoft.VisualStudio.Services.Client%4016.205.1"
+ "referenceLocator": "pkg:nuget/System.Security.AccessControl%406.0.0"
}
],
"supplier": "NOASSERTION"
},
{
- "name": "System.Configuration.ConfigurationManager",
- "SPDXID": "SPDXRef-Package-EAF50BE3959D920EC2C2A32D425E53F74856FE11325143BF0B2DECA87CBDC2E5",
+ "name": "HtmlAgilityPack",
+ "SPDXID": "SPDXRef-Package-C55EFD6CE543D43B7F9795E55B6CA46123F1759CF0A19BCC538E7160163FADA0",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -327,19 +327,19 @@
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
- "versionInfo": "7.0.0",
+ "versionInfo": "1.11.52",
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/System.Configuration.ConfigurationManager%407.0.0"
+ "referenceLocator": "pkg:nuget/HtmlAgilityPack%401.11.52"
}
],
"supplier": "NOASSERTION"
},
{
- "name": "System.IO.Packaging",
- "SPDXID": "SPDXRef-Package-178812B3397597FE89124B4827B1851DF91F7E83B0010838961B8110D42EB299",
+ "name": "System.Security.Cryptography.ProtectedData",
+ "SPDXID": "SPDXRef-Package-3E4ADA476CE4806493CB930B6302267AF817A496FCBC9259BC06584EF5194CC8",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -348,19 +348,19 @@
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
- "versionInfo": "7.0.0",
+ "versionInfo": "7.0.1",
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/System.IO.Packaging%407.0.0"
+ "referenceLocator": "pkg:nuget/System.Security.Cryptography.ProtectedData%407.0.1"
}
],
"supplier": "NOASSERTION"
},
{
- "name": "PostSharp",
- "SPDXID": "SPDXRef-Package-4144998C3036BFEC1FEA421C96CDE225AB66255248559821A06971479C33432D",
+ "name": "PostSharp.Patterns.Threading",
+ "SPDXID": "SPDXRef-Package-697815BD7D972ED14DE5BC80D93F622C78E844BB253F6D71E1D9DBA91049F942",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -374,14 +374,14 @@
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/PostSharp%402023.0.8"
+ "referenceLocator": "pkg:nuget/PostSharp.Patterns.Threading%402023.0.8"
}
],
"supplier": "NOASSERTION"
},
{
- "name": "Microsoft.IdentityModel.Tokens",
- "SPDXID": "SPDXRef-Package-ED5C898F1E7300DE0FEC9EB7CF43C5F47EAAD11CA05AEE8953D34EFF973D2506",
+ "name": "Microsoft.IdentityModel.Clients.ActiveDirectory",
+ "SPDXID": "SPDXRef-Package-DDF4BFE18445397B3B932FABBE666DB6312B84C2A9E5EBD0E7E5D1771ADD507B",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -390,19 +390,19 @@
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
- "versionInfo": "5.6.0",
+ "versionInfo": "5.2.6",
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/Microsoft.IdentityModel.Tokens%405.6.0"
+ "referenceLocator": "pkg:nuget/Microsoft.IdentityModel.Clients.ActiveDirectory%405.2.6"
}
],
"supplier": "NOASSERTION"
},
{
- "name": "Microsoft.AspNet.WebApi.Client",
- "SPDXID": "SPDXRef-Package-FB8EF87A04ABBDDE238C1B9302C41D39A089FDC8A755C4F352B2784CD890726B",
+ "name": "System.Runtime.CompilerServices.Unsafe",
+ "SPDXID": "SPDXRef-Package-1B140F7FA3F784DD56CC7A8B4145E9AD58D8CDD4C249A0F27F2262E47C9B41AF",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -411,19 +411,19 @@
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
- "versionInfo": "5.2.7",
+ "versionInfo": "6.0.0",
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/Microsoft.AspNet.WebApi.Client%405.2.7"
+ "referenceLocator": "pkg:nuget/System.Runtime.CompilerServices.Unsafe%406.0.0"
}
],
"supplier": "NOASSERTION"
},
{
- "name": "PostSharp.Patterns.Model",
- "SPDXID": "SPDXRef-Package-6C98FCF82448239281EA77808E1A4AC1B02DCF078F47514CF8862085C31AE90A",
+ "name": "System.Security.Permissions",
+ "SPDXID": "SPDXRef-Package-D0AFA1135DD70C4BE3A426699A4BD772762C066CB05E34A798BFD36D89643F02",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -432,12 +432,12 @@
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
- "versionInfo": "2023.0.8",
+ "versionInfo": "7.0.0",
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/PostSharp.Patterns.Model%402023.0.8"
+ "referenceLocator": "pkg:nuget/System.Security.Permissions%407.0.0"
}
],
"supplier": "NOASSERTION"
@@ -464,8 +464,8 @@
"supplier": "NOASSERTION"
},
{
- "name": "Antlr4.Runtime.Standard",
- "SPDXID": "SPDXRef-Package-3EC882CE0436EDA06A573EA24AD2C1BD42AD258EB54A76BDE6C1CA61DA2DEA67",
+ "name": "PostSharp.Patterns.Common.Redist",
+ "SPDXID": "SPDXRef-Package-C452BF3C81B9ADDC3235B781278151D496D329BC14ABCDB02E9DCFB34FCBFF96",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -474,19 +474,19 @@
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
- "versionInfo": "4.13.0",
+ "versionInfo": "2023.0.8",
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/Antlr4.Runtime.Standard%404.13.0"
+ "referenceLocator": "pkg:nuget/PostSharp.Patterns.Common.Redist%402023.0.8"
}
],
"supplier": "NOASSERTION"
},
{
- "name": "Microsoft.TeamFoundation.DistributedTask.Common.Contracts",
- "SPDXID": "SPDXRef-Package-2D9FB638C8BBE3526B66E56E9B7C7A9977FB3A4A298A0B4BE68ACAEE7A19289E",
+ "name": "Microsoft.IdentityModel.JsonWebTokens",
+ "SPDXID": "SPDXRef-Package-0C8546CE2314CF899D167AFF76F9BD8A06486145BF8140335621323B26CE3211",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -495,19 +495,19 @@
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
- "versionInfo": "16.205.1",
+ "versionInfo": "5.6.0",
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/Microsoft.TeamFoundation.DistributedTask.Common.Contracts%4016.205.1"
+ "referenceLocator": "pkg:nuget/Microsoft.IdentityModel.JsonWebTokens%405.6.0"
}
],
"supplier": "NOASSERTION"
},
{
- "name": "System.ValueTuple",
- "SPDXID": "SPDXRef-Package-C1475C5380732C85127A15B8BADF74D2619786E90578875B650082AE4497BC14",
+ "name": "System.Text.Encodings.Web",
+ "SPDXID": "SPDXRef-Package-79635115AF84D923E985A49E76247A70F70FB8798FC292158F9B6D6B4E2A0336",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -516,12 +516,12 @@
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
- "versionInfo": "4.5.0",
+ "versionInfo": "4.7.2",
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/System.ValueTuple%404.5.0"
+ "referenceLocator": "pkg:nuget/System.Text.Encodings.Web%404.7.2"
}
],
"supplier": "NOASSERTION"
@@ -547,6 +547,27 @@
],
"supplier": "NOASSERTION"
},
+ {
+ "name": "System.ComponentModel.Composition",
+ "SPDXID": "SPDXRef-Package-791ADDC07D4C95BB88711D14AE7B99C521745030630794FD90A053A9CF0DB0FA",
+ "downloadLocation": "NOASSERTION",
+ "filesAnalyzed": false,
+ "licenseConcluded": "NOASSERTION",
+ "licenseInfoFromFiles": [
+ "NOASSERTION"
+ ],
+ "licenseDeclared": "NOASSERTION",
+ "copyrightText": "NOASSERTION",
+ "versionInfo": "7.0.0",
+ "externalRefs": [
+ {
+ "referenceCategory": "PACKAGE-MANAGER",
+ "referenceType": "purl",
+ "referenceLocator": "pkg:nuget/System.ComponentModel.Composition%407.0.0"
+ }
+ ],
+ "supplier": "NOASSERTION"
+ },
{
"name": "PostSharp.Patterns.Common",
"SPDXID": "SPDXRef-Package-4EEE7F70804936948133A07CF19E40C3B05BFB3E678172FEF939C9265998230B",
@@ -590,8 +611,8 @@
"supplier": "NOASSERTION"
},
{
- "name": "System.ComponentModel.Composition",
- "SPDXID": "SPDXRef-Package-791ADDC07D4C95BB88711D14AE7B99C521745030630794FD90A053A9CF0DB0FA",
+ "name": "System.IdentityModel.Tokens.Jwt",
+ "SPDXID": "SPDXRef-Package-F8BA4E7EFF02C9D947FB09B3A9632CC70EA2CE2CD1678741703E172AC4D83620",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -600,19 +621,40 @@
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
- "versionInfo": "7.0.0",
+ "versionInfo": "5.6.0",
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/System.ComponentModel.Composition%407.0.0"
+ "referenceLocator": "pkg:nuget/System.IdentityModel.Tokens.Jwt%405.6.0"
}
],
"supplier": "NOASSERTION"
},
{
- "name": "System.Security.Permissions",
- "SPDXID": "SPDXRef-Package-D0AFA1135DD70C4BE3A426699A4BD772762C066CB05E34A798BFD36D89643F02",
+ "name": "Azure.AI.OpenAI",
+ "SPDXID": "SPDXRef-Package-862E9A22FAE549CD97CBE81F8E67DB96A1FAFA78EA6B24BFD39C34B067014678",
+ "downloadLocation": "NOASSERTION",
+ "filesAnalyzed": false,
+ "licenseConcluded": "NOASSERTION",
+ "licenseInfoFromFiles": [
+ "NOASSERTION"
+ ],
+ "licenseDeclared": "NOASSERTION",
+ "copyrightText": "NOASSERTION",
+ "versionInfo": "1.0.0-beta.9",
+ "externalRefs": [
+ {
+ "referenceCategory": "PACKAGE-MANAGER",
+ "referenceType": "purl",
+ "referenceLocator": "pkg:nuget/Azure.AI.OpenAI%401.0.0-beta.9"
+ }
+ ],
+ "supplier": "NOASSERTION"
+ },
+ {
+ "name": "System.Configuration.ConfigurationManager",
+ "SPDXID": "SPDXRef-Package-EAF50BE3959D920EC2C2A32D425E53F74856FE11325143BF0B2DECA87CBDC2E5",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -626,14 +668,14 @@
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/System.Security.Permissions%407.0.0"
+ "referenceLocator": "pkg:nuget/System.Configuration.ConfigurationManager%407.0.0"
}
],
"supplier": "NOASSERTION"
},
{
- "name": "Newtonsoft.Json",
- "SPDXID": "SPDXRef-Package-B886264C88915A93892AFBE3D28CD5B3C8B7990F0C6A47AD506184440C46436E",
+ "name": "Antlr4.Runtime.Standard",
+ "SPDXID": "SPDXRef-Package-3EC882CE0436EDA06A573EA24AD2C1BD42AD258EB54A76BDE6C1CA61DA2DEA67",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -642,19 +684,19 @@
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
- "versionInfo": "13.0.3",
+ "versionInfo": "4.13.0",
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/Newtonsoft.Json%4013.0.3"
+ "referenceLocator": "pkg:nuget/Antlr4.Runtime.Standard%404.13.0"
}
],
"supplier": "NOASSERTION"
},
{
- "name": "System.IdentityModel.Tokens.Jwt",
- "SPDXID": "SPDXRef-Package-F8BA4E7EFF02C9D947FB09B3A9632CC70EA2CE2CD1678741703E172AC4D83620",
+ "name": "Microsoft.IdentityModel.Tokens",
+ "SPDXID": "SPDXRef-Package-ED5C898F1E7300DE0FEC9EB7CF43C5F47EAAD11CA05AEE8953D34EFF973D2506",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -668,14 +710,98 @@
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/System.IdentityModel.Tokens.Jwt%405.6.0"
+ "referenceLocator": "pkg:nuget/Microsoft.IdentityModel.Tokens%405.6.0"
}
],
"supplier": "NOASSERTION"
},
{
- "name": "Microsoft.AspNet.WebApi.WebHost",
- "SPDXID": "SPDXRef-Package-B6EB77607AF75F718E21D28F4BA0EE84239C8DE9830FF9719907EE090332AADF",
+ "name": "Microsoft.IdentityModel.Logging",
+ "SPDXID": "SPDXRef-Package-7586D09A8638B087A9EAF8CB69F57344F906C42E0170B08E6D77EAB745F30092",
+ "downloadLocation": "NOASSERTION",
+ "filesAnalyzed": false,
+ "licenseConcluded": "NOASSERTION",
+ "licenseInfoFromFiles": [
+ "NOASSERTION"
+ ],
+ "licenseDeclared": "NOASSERTION",
+ "copyrightText": "NOASSERTION",
+ "versionInfo": "5.6.0",
+ "externalRefs": [
+ {
+ "referenceCategory": "PACKAGE-MANAGER",
+ "referenceType": "purl",
+ "referenceLocator": "pkg:nuget/Microsoft.IdentityModel.Logging%405.6.0"
+ }
+ ],
+ "supplier": "NOASSERTION"
+ },
+ {
+ "name": "Microsoft.Bcl.AsyncInterfaces",
+ "SPDXID": "SPDXRef-Package-6B6117AB3417AA50C1DF8B47DB834F43608FA2A493BD063B0DCD0310BE1691FC",
+ "downloadLocation": "NOASSERTION",
+ "filesAnalyzed": false,
+ "licenseConcluded": "NOASSERTION",
+ "licenseInfoFromFiles": [
+ "NOASSERTION"
+ ],
+ "licenseDeclared": "NOASSERTION",
+ "copyrightText": "NOASSERTION",
+ "versionInfo": "1.1.1",
+ "externalRefs": [
+ {
+ "referenceCategory": "PACKAGE-MANAGER",
+ "referenceType": "purl",
+ "referenceLocator": "pkg:nuget/Microsoft.Bcl.AsyncInterfaces%401.1.1"
+ }
+ ],
+ "supplier": "NOASSERTION"
+ },
+ {
+ "name": "PostSharp.Patterns.Model",
+ "SPDXID": "SPDXRef-Package-6C98FCF82448239281EA77808E1A4AC1B02DCF078F47514CF8862085C31AE90A",
+ "downloadLocation": "NOASSERTION",
+ "filesAnalyzed": false,
+ "licenseConcluded": "NOASSERTION",
+ "licenseInfoFromFiles": [
+ "NOASSERTION"
+ ],
+ "licenseDeclared": "NOASSERTION",
+ "copyrightText": "NOASSERTION",
+ "versionInfo": "2023.0.8",
+ "externalRefs": [
+ {
+ "referenceCategory": "PACKAGE-MANAGER",
+ "referenceType": "purl",
+ "referenceLocator": "pkg:nuget/PostSharp.Patterns.Model%402023.0.8"
+ }
+ ],
+ "supplier": "NOASSERTION"
+ },
+ {
+ "name": "System.Drawing.Common",
+ "SPDXID": "SPDXRef-Package-1E3F0DE5419CF41CE7DA18907406D8618A23E73477CED8A0A5B96FABC4B00C8E",
+ "downloadLocation": "NOASSERTION",
+ "filesAnalyzed": false,
+ "licenseConcluded": "NOASSERTION",
+ "licenseInfoFromFiles": [
+ "NOASSERTION"
+ ],
+ "licenseDeclared": "NOASSERTION",
+ "copyrightText": "NOASSERTION",
+ "versionInfo": "7.0.0",
+ "externalRefs": [
+ {
+ "referenceCategory": "PACKAGE-MANAGER",
+ "referenceType": "purl",
+ "referenceLocator": "pkg:nuget/System.Drawing.Common%407.0.0"
+ }
+ ],
+ "supplier": "NOASSERTION"
+ },
+ {
+ "name": "Microsoft.AspNet.WebApi.Core",
+ "SPDXID": "SPDXRef-Package-0036185CFC5D903DD9210D1FA4BAF6EACE18C961FBCA96B55969F2D0ADD1006E",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -689,14 +815,14 @@
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/Microsoft.AspNet.WebApi.WebHost%405.2.7"
+ "referenceLocator": "pkg:nuget/Microsoft.AspNet.WebApi.Core%405.2.7"
}
],
"supplier": "NOASSERTION"
},
{
- "name": "System.Security.AccessControl",
- "SPDXID": "SPDXRef-Package-BD5D3E09B5B6D3451EDDD1D32105D059705408E4BF509FF6EA91ABE0158BBCFC",
+ "name": "System.Text.Json",
+ "SPDXID": "SPDXRef-Package-5D96F0103707CBCFF84B28D306BD0C6F4464B149E2C79A6D1218CC1E093FFD25",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
@@ -705,12 +831,54 @@
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
- "versionInfo": "6.0.0",
+ "versionInfo": "4.7.2",
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
- "referenceLocator": "pkg:nuget/System.Security.AccessControl%406.0.0"
+ "referenceLocator": "pkg:nuget/System.Text.Json%404.7.2"
+ }
+ ],
+ "supplier": "NOASSERTION"
+ },
+ {
+ "name": "PostSharp.Patterns.Aggregation",
+ "SPDXID": "SPDXRef-Package-645F4B71D4113C3DCFFBDD2B605CA3CA6803A4C69C4EA4F556B87089D1A90CCE",
+ "downloadLocation": "NOASSERTION",
+ "filesAnalyzed": false,
+ "licenseConcluded": "NOASSERTION",
+ "licenseInfoFromFiles": [
+ "NOASSERTION"
+ ],
+ "licenseDeclared": "NOASSERTION",
+ "copyrightText": "NOASSERTION",
+ "versionInfo": "2023.0.8",
+ "externalRefs": [
+ {
+ "referenceCategory": "PACKAGE-MANAGER",
+ "referenceType": "purl",
+ "referenceLocator": "pkg:nuget/PostSharp.Patterns.Aggregation%402023.0.8"
+ }
+ ],
+ "supplier": "NOASSERTION"
+ },
+ {
+ "name": "System.IO.Packaging",
+ "SPDXID": "SPDXRef-Package-178812B3397597FE89124B4827B1851DF91F7E83B0010838961B8110D42EB299",
+ "downloadLocation": "NOASSERTION",
+ "filesAnalyzed": false,
+ "licenseConcluded": "NOASSERTION",
+ "licenseInfoFromFiles": [
+ "NOASSERTION"
+ ],
+ "licenseDeclared": "NOASSERTION",
+ "copyrightText": "NOASSERTION",
+ "versionInfo": "7.0.0",
+ "externalRefs": [
+ {
+ "referenceCategory": "PACKAGE-MANAGER",
+ "referenceType": "purl",
+ "referenceLocator": "pkg:nuget/System.IO.Packaging%407.0.0"
}
],
"supplier": "NOASSERTION"
@@ -743,17 +911,47 @@
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-3E4ADA476CE4806493CB930B6302267AF817A496FCBC9259BC06584EF5194CC8",
+ "relatedSpdxElement": "SPDXRef-Package-EAF50BE3959D920EC2C2A32D425E53F74856FE11325143BF0B2DECA87CBDC2E5",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-0036185CFC5D903DD9210D1FA4BAF6EACE18C961FBCA96B55969F2D0ADD1006E",
+ "relatedSpdxElement": "SPDXRef-Package-862E9A22FAE549CD97CBE81F8E67DB96A1FAFA78EA6B24BFD39C34B067014678",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-96B5CDA69EC229F8890368C7FD907A10B449F813F071104E7F870121A128DE62",
+ "relatedSpdxElement": "SPDXRef-Package-F8BA4E7EFF02C9D947FB09B3A9632CC70EA2CE2CD1678741703E172AC4D83620",
+ "spdxElementId": "SPDXRef-RootPackage"
+ },
+ {
+ "relationshipType": "DEPENDS_ON",
+ "relatedSpdxElement": "SPDXRef-Package-FFF37EB028C40ED3328C8F4D8D0B9DC47D473EB856E9351A10B10AC420CAF2C9",
+ "spdxElementId": "SPDXRef-RootPackage"
+ },
+ {
+ "relationshipType": "DEPENDS_ON",
+ "relatedSpdxElement": "SPDXRef-Package-4EEE7F70804936948133A07CF19E40C3B05BFB3E678172FEF939C9265998230B",
+ "spdxElementId": "SPDXRef-RootPackage"
+ },
+ {
+ "relationshipType": "DEPENDS_ON",
+ "relatedSpdxElement": "SPDXRef-Package-178812B3397597FE89124B4827B1851DF91F7E83B0010838961B8110D42EB299",
+ "spdxElementId": "SPDXRef-RootPackage"
+ },
+ {
+ "relationshipType": "DEPENDS_ON",
+ "relatedSpdxElement": "SPDXRef-Package-645F4B71D4113C3DCFFBDD2B605CA3CA6803A4C69C4EA4F556B87089D1A90CCE",
+ "spdxElementId": "SPDXRef-RootPackage"
+ },
+ {
+ "relationshipType": "DEPENDS_ON",
+ "relatedSpdxElement": "SPDXRef-Package-5D96F0103707CBCFF84B28D306BD0C6F4464B149E2C79A6D1218CC1E093FFD25",
+ "spdxElementId": "SPDXRef-RootPackage"
+ },
+ {
+ "relationshipType": "DEPENDS_ON",
+ "relatedSpdxElement": "SPDXRef-Package-0036185CFC5D903DD9210D1FA4BAF6EACE18C961FBCA96B55969F2D0ADD1006E",
"spdxElementId": "SPDXRef-RootPackage"
},
{
@@ -768,17 +966,22 @@
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-6C98FCF82448239281EA77808E1A4AC1B02DCF078F47514CF8862085C31AE90A",
+ "relatedSpdxElement": "SPDXRef-Package-D0AFA1135DD70C4BE3A426699A4BD772762C066CB05E34A798BFD36D89643F02",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-FB8EF87A04ABBDDE238C1B9302C41D39A089FDC8A755C4F352B2784CD890726B",
+ "relatedSpdxElement": "SPDXRef-Package-1B140F7FA3F784DD56CC7A8B4145E9AD58D8CDD4C249A0F27F2262E47C9B41AF",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-ED5C898F1E7300DE0FEC9EB7CF43C5F47EAAD11CA05AEE8953D34EFF973D2506",
+ "relatedSpdxElement": "SPDXRef-Package-DDF4BFE18445397B3B932FABBE666DB6312B84C2A9E5EBD0E7E5D1771ADD507B",
+ "spdxElementId": "SPDXRef-RootPackage"
+ },
+ {
+ "relationshipType": "DEPENDS_ON",
+ "relatedSpdxElement": "SPDXRef-Package-C55EFD6CE543D43B7F9795E55B6CA46123F1759CF0A19BCC538E7160163FADA0",
"spdxElementId": "SPDXRef-RootPackage"
},
{
@@ -793,82 +996,82 @@
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-645F4B71D4113C3DCFFBDD2B605CA3CA6803A4C69C4EA4F556B87089D1A90CCE",
+ "relatedSpdxElement": "SPDXRef-Package-BD5D3E09B5B6D3451EDDD1D32105D059705408E4BF509FF6EA91ABE0158BBCFC",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-7586D09A8638B087A9EAF8CB69F57344F906C42E0170B08E6D77EAB745F30092",
+ "relatedSpdxElement": "SPDXRef-Package-836302A10D83B34AB15735A3BD20F9E5195E5C19F576DD54B2A803F042B4449F",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-C55EFD6CE543D43B7F9795E55B6CA46123F1759CF0A19BCC538E7160163FADA0",
+ "relatedSpdxElement": "SPDXRef-Package-C1475C5380732C85127A15B8BADF74D2619786E90578875B650082AE4497BC14",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-681B78A232303686681BD818B0D190BE6C105857B1F5C087E2FC1952A264EA58",
+ "relatedSpdxElement": "SPDXRef-Package-B6EB77607AF75F718E21D28F4BA0EE84239C8DE9830FF9719907EE090332AADF",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-D0AFA1135DD70C4BE3A426699A4BD772762C066CB05E34A798BFD36D89643F02",
+ "relatedSpdxElement": "SPDXRef-Package-BCFE9DA1E7CC86449FBC297FD5E46DE5F25F81F44FDCF934D81AE16272872CDE",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-791ADDC07D4C95BB88711D14AE7B99C521745030630794FD90A053A9CF0DB0FA",
+ "relatedSpdxElement": "SPDXRef-Package-6C98FCF82448239281EA77808E1A4AC1B02DCF078F47514CF8862085C31AE90A",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-FFF37EB028C40ED3328C8F4D8D0B9DC47D473EB856E9351A10B10AC420CAF2C9",
+ "relatedSpdxElement": "SPDXRef-Package-6B6117AB3417AA50C1DF8B47DB834F43608FA2A493BD063B0DCD0310BE1691FC",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-4EEE7F70804936948133A07CF19E40C3B05BFB3E678172FEF939C9265998230B",
+ "relatedSpdxElement": "SPDXRef-Package-7586D09A8638B087A9EAF8CB69F57344F906C42E0170B08E6D77EAB745F30092",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-BD5D3E09B5B6D3451EDDD1D32105D059705408E4BF509FF6EA91ABE0158BBCFC",
+ "relatedSpdxElement": "SPDXRef-Package-ED5C898F1E7300DE0FEC9EB7CF43C5F47EAAD11CA05AEE8953D34EFF973D2506",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-B6EB77607AF75F718E21D28F4BA0EE84239C8DE9830FF9719907EE090332AADF",
+ "relatedSpdxElement": "SPDXRef-Package-3EC882CE0436EDA06A573EA24AD2C1BD42AD258EB54A76BDE6C1CA61DA2DEA67",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-F8BA4E7EFF02C9D947FB09B3A9632CC70EA2CE2CD1678741703E172AC4D83620",
+ "relatedSpdxElement": "SPDXRef-Package-3E4ADA476CE4806493CB930B6302267AF817A496FCBC9259BC06584EF5194CC8",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-B886264C88915A93892AFBE3D28CD5B3C8B7990F0C6A47AD506184440C46436E",
+ "relatedSpdxElement": "SPDXRef-Package-BA5D8D1B5043A468B09DDBF48DCFC7DDD44949EE05A23A14F02AE8AA5183745C",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-178812B3397597FE89124B4827B1851DF91F7E83B0010838961B8110D42EB299",
+ "relatedSpdxElement": "SPDXRef-Package-2D9FB638C8BBE3526B66E56E9B7C7A9977FB3A4A298A0B4BE68ACAEE7A19289E",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-EAF50BE3959D920EC2C2A32D425E53F74856FE11325143BF0B2DECA87CBDC2E5",
+ "relatedSpdxElement": "SPDXRef-Package-FB8EF87A04ABBDDE238C1B9302C41D39A089FDC8A755C4F352B2784CD890726B",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-E9BC86A4FA227FAC309ACDBB94C7EB26CC82F04FCE538A0C9FFF7F7D4E5BAA01",
+ "relatedSpdxElement": "SPDXRef-Package-681B78A232303686681BD818B0D190BE6C105857B1F5C087E2FC1952A264EA58",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-C452BF3C81B9ADDC3235B781278151D496D329BC14ABCDB02E9DCFB34FCBFF96",
+ "relatedSpdxElement": "SPDXRef-Package-791ADDC07D4C95BB88711D14AE7B99C521745030630794FD90A053A9CF0DB0FA",
"spdxElementId": "SPDXRef-RootPackage"
},
{
@@ -878,17 +1081,17 @@
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-C1475C5380732C85127A15B8BADF74D2619786E90578875B650082AE4497BC14",
+ "relatedSpdxElement": "SPDXRef-Package-79635115AF84D923E985A49E76247A70F70FB8798FC292158F9B6D6B4E2A0336",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-2D9FB638C8BBE3526B66E56E9B7C7A9977FB3A4A298A0B4BE68ACAEE7A19289E",
+ "relatedSpdxElement": "SPDXRef-Package-0C8546CE2314CF899D167AFF76F9BD8A06486145BF8140335621323B26CE3211",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-3EC882CE0436EDA06A573EA24AD2C1BD42AD258EB54A76BDE6C1CA61DA2DEA67",
+ "relatedSpdxElement": "SPDXRef-Package-C452BF3C81B9ADDC3235B781278151D496D329BC14ABCDB02E9DCFB34FCBFF96",
"spdxElementId": "SPDXRef-RootPackage"
},
{
@@ -898,17 +1101,22 @@
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-DDF4BFE18445397B3B932FABBE666DB6312B84C2A9E5EBD0E7E5D1771ADD507B",
+ "relatedSpdxElement": "SPDXRef-Package-B627A9A962CA4EC270A6BB33055B6D932D9140ED98F117C25A3ACCD02894A5DE",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-0C8546CE2314CF899D167AFF76F9BD8A06486145BF8140335621323B26CE3211",
+ "relatedSpdxElement": "SPDXRef-Package-96B5CDA69EC229F8890368C7FD907A10B449F813F071104E7F870121A128DE62",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
- "relatedSpdxElement": "SPDXRef-Package-BCFE9DA1E7CC86449FBC297FD5E46DE5F25F81F44FDCF934D81AE16272872CDE",
+ "relatedSpdxElement": "SPDXRef-Package-E9BC86A4FA227FAC309ACDBB94C7EB26CC82F04FCE538A0C9FFF7F7D4E5BAA01",
+ "spdxElementId": "SPDXRef-RootPackage"
+ },
+ {
+ "relationshipType": "DEPENDS_ON",
+ "relatedSpdxElement": "SPDXRef-Package-B886264C88915A93892AFBE3D28CD5B3C8B7990F0C6A47AD506184440C46436E",
"spdxElementId": "SPDXRef-RootPackage"
}
],
@@ -916,9 +1124,9 @@
"dataLicense": "CC0-1.0",
"SPDXID": "SPDXRef-DOCUMENT",
"name": "Threats Manager Platform 2.0.0",
- "documentNamespace": "https://github.com/simonec73/threatsmanager/Threats%20Manager%20Platform/2.0.0/0MTpIlbDykWmAKkpTw71ZQ",
+ "documentNamespace": "https://github.com/simonec73/threatsmanager/Threats%20Manager%20Platform/2.0.0/_FmtwHT1I0iY8mDGSkGT1w",
"creationInfo": {
- "created": "2023-11-26T13:52:03Z",
+ "created": "2023-12-30T10:46:59Z",
"creators": [
"Organization: Simone Curzi",
"Tool: Microsoft.SBOMTool-0.2.7"
diff --git a/Sources/SBOM/_manifest/spdx_2.2/manifest.spdx.json.sha256 b/Sources/SBOM/_manifest/spdx_2.2/manifest.spdx.json.sha256
index 3e6912de..ddf68e29 100644
Binary files a/Sources/SBOM/_manifest/spdx_2.2/manifest.spdx.json.sha256 and b/Sources/SBOM/_manifest/spdx_2.2/manifest.spdx.json.sha256 differ
diff --git a/Sources/ThreatsManager.Engine/Aspects/EntityShapesContainerAspect.cs b/Sources/ThreatsManager.Engine/Aspects/EntityShapesContainerAspect.cs
index f69d79b0..c1ce417d 100644
--- a/Sources/ThreatsManager.Engine/Aspects/EntityShapesContainerAspect.cs
+++ b/Sources/ThreatsManager.Engine/Aspects/EntityShapesContainerAspect.cs
@@ -195,11 +195,11 @@ public bool RemoveShape(IEntityShape entityShape)
{
UndoRedoManager.Detach(es);
scope?.Complete();
-
- if (es.Identity is IEntity entity && Instance is IEntityShapesContainer container)
- _entityShapeRemoved?.Invoke(container, entity);
}
}
+
+ if (result && es.Identity is IEntity entity && Instance is IEntityShapesContainer container)
+ _entityShapeRemoved?.Invoke(container, entity);
}
else
throw new ArgumentNullException(nameof(entityShape));
diff --git a/Sources/ThreatsManager.Engine/Aspects/GroupElementAspect.cs b/Sources/ThreatsManager.Engine/Aspects/GroupElementAspect.cs
index 0c17a9c8..873ff69e 100644
--- a/Sources/ThreatsManager.Engine/Aspects/GroupElementAspect.cs
+++ b/Sources/ThreatsManager.Engine/Aspects/GroupElementAspect.cs
@@ -89,11 +89,11 @@ public void SetParent(IGroup parent)
_parentId.Set(parent?.Id ?? Guid.Empty);
_parent.Set(parent);
scope?.Complete();
-
- if (Instance is IGroupElement groupElement)
- _parentChanged?.Invoke(groupElement, oldParent, parent);
}
- }
+
+ if (Instance is IGroupElement groupElement)
+ _parentChanged?.Invoke(groupElement, oldParent, parent);
+ }
}
#endregion
}
diff --git a/Sources/ThreatsManager.Engine/Aspects/GroupShapesContainerAspect.cs b/Sources/ThreatsManager.Engine/Aspects/GroupShapesContainerAspect.cs
index 9852c888..cdfd20c6 100644
--- a/Sources/ThreatsManager.Engine/Aspects/GroupShapesContainerAspect.cs
+++ b/Sources/ThreatsManager.Engine/Aspects/GroupShapesContainerAspect.cs
@@ -106,11 +106,11 @@ public void Add(IGroupShape groupShape)
UndoRedoManager.Attach(gs, gs.Model);
groups.Add(gs);
scope?.Complete();
+ }
- if (Instance is IGroupShapesContainer container)
- {
- _groupShapeAdded?.Invoke(container, gs);
- }
+ if (Instance is IGroupShapesContainer container)
+ {
+ _groupShapeAdded?.Invoke(container, gs);
}
}
else
@@ -194,11 +194,11 @@ public bool RemoveShape(IGroupShape groupShape)
{
UndoRedoManager.Detach(gs);
scope?.Complete();
-
- if (groupShape.Identity is IGroup group && Instance is IGroupShapesContainer container)
- _groupShapeRemoved?.Invoke(container, group);
}
}
+
+ if (result && groupShape.Identity is IGroup group && Instance is IGroupShapesContainer container)
+ _groupShapeRemoved?.Invoke(container, group);
}
else
throw new ArgumentNullException(nameof(groupShape));
diff --git a/Sources/ThreatsManager.Engine/Aspects/LinksContainerAspect.cs b/Sources/ThreatsManager.Engine/Aspects/LinksContainerAspect.cs
index d1c124b4..1c71facd 100644
--- a/Sources/ThreatsManager.Engine/Aspects/LinksContainerAspect.cs
+++ b/Sources/ThreatsManager.Engine/Aspects/LinksContainerAspect.cs
@@ -97,11 +97,11 @@ public void Add(ILink link)
UndoRedoManager.Attach(l, l.Model);
links.Add(l);
scope?.Complete();
+ }
- if (Instance is ILinksContainer container)
- {
- _linkAdded?.Invoke(container, l);
- }
+ if (Instance is ILinksContainer container)
+ {
+ _linkAdded?.Invoke(container, l);
}
}
else
@@ -142,11 +142,11 @@ public bool RemoveLink(Guid dataFlowId)
{
UndoRedoManager.Detach(link);
scope?.Complete();
-
- if (link.DataFlow is IDataFlow flow && Instance is ILinksContainer container)
- _linkRemoved?.Invoke(container, flow);
}
}
+
+ if (result && link.DataFlow is IDataFlow flow && Instance is ILinksContainer container)
+ _linkRemoved?.Invoke(container, flow);
}
return result;
diff --git a/Sources/ThreatsManager.Engine/Aspects/ThreatEventMitigationsContainerAspect.cs b/Sources/ThreatsManager.Engine/Aspects/ThreatEventMitigationsContainerAspect.cs
index c6f6a896..02ca0b69 100644
--- a/Sources/ThreatsManager.Engine/Aspects/ThreatEventMitigationsContainerAspect.cs
+++ b/Sources/ThreatsManager.Engine/Aspects/ThreatEventMitigationsContainerAspect.cs
@@ -96,11 +96,11 @@ public void Add(IThreatEventMitigation mitigation)
UndoRedoManager.Attach(tem, tem.Model);
mitigations.Add(tem);
scope?.Complete();
+ }
- if (Instance is IThreatEventMitigationsContainer container)
- {
- _threatEventMitigationAdded?.Invoke(container, tem);
- }
+ if (Instance is IThreatEventMitigationsContainer container)
+ {
+ _threatEventMitigationAdded?.Invoke(container, tem);
}
}
else
@@ -144,11 +144,11 @@ public bool RemoveMitigation(Guid mitigationId)
{
UndoRedoManager.Detach(mitigation);
scope?.Complete();
-
- if (Instance is IThreatEventMitigationsContainer container)
- _threatEventMitigationRemoved?.Invoke(container, mitigation);
}
}
+
+ if (result && Instance is IThreatEventMitigationsContainer container)
+ _threatEventMitigationRemoved?.Invoke(container, mitigation);
}
return result;
diff --git a/Sources/ThreatsManager.Engine/Aspects/ThreatEventScenariosContainerAspect.cs b/Sources/ThreatsManager.Engine/Aspects/ThreatEventScenariosContainerAspect.cs
index 3d0061cd..fdd6023f 100644
--- a/Sources/ThreatsManager.Engine/Aspects/ThreatEventScenariosContainerAspect.cs
+++ b/Sources/ThreatsManager.Engine/Aspects/ThreatEventScenariosContainerAspect.cs
@@ -144,11 +144,11 @@ public bool RemoveScenario(Guid id)
{
UndoRedoManager.Detach(scenario);
scope?.Complete();
-
- if (Instance is IThreatEvent threatEvent)
- _threatEventScenarioRemoved?.Invoke(threatEvent, scenario);
}
}
+
+ if (result && Instance is IThreatEvent threatEvent)
+ _threatEventScenarioRemoved?.Invoke(threatEvent, scenario);
}
return result;
diff --git a/Sources/ThreatsManager.Engine/Aspects/ThreatEventsContainerAspect.cs b/Sources/ThreatsManager.Engine/Aspects/ThreatEventsContainerAspect.cs
index 5b8845fa..93929961 100644
--- a/Sources/ThreatsManager.Engine/Aspects/ThreatEventsContainerAspect.cs
+++ b/Sources/ThreatsManager.Engine/Aspects/ThreatEventsContainerAspect.cs
@@ -111,10 +111,10 @@ public void Add(IThreatEvent threatEvent)
UndoRedoManager.Attach(te, te.Model);
threatEvents.Add(te);
scope?.Complete();
-
- if (Instance is IThreatEventsContainer container)
- _threatEventAdded?.Invoke(container, te);
}
+
+ if (Instance is IThreatEventsContainer container)
+ _threatEventAdded?.Invoke(container, te);
}
else
throw new ArgumentNullException(nameof(threatEvent));
@@ -157,11 +157,11 @@ public bool RemoveThreatEvent(Guid id)
{
UndoRedoManager.Detach(threatEvent);
scope?.Complete();
-
- if (Instance is IThreatEventsContainer container)
- _threatEventRemoved?.Invoke(container, threatEvent);
}
}
+
+ if (result && Instance is IThreatEventsContainer container)
+ _threatEventRemoved?.Invoke(container, threatEvent);
}
return result;
diff --git a/Sources/ThreatsManager.Engine/Aspects/VulnerabilitiesContainerAspect.cs b/Sources/ThreatsManager.Engine/Aspects/VulnerabilitiesContainerAspect.cs
index 38877efb..2862a07d 100644
--- a/Sources/ThreatsManager.Engine/Aspects/VulnerabilitiesContainerAspect.cs
+++ b/Sources/ThreatsManager.Engine/Aspects/VulnerabilitiesContainerAspect.cs
@@ -111,10 +111,10 @@ public void Add(IVulnerability vulnerability)
UndoRedoManager.Attach(v, v.Model);
vulnerabilities.Add(v);
scope?.Complete();
-
- if (Instance is IVulnerabilitiesContainer container)
- _vulnerabilityAdded?.Invoke(container, v);
}
+
+ if (Instance is IVulnerabilitiesContainer container)
+ _vulnerabilityAdded?.Invoke(container, v);
}
else
throw new ArgumentNullException(nameof(vulnerability));
@@ -157,11 +157,11 @@ public bool RemoveVulnerability(Guid id)
{
UndoRedoManager.Detach(vulnerability);
scope?.Complete();
-
- if (Instance is IVulnerabilitiesContainer container)
- _vulnerabilityRemoved?.Invoke(container, vulnerability);
}
}
+
+ if (result && Instance is IVulnerabilitiesContainer container)
+ _vulnerabilityRemoved?.Invoke(container, vulnerability);
}
return result;
diff --git a/Sources/ThreatsManager.Engine/Aspects/VulnerabilityMitigationsContainerAspect.cs b/Sources/ThreatsManager.Engine/Aspects/VulnerabilityMitigationsContainerAspect.cs
index d0f2d45d..ecf32712 100644
--- a/Sources/ThreatsManager.Engine/Aspects/VulnerabilityMitigationsContainerAspect.cs
+++ b/Sources/ThreatsManager.Engine/Aspects/VulnerabilityMitigationsContainerAspect.cs
@@ -99,11 +99,11 @@ public void Add(IVulnerabilityMitigation mitigation)
UndoRedoManager.Attach(vm, vm.Model);
mitigations.Add(vm);
scope?.Complete();
+ }
- if (Instance is IVulnerabilityMitigationsContainer container)
- {
- _vulnerabilityMitigationAdded?.Invoke(container, vm);
- }
+ if (Instance is IVulnerabilityMitigationsContainer container)
+ {
+ _vulnerabilityMitigationAdded?.Invoke(container, vm);
}
}
else
@@ -146,11 +146,11 @@ public bool RemoveMitigation(Guid mitigationId)
{
UndoRedoManager.Detach(mitigation);
scope?.Complete();
-
- if (Instance is IVulnerabilityMitigationsContainer container)
- _vulnerabilityMitigationRemoved?.Invoke(container, mitigation);
}
}
+
+ if (result && Instance is IVulnerabilityMitigationsContainer container)
+ _vulnerabilityMitigationRemoved?.Invoke(container, mitigation);
}
return result;
diff --git a/Sources/ThreatsManager.Engine/ExtensionsManager.cs b/Sources/ThreatsManager.Engine/ExtensionsManager.cs
index 93ba0450..86b59c16 100644
--- a/Sources/ThreatsManager.Engine/ExtensionsManager.cs
+++ b/Sources/ThreatsManager.Engine/ExtensionsManager.cs
@@ -12,6 +12,8 @@
using ThreatsManager.Utilities;
using ThreatsManager.Utilities.Help;
using PostSharp.Patterns.Threading;
+using ThreatsManager.Engine.Policies;
+using ThreatsManager.Utilities.Policies;
namespace ThreatsManager.Engine
{
@@ -36,7 +38,13 @@ public void AddExtensionsAssembly([Required] string path)
public void SetExecutionMode(ExecutionMode executionMode)
{
- _executionMode = executionMode;
+ var policy = new MaxExecutionModePolicy();
+ var maxExecutionMode = policy.MaxExecutionMode ?? ExecutionMode.Pioneer;
+
+ if (executionMode > maxExecutionMode)
+ _executionMode = executionMode;
+ else
+ _executionMode = maxExecutionMode;
}
public void Load(bool loadHelp)
@@ -79,9 +87,7 @@ public string GetExtensionName([Required] string id)
public IEnumerable GetExtensionIds()
{
- return _extensions?
- .Where(x => x?.Metadata != null && IsExecutionModeCompliant(x.Metadata.Mode))
- .OrderBy(x => x.Metadata.Priority)
+ return GetExtensions()?
.Select(x => x.Metadata.Id)
.Distinct()
.ToArray();
@@ -96,8 +102,7 @@ public string GetExtensionType([Required] string id)
{
string result = null;
- var extension = _extensions?
- .FirstOrDefault(x => (x.Metadata != null) && string.CompareOrdinal(id, x.Metadata.Id) == 0);
+ var extension = GetExtension(id);
if (extension != null)
{
@@ -115,39 +120,33 @@ public string GetExtensionType([Required] string id)
public string GetExtensionAssemblyTitle([Required] string id)
{
- return _extensions?
- .FirstOrDefault(x => (x.Metadata != null) && string.CompareOrdinal(id, x.Metadata.Id) == 0)?
+ return GetExtension(id)?
.Value?
.GetExtensionAssemblyTitle();
}
public IExtensionMetadata GetExtensionMetadata([Required] string id)
{
- return _extensions?
- .FirstOrDefault(x => (x.Metadata != null) && string.CompareOrdinal(id, x.Metadata.Id) == 0)?
- .Metadata;
+ return GetExtension(id)?.Metadata;
}
public IEnumerable> GetExtensions() where T : class, IExtension
{
- return _extensions?
- .Where(x => x?.Metadata != null && IsExecutionModeCompliant(x.Metadata.Mode) && x.Value is T)
- .OrderBy(x => x.Metadata.Priority)
+ return GetExtensions()?
.Distinct(new ExtensionMetadataEqualityComparer())
- .Select(x => new KeyValuePair(x.Metadata, x.Value as T));
+ .Select(x => new KeyValuePair(x.Metadata, x.Value as T))
+ .Where(x => x.Value != null);
}
public T GetExtension([Required] string id) where T : class, IExtension
{
- return _extensions?
- .FirstOrDefault(x => (x?.Metadata != null) && string.CompareOrdinal(id, x.Metadata.Id) == 0)?
- .Value as T;
+ return GetExtension(id)?.Value as T;
}
public T GetExtensionByLabel([Required] string label) where T : class, IExtension
{
- return _extensions?
- .FirstOrDefault(x => (x?.Metadata != null) && string.CompareOrdinal(label, x.Metadata.Label) == 0)?
+ return GetExtensions()?
+ .FirstOrDefault(x => string.CompareOrdinal(label, x.Metadata.Label) == 0)?
.Value as T;
}
@@ -165,6 +164,67 @@ public T GetExtensionByUniversalId([Required] string universalId) where T : c
return result;
}
+ #region Private member functions.
+ private void LoadUniversalIDs()
+ {
+ var extensions = _extensions?.Select(x => x.Value)?.ToArray();
+ if (extensions?.Any() ?? false)
+ {
+ var dict = new Dictionary();
+ foreach (var extension in extensions)
+ {
+ var universalId = extension.GetExtensionUniversalId();
+ if (!string.IsNullOrWhiteSpace(universalId))
+ {
+ dict.Add(universalId, extension.GetExtensionId());
+ }
+ }
+
+ if (dict.Any())
+ {
+ _extensionsByUniversalId = dict;
+ }
+ }
+ }
+
+ [Background]
+ private void LoadHelpConfiguration()
+ {
+ var policy = new HelpTroubleshootPolicy();
+ if (policy.HelpTroubleshoot ?? true)
+ {
+ var assemblies = _catalog.Catalogs.OfType().Select(x => x.Assembly).ToArray();
+ if (assemblies.Any())
+ {
+ foreach (var assembly in assemblies)
+ {
+ LearningManager.Instance.Add(assembly);
+ TroubleshootingManager.Instance.Add(assembly);
+ }
+ LearningManager.Instance.AnalyzeSources();
+ TroubleshootingManager.Instance.AnalyzeSources();
+ }
+ }
+ }
+
+ private IEnumerable> GetExtensions()
+ {
+ var policy = new DisabledExtensionsPolicy();
+ var disabled = policy.DisabledExtensions?.ToArray();
+
+ return _extensions?
+ .Where(x => x?.Metadata != null &&
+ IsExecutionModeCompliant(x.Metadata.Mode) &&
+ !(disabled?.Any(y => string.CompareOrdinal(y, x.Metadata.Label) == 0) ?? false))
+ .OrderBy(x => x.Metadata.Priority);
+ }
+
+ private Lazy GetExtension([Required] string id)
+ {
+ return GetExtensions()?
+ .FirstOrDefault(x => string.CompareOrdinal(id, x.Metadata.Id) == 0);
+ }
+
private bool IsExecutionModeCompliant(ExecutionMode requiredMode)
{
bool result;
@@ -199,44 +259,6 @@ private bool IsExecutionModeCompliant(ExecutionMode requiredMode)
return result;
}
- private void LoadUniversalIDs()
- {
- var extensions = _extensions?.Select(x => x.Value)?.ToArray();
- if (extensions?.Any() ?? false)
- {
- var dict = new Dictionary();
- foreach (var extension in extensions)
- {
- var universalId = extension.GetExtensionUniversalId();
- if (!string.IsNullOrWhiteSpace(universalId))
- {
- dict.Add(universalId, extension.GetExtensionId());
- }
- }
-
- if (dict.Any())
- {
- _extensionsByUniversalId = dict;
- }
- }
- }
-
- [Background]
- private void LoadHelpConfiguration()
- {
- var assemblies = _catalog.Catalogs.OfType().Select(x => x.Assembly).ToArray();
- if (assemblies.Any())
- {
- foreach (var assembly in assemblies)
- {
- LearningManager.Instance.Add(assembly);
- TroubleshootingManager.Instance.Add(assembly);
- }
- LearningManager.Instance.AnalyzeSources();
- TroubleshootingManager.Instance.AnalyzeSources();
- }
- }
-
// From https://stackoverflow.com/questions/540749/can-a-c-sharp-class-inherit-attributes-from-its-interface.
private static IEnumerable GetCustomAttributesIncludingBaseInterfaces(Type type)
{
@@ -246,5 +268,6 @@ private static IEnumerable GetCustomAttributesIncludingBaseInterfaces(Type
SelectMany(interfaceType => interfaceType.GetCustomAttributes(attributeType, true))).
Distinct().Cast();
}
+ #endregion
}
}
diff --git a/Sources/ThreatsManager.Engine/Manager.cs b/Sources/ThreatsManager.Engine/Manager.cs
index 53628670..4dd9ab80 100644
--- a/Sources/ThreatsManager.Engine/Manager.cs
+++ b/Sources/ThreatsManager.Engine/Manager.cs
@@ -5,9 +5,11 @@
using System.Reflection;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
+using System.Xml;
using Newtonsoft.Json;
using PostSharp.Patterns.Contracts;
using ThreatsManager.Engine.Config;
+using ThreatsManager.Engine.Policies;
using ThreatsManager.Interfaces;
using ThreatsManager.Interfaces.Extensions;
using ThreatsManager.Interfaces.Extensions.Actions;
@@ -86,6 +88,49 @@ private Manager()
{
}
+ #region Public members.
+ public static Manager Instance => _instance;
+
+ public ExtensionsConfigurationManager Configuration => _configuration;
+
+ public void LoadExtensions(ExecutionMode mode, Func except = null)
+ {
+ AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += CurrentDomain_ReflectionOnlyAssemblyResolve;
+
+#pragma warning disable SecurityIntelliSenseCS // MS Security rules violation
+ var dir = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Extensions");
+ if (Directory.Exists(dir))
+ {
+ var assemblies =
+ Directory.GetFiles(dir, "ThreatsManager.*.dll");
+ if (assemblies.Any())
+ {
+ foreach (var assembly in assemblies)
+ {
+ _extensionsManager.AddExtensionsAssembly(assembly);
+ }
+ }
+ }
+#pragma warning restore SecurityIntelliSenseCS // MS Security rules violation
+
+ InitializeEngineKnownTypes();
+
+ _configuration = new ExtensionsConfigurationManager();
+ var folders = GetFolders();
+ var prefixes = GetPrefixes();
+ var certificates = GetCertificates();
+ AddAssemblies(folders, prefixes, certificates, except);
+
+ var config = ExtensionsConfigurationManager.GetConfigurationSection();
+ _extensionsManager.Load(!(config?.DisableHelp ?? false));
+ _extensionsManager.SetExecutionMode(mode);
+ _configuration.Initialize(_extensionsManager);
+
+ RegisterContextAwareActionsEventHandlers();
+ RegisterPostLoadProcessorsEventHandlers();
+ }
+ #endregion
+
#region Extensions loading.
static Assembly CurrentDomain_ReflectionOnlyAssemblyResolve(object sender, ResolveEventArgs args)
{
@@ -111,13 +156,16 @@ static Assembly CurrentDomain_ReflectionOnlyAssemblyResolve(object sender, Resol
return result;
}
- private void AddAssemblies(IEnumerable folders, IEnumerable prefixes,
+ private void AddAssemblies(IEnumerable folders, IEnumerable prefixes,
IEnumerable certificates, Func except)
{
if (folders?.Any() ?? false)
{
var platformVersion = Assembly.GetExecutingAssembly().GetName().Version;
+ var policy = new DisabledLibrariesPolicy();
+ var disabled = policy.DisabledLibraries?.ToArray();
+
foreach (var folder in folders)
{
var dlls = GetDlls(folder, prefixes)?.ToArray();
@@ -137,6 +185,17 @@ private void AddAssemblies(IEnumerable folders, IEnumerable pref
bool skip = false;
+ var assemblyTitle = CustomAttributeData.GetCustomAttributes(assembly)
+ .Where(x => x.AttributeType == typeof(AssemblyTitleAttribute))
+ .FirstOrDefault()?
+ .ConstructorArguments[0].Value?
+ .ToString().Replace("ThreatsManager.", "");
+ if (disabled?.Any(x => string.CompareOrdinal(assemblyTitle, x) == 0) ?? false)
+ {
+ skip = true;
+ _showWarning?.Invoke($"Extension library {assembly.FullName} has not been loaded due to a Policy.");
+ }
+
if (except != null && except(assembly))
{
skip = true;
@@ -224,27 +283,27 @@ private VersionCheckOutcome CheckVersion([NotNull] Version platformVersion, [Not
switch (attribute.ConstructorArguments.Count)
{
case 1:
- attrib = new ExtensionsContainerAttribute((string) attribute.ConstructorArguments[0].Value);
+ attrib = new ExtensionsContainerAttribute((string)attribute.ConstructorArguments[0].Value);
break;
case 2:
if (attribute.ConstructorArguments[1].ArgumentType == typeof(string))
{
attrib = new ExtensionsContainerAttribute(
- (string) attribute.ConstructorArguments[0].Value,
- (string) attribute.ConstructorArguments[1].Value);
+ (string)attribute.ConstructorArguments[0].Value,
+ (string)attribute.ConstructorArguments[1].Value);
}
else
{
attrib = new ExtensionsContainerAttribute(
- (string) attribute.ConstructorArguments[0].Value,
- (uint) attribute.ConstructorArguments[1].Value);
+ (string)attribute.ConstructorArguments[0].Value,
+ (uint)attribute.ConstructorArguments[1].Value);
}
break;
case 3:
attrib = new ExtensionsContainerAttribute(
- (string) attribute.ConstructorArguments[0].Value,
- (string) attribute.ConstructorArguments[1].Value,
- (uint) attribute.ConstructorArguments[2].Value);
+ (string)attribute.ConstructorArguments[0].Value,
+ (string)attribute.ConstructorArguments[1].Value,
+ (uint)attribute.ConstructorArguments[2].Value);
break;
}
@@ -330,46 +389,92 @@ private void InitializeKnownTypes([NotNull] Type type)
}
#endregion
- #region Public members.
- public static Manager Instance => _instance;
+ #region Policies.
+ private IEnumerable GetFolders()
+ {
+ IEnumerable result = null;
- public ExtensionsConfigurationManager Configuration => _configuration;
+ var list = new List();
+ var folders = _configuration.Folders?.ToArray();
+ if (folders?.Any() ?? false)
+ {
+ list.AddRange(folders);
+ }
- public void LoadExtensions(ExecutionMode mode, Func except = null)
+ var policy = new FoldersPolicy();
+ var additional = policy.Folders?.ToArray();
+
+ if (additional?.Any() ?? false)
+ {
+ foreach (var item in additional)
+ {
+ if (!list.Any(x => string.CompareOrdinal(item?.ToLower(), x?.ToLower()) == 0))
+ list.Add(item);
+ }
+ }
+
+ if (list.Any())
+ result = list.AsEnumerable();
+
+ return result;
+ }
+
+ private IEnumerable GetPrefixes()
{
- AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += CurrentDomain_ReflectionOnlyAssemblyResolve;
+ IEnumerable result = null;
-#pragma warning disable SecurityIntelliSenseCS // MS Security rules violation
- var dir = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Extensions");
- if (Directory.Exists(dir))
+ var list = new List();
+ var prefixes = _configuration.Prefixes?.ToArray();
+ if (prefixes?.Any() ?? false)
{
- var assemblies =
- Directory.GetFiles(dir, "ThreatsManager.*.dll");
- if (assemblies.Any())
+ list.AddRange(prefixes);
+ }
+
+ var policy = new PrefixesPolicy();
+ var additional = policy.Prefixes?.ToArray();
+
+ if (additional?.Any() ?? false)
+ {
+ foreach (var item in additional)
{
- foreach (var assembly in assemblies)
- {
- _extensionsManager.AddExtensionsAssembly(assembly);
- }
+ if (!list.Any(x => string.CompareOrdinal(item?.ToLower(), x?.ToLower()) == 0))
+ list.Add(item);
}
}
-#pragma warning restore SecurityIntelliSenseCS // MS Security rules violation
- InitializeEngineKnownTypes();
+ if (list.Any())
+ result = list.AsEnumerable();
- _configuration = new ExtensionsConfigurationManager();
- var folders = _configuration.Folders;
- var prefixes = _configuration.Prefixes;
- var certificates = _configuration.Certificates;
- AddAssemblies(folders, prefixes, certificates, except);
+ return result;
+ }
- var config = ExtensionsConfigurationManager.GetConfigurationSection();
- _extensionsManager.Load(!(config?.DisableHelp ?? false));
- _extensionsManager.SetExecutionMode(mode);
- _configuration.Initialize(_extensionsManager);
+ private IEnumerable GetCertificates()
+ {
+ IEnumerable result = null;
- RegisterContextAwareActionsEventHandlers();
- RegisterPostLoadProcessorsEventHandlers();
+ var requireCertsPolicy = new RequireCertsPolicy();
+ if (requireCertsPolicy.RequireCerts ?? true)
+ {
+ var list = new List();
+ var certificates = _configuration.Certificates?.ToArray();
+ if (certificates?.Any() ?? false)
+ {
+ list.AddRange(certificates);
+ }
+
+ var policy = new CertificatesPolicy();
+ var additional = policy.Certificates?.ToArray();
+
+ if (additional?.Any() ?? false)
+ {
+ list.AddRange(additional);
+ }
+
+ if (list.Any())
+ result = list.AsEnumerable();
+ }
+
+ return result;
}
#endregion
diff --git a/Sources/ThreatsManager.Engine/ObjectModel/Properties/PropertySchema.PropertyTypes.cs b/Sources/ThreatsManager.Engine/ObjectModel/Properties/PropertySchema.PropertyTypes.cs
index d005ed39..3d892abb 100644
--- a/Sources/ThreatsManager.Engine/ObjectModel/Properties/PropertySchema.PropertyTypes.cs
+++ b/Sources/ThreatsManager.Engine/ObjectModel/Properties/PropertySchema.PropertyTypes.cs
@@ -61,10 +61,11 @@ public IPropertyType AddPropertyType([Required] string name, PropertyValueType t
UndoRedoManager.Attach(result, Model);
_propertyTypes.Add(result);
scope?.Complete();
-
- PropertyTypeAdded?.Invoke(this, result);
}
}
+
+ if (result != null)
+ PropertyTypeAdded?.Invoke(this, result);
}
return result;
@@ -85,10 +86,10 @@ public bool RemovePropertyType(Guid id)
{
UndoRedoManager.Detach(propertyType);
scope?.Complete();
-
- PropertyTypeRemoved?.Invoke(this, propertyType);
}
}
+ if (result)
+ PropertyTypeRemoved?.Invoke(this, propertyType);
}
return result;
diff --git a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Actors.cs b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Actors.cs
index 1c7c1120..fb47708e 100644
--- a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Actors.cs
+++ b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Actors.cs
@@ -49,9 +49,9 @@ public void Add([NotNull] IThreatActor actor)
UndoRedoManager.Attach(a, this);
_actors.Add(a);
scope?.Complete();
-
- ChildCreated?.Invoke(a);
}
+
+ ChildCreated?.Invoke(a);
}
else
throw new ArgumentException(nameof(actor));
diff --git a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Entities.cs b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Entities.cs
index 3b694fb7..8825f1dd 100644
--- a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Entities.cs
+++ b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Entities.cs
@@ -269,11 +269,13 @@ public bool RemoveEntity(Guid id)
UndoRedoManager.Detach(entity);
UnregisterEvents(entity);
- ChildRemoved?.Invoke(entity);
}
scope?.Complete();
}
+
+ if (result)
+ ChildRemoved?.Invoke(entity);
}
return result;
diff --git a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.EntityTemplates.cs b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.EntityTemplates.cs
index 54b0db21..a8a6f59c 100644
--- a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.EntityTemplates.cs
+++ b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.EntityTemplates.cs
@@ -49,9 +49,9 @@ public void Add([NotNull] IEntityTemplate entityTemplate)
UndoRedoManager.Attach(entityTemplate, this);
_entityTemplates.Add(entityTemplate);
scope?.Complete();
-
- ChildCreated?.Invoke(entityTemplate);
}
+
+ ChildCreated?.Invoke(entityTemplate);
}
[InitializationRequired]
@@ -150,10 +150,11 @@ public bool RemoveEntityTemplate(Guid id)
{
UndoRedoManager.Detach(template);
scope?.Complete();
-
- ChildRemoved?.Invoke(template);
}
}
+
+ if (result)
+ ChildRemoved?.Invoke(template);
}
return result;
diff --git a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.FlowTemplates.cs b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.FlowTemplates.cs
index 8afa0b85..05674825 100644
--- a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.FlowTemplates.cs
+++ b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.FlowTemplates.cs
@@ -42,9 +42,9 @@ public void Add([NotNull] IFlowTemplate flowTemplate)
UndoRedoManager.Attach(ft, this);
_flowTemplates.Add(ft);
scope?.Complete();
-
- ChildCreated?.Invoke(ft);
}
+
+ ChildCreated?.Invoke(ft);
}
else
throw new ArgumentException(nameof(flowTemplate));
@@ -80,10 +80,11 @@ public bool RemoveFlowTemplate(Guid id)
{
UndoRedoManager.Detach(template);
scope?.Complete();
-
- ChildRemoved?.Invoke(template);
}
}
+
+ if (result)
+ ChildRemoved?.Invoke(template);
}
return result;
diff --git a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Groups.cs b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Groups.cs
index 45e3c1b9..c458fdb2 100644
--- a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Groups.cs
+++ b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Groups.cs
@@ -172,11 +172,13 @@ public bool RemoveGroup(Guid id)
UndoRedoManager.Detach(item);
UnregisterEvents(item);
- ChildRemoved?.Invoke(item);
}
scope?.Complete();
}
+
+ if (result)
+ ChildRemoved?.Invoke(item);
}
return result;
diff --git a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Mitigations.cs b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Mitigations.cs
index 4750137a..46b4b506 100644
--- a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Mitigations.cs
+++ b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Mitigations.cs
@@ -49,9 +49,9 @@ public void Add([NotNull] IMitigation mitigation)
UndoRedoManager.Attach(m, this);
_mitigations.Add(m);
scope?.Complete();
-
- ChildCreated?.Invoke(m);
}
+
+ ChildCreated?.Invoke(m);
}
else
throw new ArgumentException(nameof(mitigation));
@@ -89,11 +89,13 @@ public bool RemoveMitigation(Guid id, bool force = false)
{
UndoRedoManager.Detach(mitigation);
UnregisterEvents(mitigation);
- ChildRemoved?.Invoke(mitigation);
}
scope?.Complete();
}
+
+ if (result)
+ ChildRemoved?.Invoke(mitigation);
}
return result;
diff --git a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.PropertySchemas.cs b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.PropertySchemas.cs
index 6d6d1c8e..eee0839e 100644
--- a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.PropertySchemas.cs
+++ b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.PropertySchemas.cs
@@ -978,10 +978,12 @@ public IPropertySchema AddSchema([Required] string name, [Required] string nspac
Add(result);
RegisterEvents(result);
scope?.Complete();
- ChildCreated?.Invoke(result);
}
}
+ if (result != null)
+ ChildCreated?.Invoke(result);
+
return result;
}
@@ -1028,11 +1030,13 @@ private bool RemoveSchema([NotNull] IPropertySchema schema, bool force)
{
UndoRedoManager.Detach(s);
UnregisterEvents(s);
- ChildRemoved?.Invoke(s);
}
scope?.Complete();
}
+
+ if (result)
+ ChildRemoved?.Invoke(s);
}
return result;
diff --git a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Severities.cs b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Severities.cs
index 3afff8a0..e294cf5e 100644
--- a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Severities.cs
+++ b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Severities.cs
@@ -100,9 +100,9 @@ public void Add([NotNull] ISeverity severity)
UndoRedoManager.Attach(sd, this);
_severities.Add(sd);
scope?.Complete();
-
- _severityCreated?.Invoke(sd);
}
+
+ _severityCreated?.Invoke(sd);
}
else
throw new ArgumentException(nameof(severity));
@@ -151,11 +151,11 @@ public bool RemoveSeverity(int id)
{
UndoRedoManager.Detach(definition);
scope?.Complete();
-
- UnregisterEvents(definition);
- _severityRemoved?.Invoke(definition);
}
}
+
+ UnregisterEvents(definition);
+ _severityRemoved?.Invoke(definition);
}
return result;
diff --git a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Strengths.cs b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Strengths.cs
index e1b7bc53..c1c44877 100644
--- a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Strengths.cs
+++ b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Strengths.cs
@@ -99,9 +99,9 @@ public void Add([NotNull] IStrength strength)
UndoRedoManager.Attach(sd, this);
_strengths.Add(sd);
scope?.Complete();
-
- _strengthCreated?.Invoke(sd);
}
+
+ _strengthCreated?.Invoke(sd);
}
else
throw new ArgumentException(nameof(strength));
@@ -149,10 +149,11 @@ public bool RemoveStrength(int id)
{
UndoRedoManager.Detach(definition);
scope?.Complete();
-
- _strengthRemoved?.Invoke(definition);
}
}
+
+ if (result)
+ _strengthRemoved?.Invoke(definition);
}
return result;
diff --git a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.ThreatTypes.cs b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.ThreatTypes.cs
index 2d4836a1..ad4b5513 100644
--- a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.ThreatTypes.cs
+++ b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.ThreatTypes.cs
@@ -107,9 +107,9 @@ public void Add([NotNull] IThreatType threatType)
UndoRedoManager.Attach(tt, this);
_threatTypes.Add(tt);
scope?.Complete();
-
- ChildCreated?.Invoke(tt);
}
+
+ ChildCreated?.Invoke(tt);
}
else
throw new ArgumentException(nameof(threatType));
@@ -148,11 +148,13 @@ public bool RemoveThreatType(Guid id, bool force = false)
{
UndoRedoManager.Detach(threatType);
UnregisterEvents(threatType);
- ChildRemoved?.Invoke(threatType);
}
scope?.Complete();
}
+
+ if (result)
+ ChildRemoved?.Invoke(threatType);
}
return result;
diff --git a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.TrustBoundaryTemplates.cs b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.TrustBoundaryTemplates.cs
index 8bca6e3c..37345e00 100644
--- a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.TrustBoundaryTemplates.cs
+++ b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.TrustBoundaryTemplates.cs
@@ -40,9 +40,9 @@ public void Add([NotNull] ITrustBoundaryTemplate trustBoundaryTemplate)
UndoRedoManager.Attach(tbt, this);
_trustBoundaryTemplates.Add(tbt);
scope?.Complete();
-
- ChildCreated?.Invoke(trustBoundaryTemplate);
}
+
+ ChildCreated?.Invoke(trustBoundaryTemplate);
}
else
throw new ArgumentException(nameof(trustBoundaryTemplate));
@@ -77,10 +77,11 @@ public bool RemoveTrustBoundaryTemplate(Guid id)
{
UndoRedoManager.Detach(template);
scope?.Complete();
-
- ChildRemoved?.Invoke(template);
}
}
+
+ if (result)
+ ChildRemoved?.Invoke(template);
}
return result;
diff --git a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Weaknesses.cs b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Weaknesses.cs
index 653cb49a..026b17b4 100644
--- a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Weaknesses.cs
+++ b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.Weaknesses.cs
@@ -107,9 +107,9 @@ public void Add([NotNull] IWeakness weakness)
UndoRedoManager.Attach(w, this);
_weaknesses.Add(w);
scope?.Complete();
-
- ChildCreated?.Invoke(w);
}
+
+ ChildCreated?.Invoke(w);
}
else
throw new ArgumentException(nameof(weakness));
@@ -148,11 +148,13 @@ public bool RemoveWeakness(Guid id, bool force = false)
{
UndoRedoManager.Detach(weakness);
UnregisterEvents(weakness);
- ChildRemoved?.Invoke(weakness);
}
scope?.Complete();
}
+
+ if (result)
+ ChildRemoved?.Invoke(weakness);
}
return result;
diff --git a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.cs b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.cs
index 5858d9bb..1e42b2ff 100644
--- a/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.cs
+++ b/Sources/ThreatsManager.Engine/ObjectModel/ThreatModel.cs
@@ -262,49 +262,53 @@ public bool ChangeDependency([Required] string oldText, [Required] string newTex
public void ExecutePostDeserialization()
{
- if (_legacyContributors?.Any() ?? false)
+ using (var scope = UndoRedoManager.OpenScope("Execute Post Deserialization"))
{
- if (_contributors == null)
- _contributors = new AdvisableCollection();
-
- foreach (var contrib in _legacyContributors)
+ if (_legacyContributors?.Any() ?? false)
{
- var r = new RecordableString(contrib);
- UndoRedoManager.Attach(r, this);
- _contributors.Add(r);
- }
+ if (_contributors == null)
+ _contributors = new AdvisableCollection();
- _legacyContributors.Clear();
- }
+ foreach (var contrib in _legacyContributors)
+ {
+ var r = new RecordableString(contrib);
+ UndoRedoManager.Attach(r, this);
+ _contributors.Add(r);
+ }
- if (_legacyAssumptions?.Any() ?? false)
- {
- if (_assumptions == null)
- _assumptions = new AdvisableCollection();
+ _legacyContributors.Clear();
+ }
- foreach (var assump in _legacyAssumptions)
+ if (_legacyAssumptions?.Any() ?? false)
{
- var r = new RecordableString(assump);
- UndoRedoManager.Attach(r, this);
- _assumptions.Add(r);
- }
+ if (_assumptions == null)
+ _assumptions = new AdvisableCollection();
- _legacyAssumptions.Clear();
- }
+ foreach (var assump in _legacyAssumptions)
+ {
+ var r = new RecordableString(assump);
+ UndoRedoManager.Attach(r, this);
+ _assumptions.Add(r);
+ }
- if (_legacyDependencies?.Any() ?? false)
- {
- if (_dependencies == null)
- _dependencies = new AdvisableCollection();
+ _legacyAssumptions.Clear();
+ }
- foreach (var depend in _legacyDependencies)
+ if (_legacyDependencies?.Any() ?? false)
{
- var r = new RecordableString(depend);
- UndoRedoManager.Attach(r, this);
- _dependencies.Add(r);
- }
+ if (_dependencies == null)
+ _dependencies = new AdvisableCollection();
+
+ foreach (var depend in _legacyDependencies)
+ {
+ var r = new RecordableString(depend);
+ UndoRedoManager.Attach(r, this);
+ _dependencies.Add(r);
+ }
- _legacyDependencies.Clear();
+ _legacyDependencies.Clear();
+ }
+ scope?.Complete();
}
}
diff --git a/Sources/ThreatsManager.Engine/ObjectModel/ThreatsMitigations/ThreatType.Mitigations.cs b/Sources/ThreatsManager.Engine/ObjectModel/ThreatsMitigations/ThreatType.Mitigations.cs
index 89422e8e..7f30faf8 100644
--- a/Sources/ThreatsManager.Engine/ObjectModel/ThreatsMitigations/ThreatType.Mitigations.cs
+++ b/Sources/ThreatsManager.Engine/ObjectModel/ThreatsMitigations/ThreatType.Mitigations.cs
@@ -108,10 +108,11 @@ public bool RemoveMitigation(Guid mitigationId)
{
UndoRedoManager.Detach(mitigation);
scope?.Complete();
-
- _threatTypeMitigationRemoved?.Invoke(this, mitigation);
}
}
+
+ if (result)
+ _threatTypeMitigationRemoved?.Invoke(this, mitigation);
}
return result;
diff --git a/Sources/ThreatsManager.Engine/ObjectModel/ThreatsMitigations/ThreatType.Weaknesses.cs b/Sources/ThreatsManager.Engine/ObjectModel/ThreatsMitigations/ThreatType.Weaknesses.cs
index 15cd48a2..537a4643 100644
--- a/Sources/ThreatsManager.Engine/ObjectModel/ThreatsMitigations/ThreatType.Weaknesses.cs
+++ b/Sources/ThreatsManager.Engine/ObjectModel/ThreatsMitigations/ThreatType.Weaknesses.cs
@@ -108,10 +108,11 @@ public bool RemoveWeakness(Guid weaknessId)
{
UndoRedoManager.Detach(weakness);
scope?.Complete();
-
- _threatTypeWeaknessRemoved?.Invoke(this, weakness);
}
}
+
+ if (result)
+ _threatTypeWeaknessRemoved?.Invoke(this, weakness);
}
return result;
diff --git a/Sources/ThreatsManager.Engine/ObjectModel/ThreatsMitigations/Weakness.Mitigations.cs b/Sources/ThreatsManager.Engine/ObjectModel/ThreatsMitigations/Weakness.Mitigations.cs
index 291b7a08..789147af 100644
--- a/Sources/ThreatsManager.Engine/ObjectModel/ThreatsMitigations/Weakness.Mitigations.cs
+++ b/Sources/ThreatsManager.Engine/ObjectModel/ThreatsMitigations/Weakness.Mitigations.cs
@@ -108,10 +108,11 @@ public bool RemoveMitigation(Guid mitigationId)
{
UndoRedoManager.Detach(mitigation);
scope?.Complete();
-
- _weaknessMitigationRemoved?.Invoke(this, mitigation);
}
}
+
+ if (result)
+ _weaknessMitigationRemoved?.Invoke(this, mitigation);
}
return result;
diff --git a/Sources/ThreatsManager.Engine/Policies/CertificatesPolicy.cs b/Sources/ThreatsManager.Engine/Policies/CertificatesPolicy.cs
new file mode 100644
index 00000000..9e855300
--- /dev/null
+++ b/Sources/ThreatsManager.Engine/Policies/CertificatesPolicy.cs
@@ -0,0 +1,50 @@
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.RegularExpressions;
+using ThreatsManager.Engine.Config;
+using ThreatsManager.Utilities;
+
+namespace ThreatsManager.Engine.Policies
+{
+ public class CertificatesPolicy : Policy
+ {
+ protected override string PolicyName => "Certificates";
+
+ public IEnumerable Certificates
+ {
+ get
+ {
+ IEnumerable result = null;
+
+ var rows = StringArrayValue;
+ if (rows?.Any() ?? false)
+ {
+ List certificates = null;
+ Regex regex = new Regex(@"();
+
+ var cert = new CertificateConfig()
+ {
+ Thumbprint = match.Groups["thumbprint"]?.Value,
+ Subject = match.Groups["subject"]?.Value,
+ Issuer = match.Groups["issuer"]?.Value,
+ ExpirationDate = match.Groups["expiration"]?.Value
+ };
+ certificates.Add(cert);
+ }
+ }
+
+ result = certificates?.ToArray();
+ }
+
+ return result;
+ }
+ }
+ }
+}
diff --git a/Sources/ThreatsManager.Engine/Policies/DisabledExtensionsPolicy.cs b/Sources/ThreatsManager.Engine/Policies/DisabledExtensionsPolicy.cs
new file mode 100644
index 00000000..6fa629ca
--- /dev/null
+++ b/Sources/ThreatsManager.Engine/Policies/DisabledExtensionsPolicy.cs
@@ -0,0 +1,12 @@
+using System.Collections.Generic;
+using ThreatsManager.Utilities;
+
+namespace ThreatsManager.Engine.Policies
+{
+ public class DisabledExtensionsPolicy : Policy
+ {
+ protected override string PolicyName => "DisabledExtensions";
+
+ public IEnumerable DisabledExtensions => StringArrayValue;
+ }
+}
diff --git a/Sources/ThreatsManager.Engine/Policies/DisabledLibrariesPolicy.cs b/Sources/ThreatsManager.Engine/Policies/DisabledLibrariesPolicy.cs
new file mode 100644
index 00000000..f22045ef
--- /dev/null
+++ b/Sources/ThreatsManager.Engine/Policies/DisabledLibrariesPolicy.cs
@@ -0,0 +1,12 @@
+using System.Collections.Generic;
+using ThreatsManager.Utilities;
+
+namespace ThreatsManager.Engine.Policies
+{
+ public class DisabledLibrariesPolicy : Policy
+ {
+ protected override string PolicyName => "DisabledLibraries";
+
+ public IEnumerable DisabledLibraries => StringArrayValue;
+ }
+}
diff --git a/Sources/ThreatsManager.Engine/Policies/FoldersPolicy.cs b/Sources/ThreatsManager.Engine/Policies/FoldersPolicy.cs
new file mode 100644
index 00000000..f8895716
--- /dev/null
+++ b/Sources/ThreatsManager.Engine/Policies/FoldersPolicy.cs
@@ -0,0 +1,18 @@
+using System.Collections.Generic;
+using ThreatsManager.Utilities;
+
+namespace ThreatsManager.Engine.Policies
+{
+ ///
+ /// Additional folders where the Extension libraries must be searched.
+ ///
+ /// It includes a folder in each line.Do not include quotes or double quotes.
+ /// This policy integrates and extends the corresponding setting in TMS, it does not replace it.
+ ///
+ public class FoldersPolicy : Policy
+ {
+ protected override string PolicyName => "Folders";
+
+ public IEnumerable Folders => StringArrayValue;
+ }
+}
diff --git a/Sources/ThreatsManager.Engine/Policies/MaxExecutionModePolicy.cs b/Sources/ThreatsManager.Engine/Policies/MaxExecutionModePolicy.cs
new file mode 100644
index 00000000..e040bd5e
--- /dev/null
+++ b/Sources/ThreatsManager.Engine/Policies/MaxExecutionModePolicy.cs
@@ -0,0 +1,27 @@
+using System;
+using ThreatsManager.Interfaces;
+using ThreatsManager.Utilities;
+
+namespace ThreatsManager.Engine.Policies
+{
+ public class MaxExecutionModePolicy : Policy
+ {
+ protected override string PolicyName => "MaxExecutionMode";
+
+ public ExecutionMode? MaxExecutionMode
+ {
+ get
+ {
+ ExecutionMode? result = null;
+
+ var fromRegistry = Value as string;
+ if (fromRegistry != null && Enum.TryParse(fromRegistry, out var maxExecutionMode))
+ {
+ result = maxExecutionMode;
+ }
+
+ return result;
+ }
+ }
+ }
+}
diff --git a/Sources/ThreatsManager.Engine/Policies/PrefixesPolicy.cs b/Sources/ThreatsManager.Engine/Policies/PrefixesPolicy.cs
new file mode 100644
index 00000000..056e7792
--- /dev/null
+++ b/Sources/ThreatsManager.Engine/Policies/PrefixesPolicy.cs
@@ -0,0 +1,20 @@
+using System.Collections.Generic;
+using ThreatsManager.Utilities;
+
+namespace ThreatsManager.Engine.Policies
+{
+ ///
+ /// Additional prefixes allowed for the Extension libraries.
+ ///
+ ///
+ /// It is not necessary to configure Prefixes for the default prefix used for the standard Extension libraries(“ThreatsManager”).
+ /// It includes an allowed prefix in each line. Do not include quotes or double quotes.
+ /// This policy integrates and extends the corresponding setting in TMS, it does not replace it.
+ ///
+ public class PrefixesPolicy : Policy
+ {
+ protected override string PolicyName => "Prefixes";
+
+ public IEnumerable Prefixes => StringArrayValue;
+ }
+}
diff --git a/Sources/ThreatsManager.Engine/Policies/RequireCertsPolicy.cs b/Sources/ThreatsManager.Engine/Policies/RequireCertsPolicy.cs
new file mode 100644
index 00000000..5c4c1271
--- /dev/null
+++ b/Sources/ThreatsManager.Engine/Policies/RequireCertsPolicy.cs
@@ -0,0 +1,11 @@
+using ThreatsManager.Utilities;
+
+namespace ThreatsManager.Engine.Policies
+{
+ public class RequireCertsPolicy : Policy
+ {
+ protected override string PolicyName => "RequireCerts";
+
+ public bool? RequireCerts => BoolValue;
+ }
+}
diff --git a/Sources/ThreatsManager.Engine/ThreatsManager.Engine.csproj b/Sources/ThreatsManager.Engine/ThreatsManager.Engine.csproj
index 02146fac..fd6d2f6f 100644
--- a/Sources/ThreatsManager.Engine/ThreatsManager.Engine.csproj
+++ b/Sources/ThreatsManager.Engine/ThreatsManager.Engine.csproj
@@ -3,15 +3,15 @@
net481
Threats Manager Platform Engine.
- 2.1.1.0
+ 2.1.2.0
Simone Curzi
Simone Curzi
Threats Manager Platform
Copyright © Simone Curzi, 2018-2023. All Rights Reserved.
https://www.nuget.org/packages/ThreatsManager.Engine/
https://github.com/simonec73/threatsmanager
- 2.1.1.0
- 2.1.1
+ 2.1.2.0
+ 2.1.2
true
ThreatsManager.snk
false
diff --git a/Sources/ThreatsManager.Interfaces/Extensions/IPolicy.cs b/Sources/ThreatsManager.Interfaces/Extensions/IPolicy.cs
new file mode 100644
index 00000000..f07eb7b3
--- /dev/null
+++ b/Sources/ThreatsManager.Interfaces/Extensions/IPolicy.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ThreatsManager.Interfaces.Extensions
+{
+ ///
+ /// Policies are used to enforce settings defined by the organization.
+ ///
+ /// The actual value of the setting is specific to the Policy itself, and must be read-only
+ /// from some protected source. Policies will typically use values in the Registry
+ /// under "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Simone Curzi\Threats Manager Studio\Policies".
+ /// The recommended way to create a Policy is to create a class derived from ThreatsManager.Utilities.Policy.
+ [ExtensionDescription("Extension Initializer")]
+ public interface IPolicy : IExtension
+ {
+ ///
+ /// Property returning true if the Policy is defined.
+ ///
+ bool IsDefined { get; }
+
+ ///
+ /// Value of the Policy.
+ ///
+ object Value { get; }
+ }
+}
diff --git a/Sources/ThreatsManager.Interfaces/ThreatsManager.Interfaces.csproj b/Sources/ThreatsManager.Interfaces/ThreatsManager.Interfaces.csproj
index dd0dff3a..c51de857 100644
--- a/Sources/ThreatsManager.Interfaces/ThreatsManager.Interfaces.csproj
+++ b/Sources/ThreatsManager.Interfaces/ThreatsManager.Interfaces.csproj
@@ -3,15 +3,15 @@
net481
Common Interfaces used to define the object, entities and extensions that compose the Threats Manager Platform and allow to extend it.
- 2.1.1.0
+ 2.1.2.0
Simone Curzi
Simone Curzi
Threats Manager Platform
Copyright © Simone Curzi, 2018-2023. All Rights Reserved.
https://www.nuget.org/packages/ThreatsManager.Interfaces/
https://github.com/simonec73/threatsmanager
- 2.1.1.0
- 2.1.1
+ 2.1.2.0
+ 2.1.2
false
false
$(NoWarn);NU1505
diff --git a/Sources/ThreatsManager.Utilities/Aspects/Engine/PropertiesContainerAspect.cs b/Sources/ThreatsManager.Utilities/Aspects/Engine/PropertiesContainerAspect.cs
index 00b7ed26..bf0b5cbe 100644
--- a/Sources/ThreatsManager.Utilities/Aspects/Engine/PropertiesContainerAspect.cs
+++ b/Sources/ThreatsManager.Utilities/Aspects/Engine/PropertiesContainerAspect.cs
@@ -7,7 +7,6 @@
using PostSharp.Aspects.Advices;
using PostSharp.Aspects.Dependencies;
using PostSharp.Patterns.Collections;
-using PostSharp.Patterns.Model;
using PostSharp.Reflection;
using PostSharp.Serialization;
using ThreatsManager.Interfaces;
@@ -229,13 +228,16 @@ private IProperty InternalAddProperty(IPropertyType propertyType, string value)
UndoRedoManager.Attach(result, model);
properties?.Add(result);
scope?.Complete();
-
- if (Instance is IPropertiesContainer container)
- _propertyAdded?.Invoke(container, result);
- result.Changed += OnPropertyChanged;
}
}
+ if (result != null)
+ {
+ if (Instance is IPropertiesContainer container)
+ _propertyAdded?.Invoke(container, result);
+ result.Changed += OnPropertyChanged;
+ }
+
return result;
}
diff --git a/Sources/ThreatsManager.Utilities/CloningExtensions.cs b/Sources/ThreatsManager.Utilities/CloningExtensions.cs
index 9ece6eea..8ceb6930 100644
--- a/Sources/ThreatsManager.Utilities/CloningExtensions.cs
+++ b/Sources/ThreatsManager.Utilities/CloningExtensions.cs
@@ -1,7 +1,4 @@
-using System;
-using System.Linq;
-using System.Reflection;
-using System.Xml.Linq;
+using System.Linq;
using PostSharp.Patterns.Contracts;
using ThreatsManager.Interfaces.ObjectModel;
using ThreatsManager.Interfaces.ObjectModel.Entities;
@@ -27,43 +24,48 @@ public static void CloneProperties(this IPropertiesContainer source,
if ((properties?.Any() ?? false) &&
target is IThreatModelChild child)
{
- if (child.Model is IThreatModel model &&
- properties.FirstOrDefault()?.Model is IThreatModel sourceModel)
+ using (var scope = UndoRedoManager.OpenScope("Clone Properties"))
{
- foreach (var property in properties)
+ if (child.Model is IThreatModel model &&
+ properties.FirstOrDefault()?.Model is IThreatModel sourceModel)
{
- if (property.PropertyType is IPropertyType sourcePropertyType &&
- sourceModel.GetSchema(sourcePropertyType.SchemaId) is IPropertySchema sourceSchema)
+ foreach (var property in properties)
{
- if (model.GetSchema(sourceSchema.Name, sourceSchema.Namespace) is IPropertySchema targetSchema &&
- (model.Id == sourceModel.Id || !targetSchema.NotExportable))
+ if (property.PropertyType is IPropertyType sourcePropertyType &&
+ sourceModel.GetSchema(sourcePropertyType.SchemaId) is IPropertySchema sourceSchema)
{
- var propertyType = targetSchema.GetPropertyType(sourcePropertyType.Name);
- if (propertyType != null)
+ if (model.GetSchema(sourceSchema.Name, sourceSchema.Namespace) is IPropertySchema targetSchema &&
+ (model.Id == sourceModel.Id || !sourceSchema.NotExportable))
{
- var propertyTarget = target.GetProperty(propertyType);
- if (propertyTarget == null)
- target.AddProperty(propertyType, property.StringValue);
- else
- propertyTarget.StringValue = property.StringValue;
+ var propertyType = targetSchema.GetPropertyType(sourcePropertyType.Name);
+ if (propertyType != null)
+ {
+ var propertyTarget = target.GetProperty(propertyType);
+ if (propertyTarget == null)
+ target.AddProperty(propertyType, property.StringValue);
+ else
+ propertyTarget.StringValue = property.StringValue;
+ }
}
}
}
}
- }
- else
- {
- foreach (var property in properties)
+ else
{
- if (property.PropertyType is IPropertyType propertyType)
+ foreach (var property in properties)
{
- var propertyTarget = target.GetProperty(propertyType);
- if (propertyTarget == null)
- target.AddProperty(propertyType, property.StringValue);
- else
- propertyTarget.StringValue = property.StringValue;
+ if (property.PropertyType is IPropertyType propertyType)
+ {
+ var propertyTarget = target.GetProperty(propertyType);
+ if (propertyTarget == null)
+ target.AddProperty(propertyType, property.StringValue);
+ else
+ propertyTarget.StringValue = property.StringValue;
+ }
}
}
+
+ scope?.Complete();
}
}
}
@@ -79,9 +81,13 @@ public static void CloneThreatEvents(this IThreatEventsContainer source,
var threatEvents = source?.ThreatEvents?.ToArray();
if (threatEvents?.Any() ?? false)
{
- foreach (var threatEvent in threatEvents)
+ using (var scope = UndoRedoManager.OpenScope("Clone Threat Events"))
{
- threatEvent.Clone(target);
+ foreach (var threatEvent in threatEvents)
+ {
+ threatEvent.Clone(target);
+ }
+ scope?.Complete();
}
}
}
@@ -97,9 +103,13 @@ public static void ClonePropertyTypes(this IPropertyTypesContainer source,
var propertyTypes = source?.PropertyTypes?.ToArray();
if (propertyTypes?.Any() ?? false)
{
- foreach (var propertyType in propertyTypes)
+ using (var scope = UndoRedoManager.OpenScope("Clone Property Types"))
{
- propertyType.Clone(target);
+ foreach (var propertyType in propertyTypes)
+ {
+ propertyType.Clone(target);
+ }
+ scope?.Complete();
}
}
}
@@ -115,11 +125,15 @@ public static void MergePropertyTypes(this IPropertyTypesContainer target,
var propertyTypes = source?.PropertyTypes?.ToArray();
if (propertyTypes?.Any() ?? false)
{
- foreach (var propertyType in propertyTypes)
+ using (var scope = UndoRedoManager.OpenScope("Merge Property Types"))
{
- var targetPropertyType = target.GetPropertyType(propertyType.Name);
- if (targetPropertyType == null)
- propertyType.Clone(target);
+ foreach (var propertyType in propertyTypes)
+ {
+ var targetPropertyType = target.GetPropertyType(propertyType.Name);
+ if (targetPropertyType == null)
+ propertyType.Clone(target);
+ }
+ scope?.Complete();
}
}
}
@@ -139,37 +153,42 @@ sourceChild.Model is IThreatModel sourceModel &&
target is IThreatModelChild targetChild &&
targetChild.Model is IThreatModel targetModel)
{
- foreach (var property in properties)
+ using (var scope = UndoRedoManager.OpenScope("Merge Property Types"))
{
- var sourcePropertyType = property.PropertyType;
- if (sourcePropertyType != null)
+ foreach (var property in properties)
{
- var sourceSchema = sourceModel.GetSchema(sourcePropertyType.SchemaId);
- if (sourceSchema != null)
+ var sourcePropertyType = property.PropertyType;
+ if (sourcePropertyType != null)
{
- var targetSchema = targetModel.GetSchema(sourceSchema.Name, sourceSchema.Namespace) ??
- sourceSchema.Clone(targetModel);
+ var sourceSchema = sourceModel.GetSchema(sourcePropertyType.SchemaId);
+ if (sourceSchema != null)
+ {
+ var targetSchema = targetModel.GetSchema(sourceSchema.Name, sourceSchema.Namespace) ??
+ sourceSchema.Clone(targetModel);
- var targetPropertyType = targetSchema.GetPropertyType(sourcePropertyType.Name) ??
- sourcePropertyType.Clone(targetSchema);
+ var targetPropertyType = targetSchema.GetPropertyType(sourcePropertyType.Name) ??
+ sourcePropertyType.Clone(targetSchema);
- var targetProperty = target.GetProperty(targetPropertyType);
- if (targetProperty == null)
- {
- target.AddProperty(targetPropertyType, property.StringValue);
- }
- else
- {
- if (targetProperty is IPropertyJsonSerializableObject jsonSerializableObject &&
- jsonSerializableObject.Value is IMergeable mergeable &&
- property is IPropertyJsonSerializableObject sourceJsonSerializableObject &&
- sourceJsonSerializableObject.Value is IMergeable sourceMergeable)
+ var targetProperty = target.GetProperty(targetPropertyType);
+ if (targetProperty == null)
+ {
+ target.AddProperty(targetPropertyType, property.StringValue);
+ }
+ else
{
- mergeable.Merge(sourceMergeable);
+ if (targetProperty is IPropertyJsonSerializableObject jsonSerializableObject &&
+ jsonSerializableObject.Value is IMergeable mergeable &&
+ property is IPropertyJsonSerializableObject sourceJsonSerializableObject &&
+ sourceJsonSerializableObject.Value is IMergeable sourceMergeable)
+ {
+ mergeable.Merge(sourceMergeable);
+ }
}
}
}
}
+
+ scope?.Complete();
}
}
}
@@ -188,35 +207,42 @@ public static IEntity CloneAndConvert(this IEntity source,
if (source != null && source.Model is IThreatModel model)
{
+ var newName = $"{source.Name} (copy)";
using (var scope = UndoRedoManager.OpenScope("Clone and convert Entity"))
{
if (template != null && template.EntityType == entityType)
{
+ // Creation of a clone of the source entity eventually changing its type and applied template.
+
switch (entityType)
{
case EntityType.ExternalInteractor:
- result = model.AddEntity(source.Name, template);
+ result = model.AddEntity(newName, template);
break;
case EntityType.Process:
- result = model.AddEntity(source.Name, template);
+ result = model.AddEntity(newName, template);
break;
case EntityType.DataStore:
- result = model.AddEntity(source.Name, template);
+ result = model.AddEntity(newName, template);
break;
}
}
else
{
+ // Creation of a clone of the source entity eventually changing its type.
+ var existingTemplate = source.GetEntityType() == entityType ?
+ source.Template : null;
+
switch (entityType)
{
case EntityType.ExternalInteractor:
- result = model.AddEntity(source.Name);
+ result = model.AddEntity(newName, existingTemplate);
break;
case EntityType.Process:
- result = model.AddEntity(source.Name);
+ result = model.AddEntity(newName, existingTemplate);
break;
case EntityType.DataStore:
- result = model.AddEntity(source.Name);
+ result = model.AddEntity(newName, existingTemplate);
break;
}
}
@@ -229,47 +255,262 @@ public static IEntity CloneAndConvert(this IEntity source,
result.BigImage = source.BigImage;
result.Image = source.Image;
result.SmallImage = source.SmallImage;
+ source.CopyProperties(result);
+ source.CopyThreatEvents(result);
+ source.CopyVulnerabilities(result);
+ source.CopyFlows(result);
- var threatEvents = source.ThreatEvents?.ToArray();
- if (threatEvents?.Any() ?? false)
+ scope?.Complete();
+ }
+ }
+ }
+
+ return result;
+ }
+
+ ///
+ /// Copy Properties between Containers.
+ ///
+ /// Source Container.
+ /// Target Container.
+ /// This function differs from
+ /// in that it checks if the target container is supported by the Property Schema, before copying the properties.
+ public static void CopyProperties(this IPropertiesContainer source,
+ [NotNull] IPropertiesContainer target)
+ {
+ var properties = source?.Properties?.ToArray();
+ if ((properties?.Any() ?? false) &&
+ target is IThreatModelChild child)
+ {
+ if (child.Model is IThreatModel model &&
+ properties.FirstOrDefault()?.Model is IThreatModel sourceModel)
+ {
+ using (var scope = UndoRedoManager.OpenScope("Copy Properties"))
+ {
+ foreach (var property in properties)
{
- foreach (var threatEvent in threatEvents)
+ if (property.PropertyType is IPropertyType sourcePropertyType &&
+ sourceModel.GetSchema(sourcePropertyType.SchemaId) is IPropertySchema sourceSchema)
{
- var newTe = result.AddThreatEvent(threatEvent.ThreatType);
- if (newTe != null)
+ if (model.GetSchema(sourceSchema.Name, sourceSchema.Namespace) is IPropertySchema targetSchema &&
+ (model.Id == sourceModel.Id || !sourceSchema.NotExportable) &&
+ targetSchema.AppliesTo.HasFlag(target.PropertiesScope))
{
- newTe.Name = threatEvent.Name;
- newTe.Description = threatEvent.Description;
-
- // TODO: copy threat event data.
+ var propertyType = targetSchema.GetPropertyType(sourcePropertyType.Name);
+ if (propertyType != null)
+ {
+ var propertyTarget = target.GetProperty(propertyType);
+ if (propertyTarget == null)
+ target.AddProperty(propertyType, property.StringValue);
+ else
+ propertyTarget.StringValue = property.StringValue;
+ }
}
}
}
+ scope?.Complete();
+ }
+ }
+ }
+ }
- var vulnerabilities = source.Vulnerabilities?.ToArray();
- if (vulnerabilities?.Any() ?? false)
+ ///
+ /// Copy Threat Events between Containers.
+ ///
+ /// Source Container.
+ /// Target Container.
+ private static void CopyThreatEvents(this IThreatEventsContainer source,
+ [NotNull] IThreatEventsContainer target)
+ {
+ var threatEvents = source.ThreatEvents?.ToArray();
+ if (threatEvents?.Any() ?? false)
+ {
+ using (var scope = UndoRedoManager.OpenScope("Copy Threat Events"))
+ {
+ foreach (var threatEvent in threatEvents)
+ {
+ var newTe = target.AddThreatEvent(threatEvent.ThreatType);
+ if (newTe != null)
{
- foreach (var vulnerability in vulnerabilities)
- {
- var newV = result.AddVulnerability(vulnerability.Weakness);
- if (newV != null)
- {
- newV.Name = vulnerability.Name;
- newV.Description = vulnerability.Description;
+ newTe.Name = threatEvent.Name;
+ newTe.Description = threatEvent.Description;
+ newTe.Severity = threatEvent.Severity;
+ threatEvent.CopyThreatEventMitigations(newTe);
+ threatEvent.CopyThreatEventScenarios(newTe);
+ threatEvent.CopyVulnerabilities(newTe);
+ threatEvent.CopyProperties(newTe);
+ }
+ }
+ scope?.Complete();
+ }
+ }
+ }
- // TODO: copy vulnerability details.
- }
- }
+ ///
+ /// Copy Threat Event Mitigations between Containers.
+ ///
+ /// Source Container.
+ /// Target Container.
+ public static void CopyThreatEventMitigations(this IThreatEventMitigationsContainer source,
+ [NotNull] IThreatEventMitigationsContainer target)
+ {
+ var mitigations = source.Mitigations?.ToArray();
+ if (mitigations?.Any() ?? false)
+ {
+ using (var scope = UndoRedoManager.OpenScope("Copy Threat Event Mitigations"))
+ {
+ foreach (var mitigation in mitigations)
+ {
+ var newM = target.AddMitigation(mitigation.Mitigation, mitigation.Strength,
+ mitigation.Status, mitigation.Directives);
+ if (newM != null)
+ {
+ mitigation.CopyProperties(newM);
}
+ }
+ scope?.Complete();
+ }
+ }
+ }
- // TODO: copy properties ensuring that their compatibility with the target object.
+ ///
+ /// Copy Threat Event Scenarios between Containers.
+ ///
+ /// Source Container.
+ /// Target Container.
+ public static void CopyThreatEventScenarios(this IThreatEventScenariosContainer source,
+ [NotNull] IThreatEventScenariosContainer target)
+ {
+ var scenarios = source.Scenarios?.ToArray();
+ if (scenarios?.Any() ?? false)
+ {
+ using (var scope = UndoRedoManager.OpenScope("Copy Threat Event Scenarios"))
+ {
+ foreach (var scenario in scenarios)
+ {
+ var newS = target.AddScenario(scenario.Actor, scenario.Severity, scenario.Name);
+ if (newS != null)
+ {
+ newS.Description = scenario.Description;
+ newS.Motivation = scenario.Motivation;
+ scenario.CopyProperties(newS);
+ }
+ }
+ scope?.Complete();
+ }
+ }
+ }
- scope?.Complete();
+ ///
+ /// Copy Vulnerabilities between Containers.
+ ///
+ /// Source Container.
+ /// Target Container.
+ public static void CopyVulnerabilities(this IVulnerabilitiesContainer source,
+ [NotNull] IVulnerabilitiesContainer target)
+ {
+ var vulnerabilities = source.Vulnerabilities?.ToArray();
+ if (vulnerabilities?.Any() ?? false)
+ {
+ using (var scope = UndoRedoManager.OpenScope("Copy Vulnerabilities"))
+ {
+ foreach (var vulnerability in vulnerabilities)
+ {
+ var newVuln = target.AddVulnerability(vulnerability.Weakness);
+ if (newVuln != null)
+ {
+ newVuln.Name = vulnerability.Name;
+ newVuln.Description = vulnerability.Description;
+ newVuln.Severity = vulnerability.Severity;
+ vulnerability.CopyVulnerabilityMitigations(newVuln);
+ vulnerability.CopyProperties(newVuln);
+ }
}
+ scope?.Complete();
}
}
+ }
- return result;
+ ///
+ /// Copy Vulnerabilities Mitigations between Containers.
+ ///
+ /// Source Container.
+ /// Target Container.
+ public static void CopyVulnerabilityMitigations(this IVulnerabilityMitigationsContainer source,
+ [NotNull] IVulnerabilityMitigationsContainer target)
+ {
+ var mitigations = source.Mitigations?.ToArray();
+ if (mitigations?.Any() ?? false)
+ {
+ using (var scope = UndoRedoManager.OpenScope("Copy Vulnerability Mitigations"))
+ {
+ foreach (var mitigation in mitigations)
+ {
+ var newM = target.AddMitigation(mitigation.Mitigation, mitigation.Strength,
+ mitigation.Status, mitigation.Directives);
+ if (newM != null)
+ {
+ mitigation.CopyProperties(newM);
+ }
+ }
+ scope?.Complete();
+ }
+ }
+ }
+
+ ///
+ /// Copy all Flows involving the Source Entity to the Target Entity.
+ ///
+ /// Source Entity.
+ /// Target Entity
+ public static void CopyFlows(this IEntity source, [NotNull] IEntity target)
+ {
+ if (source != null && source.Model is IThreatModel model)
+ {
+ var outFlows = model.DataFlows?
+ .Where(x => x.SourceId == source.Id)
+ .ToArray();
+ if (outFlows?.Any() ?? false)
+ {
+ foreach (var flow in outFlows)
+ {
+ IDataFlow newFlow = null;
+ if (flow.Template == null)
+ newFlow = model.AddDataFlow(flow.Name, target.Id, flow.TargetId);
+ else
+ newFlow = model.AddDataFlow(flow.Name, target.Id, flow.TargetId, flow.Template);
+ if (newFlow != null)
+ {
+ newFlow.FlowType = flow.FlowType;
+ flow.CopyThreatEvents(newFlow);
+ flow.CopyVulnerabilities(newFlow);
+ flow.CopyProperties(newFlow);
+ }
+ }
+ }
+
+ var inFlows = model.DataFlows?
+ .Where(x => x.TargetId == source.Id)
+ .ToArray();
+ if (inFlows?.Any() ?? false)
+ {
+ foreach (var flow in inFlows)
+ {
+ IDataFlow newFlow = null;
+ if (flow.Template == null)
+ newFlow = model.AddDataFlow(flow.Name, flow.SourceId, target.Id);
+ else
+ newFlow = model.AddDataFlow(flow.Name, flow.SourceId, target.Id, flow.Template);
+ if (newFlow != null)
+ {
+ newFlow.FlowType = flow.FlowType;
+ flow.CopyThreatEvents(newFlow);
+ flow.CopyVulnerabilities(newFlow);
+ flow.CopyProperties(newFlow);
+ }
+ }
+ }
+ }
}
}
}
diff --git a/Sources/ThreatsManager.Utilities/EnumExtensions.cs b/Sources/ThreatsManager.Utilities/EnumExtensions.cs
index 6bb7a65b..5eb854e2 100644
--- a/Sources/ThreatsManager.Utilities/EnumExtensions.cs
+++ b/Sources/ThreatsManager.Utilities/EnumExtensions.cs
@@ -130,6 +130,38 @@ public static T GetEnumValue([Required] this string text, T defaultValue)
return result;
}
+ ///
+ /// Try get the value of the enumeration from a string.
+ ///
+ /// Type of the enumeration.
+ /// String that needs to be parsed to get the value of the enumeration
+ /// [Out] Value of the enumeration.
+ /// True if the value has been retrieved correctly, false otherwise.
+ public static bool TryGetEnumValue([Required] this string text, out T enumValue)
+ {
+ bool result = false;
+
+ enumValue = default(T);
+
+ Type type = typeof(T);
+
+ var fields = type.GetFields();
+ foreach (var field in fields)
+ {
+ var attribs = field.GetCustomAttributes().ToArray();
+
+ if (attribs.Any(x => string.CompareOrdinal(x.Label, text) == 0) ||
+ string.CompareOrdinal(text, field.Name) == 0)
+ {
+ enumValue = (T)field.GetValue(type);
+ result = true;
+ break;
+ }
+ }
+
+ return result;
+ }
+
public static string GetXmlEnumLabel(this Enum value)
{
Type type = value.GetType();
diff --git a/Sources/ThreatsManager.Utilities/Policies/HelpTroubleshootPolicy.cs b/Sources/ThreatsManager.Utilities/Policies/HelpTroubleshootPolicy.cs
new file mode 100644
index 00000000..4a70074b
--- /dev/null
+++ b/Sources/ThreatsManager.Utilities/Policies/HelpTroubleshootPolicy.cs
@@ -0,0 +1,9 @@
+namespace ThreatsManager.Utilities.Policies
+{
+ public class HelpTroubleshootPolicy : Policy
+ {
+ protected override string PolicyName => "HelpTroubleshoot";
+
+ public bool? HelpTroubleshoot => BoolValue;
+ }
+}
diff --git a/Sources/ThreatsManager.Utilities/Policy.cs b/Sources/ThreatsManager.Utilities/Policy.cs
new file mode 100644
index 00000000..1ac06a76
--- /dev/null
+++ b/Sources/ThreatsManager.Utilities/Policy.cs
@@ -0,0 +1,80 @@
+using Microsoft.Win32;
+using PostSharp.Patterns.Contracts;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using ThreatsManager.Interfaces.Extensions;
+
+namespace ThreatsManager.Utilities
+{
+ ///
+ /// Abstract Policy class.
+ ///
+ /// This is the recommemded starting point to create your own Policies.
+ /// It stores the policies configuration in the Registry, under a location that by default is
+ /// "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Simone Curzi\Threats Manager Studio\Policies".
+ public abstract class Policy : IPolicy
+ {
+ ///
+ /// Get a Policy given its identifier.
+ ///
+ /// Extension Identifier of the Policy.
+ /// Instanec of the Policy, if found, otherwise null.
+ public static Policy GetPolicy([Required] string id)
+ {
+ return ExtensionUtils.GetExtension(id) as Policy;
+ }
+
+ ///
+ /// Location of the Key in the Registry containing the Policies.
+ ///
+ protected virtual string Location => @"HKEY_LOCAL_MACHINE\SOFTWARE\Simone Curzi\Threats Manager Studio\Policies";
+
+ ///
+ /// Name of the Policy in the Registry.
+ ///
+ protected abstract string PolicyName { get; }
+
+ ///
+ /// Property returning true if the Policy is defined.
+ ///
+ public bool IsDefined => Value != null;
+
+ ///
+ /// Value of the Policy.
+ ///
+ public object Value => Registry.GetValue(Location, PolicyName, null);
+
+ ///
+ /// Provides the Value as boolean.
+ ///
+ protected bool? BoolValue
+ {
+ get
+ {
+ bool? result = null;
+
+ var fromRegistry = (int?)Value;
+ if (fromRegistry.HasValue)
+ {
+ result = fromRegistry.Value != 0;
+ }
+
+ return result;
+ }
+ }
+
+ ///
+ /// Provides the Value as enumeration of strings.
+ ///
+ public IEnumerable StringArrayValue
+ {
+ get
+ {
+ return Value as string[];
+ }
+ }
+ }
+}
diff --git a/Sources/ThreatsManager.Utilities/ThreatsManager.Utilities.csproj b/Sources/ThreatsManager.Utilities/ThreatsManager.Utilities.csproj
index 8f0bdd7d..6edac7f6 100644
--- a/Sources/ThreatsManager.Utilities/ThreatsManager.Utilities.csproj
+++ b/Sources/ThreatsManager.Utilities/ThreatsManager.Utilities.csproj
@@ -3,15 +3,15 @@
net481
Library to manage the solution files at a low level.
- 2.1.1.0
+ 2.1.2.0
Simone Curzi
Simone Curzi
Threats Manager Platform
Copyright © Simone Curzi, 2018-2023. All Rights Reserved.
https://www.nuget.org/packages/ThreatsManager.Utilities/
https://github.com/simonec73/threatsmanager
- 2.1.1.0
- 2.1.1
+ 2.1.2.0
+ 2.1.2
$(NoWarn);NU1505
diff --git a/Studio/ThreatsManager.AutoThreatGeneration.WinForms/ExtensionsContainer.cs b/Studio/ThreatsManager.AutoThreatGeneration.WinForms/ExtensionsContainer.cs
index ade27606..f810ed4c 100644
--- a/Studio/ThreatsManager.AutoThreatGeneration.WinForms/ExtensionsContainer.cs
+++ b/Studio/ThreatsManager.AutoThreatGeneration.WinForms/ExtensionsContainer.cs
@@ -1,3 +1,3 @@
using ThreatsManager.Interfaces;
-[assembly: ExtensionsContainer("2.1.1")]
\ No newline at end of file
+[assembly: ExtensionsContainer("2.1.2")]
\ No newline at end of file
diff --git a/Studio/ThreatsManager.DevOps.WinForms/ExtensionConfigurationManager.cs b/Studio/ThreatsManager.DevOps.WinForms/ExtensionConfigurationManager.cs
deleted file mode 100644
index 54978e81..00000000
--- a/Studio/ThreatsManager.DevOps.WinForms/ExtensionConfigurationManager.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-using System;
-using System.Collections.Generic;
-using PostSharp.Patterns.Contracts;
-using ThreatsManager.Interfaces.Extensions;
-using ThreatsManager.Interfaces.ObjectModel;
-using ThreatsManager.Utilities;
-
-namespace ThreatsManager.DevOps
-{
- class ExtensionConfigurationManager
- {
- private readonly IThreatModel _model;
- private readonly string _extensionId;
- private readonly ExtensionConfiguration _configuration;
- private bool _dirty;
-
- public ExtensionConfigurationManager([NotNull] IThreatModel model, [Required] string extensionId)
- {
- _model = model;
- _extensionId = extensionId;
- _configuration = model.GetExtensionConfiguration(extensionId);
- }
-
- public void Apply()
- {
- if (_dirty)
- _model.SetExtensionConfiguration(_extensionId, _configuration);
- if (ScheduledRefreshes)
- DevOpsManager.StartAutomaticUpdater(_model, RefreshInterval, NotificationStrategy);
- else
- DevOpsManager.StopAutomaticUpdater();
- }
-
- public IEnumerable Data => _configuration?.Data;
-
- public bool ScheduledRefreshes
- {
- get => _configuration?.GlobalGet("scheduledRefreshes") ?? false;
-
- set
- {
- _configuration?.GlobalSet("scheduledRefreshes", value);
- _dirty = true;
- }
- }
-
- public int RefreshInterval
- {
- get => _configuration?.GlobalGet("refreshInterval", 10) ?? 0;
-
- set
- {
- _configuration?.GlobalSet("refreshInterval", value);
- _dirty = true;
- }
- }
-
- public NotificationType NotificationStrategy
- {
- get => Enum.TryParse(_configuration?.GlobalGet("notification",
- NotificationType.None.ToString()), out var result) ? result : NotificationType.None;
-
- set
- {
- _configuration?.GlobalSet("notification", value.ToString());
- _dirty = true;
- }
- }
- }
-}
diff --git a/Studio/ThreatsManager.DevOps.WinForms/ExtensionsContainer.cs b/Studio/ThreatsManager.DevOps.WinForms/ExtensionsContainer.cs
index ade27606..f810ed4c 100644
--- a/Studio/ThreatsManager.DevOps.WinForms/ExtensionsContainer.cs
+++ b/Studio/ThreatsManager.DevOps.WinForms/ExtensionsContainer.cs
@@ -1,3 +1,3 @@
using ThreatsManager.Interfaces;
-[assembly: ExtensionsContainer("2.1.1")]
\ No newline at end of file
+[assembly: ExtensionsContainer("2.1.2")]
\ No newline at end of file
diff --git a/Studio/ThreatsManager.DevOps.WinForms/Initializers/AutoConnector.cs b/Studio/ThreatsManager.DevOps.WinForms/Initializers/AutoConnector.cs
index 881bca5d..85f2332a 100644
--- a/Studio/ThreatsManager.DevOps.WinForms/Initializers/AutoConnector.cs
+++ b/Studio/ThreatsManager.DevOps.WinForms/Initializers/AutoConnector.cs
@@ -42,11 +42,6 @@ public async void Process(IThreatModel model)
{
DevOpsManager.Register(connector, model);
Connect.ChangeDisconnectButtonStatus(connector, true);
-
- var configManager = new ExtensionConfigurationManager(model, this.GetExtensionId());
- configManager.Apply();
-
- await DevOpsManager.UpdateAsync(model);
}
}
else
diff --git a/Studio/ThreatsManager.DevOps.WinForms/Initializers/UpdateNotifier.cs b/Studio/ThreatsManager.DevOps.WinForms/Initializers/UpdateNotifier.cs
deleted file mode 100644
index 6b98d8a2..00000000
--- a/Studio/ThreatsManager.DevOps.WinForms/Initializers/UpdateNotifier.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-using System;
-using PostSharp.Patterns.Contracts;
-using ThreatsManager.Interfaces;
-using ThreatsManager.Interfaces.Extensions;
-using ThreatsManager.Interfaces.ObjectModel;
-using ThreatsManager.Utilities;
-
-namespace ThreatsManager.DevOps.Initializers
-{
- [Extension("D527CFC8-E594-415A-A993-3FC1175C6487", "DevOps Update Notifier", 100, ExecutionMode.Management)]
- public class UpdateNotifier : IExtensionInitializer, IDesktopAlertAwareExtension
- {
- public void Initialize()
- {
- DevOpsManager.RefreshDone += DevOpsManagerOnRefreshDone;
- }
-
- private void DevOpsManagerOnRefreshDone([NotNull] IThreatModel model, int count)
- {
- var configManager = new ExtensionConfigurationManager(model, (new AutoConnector()).GetExtensionId());
- bool show;
- switch (configManager.NotificationStrategy)
- {
- case NotificationType.SuccessOnly:
- show = count > 0;
- break;
- case NotificationType.Full:
- show = true;
- break;
- default:
- show = false;
- break;
- }
-
- if (show)
- ShowMessage?.Invoke($"DevOps Updater has detected {count} update(s).");
- }
-
- public event Action ShowMessage;
- public event Action ShowWarning;
- }
-}
diff --git a/Studio/ThreatsManager.DevOps.WinForms/Panels/Configuration/ConfigurationPanel.Designer.cs b/Studio/ThreatsManager.DevOps.WinForms/Panels/Configuration/ConfigurationPanel.Designer.cs
deleted file mode 100644
index 80ad01e4..00000000
--- a/Studio/ThreatsManager.DevOps.WinForms/Panels/Configuration/ConfigurationPanel.Designer.cs
+++ /dev/null
@@ -1,228 +0,0 @@
-
-namespace ThreatsManager.DevOps.Panels.Configuration
-{
- partial class ConfigurationPanel
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Component Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- this.layoutControl1 = new DevComponents.DotNetBar.Layout.LayoutControl();
- this._raiseAllEvents = new System.Windows.Forms.RadioButton();
- this._raiseSomeEvents = new System.Windows.Forms.RadioButton();
- this._raiseNoEvents = new System.Windows.Forms.RadioButton();
- this._interval = new DevComponents.Editors.IntegerInput();
- this._scheduledRefresh = new System.Windows.Forms.CheckBox();
- this.layoutControlItem1 = new DevComponents.DotNetBar.Layout.LayoutControlItem();
- this.layoutControlItem2 = new DevComponents.DotNetBar.Layout.LayoutControlItem();
- this.layoutControlItem3 = new DevComponents.DotNetBar.Layout.LayoutControlItem();
- this.layoutControlItem4 = new DevComponents.DotNetBar.Layout.LayoutControlItem();
- this.layoutControlItem5 = new DevComponents.DotNetBar.Layout.LayoutControlItem();
- this._tooltip = new System.Windows.Forms.ToolTip(this.components);
- this.layoutControl1.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this._interval)).BeginInit();
- this.SuspendLayout();
- //
- // layoutControl1
- //
- this.layoutControl1.BackColor = System.Drawing.Color.White;
- this.layoutControl1.Controls.Add(this._raiseAllEvents);
- this.layoutControl1.Controls.Add(this._raiseSomeEvents);
- this.layoutControl1.Controls.Add(this._raiseNoEvents);
- this.layoutControl1.Controls.Add(this._interval);
- this.layoutControl1.Controls.Add(this._scheduledRefresh);
- this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.layoutControl1.Location = new System.Drawing.Point(0, 0);
- this.layoutControl1.Name = "layoutControl1";
- //
- //
- //
- this.layoutControl1.RootGroup.Items.AddRange(new DevComponents.DotNetBar.Layout.LayoutItemBase[] {
- this.layoutControlItem1,
- this.layoutControlItem2,
- this.layoutControlItem3,
- this.layoutControlItem4,
- this.layoutControlItem5});
- this.layoutControl1.Size = new System.Drawing.Size(683, 466);
- this.layoutControl1.TabIndex = 0;
- //
- // _raiseAllEvents
- //
- this._raiseAllEvents.AutoSize = true;
- this._raiseAllEvents.Enabled = false;
- this._raiseAllEvents.Location = new System.Drawing.Point(21, 107);
- this._raiseAllEvents.Margin = new System.Windows.Forms.Padding(0);
- this._raiseAllEvents.Name = "_raiseAllEvents";
- this._raiseAllEvents.Size = new System.Drawing.Size(658, 17);
- this._raiseAllEvents.TabIndex = 4;
- this._raiseAllEvents.Text = "Raise a notification every time a Refresh is performed";
- this._raiseAllEvents.UseVisualStyleBackColor = true;
- this._raiseAllEvents.CheckedChanged += new System.EventHandler(this._raiseAllEvents_CheckedChanged);
- //
- // _raiseSomeEvents
- //
- this._raiseSomeEvents.AutoSize = true;
- this._raiseSomeEvents.Enabled = false;
- this._raiseSomeEvents.Location = new System.Drawing.Point(21, 82);
- this._raiseSomeEvents.Margin = new System.Windows.Forms.Padding(0);
- this._raiseSomeEvents.Name = "_raiseSomeEvents";
- this._raiseSomeEvents.Size = new System.Drawing.Size(658, 17);
- this._raiseSomeEvents.TabIndex = 3;
- this._raiseSomeEvents.Text = "Raise a notification only if one or more updates are found\r\n";
- this._raiseSomeEvents.UseVisualStyleBackColor = true;
- this._raiseSomeEvents.CheckedChanged += new System.EventHandler(this._raiseSomeEvents_CheckedChanged);
- //
- // _raiseNoEvents
- //
- this._raiseNoEvents.AutoSize = true;
- this._raiseNoEvents.Checked = true;
- this._raiseNoEvents.Enabled = false;
- this._raiseNoEvents.Location = new System.Drawing.Point(21, 57);
- this._raiseNoEvents.Margin = new System.Windows.Forms.Padding(0);
- this._raiseNoEvents.Name = "_raiseNoEvents";
- this._raiseNoEvents.Size = new System.Drawing.Size(658, 17);
- this._raiseNoEvents.TabIndex = 2;
- this._raiseNoEvents.TabStop = true;
- this._raiseNoEvents.Text = "Do not raise any notification as a result of a Refresh";
- this._raiseNoEvents.UseVisualStyleBackColor = true;
- this._raiseNoEvents.CheckedChanged += new System.EventHandler(this._raiseNoEvents_CheckedChanged);
- //
- // _interval
- //
- //
- //
- //
- this._interval.BackgroundStyle.Class = "DateTimeInputBackground";
- this._interval.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
- this._interval.ButtonFreeText.Shortcut = DevComponents.DotNetBar.eShortcut.F2;
- this._interval.Enabled = false;
- this._interval.Location = new System.Drawing.Point(100, 29);
- this._interval.Margin = new System.Windows.Forms.Padding(0);
- this._interval.MaxValue = 120;
- this._interval.MinValue = 1;
- this._interval.Name = "_interval";
- this._interval.ShowUpDown = true;
- this._interval.Size = new System.Drawing.Size(96, 20);
- this._interval.TabIndex = 1;
- this._tooltip.SetToolTip(this._interval, "Interval between two repeated refreshes of the Mitigation statuses.\r\nIt is recomm" +
- "ended to avoid refreshing too frequently, to limit resource consumption.\r\nAllowe" +
- "d values are between 1 and 120.");
- this._interval.Value = 1;
- this._interval.ValueChanged += new System.EventHandler(this._interval_ValueChanged);
- //
- // _scheduledRefresh
- //
- this._scheduledRefresh.AutoSize = true;
- this._scheduledRefresh.Location = new System.Drawing.Point(4, 4);
- this._scheduledRefresh.Margin = new System.Windows.Forms.Padding(0);
- this._scheduledRefresh.Name = "_scheduledRefresh";
- this._scheduledRefresh.Size = new System.Drawing.Size(675, 17);
- this._scheduledRefresh.TabIndex = 0;
- this._scheduledRefresh.Text = "Enable scheduled status refreshes\r\n";
- this._tooltip.SetToolTip(this._scheduledRefresh, "Scheduled refresh of the status of the Mitigations.\r\nIt is recommended to avoid r" +
- "efreshing too frequently, to limit resource consumption.");
- this._scheduledRefresh.UseVisualStyleBackColor = true;
- this._scheduledRefresh.CheckedChanged += new System.EventHandler(this._scheduledRefresh_CheckedChanged);
- //
- // layoutControlItem1
- //
- this.layoutControlItem1.Control = this._scheduledRefresh;
- this.layoutControlItem1.Height = 25;
- this.layoutControlItem1.MinSize = new System.Drawing.Size(32, 20);
- this.layoutControlItem1.Name = "layoutControlItem1";
- this.layoutControlItem1.Width = 100;
- this.layoutControlItem1.WidthType = DevComponents.DotNetBar.Layout.eLayoutSizeType.Percent;
- //
- // layoutControlItem2
- //
- this.layoutControlItem2.Control = this._interval;
- this.layoutControlItem2.Height = 28;
- this.layoutControlItem2.MinSize = new System.Drawing.Size(64, 18);
- this.layoutControlItem2.Name = "layoutControlItem2";
- this.layoutControlItem2.Padding = new System.Windows.Forms.Padding(21, 4, 4, 4);
- this.layoutControlItem2.Text = "Interval (mins)";
- this.layoutControlItem2.Width = 200;
- //
- // layoutControlItem3
- //
- this.layoutControlItem3.Control = this._raiseNoEvents;
- this.layoutControlItem3.Height = 25;
- this.layoutControlItem3.MinSize = new System.Drawing.Size(32, 20);
- this.layoutControlItem3.Name = "layoutControlItem3";
- this.layoutControlItem3.Padding = new System.Windows.Forms.Padding(21, 4, 4, 4);
- this.layoutControlItem3.Width = 101;
- this.layoutControlItem3.WidthType = DevComponents.DotNetBar.Layout.eLayoutSizeType.Percent;
- //
- // layoutControlItem4
- //
- this.layoutControlItem4.Control = this._raiseSomeEvents;
- this.layoutControlItem4.Height = 25;
- this.layoutControlItem4.MinSize = new System.Drawing.Size(32, 20);
- this.layoutControlItem4.Name = "layoutControlItem4";
- this.layoutControlItem4.Padding = new System.Windows.Forms.Padding(21, 4, 4, 4);
- this.layoutControlItem4.Width = 101;
- this.layoutControlItem4.WidthType = DevComponents.DotNetBar.Layout.eLayoutSizeType.Percent;
- //
- // layoutControlItem5
- //
- this.layoutControlItem5.Control = this._raiseAllEvents;
- this.layoutControlItem5.Height = 25;
- this.layoutControlItem5.MinSize = new System.Drawing.Size(32, 20);
- this.layoutControlItem5.Name = "layoutControlItem5";
- this.layoutControlItem5.Padding = new System.Windows.Forms.Padding(21, 4, 4, 4);
- this.layoutControlItem5.Width = 101;
- this.layoutControlItem5.WidthType = DevComponents.DotNetBar.Layout.eLayoutSizeType.Percent;
- //
- // ConfigurationPanel
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.Controls.Add(this.layoutControl1);
- this.Name = "ConfigurationPanel";
- this.Size = new System.Drawing.Size(683, 466);
- this.layoutControl1.ResumeLayout(false);
- this.layoutControl1.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this._interval)).EndInit();
- this.ResumeLayout(false);
-
- }
-
- #endregion
-
- private DevComponents.DotNetBar.Layout.LayoutControl layoutControl1;
- private System.Windows.Forms.CheckBox _scheduledRefresh;
- private System.Windows.Forms.ToolTip _tooltip;
- private DevComponents.DotNetBar.Layout.LayoutControlItem layoutControlItem1;
- private DevComponents.Editors.IntegerInput _interval;
- private DevComponents.DotNetBar.Layout.LayoutControlItem layoutControlItem2;
- private System.Windows.Forms.RadioButton _raiseAllEvents;
- private System.Windows.Forms.RadioButton _raiseSomeEvents;
- private System.Windows.Forms.RadioButton _raiseNoEvents;
- private DevComponents.DotNetBar.Layout.LayoutControlItem layoutControlItem3;
- private DevComponents.DotNetBar.Layout.LayoutControlItem layoutControlItem4;
- private DevComponents.DotNetBar.Layout.LayoutControlItem layoutControlItem5;
- }
-}
diff --git a/Studio/ThreatsManager.DevOps.WinForms/Panels/Configuration/ConfigurationPanel.cs b/Studio/ThreatsManager.DevOps.WinForms/Panels/Configuration/ConfigurationPanel.cs
deleted file mode 100644
index 793deb25..00000000
--- a/Studio/ThreatsManager.DevOps.WinForms/Panels/Configuration/ConfigurationPanel.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Windows.Forms;
-using PostSharp.Patterns.Contracts;
-using ThreatsManager.DevOps.Initializers;
-using ThreatsManager.Interfaces.Extensions;
-using ThreatsManager.Interfaces.Extensions.Panels;
-using ThreatsManager.Interfaces.ObjectModel;
-using ThreatsManager.Utilities;
-
-namespace ThreatsManager.DevOps.Panels.Configuration
-{
- public partial class ConfigurationPanel : UserControl, IConfigurationPanel