using System;
using System.Collections.Generic;
namespace VanadiumGuard.Protocol
{
///
/// One observation. The client fills these in and ships them; it draws no conclusions.
///
public sealed class Detection
{
public DetectionCode Code { get; set; }
public Severity Severity { get; set; }
///
/// 0-100. How sure the client is that the observation is what it looks like, rather
/// than a legitimate program that happens to match. The policy engine multiplies
/// weight by confidence, so a noisy heuristic can stay enabled at low confidence
/// without ever reaching a disconnect on its own.
///
public int Confidence { get; set; }
/// Normalised subject: module base name, process image name, method signature.
public string Subject { get; set; } = string.Empty;
/// Which detector produced this, for triage.
public string Detector { get; set; } = string.Empty;
/// Supporting detail. Keep it small; it is stored verbatim.
public Dictionary Evidence { get; set; } = new Dictionary();
public DateTimeOffset FirstObservedUtc { get; set; }
public DateTimeOffset LastObservedUtc { get; set; }
/// Times this exact Code plus Subject pair was seen before the batch flushed.
public int OccurrenceCount { get; set; } = 1;
/// Dedupe key used by both the client sink and the server store.
public string DedupeKey()
{
return ((int)Code).ToString() + "|" + Subject;
}
}
}