This commit is contained in:
master
2026-02-04 19:59:20 +02:00
parent 557feefdc3
commit 5548cf83bf
1479 changed files with 53557 additions and 40339 deletions

View File

@@ -4,7 +4,6 @@
// </copyright>
using System.Collections.Immutable;
using System.Text.Json.Serialization;
namespace StellaOps.Evidence.Bundle;
@@ -98,270 +97,3 @@ public sealed class BinaryDiffEvidence
/// </summary>
public DateTimeOffset? ComputedAt { get; init; }
}
/// <summary>
/// Type of binary diff analysis.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum BinaryDiffType
{
/// <summary>Structural diff (sections, symbols).</summary>
Structural,
/// <summary>Semantic diff (IR-based).</summary>
Semantic,
/// <summary>Combined structural and semantic.</summary>
Combined,
/// <summary>Fast hash-only comparison.</summary>
HashOnly
}
/// <summary>
/// Function-level diff entry.
/// </summary>
public sealed class BinaryFunctionDiff
{
/// <summary>
/// Diff operation type.
/// </summary>
public required BinaryDiffOperation Operation { get; init; }
/// <summary>
/// Function name or symbol.
/// </summary>
public required string FunctionName { get; init; }
/// <summary>
/// Function address in previous binary.
/// </summary>
public ulong? PreviousAddress { get; init; }
/// <summary>
/// Function address in current binary.
/// </summary>
public ulong? CurrentAddress { get; init; }
/// <summary>
/// Previous size in bytes.
/// </summary>
public int? PreviousSize { get; init; }
/// <summary>
/// Current size in bytes.
/// </summary>
public int? CurrentSize { get; init; }
/// <summary>
/// Semantic similarity score (0.0-1.0) for modified functions.
/// </summary>
public double? Similarity { get; init; }
/// <summary>
/// Node hash for the function (for reachability correlation).
/// </summary>
public string? NodeHash { get; init; }
/// <summary>
/// Whether this function is security-sensitive.
/// </summary>
public bool SecuritySensitive { get; init; }
/// <summary>
/// Brief description of the change.
/// </summary>
public string? ChangeDescription { get; init; }
}
/// <summary>
/// Symbol-level diff entry.
/// </summary>
public sealed class BinarySymbolDiff
{
/// <summary>
/// Diff operation type.
/// </summary>
public required BinaryDiffOperation Operation { get; init; }
/// <summary>
/// Symbol name.
/// </summary>
public required string SymbolName { get; init; }
/// <summary>
/// Symbol type (function, object, etc.).
/// </summary>
public string? SymbolType { get; init; }
/// <summary>
/// Section containing the symbol.
/// </summary>
public string? Section { get; init; }
/// <summary>
/// Symbol visibility.
/// </summary>
public string? Visibility { get; init; }
}
/// <summary>
/// Section-level diff entry.
/// </summary>
public sealed class BinarySectionDiff
{
/// <summary>
/// Diff operation type.
/// </summary>
public required BinaryDiffOperation Operation { get; init; }
/// <summary>
/// Section name.
/// </summary>
public required string SectionName { get; init; }
/// <summary>
/// Previous section size.
/// </summary>
public long? PreviousSize { get; init; }
/// <summary>
/// Current section size.
/// </summary>
public long? CurrentSize { get; init; }
/// <summary>
/// Size delta.
/// </summary>
public long? SizeDelta { get; init; }
/// <summary>
/// Section permissions/flags.
/// </summary>
public string? Permissions { get; init; }
}
/// <summary>
/// Semantic diff summary.
/// </summary>
public sealed class BinarySemanticDiff
{
/// <summary>
/// Previous semantic fingerprint hash.
/// </summary>
public string? PreviousFingerprint { get; init; }
/// <summary>
/// Current semantic fingerprint hash.
/// </summary>
public string? CurrentFingerprint { get; init; }
/// <summary>
/// Overall semantic similarity (0.0-1.0).
/// </summary>
public double Similarity { get; init; }
/// <summary>
/// Number of semantically identical functions.
/// </summary>
public int IdenticalFunctions { get; init; }
/// <summary>
/// Number of semantically similar functions.
/// </summary>
public int SimilarFunctions { get; init; }
/// <summary>
/// Number of semantically different functions.
/// </summary>
public int DifferentFunctions { get; init; }
/// <summary>
/// IR normalization recipe version used.
/// </summary>
public string? NormalizationRecipe { get; init; }
}
/// <summary>
/// Security-relevant change in binary.
/// </summary>
public sealed class BinarySecurityChange
{
/// <summary>
/// Type of security change.
/// </summary>
public required BinarySecurityChangeType ChangeType { get; init; }
/// <summary>
/// Severity of the change (low, medium, high, critical).
/// </summary>
public required string Severity { get; init; }
/// <summary>
/// Description of the change.
/// </summary>
public required string Description { get; init; }
/// <summary>
/// Affected function or symbol.
/// </summary>
public string? AffectedSymbol { get; init; }
/// <summary>
/// CVE IDs potentially related to this change.
/// </summary>
public ImmutableArray<string> RelatedCves { get; init; } = [];
}
/// <summary>
/// Type of security-relevant change.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum BinarySecurityChangeType
{
/// <summary>New security-sensitive function added.</summary>
SecurityFunctionAdded,
/// <summary>Security-sensitive function removed.</summary>
SecurityFunctionRemoved,
/// <summary>Security-sensitive function modified.</summary>
SecurityFunctionModified,
/// <summary>Crypto function changed.</summary>
CryptoChange,
/// <summary>Memory safety function changed.</summary>
MemorySafetyChange,
/// <summary>Authentication/authorization function changed.</summary>
AuthChange,
/// <summary>Input validation function changed.</summary>
InputValidationChange,
/// <summary>Hardening feature added or removed.</summary>
HardeningChange
}
/// <summary>
/// Binary diff operation types.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum BinaryDiffOperation
{
/// <summary>Element was added.</summary>
Added,
/// <summary>Element was removed.</summary>
Removed,
/// <summary>Element was modified.</summary>
Modified,
/// <summary>Element was renamed.</summary>
Renamed,
/// <summary>Element was moved to different location.</summary>
Moved
}

