Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Concelier Attestation Tests / attestation-tests (push) Has been cancelled
Policy Lint & Smoke / policy-lint (push) Has been cancelled
64 lines
2.1 KiB
C#
64 lines
2.1 KiB
C#
using System.Collections.Generic;
|
|
|
|
namespace StellaOps.Cli.Services.Models;
|
|
|
|
// CLI-POLICY-27-003: Enhanced simulation modes
|
|
internal enum PolicySimulationMode
|
|
{
|
|
Quick,
|
|
Batch
|
|
}
|
|
|
|
/// <summary>
|
|
/// Input for policy simulation.
|
|
/// Per CLI-EXC-25-002, supports exception preview via WithExceptions/WithoutExceptions.
|
|
/// Per CLI-POLICY-27-003, supports mode (quick/batch), SBOM selectors, heatmap, and manifest download.
|
|
/// Per CLI-SIG-26-002, supports reachability overrides for vulnerability/package state and score.
|
|
/// </summary>
|
|
internal sealed record PolicySimulationInput(
|
|
int? BaseVersion,
|
|
int? CandidateVersion,
|
|
IReadOnlyList<string> SbomSet,
|
|
IReadOnlyDictionary<string, object?> Environment,
|
|
bool Explain,
|
|
IReadOnlyList<string>? WithExceptions = null,
|
|
IReadOnlyList<string>? WithoutExceptions = null,
|
|
PolicySimulationMode? Mode = null,
|
|
IReadOnlyList<string>? SbomSelectors = null,
|
|
bool IncludeHeatmap = false,
|
|
bool IncludeManifest = false,
|
|
IReadOnlyList<ReachabilityOverride>? ReachabilityOverrides = null);
|
|
|
|
internal sealed record PolicySimulationResult(
|
|
PolicySimulationDiff Diff,
|
|
string? ExplainUri,
|
|
PolicySimulationHeatmap? Heatmap = null,
|
|
string? ManifestDownloadUri = null,
|
|
string? ManifestDigest = null);
|
|
|
|
internal sealed record PolicySimulationDiff(
|
|
string? SchemaVersion,
|
|
int Added,
|
|
int Removed,
|
|
int Unchanged,
|
|
IReadOnlyDictionary<string, PolicySimulationSeverityDelta> BySeverity,
|
|
IReadOnlyList<PolicySimulationRuleDelta> RuleHits);
|
|
|
|
internal sealed record PolicySimulationSeverityDelta(int? Up, int? Down);
|
|
|
|
internal sealed record PolicySimulationRuleDelta(string RuleId, string RuleName, int? Up, int? Down);
|
|
|
|
// CLI-POLICY-27-003: Heatmap summary for quick severity visualization
|
|
internal sealed record PolicySimulationHeatmap(
|
|
int Critical,
|
|
int High,
|
|
int Medium,
|
|
int Low,
|
|
int Info,
|
|
IReadOnlyList<PolicySimulationHeatmapBucket> Buckets);
|
|
|
|
internal sealed record PolicySimulationHeatmapBucket(
|
|
string Label,
|
|
int Count,
|
|
string? Color);
|