mirror of
https://github.com/okieselbach/AutopilotMonitor.git
synced 2026-10-24 12:42:38 +00:00
vul report fix 3
This commit is contained in:
+15
-7
@@ -132,11 +132,11 @@ export default function VulnerabilityReportSection({
|
||||
const d = (evt.data || {}) as Record<string, unknown>;
|
||||
if (d.findings && Array.isArray(d.findings)) {
|
||||
for (const f of d.findings) {
|
||||
const key = `${f.softwareName || f.software || "Unknown"}|||${f.version || ""}`;
|
||||
const key = `${f.softwareName || f.software || "Unknown"}|||${f.installedVersion || f.version || ""}`;
|
||||
const cves: CveDetail[] = (f.cves || f.vulnerabilities || []).map((c: Record<string, unknown>) => ({
|
||||
cveId: (c.cveId || c.id || c.cve_id || "Unknown") as string,
|
||||
cvss: (c.cvss ?? c.cvssScore ?? c.cvss_score ?? 0) as number,
|
||||
severity: normalizeSeverity(c.severity as string | undefined),
|
||||
severity: normalizeSeverity((c.severity || c.cvssSeverity) as string | undefined),
|
||||
description: (c.description || c.summary || "") as string,
|
||||
kev: (c.kev ?? c.isKev ?? c.is_kev ?? false) as boolean,
|
||||
publishedDate: (c.publishedDate || c.published_date || "") as string,
|
||||
@@ -165,7 +165,7 @@ export default function VulnerabilityReportSection({
|
||||
} else {
|
||||
findingsMap.set(key, {
|
||||
softwareName: f.softwareName || f.software || "Unknown",
|
||||
version: f.version || "",
|
||||
version: f.installedVersion || f.version || "",
|
||||
cves,
|
||||
maxCvss,
|
||||
maxSeverity: maxSev,
|
||||
@@ -175,10 +175,18 @@ export default function VulnerabilityReportSection({
|
||||
kevCount += cveKevCount;
|
||||
}
|
||||
}
|
||||
if (d.unmatchedSoftware && Array.isArray(d.unmatchedSoftware)) {
|
||||
unmatched = [...unmatched, ...d.unmatchedSoftware];
|
||||
} else if (d.unmatched_software && Array.isArray(d.unmatched_software)) {
|
||||
unmatched = [...unmatched, ...d.unmatched_software];
|
||||
const rawUnmatched = d.unmatchedSoftware || d.unmatched_software;
|
||||
if (rawUnmatched && Array.isArray(rawUnmatched)) {
|
||||
for (const entry of rawUnmatched) {
|
||||
if (typeof entry === "string") {
|
||||
unmatched.push(entry);
|
||||
} else if (entry && typeof entry === "object") {
|
||||
const e = entry as Record<string, unknown>;
|
||||
const label = (e.softwareName || e.software || e.name || "Unknown") as string;
|
||||
const ver = (e.installedVersion || e.version || "") as string;
|
||||
unmatched.push(ver ? `${label} (${ver})` : label);
|
||||
}
|
||||
}
|
||||
}
|
||||
total = (d.totalSoftware ?? d.total_software ?? d.totalCount ?? total) as number;
|
||||
const rawFreshness = d.dataFreshness || d.data_freshness || d.analyzedAt || d.analyzed_at || freshness;
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user