agentleFS
mdmiller5933mdmiller5933/agentic-it-ops/skills/analyze-vulnerability-kpis/SKILL.md

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

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
  1. Very specific:

    Start/reuse an export and poll it with the bulk-export tools when available (start_rapid7_export -> check_rapid7_export_status -> …

    line 29
  2. Very specific:

    If many Windows CVEs share the same Instances count, treat it as a patch/reboot/stale-device cohort until reconciled.

    line 93

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.xlsx answers "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 inherited Sawyer 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

  1. 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.
  2. 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.py inside 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 + requests on any Python 3, plus RAPID7_API_KEY and RAPID7_REGION (region us2) in the environment — inject those from Keeper via the retrieve-keeper-secret skill's KSM wrapper, never from a plaintext env file.

  3. 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

  1. Instance totals and Critical/Severe/Moderate split, plus distinct assets and vulns.
  2. The KPI number using the formula above, then KPI composition by product family (regexp_extract(title, '^([^:]+)', 1)) — that is the actual driver list.
  3. 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.
  4. 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.
  5. Age-in forecast: group critical instances by datePublished + 30 days to see which future dates the KPI jumps on. Browser CVE batches age in as very large single-day steps.
  6. 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
  7. 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 (normally reports\Vulnerabilities-YYYYMMDD.xlsx), then run the bundled scripts/analyze_vulnerability_kpis.py with --workbook and --out-dir.
  • If many Windows CVEs share the same Instances count, treat it as a patch/reboot/stale-device cohort until reconciled.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.