View File

@@ -0,0 +1,25 @@
using System.Text.Json.Serialization;
namespace StellaOps.Evidence.Bundle;
/// <summary>
/// Binary diff operation types.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum BinaryDiffOperation
{
/// <summary>Element was added.</summary>
Added,
/// <summary>Element was removed.</summary>
Removed,
/// <summary>Element was modified.</summary>
Modified,
/// <summary>Element was renamed.</summary>
Renamed,
/// <summary>Element was moved to different location.</summary>
Moved
}

View File

@@ -0,0 +1,22 @@
using System.Text.Json.Serialization;
namespace StellaOps.Evidence.Bundle;
/// <summary>
/// Type of binary diff analysis.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum BinaryDiffType
{
/// <summary>Structural diff (sections, symbols).</summary>
Structural,
/// <summary>Semantic diff (IR-based).</summary>
Semantic,
/// <summary>Combined structural and semantic.</summary>
Combined,
/// <summary>Fast hash-only comparison.</summary>
HashOnly
}

View File

@@ -0,0 +1,57 @@
namespace StellaOps.Evidence.Bundle;
/// <summary>
/// Function-level diff entry.
/// </summary>
public sealed class BinaryFunctionDiff
{
/// <summary>
/// Diff operation type.
/// </summary>
public required BinaryDiffOperation Operation { get; init; }
/// <summary>
/// Function name or symbol.
/// </summary>
public required string FunctionName { get; init; }
/// <summary>
/// Function address in previous binary.
/// </summary>
public ulong? PreviousAddress { get; init; }
/// <summary>
/// Function address in current binary.
/// </summary>
public ulong? CurrentAddress { get; init; }
/// <summary>
/// Previous size in bytes.
/// </summary>
public int? PreviousSize { get; init; }
/// <summary>
/// Current size in bytes.
/// </summary>
public int? CurrentSize { get; init; }
/// <summary>
/// Semantic similarity score (0.0-1.0) for modified functions.
/// </summary>
public double? Similarity { get; init; }
/// <summary>
/// Node hash for the function (for reachability correlation).
/// </summary>
public string? NodeHash { get; init; }
/// <summary>
/// Whether this function is security-sensitive.
/// </summary>
public bool SecuritySensitive { get; init; }
/// <summary>
/// Brief description of the change.
/// </summary>
public string? ChangeDescription { get; init; }
}

View File

@@ -0,0 +1,37 @@
namespace StellaOps.Evidence.Bundle;
/// <summary>
/// Section-level diff entry.
/// </summary>
public sealed class BinarySectionDiff
{
/// <summary>
/// Diff operation type.
/// </summary>
public required BinaryDiffOperation Operation { get; init; }
/// <summary>
/// Section name.
/// </summary>
public required string SectionName { get; init; }
/// <summary>
/// Previous section size.
/// </summary>
public long? PreviousSize { get; init; }
/// <summary>
/// Current section size.
/// </summary>
public long? CurrentSize { get; init; }
/// <summary>
/// Size delta.
/// </summary>
public long? SizeDelta { get; init; }
/// <summary>
/// Section permissions/flags.
/// </summary>
public string? Permissions { get; init; }
}

View File

@@ -0,0 +1,34 @@
using System.Collections.Immutable;
namespace StellaOps.Evidence.Bundle;
/// <summary>
/// Security-relevant change in binary.
/// </summary>
public sealed class BinarySecurityChange
{
/// <summary>
/// Type of security change.
/// </summary>
public required BinarySecurityChangeType ChangeType { get; init; }
/// <summary>
/// Severity of the change (low, medium, high, critical).
/// </summary>
public required string Severity { get; init; }
/// <summary>
/// Description of the change.
/// </summary>
public required string Description { get; init; }
/// <summary>
/// Affected function or symbol.
/// </summary>
public string? AffectedSymbol { get; init; }
/// <summary>
/// CVE IDs potentially related to this change.
/// </summary>
public ImmutableArray<string> RelatedCves { get; init; } = [];
}

View File

@@ -0,0 +1,34 @@
using System.Text.Json.Serialization;
namespace StellaOps.Evidence.Bundle;
/// <summary>
/// Type of security-relevant change.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum BinarySecurityChangeType
{
/// <summary>New security-sensitive function added.</summary>
SecurityFunctionAdded,
/// <summary>Security-sensitive function removed.</summary>
SecurityFunctionRemoved,
/// <summary>Security-sensitive function modified.</summary>
SecurityFunctionModified,
/// <summary>Crypto function changed.</summary>
CryptoChange,
/// <summary>Memory safety function changed.</summary>
MemorySafetyChange,
/// <summary>Authentication/authorization function changed.</summary>
AuthChange,
/// <summary>Input validation function changed.</summary>
InputValidationChange,
/// <summary>Hardening feature added or removed.</summary>
HardeningChange
}

View File

@@ -0,0 +1,42 @@
namespace StellaOps.Evidence.Bundle;
/// <summary>
/// Semantic diff summary.
/// </summary>
public sealed class BinarySemanticDiff
{
/// <summary>
/// Previous semantic fingerprint hash.
/// </summary>
public string? PreviousFingerprint { get; init; }
/// <summary>
/// Current semantic fingerprint hash.
/// </summary>
public string? CurrentFingerprint { get; init; }
/// <summary>
/// Overall semantic similarity (0.0-1.0).
/// </summary>
public double Similarity { get; init; }
/// <summary>
/// Number of semantically identical functions.
/// </summary>
public int IdenticalFunctions { get; init; }
/// <summary>
/// Number of semantically similar functions.
/// </summary>
public int SimilarFunctions { get; init; }
/// <summary>
/// Number of semantically different functions.
/// </summary>
public int DifferentFunctions { get; init; }
/// <summary>
/// IR normalization recipe version used.
/// </summary>
public string? NormalizationRecipe { get; init; }
}

