WEBMAILDBSCANNERNVDCISA KEVPATCH1findings = [("web", 9.1, False),2 ("mail", 7.5, True),3 ("db", 5.3, False)]4def rank(f):5 host, cvss, kev = f6 return (not kev, -cvss)7for f in sorted(findings, key=rank):8 print(f[0])FIX QUEUE1st2nd3rd
Back: three servers, the scanner, the NVD, CISA's KEV catalog and the vendor patchFront: the Python ranking script and the fix queueTokens: findings, a CVSS score, a KEV mark, the patch and a verification scanA small firm keeps an inventory of three servers, and a scanner finds one known flaw on each. CVSS rates them 9.1 (critical), 7.5 (high) and 5.3 (medium); CISA's KEV catalog shows only the mail server's flaw is being exploited. A short Python script sorts the findings KEV first, then by score, giving the fix queue mail, web, db. The mail server is patched, a fresh scan confirms the fix, and the loop starts again. The three findings, their scores and the KEV mark are made up to show the method. Real CVE records list their own scores, and an NVD score can change as more is learned.

Finding the flaws

  1. A vulnerability is a weakness a threat could use: a bug in software, a bad setting, a missing step. Each publicly known one gets an ID called a CVE. This mail server runs software with one.

Ranking them in Python

Fixing and checking

What happens

;; step 1/11 · weakness
vulnerability  a weakness that a threat could use
               (NIST CSRC glossary)
CVE            one public ID per known flaw
               CVE-YEAR-NUMBER, for example
               CVE-2021-44228 (Log4Shell, in Apache Log4j)
here           the flaws are made-up examples

The three findings, their scores and the KEV mark are made up to show the method. Real CVE records list their own scores, and an NVD score can change as more is learned. FIRST, which maintains CVSS, says it is designed to measure severity and should not be used alone to assess risk. Real programs also weigh how exposed a system is and how important it is: CISA's SSVC decision trees and FIRST's EPSS (the chance of exploitation) help with that.