synergy moats product advisory implementations
This commit is contained in:
@@ -27,6 +27,9 @@ public sealed class RuntimeNodeHashTests
|
||||
Tid = 5678,
|
||||
TimestampNs = 1000000000,
|
||||
Symbol = "vulnerable_func",
|
||||
FunctionAddress = 0,
|
||||
StackTrace = Array.Empty<ulong>(),
|
||||
RuntimeType = RuntimeType.Unknown,
|
||||
};
|
||||
|
||||
// Assert - New fields should be null by default
|
||||
@@ -49,6 +52,9 @@ public sealed class RuntimeNodeHashTests
|
||||
Tid = 5678,
|
||||
TimestampNs = 1000000000,
|
||||
Symbol = "vulnerable_func",
|
||||
FunctionAddress = 0x1234,
|
||||
StackTrace = new ulong[] { 0x10, 0x20, 0x30 },
|
||||
RuntimeType = RuntimeType.DotNet,
|
||||
Purl = "pkg:npm/lodash@4.17.21",
|
||||
FunctionSignature = "lodash.merge(object, ...sources)",
|
||||
BinaryDigest = "sha256:abc123def456",
|
||||
@@ -90,7 +96,7 @@ public sealed class RuntimeNodeHashTests
|
||||
{
|
||||
// Arrange
|
||||
var nodeHashes = new List<string> { "sha256:hash1", "sha256:hash2", "sha256:hash3" };
|
||||
var functionSignatures = new List<string?> { "main()", "process(req)", "vuln(data)" };
|
||||
var functionSignatures = new List<string> { "main()", "process(req)", "vuln(data)" };
|
||||
var binaryDigests = new List<string?> { "sha256:bin1", "sha256:bin2", "sha256:bin3" };
|
||||
var binaryOffsets = new List<ulong?> { 0x1000, 0x2000, 0x3000 };
|
||||
|
||||
@@ -128,6 +134,8 @@ public sealed class RuntimeNodeHashTests
|
||||
StartedAt = DateTimeOffset.UtcNow.AddMinutes(-5),
|
||||
StoppedAt = DateTimeOffset.UtcNow,
|
||||
TotalEvents = 1000,
|
||||
CallPaths = Array.Empty<ObservedCallPath>(),
|
||||
ObservedSymbols = Array.Empty<string>(),
|
||||
};
|
||||
|
||||
// Assert
|
||||
@@ -150,6 +158,8 @@ public sealed class RuntimeNodeHashTests
|
||||
StartedAt = DateTimeOffset.UtcNow.AddMinutes(-5),
|
||||
StoppedAt = DateTimeOffset.UtcNow,
|
||||
TotalEvents = 1000,
|
||||
CallPaths = Array.Empty<ObservedCallPath>(),
|
||||
ObservedSymbols = Array.Empty<string>(),
|
||||
ObservedNodeHashes = observedNodeHashes,
|
||||
ObservedPathHashes = observedPathHashes,
|
||||
CombinedPathHash = "sha256:combinedhash"
|
||||
@@ -188,12 +198,14 @@ public sealed class RuntimeNodeHashTests
|
||||
var path1 = new ObservedCallPath
|
||||
{
|
||||
Symbols = ["main", "process", "vulnerable_func"],
|
||||
ObservationCount = 1,
|
||||
Purl = "pkg:npm/lodash@4.17.21"
|
||||
};
|
||||
|
||||
var path2 = new ObservedCallPath
|
||||
{
|
||||
Symbols = ["main", "process", "vulnerable_func"],
|
||||
ObservationCount = 1,
|
||||
Purl = "pkg:npm/lodash@4.17.21"
|
||||
};
|
||||
|
||||
@@ -218,6 +230,9 @@ public sealed class RuntimeNodeHashTests
|
||||
Tid = 5678,
|
||||
TimestampNs = 1000000000,
|
||||
Symbol = "unknown_func",
|
||||
FunctionAddress = 0,
|
||||
StackTrace = Array.Empty<ulong>(),
|
||||
RuntimeType = RuntimeType.Unknown,
|
||||
Purl = null, // Missing PURL
|
||||
FunctionSignature = "unknown_func()",
|
||||
};
|
||||
@@ -239,6 +254,9 @@ public sealed class RuntimeNodeHashTests
|
||||
Tid = 5678,
|
||||
TimestampNs = 1000000000,
|
||||
Symbol = null, // Missing symbol
|
||||
FunctionAddress = 0,
|
||||
StackTrace = Array.Empty<ulong>(),
|
||||
RuntimeType = RuntimeType.Unknown,
|
||||
Purl = "pkg:npm/lodash@4.17.21",
|
||||
};
|
||||
|
||||
@@ -271,12 +289,14 @@ public sealed class RuntimeNodeHashTests
|
||||
var path1 = new ObservedCallPath
|
||||
{
|
||||
Symbols = ["main", "process", "vulnerable_func"],
|
||||
ObservationCount = 1,
|
||||
PathHash = "sha256:path1hash"
|
||||
};
|
||||
|
||||
var path2 = new ObservedCallPath
|
||||
{
|
||||
Symbols = ["vulnerable_func", "process", "main"],
|
||||
ObservationCount = 1,
|
||||
PathHash = "sha256:path2hash"
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user