DocsSecurity & CompliancePriority Score

Priority Score

How every security finding gets an explainable priority score from 0 to 100 and a band from P1 to P4, combining severity, real exploitation signals, remediability and the context of the asset.


Overview

Each active finding has its own priority score (risk_score, 0–100) and band (P1 most urgent, then P2, P3, P4). The findings table of the Security overview (/dashboard/security) shows the score with the band badge in the Risk column and can be sorted by it, so a CVE in the CISA KEV catalog on an internet-exposed server comes before a theoretical CVE on the same host. Findings of every type are scored: for file changes and other non-CVE findings the exploitation signals are simply absent.

  • The score is additive: each factor adds or removes points, so the breakdown sums up to the score (before the 0–100 clamp)
  • The breakdown is stored with the finding in details.priority as {score, band, rule, factors: [{factor, value, contribution}]}
  • The finding APIs expose priority (P1–P4, or null when not computed yet) in the list and the detail
  • Resolved and false-positive findings keep their last score and are not recomputed

Factors

The factors are always listed in this order, each contribution rounded to one decimal. The default weights are shown in brackets.

  • cvss: the CVSS score of the finding (details.cvss_score) × cvss_per_point (5). Without a CVSS score the factor is severity: the CVSS assumed from the severity (critical 9, high 7, medium 5, low 3, info 0) × cvss_per_point
  • kev: the CVE is in the CISA KEV catalog (+25)
  • kev_ransomware: CISA reports known use in ransomware campaigns (+5)
  • epss: the FIRST EPSS score (0–1) × epss (15); no score adds 0
  • exploit: metasploit when a Metasploit module exists (+10), public when only an ExploitDB exploit exists (+7), none (0)
  • attack_vector: CVSS attack vector of the CVE: network (+5), adjacent (+2), local (-3), physical (-5), unknown (0, also when the CVE is not in the NVD mirror)
  • fix: details.fix_state when present: upgrade_resolves (+5), upgrade_insufficient (+2), fixed_upstream_no_upgrade (+2), already_fixed_pending_rescan (-10), no_fix (0), unknown (0), reboot_required (+5, kernel findings fixed by a reboot); missing or unknown values are neutral (0). The component matcher writes fix_state on every OSV finding it updates (see Finding Filters & KEV Alerts, Fix State Badges) and recomputes the priority in the same run, so a new upgrade candidate reported by the agent moves this factor at the next incremental match. NVD/CPE and imported findings have no fix_state
  • criticality: effective criticality of the asset (explicit, or derived from the environment): critical (+10), high (+5), medium (0), low (-5)
  • exposure: internet_exposed of the asset: yes (+10), no (-5), unknown (0)
  • blast_radius: number of assets that depend on it (the same backwards traversal as the impact analysis, 3 hops): blast_radius_per_log2 (2.5) × log2(dependents + 1), at most blast_radius_max (10)

Bands and the KEV Rule

Score = sum of the contributions, clamped to 0–100 and rounded to one decimal. The band follows the score with these minimum values (SECURITY_PRIORITY_BANDS):

  • P1: score ≥ 80
  • P2: score ≥ 55
  • P3: score ≥ 30
  • P4: below 30
  • Rule kev_exposed_or_critical: a KEV CVE on an asset with internet_exposed = yes or effective criticality critical is always P1. When the score is below the P1 threshold, a visible kev_p1_rule factor adds the missing points, so the score is lifted to the threshold and band and score never diverge

Why P1?

On the finding detail page the Risk Score card shows the score, the band badge and a "Why P1?" (or P2, P3, P4) button. It opens the table of the factors with their value and their signed contribution (+5.0, -3.0), the total score and, when it applied, the rule that forced the band. A finding that has not been scored yet shows "Not computed yet".

Finding detail with priority score explanation, ownership and timeline

Weights and Overrides

The weights live in SECURITY_PRIORITY_WEIGHTS and the band thresholds in SECURITY_PRIORITY_BANDS (config/settings/base.py, with the defaults below). A partial dict is merged over the defaults, nested dicts too: {"kev": 40} changes only the KEV weight, {"criticality": {"critical": 20}} only the critical criticality. After changing them, run the backfill command to rescore the existing findings.

SECURITY_PRIORITY_WEIGHTS = {
    'cvss_per_point': 5.0,
    'severity_cvss': {'critical': 9.0, 'high': 7.0, 'medium': 5.0, 'low': 3.0, 'info': 0.0},
    'kev': 25.0,
    'kev_ransomware': 5.0,
    'epss': 15.0,
    'exploit_metasploit': 10.0,
    'exploit_public': 7.0,
    'attack_vector': {'network': 5.0, 'adjacent': 2.0, 'local': -3.0, 'physical': -5.0, 'unknown': 0.0},
    'fix_state': {
        'upgrade_resolves': 5.0,
        'upgrade_insufficient': 2.0,
        'fixed_upstream_no_upgrade': 2.0,
        'already_fixed_pending_rescan': -10.0,
        'no_fix': 0.0,
        'unknown': 0.0,
        'reboot_required': 5.0,
    },
    'criticality': {'critical': 10.0, 'high': 5.0, 'medium': 0.0, 'low': -5.0},
    'exposure': {'yes': 10.0, 'no': -5.0, 'unknown': 0.0},
    'blast_radius_per_log2': 2.5,
    'blast_radius_max': 10.0,
}
SECURITY_PRIORITY_BANDS = {'P1': 80.0, 'P2': 55.0, 'P3': 30.0}

Targeted Recalculation

The findings affected by these input changes are recomputed, and only the rows whose score or breakdown actually change are written (only the priority key of details, so the other keys are left untouched).

  • Matchers (NVD and component) and agent ingestion: the active findings of the assets written, in the same transaction
  • KEV, EPSS and exploit syncs (online and import_feed bundles): the findings of the CVEs written or cleared by the run. A failed recalculation is logged and does not mark the feed as failed
  • compute_exposure: the findings of the assets whose exposure changed; its summary reports findings_recomputed
  • Asset edits: changing criticality, criticality_locked or internet_exposed (PATCH), setting the criticality in bulk, and assigning or removing a deployment environment (the derived criticality follows it) queue the recompute_priorities task for those assets once the change is committed
  • Environments: changing the kind of an environment, or deleting it, queues the recompute for its assets (their derived criticality changes)
  • Finding status changes (acknowledge, resolve, false positive, reopen) queue the recompute for the asset, so its risk score follows its active findings
  • If the task cannot be queued (broker unavailable) the recompute runs right away in the request; a failure is logged and never fails the change
  • Not recomputed on change: dependency changes (blast radius) and NVD updates of the CVSS score or attack vector of a CVE. They are picked up at the next matcher run on the asset or with manage.py recompute_priorities

Asset Risk Score

Every asset has a risk_score: the highest score among its active findings, or null without active findings. A single P1 finding is enough to make the asset P1, whatever the number of findings. The asset APIs (list and detail) expose risk_score and risk_priority (its band), and the asset Details card shows the "Risk score" entry with its badge, or — when there is none.

Backfill

After the deploy (or after changing the weights) rescore every asset with active findings with the management command, or only some assets with --asset (repeatable). It runs synchronously, without a Celery worker.

python manage.py recompute_priorities
python manage.py recompute_priorities --asset aws:ec2:i-0abc --asset k8s:pod:web-1