JPeetz/agent-skills / skills/security/vulnerability-management
vulnerability-management
VerifiedUse this skill when implementing or operating a vulnerability management program — automated vulnerability scanning, risk-based prioritization (CVSS/EPSS), patch management automation, zero-day response procedures, CVE tracking and monitoring, vulnerability metrics tracking, remediation verification, security advisory monitoring, and threat intelligence integration.
| File | Kind | Size |
|---|---|---|
| CHANGELOG.md | markdown | 1.8 KB |
| LICENSE | other | 1.0 KB |
| SKILL.md | skill md | 21.6 KB |
| evals/evals.json | config | 3.6 KB |
| references/sources.md | markdown | 7.3 KB |
| scripts/cve_lookup.pyexecutable | script | 7.7 KB |
| scripts/prioritize.pyexecutable | script | 8.7 KB |
scripts/prioritize.py
View on GitHub#!/usr/bin/env python3
"""Rank vulnerability findings with the skill's composite risk model and compute SLA deadlines.
Input: JSON array or CSV of findings. Recognized fields (case-insensitive, common
aliases accepted):
id / finding_id / cve / title
cvss / cvss_score / severity (severity alone is accepted: critical/high/medium/low)
epss (0-1)
kev (true/false/1/0)
exposure (internet|partner|internal) or internet_facing (bool)
criticality / tier (1-3 or "tier1")
compensating_control (bool) or mitigated (bool)
discovered / first_seen / created (ISO date; defaults to today)
Output: ranked table (text) or --json. Priority score uses documented weights:
severity: critical 10, high 7, medium 4, low 1
exposure: internet +3, partner +2, internal +1
exploit: KEV +4, EPSS>=0.5 +3, EPSS>=0.1 +2, else 0
criticality: tier1 +3, tier2 +1, tier3 0
mitigation: -2 when a compensating control is documented
Usage:
python3 prioritize.py findings.json
python3 prioritize.py findings.csv --json --today 2026-11-13
"""
from __future__ import annotations
import argparse
import csv
import json
import sys
from datetime import date, datetime, timedelta
from pathlib import Path
SEVERITY_WEIGHT = {"critical": 10.0, "high": 7.0, "medium": 4.0, "low": 1.0, "none": 0.0}
EXPOSURE_WEIGHT = {"internet": 3.0, "partner": 2.0, "internal": 1.0}
SLA_DAYS = {
# (severity, internet-facing) -> days
"critical": {"internet": 3, "internal": 7},
"high": {"internet": 7, "internal": 30},
"medium": {"internet": 30, "internal": 90},
"low": {"internet": 90, "internal": 180},
}
ALIASES = {
"id": ["id", "finding_id", "cve", "title", "name"],
"cvss": ["cvss", "cvss_score", "cvssscore", "score"],
"severity": ["severity", "band", "risk"],
"epss": ["epss", "epss_score", "epssscore"],
"kev": ["kev", "kev_listed", "in_kev", "known_exploited"],
"exposure": ["exposure", "exposure_type", "location"],
"internet_facing": ["internet_facing", "internetfacing", "public"],
"criticality": ["criticality", "tier", "asset_tier", "asset_criticality"],
"compensating_control": ["compensating_control", "mitigated", "compensating"],
"discovered": ["discovered", "first_seen", "created", "found"],
}
def norm_key(k: str) -> str:
return k.strip().lower().replace("-", "_").replace(" ", "_")
def pick(row: dict, field: str):
nrow = {norm_key(k): v for k, v in row.items()}
for alias in ALIASES[field]:
if alias in nrow and nrow[alias] not in ("", None):
return nrow[alias]
return None
def truthy(v) -> bool:
if isinstance(v, bool):
return v
if v is None:
return False
return str(v).strip().lower() in {"1", "true", "yes", "y", "kev", "listed"}
def band_from_score(score: float) -> str:
if score >= 9.0:
return "critical"
if score >= 7.0:
return "high"
if score >= 4.0:
return "medium"
return "low"
def exposure_of(row: dict) -> str:
raw = (pick(row, "exposure") or "").strip().lower()
if raw in EXPOSURE_WEIGHT:
return raw
if raw in {"external", "public", "dmz"}:
return "internet"
if truthy(pick(row, "internet_facing")):
return "internet"
return "internal"
def tier_of(row: dict) -> int:
raw = pick(row, "criticality")
if raw is None:
return 2
s = str(raw).strip().lower().replace("tier", "").replace("t", "")
try:
return min(3, max(1, int(float(s))))
except ValueError:
return {"critical": 1, "high": 1, "medium": 2, "low": 3}.get(s, 2)
def parse_date(v) -> date:
if not v:
return date.today()
s = str(v)[:10]
for fmt in ("%Y-%m-%d", "%d/%m/%Y", "%m/%d/%Y"):
try:
return datetime.strptime(str(v)[:10] if fmt == "%Y-%m-%d" else str(v), fmt).date()
except ValueError:
continue
try:
return datetime.fromisoformat(str(v).replace("Z", "+00:00")).date()
except ValueError:
return date.today()
def score_row(row: dict, today: date) -> dict:
cvss_raw = pick(row, "cvss")
cvss = None
if cvss_raw is not None:
try:
cvss = float(cvss_raw)
except (TypeError, ValueError):
cvss = None
sev_raw = str(pick(row, "severity") or "").strip().lower()
severity = sev_raw if sev_raw in SEVERITY_WEIGHT else None
if severity is None and cvss is not None:
severity = band_from_score(cvss)
if severity is None:
severity = "medium"
epss: float | None = None
epss_raw = pick(row, "epss")
if epss_raw is not None:
try:
epss = float(str(epss_raw).strip().rstrip("%"))
if epss > 1.0: # tolerate percentage input
epss /= 100.0
except (TypeError, ValueError):
epss = None
kev = truthy(pick(row, "kev"))
if kev: # KEV overrides the severity band for SLA purposes
severity = "critical"
exposure = exposure_of(row)
tier = tier_of(row)
mitigated = truthy(pick(row, "compensating_control"))
discovered = parse_date(pick(row, "discovered"))
score = SEVERITY_WEIGHT[severity] + EXPOSURE_WEIGHT[exposure]
score += 4.0 if kev else (3.0 if (epss or 0) >= 0.5 else (2.0 if (epss or 0) >= 0.1 else 0.0))
score += {1: 3.0, 2: 1.0, 3: 0.0}[tier]
if mitigated:
score -= 2.0
score = max(score, 0.0)
if kev:
sla_sev = "critical"
elif cvss is not None and cvss >= 9.0:
sla_sev = "critical"
else:
sla_sev = severity
days = SLA_DAYS[sla_sev]["internet" if exposure == "internet" else "internal"]
due = discovered + timedelta(days=days)
overdue = (today - due).days
return {
"id": pick(row, "id") or "unnamed",
"cvss": cvss,
"severity": severity,
"epss": epss,
"kev": kev,
"exposure": exposure,
"tier": tier,
"compensating_control": mitigated,
"priority_score": round(score, 2),
"discovered": discovered.isoformat(),
"sla_days": days,
"due": due.isoformat(),
"days_remaining": -overdue,
"status": "OVERDUE" if overdue > 0 else ("DUE" if overdue == 0 else "open"),
}
def load(path: Path) -> list[dict]:
text = path.read_text(encoding="utf-8")
if path.suffix.lower() == ".csv" or text.lstrip()[:1] not in "[{":
return list(csv.DictReader(text.splitlines()))
data = json.loads(text)
if isinstance(data, dict):
data = data.get("findings") or data.get("cases") or data.get("data") or []
if not isinstance(data, list):
raise SystemExit("error: JSON must be an array of findings (or {\"findings\": [...]})")
return data
def render(rows: list[dict]) -> str:
header = f"{'#':>2} {'PRIORITY':>8} {'SEV':<8} {'CVSS':>5} {'EPSS':>6} {'KEV':<4} {'EXPOSURE':<8} {'DUE':<10} {'LEFT':>5} ID"
out = [header, "-" * len(header)]
for i, r in enumerate(rows, 1):
cvss = "-" if r["cvss"] is None else f"{r['cvss']:.1f}"
epss = "-" if r["epss"] is None else f"{r['epss']:.3f}"
out.append(
f"{i:>2} {r['priority_score']:>8.2f} {r['severity']:<8} "
f"{cvss:>5} {epss:>6} {('YES' if r['kev'] else 'no'):<4} "
f"{r['exposure']:<8} {r['due']:<10} {r['days_remaining']:>5} {r['id']}"
)
overdue = sum(1 for r in rows if r["status"] == "OVERDUE")
kev = sum(1 for r in rows if r["kev"])
out.append("")
out.append(f"{len(rows)} findings · {overdue} overdue · {kev} KEV-listed")
return "\n".join(out)
def main() -> int:
ap = argparse.ArgumentParser(description="Rank vulnerability findings by composite risk and SLA.")
ap.add_argument("input", help="Findings file (.json or .csv); use - for stdin")
ap.add_argument("--json", action="store_true", help="Emit ranked JSON")
ap.add_argument("--today", help="Override today's date (YYYY-MM-DD) for reproducible runs")
ap.add_argument("--top", type=int, help="Only show the top N findings")
args = ap.parse_args()
if args.input == "-":
rows_in = json.load(sys.stdin)
if isinstance(rows_in, dict):
rows_in = rows_in.get("findings", [])
else:
path = Path(args.input)
if not path.exists():
print(f"error: {path} not found", file=sys.stderr)
return 2
rows_in = load(path)
today = parse_date(args.today) if args.today else date.today()
scored = sorted((score_row(r, today) for r in rows_in), key=lambda r: -r["priority_score"])
if args.top:
scored = scored[: args.top]
if args.json:
print(json.dumps(scored, indent=2))
else:
print(render(scored))
return 0
if __name__ == "__main__":
raise SystemExit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |