beginner

Vulnerability Management and Patching

Find, prioritise and fix weaknesses before attackers use them: asset discovery, scanning, CVE and CVSS, EPSS and the CISA KEV list, risk-based prioritisation, patch management and exceptions, configuration management, and metrics. Practise triaging a vulnerability list in Python.

45 min

The race you are in

Software has flaws. Every week researchers and attackers find new ones, vendors publish fixes, and attackers study the fixes to build exploits, sometimes within hours. The gap between a fix being available and you applying it is when most breaches happen. Vulnerability management is the continuous process of finding weaknesses, deciding which matter, and fixing them in time.

It is not a scan you run once a quarter. It is a cycle:

  1. Discover what you have (assets).
  2. Assess it for weaknesses (scanning and intelligence).
  3. Prioritise by real risk.
  4. Remediate (patch, reconfigure, mitigate, or accept).
  5. Verify the fix worked.
  6. Report and improve, then repeat.

Know what you have

Everything starts with an accurate asset inventory: servers, workstations, network devices, cloud resources, containers, applications, third-party libraries, and who owns each. Use discovery scans, cloud APIs, endpoint agents, DHCP and DNS logs and your configuration database (CMDB). Shadow IT (systems nobody told IT about) is where unpatched flaws live. Include software inventory too: you need to know which versions of which libraries run where, which is the idea behind a software bill of materials (SBOM).

CVE, CWE and CVSS: the language

Term What it is
CVE A unique ID for a specific, publicly known vulnerability (CVE-2021-44228, Log4Shell), kept in the CVE programme and enriched in the NVD (US National Vulnerability Database)
CWE A catalogue of weakness types (CWE-79 cross-site scripting, CWE-89 SQL injection)
CVSS A score from 0 to 10 for the technical severity of a vulnerability
CPE A standard name for products and versions, used to match flaws to software
Advisory The vendor’s description, affected versions, fixes and workarounds

CVSS severity bands: None 0.0, Low 0.1 to 3.9, Medium 4.0 to 6.9, High 7.0 to 8.9, Critical 9.0 to 10.0. The score is built from metrics such as the attack vector (network, adjacent, local, physical), complexity, privileges and user interaction required, and the impact on confidentiality, integrity and availability. (Versions 3.1 and 4.0 are in use.)

The limits of CVSS

CVSS is a severity score, not a risk score. It says how bad the flaw could be in general, not how likely it is to be used against you. Tens of thousands of CVEs are published every year, and only a small fraction are ever exploited. Patching strictly by CVSS means you spend effort on high scores that nobody attacks, and may miss a “medium” that criminals use daily. Add context.

Prioritise by risk, not by score

Combine several questions:

  1. Is it being exploited? Check the CISA Known Exploited Vulnerabilities (KEV) catalogue (confirmed exploitation in the wild) and threat intelligence. Exploited means urgent.
  2. How likely is exploitation? The EPSS (Exploit Prediction Scoring System) gives the probability that a CVE will be exploited in the next 30 days. A public proof-of-concept or exploit kit raises it.
  3. Is it exposed? An internet-facing system with the vulnerable service is far riskier than an isolated internal host.
  4. How valuable is the asset? A flaw on a domain controller, payment system or identity provider matters more than on a lab machine.
  5. What compensating controls exist? A WAF rule, segmentation, disabled feature or an EDR protection may reduce the risk while you patch.
  6. Is the vulnerable component actually reachable and used? (A library present but never called is lower risk, though not zero.)

A simple model many teams use:

Condition Priority
In KEV or known actively exploited Urgent: fix within days (or immediately for internet-facing)
Critical (CVSS 9+) and internet-facing Urgent
High (CVSS 7+) High: fix within about 14 to 30 days
Medium (4 to 6.9) Medium: fix within the normal patch cycle (30 to 90 days)
Low (below 4) Low: fix when convenient or accept

Write the rules into a policy with target timelines (SLAs) that the business has agreed, and measure against them.

Scanning

A vulnerability scanner probes systems and compares what it finds with a database of known flaws.

  • Network scanners: Nessus, OpenVAS/Greenbone, Qualys, Rapid7 InsightVM. Cloud and container scanners (Trivy, Grype, cloud-native tools) cover images and cloud configuration. Dependency scanners (Dependabot, npm audit, pip-audit, Snyk) check the libraries your code uses.
  • Authenticated (credentialed) scans log in and inspect installed software and configuration. They are far more accurate and less noisy than unauthenticated scans, which only see what is visible from the network.
  • Agent-based scanning keeps laptops and roaming devices covered.
  • Frequency: continuous or at least weekly for exposed systems; after major changes; and scan your external perimeter as an attacker would.
  • Careful with production: agree scan windows, intensity and exclusions; some old or fragile devices can crash when scanned.
  • Authorisation: only scan what you own or are authorised to test. Scanning other people’s systems can be illegal.

False positives (reported but not real) and false negatives (missed) both occur. Validate important findings, and do not rely on one tool or one scan type.

Remediation options

Patching is the usual fix, but not the only one:

Option When
Patch / upgrade A vendor fix exists: best option
Configuration change Disable the vulnerable feature or service, change a setting
Compensating control Cannot patch yet: segment, block the port, add a WAF or virtual patch, increase monitoring
Replace or retire End-of-life software that no longer gets fixes
Accept the risk Low risk or cost outweighs benefit: document, get approval, set a review date

Patch management that works

  1. Inventory and ownership: know which systems each team patches.
  2. Standard cycle: for example monthly (aligned with vendor release days such as Microsoft’s Patch Tuesday), with a fast track for urgent fixes.
  3. Test on a representative group first, then roll out in rings (pilot, early adopters, broad), with the ability to roll back.
  4. Automate with the tools built for it (WSUS, Intune, SCCM/Configuration Manager, Ansible, unattended-upgrades, cloud patch managers) and verify with a follow-up scan.
  5. Maintenance windows and communication so teams know about restarts.
  6. Do not forget the unglamorous parts: firmware (routers, switches, firewalls, BIOS), hypervisors, third-party apps (browsers, PDF readers, Java), containers and images that are never rebuilt, and libraries inside applications.
  7. End-of-life: track when software stops receiving updates and plan replacement before then.

Exceptions

Sometimes a patch cannot be applied (a critical legacy machine, a vendor-certified system). Handle it formally: a documented exception with the risk, the compensating controls, an owner, an expiry date and approval. An undocumented skipped patch is a hidden risk.

Zero-days and emergencies

A zero-day is a flaw being exploited before a patch exists. When one appears (with a CVE and a vendor workaround):

  1. Identify whether you are affected (this is where inventory and SBOM pay off).
  2. Mitigate immediately with the vendor’s workaround, firewall or WAF rules, or by disabling the feature.
  3. Hunt for signs of exploitation in logs (assume you may already be compromised).
  4. Patch as soon as a fix is available, then verify and remove the workaround.
  5. Communicate status to leadership in plain language.

Practise it, because the next emergency will not announce itself.

Beyond software: other weaknesses

Vulnerability management also covers misconfigurations (open storage, default credentials, weak TLS settings, excessive permissions), weak passwords, missing hardening, and exposed services. Compare systems against a baseline (CIS Benchmarks, vendor hardening guides) and use configuration management and policy-as-code so drift is detected and corrected.

Penetration testing and red teaming complement scanning: humans chain weaknesses together as an attacker would, and find logic flaws scanners cannot. Bug bounty and vulnerability disclosure programmes let outsiders report flaws responsibly; publish a security.txt file with a contact so researchers know where to send reports.

Metrics that matter

  • Coverage: percentage of assets scanned and managed.
  • Mean time to remediate by severity, against your SLAs.
  • Exposure: number of known-exploited vulnerabilities on internet-facing systems (aim for zero).
  • Aged vulnerabilities: how many critical and high findings are past their deadline.
  • Recurrence: the same class of flaw appearing again (a process problem).
  • Exception count and age.

Report trends to leadership, and use them to argue for fixing root causes (automation, standard images) instead of chasing individual findings.

Lab: triage a vulnerability list

You are given a small list of findings. Write priority(v) using this policy, then produce a work plan sorted by priority and then by CVSS score (highest first):

  1. If kev is true: urgent.
  2. Else if cvss is 9.0 or higher and the asset is internet_facing: urgent.
  3. Else if cvss is 7.0 or higher: high.
  4. Else if cvss is 4.0 or higher: medium.
  5. Otherwise: low.

Priority order is urgent, high, medium, low. plan should be a list of (id, priority) pairs in the order to fix them.

Triage the findings — Python 3
YOUR CODE (edit here, then press Run)
Ctrl/⌘ + Enter
OUTPUT

What you learned

Vulnerability management is a loop: discover, assess, prioritise by real risk, remediate, verify. Severity scores alone mislead, so combine exploitation evidence, exposure and asset value; automate patching with testing and rollback; treat exceptions formally; and measure how fast you fix what matters.

Your scanner reports 4,000 findings, and the team cannot fix them all this month. How do you decide what to do first?

Prioritise by risk: first anything on the KEV list or with a public exploit, especially on internet-facing and high-value assets; then critical and high findings on exposed or sensitive systems; then bulk fixes that remove many findings at once (updating a base image or a shared library). Use compensating controls for what cannot be patched yet, document exceptions, and track mean time to remediate against agreed deadlines.

Can You Explain It?

Close the lesson and answer these without looking back. The goal isn't the wording — it's whether you've formed a usable mental model.

  • Explain why a CVSS score is not the same as risk, and name three extra factors for prioritising.
  • Describe the steps of a patch rollout and how you reduce the chance of an update breaking production.
  • What is a documented exception, and what must it contain?

🧪 Want to practise this on your own computer? See how to set up your lab →

🤖

Need clarification? Ask GT

Hi, I'm GT — your AI tutor for Vulnerability Management and Patching. What would you like to know?
📝

Knowledge Check

1 of 4

What does a CVE identifier refer to?

Report a problem

About: /lessons/vulnerability-management-and-patching