View File

@@ -0,0 +1,32 @@
namespace StellaOps.Evidence.Bundle;
/// <summary>
/// Symbol-level diff entry.
/// </summary>
public sealed class BinarySymbolDiff
{
/// <summary>
/// Diff operation type.
/// </summary>
public required BinaryDiffOperation Operation { get; init; }
/// <summary>
/// Symbol name.
/// </summary>
public required string SymbolName { get; init; }
/// <summary>
/// Symbol type (function, object, etc.).
/// </summary>
public string? SymbolType { get; init; }
/// <summary>
/// Section containing the symbol.
/// </summary>
public string? Section { get; init; }
/// <summary>
/// Symbol visibility.
/// </summary>
public string? Visibility { get; init; }
}

View File

@@ -0,0 +1,11 @@
namespace StellaOps.Evidence.Bundle;
public sealed class BuildAncestry
{
public string? ImageDigest { get; init; }
public string? LayerDigest { get; init; }
public string? ArtifactDigest { get; init; }
public string? CommitHash { get; init; }
public string? BuildId { get; init; }
public DateTimeOffset? BuildTime { get; init; }
}

View File

@@ -10,14 +10,3 @@ public sealed class CallStackEvidence
public int? SourceFrameIndex { get; init; }
public string? UnavailableReason { get; init; }
}
public sealed class StackFrame
{
public required string FunctionName { get; init; }
public required string FilePath { get; init; }
public required int Line { get; init; }
public int? Column { get; init; }
public string? SourceSnippet { get; init; }
public bool IsSink { get; init; }
public bool IsSource { get; init; }
}

View File

@@ -0,0 +1,10 @@
namespace StellaOps.Evidence.Bundle;
public sealed class DiffEntry
{
public required DiffOperation Operation { get; init; }
public required string Path { get; init; }
public string? OldValue { get; init; }
public string? NewValue { get; init; }
public string? ComponentPurl { get; init; }
}

View File

@@ -11,16 +11,3 @@ public sealed class DiffEvidence
public DateTimeOffset? PreviousScanTime { get; init; }
public string? UnavailableReason { get; init; }
}
public enum DiffType { Sbom, Vex, Combined }
public sealed class DiffEntry
{
public required DiffOperation Operation { get; init; }
public required string Path { get; init; }
public string? OldValue { get; init; }
public string? NewValue { get; init; }
public string? ComponentPurl { get; init; }
}
public enum DiffOperation { Added, Removed, Modified }

View File

@@ -0,0 +1,8 @@
namespace StellaOps.Evidence.Bundle;
public enum DiffOperation
{
Added,
Removed,
Modified
}

View File

@@ -0,0 +1,8 @@
namespace StellaOps.Evidence.Bundle;
public enum DiffType
{
Sbom,
Vex,
Combined
}

View File

@@ -0,0 +1,8 @@
namespace StellaOps.Evidence.Bundle;
public sealed class DsseEnvelope
{
public required string PayloadType { get; init; }
public required string Payload { get; init; }
public required IReadOnlyList<DsseSignature> Signatures { get; init; }
}

View File

@@ -0,0 +1,7 @@
namespace StellaOps.Evidence.Bundle;
public sealed class DsseSignature
{
public required string KeyId { get; init; }
public required string Sig { get; init; }
}

View File

@@ -0,0 +1,10 @@
namespace StellaOps.Evidence.Bundle;
public sealed class FunctionPathNode
{
public required string FunctionName { get; init; }
public required string FilePath { get; init; }
public required int Line { get; init; }
public int? Column { get; init; }
public string? ModuleName { get; init; }
}

View File

@@ -0,0 +1,9 @@
namespace StellaOps.Evidence.Bundle;
public sealed class PackageImportNode
{
public required string PackageName { get; init; }
public string? Version { get; init; }
public string? ImportedBy { get; init; }
public string? ImportPath { get; init; }
}

