feat: Add initial implementation of Vulnerability Resolver Jobs
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
- Created project for StellaOps.Scanner.Analyzers.Native.Tests with necessary dependencies. - Documented roles and guidelines in AGENTS.md for Scheduler module. - Implemented IResolverJobService interface and InMemoryResolverJobService for handling resolver jobs. - Added ResolverBacklogNotifier and ResolverBacklogService for monitoring job metrics. - Developed API endpoints for managing resolver jobs and retrieving metrics. - Defined models for resolver job requests and responses. - Integrated dependency injection for resolver job services. - Implemented ImpactIndexSnapshot for persisting impact index data. - Introduced SignalsScoringOptions for configurable scoring weights in reachability scoring. - Added unit tests for ReachabilityScoringService and RuntimeFactsIngestionService. - Created dotnet-filter.sh script to handle command-line arguments for dotnet. - Established nuget-prime project for managing package downloads.
This commit is contained in:
@@ -29,6 +29,11 @@ public sealed class SignalsOptions
|
||||
/// Air-gap configuration.
|
||||
/// </summary>
|
||||
public SignalsAirGapOptions AirGap { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Reachability scoring configuration.
|
||||
/// </summary>
|
||||
public SignalsScoringOptions Scoring { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Validates configured options.
|
||||
@@ -39,5 +44,6 @@ public sealed class SignalsOptions
|
||||
Mongo.Validate();
|
||||
Storage.Validate();
|
||||
AirGap.Validate();
|
||||
Scoring.Validate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
|
||||
namespace StellaOps.Signals.Options;
|
||||
|
||||
/// <summary>
|
||||
/// Configurable weights used by reachability scoring.
|
||||
/// </summary>
|
||||
public sealed class SignalsScoringOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Confidence assigned when a path exists from entry point to target.
|
||||
/// </summary>
|
||||
public double ReachableConfidence { get; set; } = 0.75;
|
||||
|
||||
/// <summary>
|
||||
/// Confidence assigned when no path exists from entry point to target.
|
||||
/// </summary>
|
||||
public double UnreachableConfidence { get; set; } = 0.25;
|
||||
|
||||
/// <summary>
|
||||
/// Bonus applied when runtime evidence matches the discovered path.
|
||||
/// </summary>
|
||||
public double RuntimeBonus { get; set; } = 0.15;
|
||||
|
||||
/// <summary>
|
||||
/// Maximum confidence permitted after bonuses are applied.
|
||||
/// </summary>
|
||||
public double MaxConfidence { get; set; } = 0.99;
|
||||
|
||||
/// <summary>
|
||||
/// Minimum confidence permitted after penalties are applied.
|
||||
/// </summary>
|
||||
public double MinConfidence { get; set; } = 0.05;
|
||||
|
||||
public void Validate()
|
||||
{
|
||||
EnsurePercent(nameof(ReachableConfidence), ReachableConfidence);
|
||||
EnsurePercent(nameof(UnreachableConfidence), UnreachableConfidence);
|
||||
EnsurePercent(nameof(RuntimeBonus), RuntimeBonus);
|
||||
EnsurePercent(nameof(MaxConfidence), MaxConfidence);
|
||||
EnsurePercent(nameof(MinConfidence), MinConfidence);
|
||||
|
||||
if (MinConfidence > UnreachableConfidence)
|
||||
{
|
||||
throw new ArgumentException("MinConfidence must be less than or equal to UnreachableConfidence.");
|
||||
}
|
||||
|
||||
if (UnreachableConfidence > ReachableConfidence)
|
||||
{
|
||||
throw new ArgumentException("UnreachableConfidence must be less than or equal to ReachableConfidence.");
|
||||
}
|
||||
|
||||
if (ReachableConfidence > MaxConfidence)
|
||||
{
|
||||
throw new ArgumentException("ReachableConfidence must be less than or equal to MaxConfidence.");
|
||||
}
|
||||
|
||||
if (MinConfidence >= MaxConfidence)
|
||||
{
|
||||
throw new ArgumentException("MinConfidence must be less than MaxConfidence.");
|
||||
}
|
||||
}
|
||||
|
||||
private static void EnsurePercent(string name, double value)
|
||||
{
|
||||
if (double.IsNaN(value) || value < 0.0 || value > 1.0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(name, value, "Value must be between 0 and 1.");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user