analyze-vulnerability-kpis
Skill0 starsChanged 3 months agoMITView on GitHub
Analyze Contoso vulnerability and security KPI posture from live Rapid7 InsightVM bulk-export data and the monthly Vulnerabilities-*.xlsx workbook. Use when the user asks to "break down the Rapid7 vulnerabilities", "what is driving those numbers", how Contoso is doing on vulnerabilities, security KPIs, vulnerability scorecards, how Contoso is being judged, why vulnerability numbers look bad, what is driving findings, what to fix first, how to get better, Rapid7 KPI reporting, patch compliance impact, or vulnerability burn-down. Covers the instance-weighted Critical-over-30-days KPI formula, patch-cohort fingerprinting, and stale/duplicate asset-record inflation.
- Reads credentials
In this repository22 other files it gives its agents.
- acquire-graph-tokenSkill
- author-shared-skillSkill
- build-power-automate-flowSkill
- check-autopilot-serialsSkill
- create-fedex-labelSkill
- deploy-automox-workletSkill
- draft-it-announcementSkill
- enroll-apple-device-abm-intuneSkill
- freshservice-automation-builderSkill
- freshservice-service-catalogSkill
- it-operationsSkill
- manage-cato-clientSkill
- package-intune-win32-appSkill
- prepare-cab-change-ticketSkill
- query-crowdstrike-falconSkill
- retrieve-keeper-secretSkill
- review-intune-byod-app-protectionSkill
- run-intune-maa-teams-notifierSkill
- screenconnect-remote-diagnosticsSkill
- ssh-accessSkill
- switch-ai-toolsSkill
- triage-windows-bsodSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 29
Start/reuse an export and poll it with the bulk-export tools when available (start_rapid7_export -> check_rapid7_export_status -> …
- Very specific: line 93
If many Windows CVEs share the same Instances count, treat it as a patch/reboot/stale-device cohort until reconciled.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Analyze Vulnerability KPIs
Two sources, two different questions
- Live Rapid7 InsightVM bulk export answers "what is actually out there and what is driving the numbers." Use it for driver analysis, cohort fingerprinting and forecasting.
- The newest
Vulnerabilities-YYYYMMDD.xlsxanswers "how we are judged" — it is the artifact leadership reports from. Since Sawyer Oakhurst offboarded (2026-07-29) these workbooks live under Teal de Galloway's OneDrive, in the inheritedSawyer Oakhurst/Documents/vuln/and.../Desktop/folders. Always take the newest file matching that pattern rather than a remembered filename.
Reconcile against Automox, Intune or ScreenConnect when a finding's realness is in question.
The reported KPI formula
"Critical Vulnerabilities Open >30 days" = SUM(Instances) WHERE Severity='Critical' AND CVE
Published On is more than 30 days before the snapshot date. It ages by CVE publication
date, not first-found-on-asset, so a freshly imaged device instantly inherits >30-day criticals
and the metric punishes patch latency and scan-scope growth identically. A true first-found aging
of the same data gives a materially lower number — say which semantics a figure uses.
Live Rapid7 route
- Start/reuse an export and poll it with the bulk-export tools when available
(
start_rapid7_export->check_rapid7_export_status->download_rapid7_export). An export from the same day is reused rather than duplicated. If the download step fails with a DuckDB "used by another process" / lock error, leaked server instances are holding that database. Do not kill them and do not retry in a loop — run
scripts/r7_ingest.pyinside this skill's folder instead. It re-downloads the same completed export and builds its own scratch database:python scripts/r7_ingest.py <export_id> --out-dir <scratch dir>Needs
duckdb+requestson any Python 3, plusRAPID7_API_KEYandRAPID7_REGION(regionus2) in the environment — inject those from Keeper via the retrieve-keeper-secret skill's KSM wrapper, never from a plaintext env file.- Query with
scripts/r7_query.py <sqlfile> --db <scratch dir>/r7.duckdb(opens read-only;----lines separate labelled statements).
Tables: assets (hostName, osProduct, osVersion, sites, tags, riskScore) and vulnerabilities
(one row per asset+vuln+port: severity, title, datePublished, firstFoundTimestamp, hasExploits,
epssscore, cves). Row count is the instance count — port multiplicity is negligible.
What to compute, in order
- Instance totals and Critical/Severe/Moderate split, plus distinct assets and vulns.
- The KPI number using the formula above, then KPI composition by product family
(
regexp_extract(title, '^([^:]+)', 1)) — that is the actual driver list. - Concentration: cumulative KPI by device rank. Compute the running total before filtering
to sample ranks; a window function after a
WHERE rn IN (...)silently sums only those rows. - Cohort fingerprints: group devices by identical (instance count, critical count). Identical counts mean one device cohort missing the same update family, so N devices collapse to one fix.
- Age-in forecast: group critical instances by
datePublished + 30 daysto see which future dates the KPI jumps on. Browser CVE batches age in as very large single-day steps. - Inflation checks — subtract these before believing a number:
- stale/duplicate asset records (same trailing serial, more than one record; keep the freshest
by
MAX(firstFoundTimestamp), the rest carry phantom findings) - records with no new findings in 21+ days (agent silent, device offline, or decommissioned)
- zero-finding "ghost" records, which distort coverage percentages but not instance counts
- stale/duplicate asset records (same trailing serial, more than one record; keep the freshest
by
- Risk-weighting reality check:
hasExploits,threatFeedExists,epssscore > 0.5. These are usually a tiny fraction of the raw count — the KPI measures patch latency, not attack risk.
Interpretation rules
- Instance-weighted totals matter more than vulnerability row counts. One stale browser install produces one instance per CVE per missed release, so a handful of devices can dominate.
- Join Rapid7 to other systems by serial, never hostname — the WKS-
<serial>rename wave double-counts hostname joins and left abandoned AP-<serial>records behind. - Zero Rapid7 exceptions in use means EOL/obsolete software is a permanent KPI floor; recommend documented exceptions where remediation genuinely is not available.
- Sequence remediation by what clears the most instances per action: OS patch/reboot cohorts and browser update enforcement first, then application buckets, then exceptions.
Workbook gotchas
The workbook can contain a normal header sheet plus a second headerless data sheet. Do not assume only the first sheet matters. The headerless sheet's column order is:
Title, Malware, Exploits, CVSSv2, CVSSv3, Risk, Published On, Modified On, Severity, Instances, Exceptions- Fetch it with the SharePoint connector using
download_raw_file=true, save a local copy under the workspace (normallyreports\Vulnerabilities-YYYYMMDD.xlsx), then run the bundledscripts/analyze_vulnerability_kpis.pywith--workbookand--out-dir. - If many Windows CVEs share the same
Instancescount, treat it as a patch/reboot/stale-device cohort until reconciled.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

