100 lines
2.7 KiB
C#
100 lines
2.7 KiB
C#
// <copyright file="BinaryDiffEvidence.cs" company="StellaOps">
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
// Sprint: SPRINT_20260112_008_LB_binary_diff_evidence_models (BINDIFF-LB-001)
|
|
// </copyright>
|
|
|
|
using System.Collections.Immutable;
|
|
|
|
namespace StellaOps.Evidence.Bundle;
|
|
|
|
/// <summary>
|
|
/// Binary diff evidence capturing semantic and structural changes between binary versions.
|
|
/// </summary>
|
|
public sealed class BinaryDiffEvidence
|
|
{
|
|
/// <summary>
|
|
/// Status of the binary diff evidence.
|
|
/// </summary>
|
|
public required EvidenceStatus Status { get; init; }
|
|
|
|
/// <summary>
|
|
/// SHA-256 hash of the diff evidence content.
|
|
/// </summary>
|
|
public string? Hash { get; init; }
|
|
|
|
/// <summary>
|
|
/// Previous binary artifact digest.
|
|
/// </summary>
|
|
public string? PreviousBinaryDigest { get; init; }
|
|
|
|
/// <summary>
|
|
/// Current binary artifact digest.
|
|
/// </summary>
|
|
public string? CurrentBinaryDigest { get; init; }
|
|
|
|
/// <summary>
|
|
/// Type of binary diff performed.
|
|
/// </summary>
|
|
public BinaryDiffType DiffType { get; init; }
|
|
|
|
/// <summary>
|
|
/// Binary format or ISA (e.g., "elf-x86_64", "pe-amd64", "macho-arm64").
|
|
/// </summary>
|
|
public string? BinaryFormat { get; init; }
|
|
|
|
/// <summary>
|
|
/// Tool and version used for diffing.
|
|
/// </summary>
|
|
public string? ToolVersion { get; init; }
|
|
|
|
/// <summary>
|
|
/// Overall similarity score (0.0-1.0).
|
|
/// </summary>
|
|
public double? SimilarityScore { get; init; }
|
|
|
|
/// <summary>
|
|
/// Function-level changes.
|
|
/// </summary>
|
|
public ImmutableArray<BinaryFunctionDiff> FunctionChanges { get; init; } = [];
|
|
|
|
/// <summary>
|
|
/// Symbol-level changes.
|
|
/// </summary>
|
|
public ImmutableArray<BinarySymbolDiff> SymbolChanges { get; init; } = [];
|
|
|
|
/// <summary>
|
|
/// Section-level changes.
|
|
/// </summary>
|
|
public ImmutableArray<BinarySectionDiff> SectionChanges { get; init; } = [];
|
|
|
|
/// <summary>
|
|
/// Semantic fingerprint changes.
|
|
/// </summary>
|
|
public BinarySemanticDiff? SemanticDiff { get; init; }
|
|
|
|
/// <summary>
|
|
/// Security-relevant changes detected.
|
|
/// </summary>
|
|
public ImmutableArray<BinarySecurityChange> SecurityChanges { get; init; } = [];
|
|
|
|
/// <summary>
|
|
/// Reason if diff is unavailable.
|
|
/// </summary>
|
|
public string? UnavailableReason { get; init; }
|
|
|
|
/// <summary>
|
|
/// Previous scan ID for reference.
|
|
/// </summary>
|
|
public string? PreviousScanId { get; init; }
|
|
|
|
/// <summary>
|
|
/// Previous scan time.
|
|
/// </summary>
|
|
public DateTimeOffset? PreviousScanTime { get; init; }
|
|
|
|
/// <summary>
|
|
/// When this diff was computed.
|
|
/// </summary>
|
|
public DateTimeOffset? ComputedAt { get; init; }
|
|
}
|