ENع
←Vulnerability management
Lesson 19 · Security operations

Vulnerability management

12 min11 steps5 questionsAdvanced
About this lesson

Vulnerability management is the loop that keeps known flaws out of your systems: keep an inventory, scan it, judge each finding by severity (CVSS) and by whether attackers are really using it (CISA's KEV catalog), fix the most urgent first, check the fix, and repeat. Follow one small firm through the loop, with a short Python script that ranks its findings so an exploited high-severity flaw is fixed before an unexploited critical one.

You'll learn to

Tick what you feel confident about. These self-checks do not affect your lesson score.

Fig 19 · Interactive
01 / 11

What a vulnerability is

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.

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
Loading figure…
or ← →
Read the lesson step by step
  1. What a vulnerability is

    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.

    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
  2. Start with an inventory

    Vulnerability management is a loop: find flaws, rank them, fix them, check the fix, repeat. It starts with an inventory of every system and the software on it, with versions. You cannot fix what you do not know you have.

    the loop     inventory → scan → rank → fix → verify → repeat
    inventory    every system, its software and versions
      web   web server
      mail  mail server
      db    database
    NIST CSF 2.0 ID.AM-01 / ID.AM-02: inventories are maintained
  3. Scan for known flaws

    A vulnerability scanner compares each system's software and versions with public lists of known flaws. Every match is a finding. Here it reports one finding on each server: the web server, the mail server and the database.

    scanner   installed versions vs known flaws
    finding   one known flaw on one system
      web   1 finding
      mail  1 finding
      db    1 finding
    NIST CSF 2.0 ID.RA-01: vulnerabilities are
              identified, validated and recorded
  4. How severe? CVSS

    The Common Vulnerability Scoring System (CVSS) rates how severe a flaw is, from 0 to 10. NIST's National Vulnerability Database publishes scores. Ours: web 9.1 (critical), mail 7.5 (high), database 5.3 (medium).

    CVSS severity scale (FIRST, v3.1 and v4.0)
      None      0.0
      Low       0.1 - 3.9
      Medium    4.0 - 6.9
      High      7.0 - 8.9
      Critical  9.0 - 10.0
    web   9.1  Critical
    mail  7.5  High
    db    5.3  Medium
  5. Is it being exploited?

    Severity is not urgency. CISA's Known Exploited Vulnerabilities (KEV) catalog lists flaws attackers are really using, and CISA urges everyone to fix these first. The mail server's flaw is on the list; the other two are not.

    KEV       flaws known to be exploited in the wild
    BOD 26-04 US federal agencies must fix them
              within set timelines (2026)
    web   not listed
    mail  on the KEV list
    db    not listed
  6. Findings as Python data

    A short Python script ranks the work. Each finding is a tuple, a fixed group of values: the host, its CVSS score, and True or False for 'on the KEV list'. The three findings make one list.

    findings = [("web", 9.1, False),
                ("mail", 7.5, True),
                ("db", 5.3, False)]
    
    tuple   (host, cvss, kev)
    kev     True = on the KEV list
  7. A sort key: KEV first

    rank() turns a finding into a sort key: (not kev, -cvss). Python compares tuples item by item, and False sorts before True, so KEV flaws come first. The minus sign then puts higher scores first.

    def rank(f):
        host, cvss, kev = f
        return (not kev, -cvss)
    
    rank(web)  → (True, -9.1)
    rank(mail) → (False, -7.5)
    rank(db)   → (True, -5.3)
    False < True, and -9.1 < -5.3
  8. The fix queue

    sorted() orders the findings by that key, and the loop prints each host: mail, web, db. The exploited high-severity flaw goes ahead of the critical one that is not known to be exploited. That order is the fix queue.

    for f in sorted(findings, key=rank):
        print(f[0])
    
    output
      mail
      web
      db
  9. Remediate: patch or mitigate

    Remediating removes the flaw, usually by installing the vendor's patch: a fixed version of the software. If no patch exists yet, mitigate: switch off the risky feature or isolate the system until one arrives.

    remediate  remove the flaw: install the patch
               (a fixed version from the vendor)
    mitigate   no patch yet: turn the feature off,
               or isolate the system
    NIST SP 800-40r4  patching is preventive maintenance
  10. Verify, then close

    Then check. A fresh scan of the mail server confirms the flaw is gone, and only then is the finding closed. The queue moves on to web, then db. Tracking how long each fix takes shows if you keep up.

    verify    rescan: is the flaw really gone?
    close     only after the rescan is clean
    queue     mail ✓ · web · db
    measure   time from finding to fix
  11. Round the loop again

    New flaws are published every day, and the KEV list keeps growing. So the loop never stops: keep the inventory current, scan regularly, re-rank when the lists change and patch on a schedule. NIST calls patching preventive maintenance.

    every day   new CVE records, new KEV entries
    so          inventory  current
                scan       regularly
                rank       again when the lists change
                patch      on a schedule (preventive maintenance)

Quiz Unlocks after the last step.