fix(risk): Technique uses status_global and mitre_id (not status/technique_id)
Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled
Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled
This commit is contained in:
@@ -67,8 +67,8 @@ def _compute_for_technique(db: Session, tech: Technique) -> TechniqueRiskProfile
|
||||
).first()
|
||||
confidence_level: float = float(dlc_conf.confidence_score or 0.0) if dlc_conf else 0.0
|
||||
|
||||
# Map technique status to coverage factor
|
||||
status = tech.status
|
||||
# Map technique status_global to coverage factor
|
||||
status = tech.status_global
|
||||
if status == TechniqueStatus.validated:
|
||||
status_coverage = 1.0
|
||||
elif status == TechniqueStatus.partial:
|
||||
@@ -86,7 +86,7 @@ def _compute_for_technique(db: Session, tech: Technique) -> TechniqueRiskProfile
|
||||
detection_gap = 1.0 - raw_coverage
|
||||
breakdown["detection_gap"] = {
|
||||
"mapping_count": mapping_count,
|
||||
"status": str(status) if status else None,
|
||||
"status": str(status.value) if status else None,
|
||||
"status_coverage": status_coverage,
|
||||
"confidence_level": round(confidence_level, 3),
|
||||
"detection_gap": round(detection_gap, 3),
|
||||
@@ -306,7 +306,7 @@ def get_risk_matrix(db: Session) -> list:
|
||||
{
|
||||
"technique_id": str(p.technique_id),
|
||||
"technique_name": t.name,
|
||||
"technique_tid": t.technique_id,
|
||||
"technique_tid": t.mitre_id,
|
||||
"risk_score": p.risk_score,
|
||||
"likelihood": p.likelihood,
|
||||
"impact": p.impact,
|
||||
@@ -341,7 +341,7 @@ def get_risk_summary(db: Session) -> dict:
|
||||
{
|
||||
"technique_id": str(p.technique_id),
|
||||
"technique_name": t.name,
|
||||
"technique_tid": t.technique_id,
|
||||
"technique_tid": t.mitre_id,
|
||||
"risk_score": p.risk_score,
|
||||
"risk_level": p.risk_level,
|
||||
"likelihood": p.likelihood,
|
||||
|
||||
Reference in New Issue
Block a user