View File

@@ -11,34 +11,3 @@ public sealed class ProvenanceEvidence
public string? VerificationStatus { get; init; }
public string? UnavailableReason { get; init; }
}
public sealed class DsseEnvelope
{
public required string PayloadType { get; init; }
public required string Payload { get; init; }
public required IReadOnlyList<DsseSignature> Signatures { get; init; }
}
public sealed class DsseSignature
{
public required string KeyId { get; init; }
public required string Sig { get; init; }
}
public sealed class BuildAncestry
{
public string? ImageDigest { get; init; }
public string? LayerDigest { get; init; }
public string? ArtifactDigest { get; init; }
public string? CommitHash { get; init; }
public string? BuildId { get; init; }
public DateTimeOffset? BuildTime { get; init; }
}
public sealed class RekorReference
{
public required string LogId { get; init; }
public required long LogIndex { get; init; }
public string? Uuid { get; init; }
public DateTimeOffset? IntegratedTime { get; init; }
}

View File

@@ -12,22 +12,3 @@ public sealed class ReachabilityEvidence
public int? ConfidenceTier { get; init; }
public string? UnavailableReason { get; init; }
}
public enum ReachabilityProofType { FunctionLevel, PackageLevel, ImportChain, Heuristic, Unknown }
public sealed class FunctionPathNode
{
public required string FunctionName { get; init; }
public required string FilePath { get; init; }
public required int Line { get; init; }
public int? Column { get; init; }
public string? ModuleName { get; init; }
}
public sealed class PackageImportNode
{
public required string PackageName { get; init; }
public string? Version { get; init; }
public string? ImportedBy { get; init; }
public string? ImportPath { get; init; }
}

View File

@@ -0,0 +1,10 @@
namespace StellaOps.Evidence.Bundle;
public enum ReachabilityProofType
{
FunctionLevel,
PackageLevel,
ImportChain,
Heuristic,
Unknown
}

View File

@@ -0,0 +1,9 @@
namespace StellaOps.Evidence.Bundle;
public sealed class RekorReference
{
public required string LogId { get; init; }
public required long LogIndex { get; init; }
public string? Uuid { get; init; }
public DateTimeOffset? IntegratedTime { get; init; }
}

View File

@@ -0,0 +1,12 @@
namespace StellaOps.Evidence.Bundle;
public sealed class StackFrame
{
public required string FunctionName { get; init; }
public required string FilePath { get; init; }
public required int Line { get; init; }
public int? Column { get; init; }
public string? SourceSnippet { get; init; }
public bool IsSink { get; init; }
public bool IsSource { get; init; }
}

View File

@@ -9,3 +9,4 @@ Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229
| AUDIT-0078-T | DONE | Revalidated 2026-01-08; open findings tracked in audit report. |
| AUDIT-0078-A | TODO | Revalidated 2026-01-08 (open findings). |
| REMED-06 | DONE | SOLID review notes captured for SPRINT_20260130_002. |
| REMED-07 | DONE | Split evidence model types into single-purpose files; dotnet test 2026-02-04 (29 tests). |

View File

@@ -0,0 +1,11 @@
namespace StellaOps.Evidence.Bundle;
public sealed class VexStatement
{
public required string VexStatus { get; init; }
public string? Justification { get; init; }
public string? ImpactStatement { get; init; }
public string? ActionStatement { get; init; }
public DateTimeOffset? Timestamp { get; init; }
public string? Source { get; init; }
}

View File

@@ -9,13 +9,3 @@ public sealed class VexStatusEvidence
public IReadOnlyList<VexStatement>? History { get; init; }
public string? UnavailableReason { get; init; }
}
public sealed class VexStatement
{
public required string VexStatus { get; init; }
public string? Justification { get; init; }
public string? ImpactStatement { get; init; }
public string? ActionStatement { get; init; }
public DateTimeOffset? Timestamp { get; init; }
public string? Source { get; init; }
}