project-athena 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -0
- package/README.md +56 -4
- package/dist/{activity-P4UUFHWV.js → activity-XCHKBZTG.js} +6 -6
- package/dist/{agents-3HTSQGL2.js → agents-HUJ4JXIB.js} +6 -6
- package/dist/{ai-ASL4FFQ7.js → ai-LGTLQKL4.js} +3 -3
- package/dist/{analyze-F3YOILNL.js → analyze-AP4XJT7D.js} +10 -9
- package/dist/{chunk-ZB7LC6FP.js → chunk-3KFOI2X4.js} +2 -2
- package/dist/{chunk-PANVPNYF.js → chunk-44EGCEB2.js} +59 -251
- package/dist/{chunk-SJOOXO34.js → chunk-4FETKOY3.js} +9 -8
- package/dist/chunk-4IIBVTBS.js +76 -0
- package/dist/{chunk-LEMPCNAY.js → chunk-56EXAGTM.js} +3 -3
- package/dist/{chunk-32PRS2MG.js → chunk-6OSQMXUP.js} +5 -5
- package/dist/{chunk-OLPSEQS5.js → chunk-AKOI4VTD.js} +10 -1
- package/dist/{chunk-EF6GHOIN.js → chunk-C25FDXOO.js} +133 -23
- package/dist/{chunk-S7T6VX56.js → chunk-DH5AGULY.js} +8 -4
- package/dist/chunk-F65QINMR.js +702 -0
- package/dist/chunk-GU3ZX2J7.js +166 -0
- package/dist/chunk-GYQG4Q2N.js +108 -0
- package/dist/chunk-IDODPGTX.js +595 -0
- package/dist/chunk-KJYSNZXS.js +934 -0
- package/dist/{chunk-PR53DT7I.js → chunk-L2EHJCH4.js} +8 -8
- package/dist/{chunk-65TSRDQ3.js → chunk-P4TRQMES.js} +2 -2
- package/dist/{chunk-TGJUUB44.js → chunk-PZPMWCXS.js} +5 -5
- package/dist/chunk-QCC4VJUH.js +217 -0
- package/dist/{chunk-DOQMAZL5.js → chunk-R5AX7VST.js} +3 -3
- package/dist/{chunk-JY6BFIJJ.js → chunk-RQKGT2EK.js} +3 -3
- package/dist/{chunk-PDFQ5BFG.js → chunk-SVTEJYMS.js} +4 -155
- package/dist/{chunk-VSYBC3VY.js → chunk-UMWX4UTK.js} +2 -2
- package/dist/{chunk-RXNRMIZP.js → chunk-WUIC65QO.js} +2 -2
- package/dist/{chunk-JCGDR4UV.js → chunk-WWQ5NKEC.js} +3 -1
- package/dist/{chunk-XB66PZ6Z.js → chunk-X7EYOAEX.js} +2 -2
- package/dist/chunk-Y6SDMZET.js +278 -0
- package/dist/{chunk-2RS6TA3D.js → chunk-YRIS7ZS6.js} +28 -17
- package/dist/{clean-S7PKCOLM.js → clean-LQOG56AM.js} +4 -4
- package/dist/cli.js +2 -2
- package/dist/{context-AH5MFHRG.js → context-G5YHY3L2.js} +24 -10
- package/dist/{doctor-RSJMLE2P.js → doctor-L34QJ7WR.js} +17 -10
- package/dist/{event-TNT6CQZR.js → event-6YW6TGFI.js} +3 -3
- package/dist/{git-hook-YZNZGAAP.js → git-hook-Y7Y262F7.js} +2 -2
- package/dist/{init-2V34DVRQ.js → init-427QR5AS.js} +10 -9
- package/dist/{mcp-T2GRTEX5.js → mcp-DWNWRGJW.js} +196 -21
- package/dist/memory-XBZCYQLW.js +393 -0
- package/dist/{open-2QSZKKUG.js → open-LJMOB6U2.js} +262 -69
- package/dist/{program-V2USHGXN.js → program-DCP526LU.js} +63 -32
- package/dist/{review-R3R2J5BJ.js → review-VEJBPACX.js} +14 -11
- package/dist/{rules-4FXJUCXB.js → rules-M4DLLXBL.js} +4 -4
- package/dist/scan-JVKCVHPD.js +939 -0
- package/dist/{security-PI4LXCOB.js → security-JTJN3E7K.js} +15 -11
- package/dist/{staged-check-HHIBKKMR.js → staged-check-PQSLGQBW.js} +15 -13
- package/dist/{status-6M73WX5I.js → status-PO27BSOZ.js} +10 -4
- package/dist/{sync-3ZNJDSSU.js → sync-GVO2VHPI.js} +14 -12
- package/dist/{watch-USN5CQIV.js → watch-TEHFO47V.js} +14 -12
- package/dist/web/assets/{Editor-BI56-HX5.js → Editor-Bnilgch0.js} +1 -1
- package/dist/web/assets/{abnfDiagram-O67JEVCF-y_9px2ob.js → abnfDiagram-O67JEVCF-DW9LWr8f.js} +1 -1
- package/dist/web/assets/architecture-7GRP2DOG-BWDZV2yn.js +1 -0
- package/dist/web/assets/{architectureDiagram-NJMV4G6O-lB6fcVzU.js → architectureDiagram-NJMV4G6O-0eKeQRhj.js} +1 -1
- package/dist/web/assets/{blockDiagram-BEXU5L5S-DcM5pEjM.js → blockDiagram-BEXU5L5S-D5i3-ogI.js} +1 -1
- package/dist/web/assets/{c4Diagram-YGBWAQC7-CJgqxTY2.js → c4Diagram-YGBWAQC7-BAWQZrEu.js} +1 -1
- package/dist/web/assets/channel-Bkh05NKd.js +1 -0
- package/dist/web/assets/{chunk-3FUC2YCW-B8l_VuWR.js → chunk-3FUC2YCW-fKRGOZF3.js} +1 -1
- package/dist/web/assets/{chunk-5DYCD2WN-CZecgNhf.js → chunk-5DYCD2WN-C5jOlx42.js} +1 -1
- package/dist/web/assets/{chunk-742MDFTN-BeZ7P5jB.js → chunk-742MDFTN-urY4RP_A.js} +1 -1
- package/dist/web/assets/{chunk-7INBJB4K-IKy0pr5m.js → chunk-7INBJB4K-nk48sKqZ.js} +1 -1
- package/dist/web/assets/{chunk-7M6MHVWA-Dg_QqJEX.js → chunk-7M6MHVWA-BfBD9X0F.js} +1 -1
- package/dist/web/assets/{chunk-7PRAP22T-DqQNS8oq.js → chunk-7PRAP22T-jYf59QlI.js} +1 -1
- package/dist/web/assets/{chunk-GTNCS2PH-x4sM51nJ.js → chunk-GTNCS2PH-BOCxryKf.js} +1 -1
- package/dist/web/assets/{chunk-GWA4HPMP-CE5GcwVN.js → chunk-GWA4HPMP-CFpaW0ru.js} +1 -1
- package/dist/web/assets/{chunk-MBY4JIJT-DA_D1hjF.js → chunk-MBY4JIJT-BIB8HctN.js} +1 -1
- package/dist/web/assets/{chunk-NETBCI7D-CeJ3XBZ2.js → chunk-NETBCI7D-CpUUK6rh.js} +1 -1
- package/dist/web/assets/{chunk-O7XYJQB3-BH2gESvO.js → chunk-O7XYJQB3-BNx_V4Oi.js} +1 -1
- package/dist/web/assets/{chunk-UA2S7LBM-BWr0xCux.js → chunk-UA2S7LBM-D3tMiIOY.js} +1 -1
- package/dist/web/assets/{chunk-WEXAMYUT-B4QwUZPM.js → chunk-WEXAMYUT-CC-3C32l.js} +1 -1
- package/dist/web/assets/{chunk-Z7XXMR3K-BxcA-y5B.js → chunk-Z7XXMR3K-BzhxKQUc.js} +1 -1
- package/dist/web/assets/{chunk-ZIGJFQKS-BZYvP63G.js → chunk-ZIGJFQKS-D4tBHzxg.js} +1 -1
- package/dist/web/assets/{classDiagram-v2-NBCMYWYE-BS3P_NXb.js → classDiagram-v2-NBCMYWYE-BbtyanXR.js} +1 -1
- package/dist/web/assets/{cynefin-OW5HDTMX-BALD4Pve.js → cynefin-OW5HDTMX-BIArb8W1.js} +1 -1
- package/dist/web/assets/{cynefinDiagram-VND7K2PF-BM2y4W6d.js → cynefinDiagram-VND7K2PF-BrAcfkXL.js} +1 -1
- package/dist/web/assets/{dagre-6A5THRUB-PTfOrIdF.js → dagre-6A5THRUB-BcHXRl4s.js} +1 -1
- package/dist/web/assets/{diagram-22UHCM2B-CpXEHhUl.js → diagram-22UHCM2B-Dx9tSCdE.js} +1 -1
- package/dist/web/assets/{diagram-3UASUU5V-DPHfXzr6.js → diagram-3UASUU5V-CLLDP9yH.js} +1 -1
- package/dist/web/assets/{diagram-ATOU4E4O-DMBNXvAC.js → diagram-ATOU4E4O-B46H9iPt.js} +1 -1
- package/dist/web/assets/{diagram-CDSNMT55-CDLe1M7G.js → diagram-CDSNMT55-CYtvB6aG.js} +1 -1
- package/dist/web/assets/{diagram-MLGK6HIB-D6L8oE7j.js → diagram-MLGK6HIB-Dar7ktoX.js} +1 -1
- package/dist/web/assets/{diagram-MPIPVDR6-CP-S7rrQ.js → diagram-MPIPVDR6-C-DljnYN.js} +1 -1
- package/dist/web/assets/{ebnfDiagram-ZINNZB2B-CkUc63TK.js → ebnfDiagram-ZINNZB2B-Dv_3jWnh.js} +1 -1
- package/dist/web/assets/{elk-276RUBZZ-C1CAJLH_.js → elk-276RUBZZ-DnHciE9k.js} +1 -1
- package/dist/web/assets/{erDiagram-OPXOYQCR-DXBnaTHm.js → erDiagram-OPXOYQCR-Bn46KrHz.js} +1 -1
- package/dist/web/assets/eventmodeling-NTZA5JFV-DYwoptMd.js +1 -0
- package/dist/web/assets/flowDiagram-KWPJA3E3-y4rS0gIB.js +1 -0
- package/dist/web/assets/{ganttDiagram-FUAMR5RP-BVm8SiGg.js → ganttDiagram-FUAMR5RP-DOjjJtqz.js} +1 -1
- package/dist/web/assets/{gitGraph-4MIJSDKK-Dm7xBrW0.js → gitGraph-4MIJSDKK-BIoMXJRQ.js} +1 -1
- package/dist/web/assets/{gitGraphDiagram-X574FWY7-D_PIKKhx.js → gitGraphDiagram-X574FWY7-BsJ01R0v.js} +1 -1
- package/dist/web/assets/{index-CeOIBpu2.js → index-Cen0jOXj.js} +5 -4
- package/dist/web/assets/{index-DKE3ojTe.css → index-WwRY6n68.css} +1 -1
- package/dist/web/assets/{info-A6RAGUB7-CLGrx8pn.js → info-A6RAGUB7-BmlXzRWj.js} +1 -1
- package/dist/web/assets/{infoDiagram-VRGFBTTK-BlBjaKm7.js → infoDiagram-VRGFBTTK-CYPJPmBP.js} +1 -1
- package/dist/web/assets/{ishikawaDiagram-OU5B5YK6-Kxe7GGS3.js → ishikawaDiagram-OU5B5YK6-YN96geky.js} +1 -1
- package/dist/web/assets/{journeyDiagram-ZHPQQLJL-wCMoHK4M.js → journeyDiagram-ZHPQQLJL-20juojKY.js} +1 -1
- package/dist/web/assets/{kanban-definition-PNTS6WVX-BxdCz9Ko.js → kanban-definition-PNTS6WVX-BhCKIEbP.js} +1 -1
- package/dist/web/assets/{line-Zf11FnWF.js → line-BERsMFG6.js} +1 -1
- package/dist/web/assets/{mermaid-parser.core-BvFFklev.js → mermaid-parser.core-Bis_wTB-.js} +3 -3
- package/dist/web/assets/{mermaid.core-Cd_Ssti9.js → mermaid.core-DMsM3ZX7.js} +4 -4
- package/dist/web/assets/{mindmap-definition-NLK3R4M7-BGPQl-GY.js → mindmap-definition-NLK3R4M7-BkcGdOfv.js} +1 -1
- package/dist/web/assets/{packet-AYTQ26CC-6lI3cEX_.js → packet-AYTQ26CC-Bh30-JJX.js} +1 -1
- package/dist/web/assets/{pegDiagram-GJSIUBJH-BPIjlSAj.js → pegDiagram-GJSIUBJH-DxnIo9RF.js} +1 -1
- package/dist/web/assets/{pie-WAS4IAKB-D6Dzj3Ja.js → pie-WAS4IAKB-ChaTr-GD.js} +1 -1
- package/dist/web/assets/{pieDiagram-5QR66LMP-DtA-vZmv.js → pieDiagram-5QR66LMP-CzAp78FM.js} +1 -1
- package/dist/web/assets/{quadrantDiagram-O4NWA36T-EettyqQn.js → quadrantDiagram-O4NWA36T-BDSE-cfY.js} +1 -1
- package/dist/web/assets/{radar-RG4KPBEZ-xmRc3Dl8.js → radar-RG4KPBEZ-DgJ-o_dq.js} +1 -1
- package/dist/web/assets/{railroad-74A4TZTK-BLB7dhOn.js → railroad-74A4TZTK-C8MmcBKz.js} +1 -1
- package/dist/web/assets/railroad-abnf-HS5TGJTU-CTLXjcdP.js +1 -0
- package/dist/web/assets/railroad-ebnf-LZEXJU2U-ggWsTTL0.js +1 -0
- package/dist/web/assets/railroad-peg-WCYAUIDC-D1mCX705.js +1 -0
- package/dist/web/assets/{railroadDiagram-XR7U4H2S-PBw4We6b.js → railroadDiagram-XR7U4H2S-DfbcWRNh.js} +1 -1
- package/dist/web/assets/{requirementDiagram-PLB6GJNP-DjQpaUFA.js → requirementDiagram-PLB6GJNP-DM3nksxs.js} +1 -1
- package/dist/web/assets/{sankeyDiagram-IPEJSGJF-CBW-_AoF.js → sankeyDiagram-IPEJSGJF-DthUpiiC.js} +1 -1
- package/dist/web/assets/{sequenceDiagram-PO4LG4MO-DEoPYqY9.js → sequenceDiagram-PO4LG4MO-DLA3nuvA.js} +1 -1
- package/dist/web/assets/{stateDiagram-v2-GCMORJYK-UZq5rPud.js → stateDiagram-v2-GCMORJYK-B0X6ihBW.js} +1 -1
- package/dist/web/assets/{swimlanes-2SLR337P-CACfuXJR.js → swimlanes-2SLR337P-B4qWe6vE.js} +1 -1
- package/dist/web/assets/swimlanesDiagram-TC7HE7FX-ClIk3e7S.js +8 -0
- package/dist/web/assets/{timeline-definition-EJHVYXUP-CYJl7mP-.js → timeline-definition-EJHVYXUP-F-cDzYrj.js} +1 -1
- package/dist/web/assets/{treeView-Q6P3EWNA-DtZ5nkPQ.js → treeView-Q6P3EWNA-BaI30nLZ.js} +1 -1
- package/dist/web/assets/{treemap-WGGIJYW6-m49GDM-M.js → treemap-WGGIJYW6-D2jGGoMl.js} +1 -1
- package/dist/web/assets/{usecaseDiagram-POWQR4AR-C2Vg20UK.js → usecaseDiagram-POWQR4AR-B9qoAQCy.js} +1 -1
- package/dist/web/assets/{vennDiagram-UO4OBE2U-C07v5OGI.js → vennDiagram-UO4OBE2U-DGVNOaKO.js} +1 -1
- package/dist/web/assets/{wardley-WFR3VGLG-C9Z7EZtz.js → wardley-WFR3VGLG-DbKqhNAh.js} +1 -1
- package/dist/web/assets/{wardleyDiagram-VNRHLVJA-DdA8CcSC.js → wardleyDiagram-VNRHLVJA-BgZ1gprw.js} +1 -1
- package/dist/web/assets/{xychartDiagram-PMCCYNJV-C9EZw07b.js → xychartDiagram-PMCCYNJV-D73RYid1.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +3 -1
- package/dist/chunk-CXUTYCZX.js +0 -238
- package/dist/chunk-LMOFZNTQ.js +0 -379
- package/dist/web/assets/architecture-7GRP2DOG-DyxkwYiW.js +0 -1
- package/dist/web/assets/channel-BvDD7AMO.js +0 -1
- package/dist/web/assets/eventmodeling-NTZA5JFV-cLIzvgDp.js +0 -1
- package/dist/web/assets/flowDiagram-KWPJA3E3-D7Zq63VQ.js +0 -1
- package/dist/web/assets/railroad-abnf-HS5TGJTU-DBFym6g8.js +0 -1
- package/dist/web/assets/railroad-ebnf-LZEXJU2U-CkG28ig8.js +0 -1
- package/dist/web/assets/railroad-peg-WCYAUIDC-Df_Ifaad.js +0 -1
- package/dist/web/assets/swimlanesDiagram-TC7HE7FX-CDSrqdgx.js +0 -8
package/dist/chunk-LMOFZNTQ.js
DELETED
|
@@ -1,379 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
whichExecutable
|
|
4
|
-
} from "./chunk-VSYBC3VY.js";
|
|
5
|
-
import {
|
|
6
|
-
scanFilesForSecrets,
|
|
7
|
-
secretFingerprinter
|
|
8
|
-
} from "./chunk-PANVPNYF.js";
|
|
9
|
-
import {
|
|
10
|
-
walkProject
|
|
11
|
-
} from "./chunk-ELKFRTZT.js";
|
|
12
|
-
import {
|
|
13
|
-
loadConfig
|
|
14
|
-
} from "./chunk-2DY4PUR4.js";
|
|
15
|
-
|
|
16
|
-
// src/services/security.ts
|
|
17
|
-
import { execFile } from "child_process";
|
|
18
|
-
import { promises as fs } from "fs";
|
|
19
|
-
import path from "path";
|
|
20
|
-
var AuditToolError = class extends Error {
|
|
21
|
-
};
|
|
22
|
-
var asRecord = (v) => v && typeof v === "object" && !Array.isArray(v) ? v : {};
|
|
23
|
-
var isObject = (v) => Boolean(v) && typeof v === "object" && !Array.isArray(v);
|
|
24
|
-
var sev = (s) => {
|
|
25
|
-
const v = String(s ?? "").toLowerCase();
|
|
26
|
-
if (v === "critical") return "critical";
|
|
27
|
-
if (v === "high") return "high";
|
|
28
|
-
if (v === "moderate" || v === "medium") return "moderate";
|
|
29
|
-
if (v === "low" || v === "info") return "low";
|
|
30
|
-
return "unrated";
|
|
31
|
-
};
|
|
32
|
-
function parseJsonObject(stdout, tool) {
|
|
33
|
-
const text = stdout.trim();
|
|
34
|
-
if (!text) throw new AuditToolError(`${tool} produced no output`);
|
|
35
|
-
const json = JSON.parse(text);
|
|
36
|
-
if (!isObject(json)) throw new AuditToolError(`${tool} produced unexpected output`);
|
|
37
|
-
return json;
|
|
38
|
-
}
|
|
39
|
-
function throwIfToolError(json, tool) {
|
|
40
|
-
if (json.error === void 0) return;
|
|
41
|
-
const e = asRecord(json.error);
|
|
42
|
-
const parts = [e.code, e.summary ?? e.message].filter((x) => typeof x === "string" && x.trim());
|
|
43
|
-
const text = parts.length ? parts.join(": ") : typeof json.error === "string" ? json.error : "unknown error";
|
|
44
|
-
throw new AuditToolError(`${tool} reported an error: ${text.split("\n")[0].slice(0, 200)}`);
|
|
45
|
-
}
|
|
46
|
-
function parseAdvisories(advisories) {
|
|
47
|
-
const out = [];
|
|
48
|
-
for (const [key, raw] of Object.entries(advisories)) {
|
|
49
|
-
const a = asRecord(raw);
|
|
50
|
-
const versions = [...new Set((Array.isArray(a.findings) ? a.findings : []).map((f) => asRecord(f).version).filter((v) => typeof v === "string"))];
|
|
51
|
-
const patched = typeof a.patched_versions === "string" ? a.patched_versions.trim() : "";
|
|
52
|
-
out.push({
|
|
53
|
-
package: String(a.module_name ?? "unknown"),
|
|
54
|
-
severity: sev(a.severity),
|
|
55
|
-
title: String(a.title ?? `Vulnerable dependency: ${String(a.module_name ?? key)}`),
|
|
56
|
-
id: typeof a.github_advisory_id === "string" ? a.github_advisory_id : Array.isArray(a.cves) && typeof a.cves[0] === "string" ? a.cves[0] : String(a.id ?? key),
|
|
57
|
-
url: typeof a.url === "string" ? a.url : void 0,
|
|
58
|
-
vulnerableRange: typeof a.vulnerable_versions === "string" ? a.vulnerable_versions + (versions.length ? ` (installed ${versions.join(", ")})` : "") : void 0,
|
|
59
|
-
fixAvailable: Boolean(patched) && patched !== "<0.0.0"
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
return out;
|
|
63
|
-
}
|
|
64
|
-
function parseNpmAudit(stdout) {
|
|
65
|
-
const json = parseJsonObject(stdout, "npm audit");
|
|
66
|
-
throwIfToolError(json, "npm audit");
|
|
67
|
-
if (!isObject(json.vulnerabilities)) {
|
|
68
|
-
if (isObject(json.advisories)) return parseAdvisories(json.advisories);
|
|
69
|
-
throw new AuditToolError('npm audit output has no "vulnerabilities" report');
|
|
70
|
-
}
|
|
71
|
-
const out = [];
|
|
72
|
-
for (const [name, raw] of Object.entries(json.vulnerabilities)) {
|
|
73
|
-
const v = asRecord(raw);
|
|
74
|
-
const via = Array.isArray(v.via) ? v.via : [];
|
|
75
|
-
const advisory = via.find((x) => x && typeof x === "object");
|
|
76
|
-
const viaNames = via.filter((x) => typeof x === "string");
|
|
77
|
-
out.push({
|
|
78
|
-
package: name,
|
|
79
|
-
severity: sev(v.severity),
|
|
80
|
-
title: String(advisory?.title ?? (viaNames.length ? `Depends on vulnerable ${viaNames.join(", ")}` : `Vulnerable dependency: ${name}`)),
|
|
81
|
-
id: advisory?.source !== void 0 ? String(advisory.source) : void 0,
|
|
82
|
-
url: typeof advisory?.url === "string" ? advisory.url : void 0,
|
|
83
|
-
vulnerableRange: typeof v.range === "string" ? v.range : void 0,
|
|
84
|
-
fixAvailable: Boolean(v.fixAvailable)
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
return out;
|
|
88
|
-
}
|
|
89
|
-
function parsePnpmAudit(stdout) {
|
|
90
|
-
const json = parseJsonObject(stdout, "pnpm audit");
|
|
91
|
-
throwIfToolError(json, "pnpm audit");
|
|
92
|
-
if (!isObject(json.advisories)) throw new AuditToolError('pnpm audit output has no "advisories" report');
|
|
93
|
-
return parseAdvisories(json.advisories);
|
|
94
|
-
}
|
|
95
|
-
function parsePipAudit(stdout) {
|
|
96
|
-
const text = stdout.trim();
|
|
97
|
-
if (!text) throw new AuditToolError("pip-audit produced no output");
|
|
98
|
-
const json = JSON.parse(text);
|
|
99
|
-
const deps = isObject(json) && Array.isArray(json.dependencies) ? json.dependencies : Array.isArray(json) ? json : null;
|
|
100
|
-
if (!deps) throw new AuditToolError('pip-audit output has no "dependencies" list');
|
|
101
|
-
const out = [];
|
|
102
|
-
for (const raw of deps) {
|
|
103
|
-
const d = asRecord(raw);
|
|
104
|
-
for (const vRaw of Array.isArray(d.vulns) ? d.vulns : []) {
|
|
105
|
-
const v = asRecord(vRaw);
|
|
106
|
-
const aliases = Array.isArray(v.aliases) ? v.aliases.filter((a) => typeof a === "string") : [];
|
|
107
|
-
const id = typeof v.id === "string" ? v.id : void 0;
|
|
108
|
-
out.push({
|
|
109
|
-
package: String(d.name ?? "unknown"),
|
|
110
|
-
severity: "unrated",
|
|
111
|
-
// pip-audit does not report severity
|
|
112
|
-
title: String(v.description ?? id ?? "Known vulnerability").split("\n")[0].slice(0, 300),
|
|
113
|
-
id: id ?? aliases[0],
|
|
114
|
-
url: id ? `https://osv.dev/vulnerability/${id}` : void 0,
|
|
115
|
-
vulnerableRange: typeof d.version === "string" ? `installed ${d.version}` : void 0,
|
|
116
|
-
fixAvailable: Array.isArray(v.fix_versions) && v.fix_versions.length > 0
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
return out;
|
|
121
|
-
}
|
|
122
|
-
function splitJsonStream(text) {
|
|
123
|
-
const out = [];
|
|
124
|
-
let depth = 0;
|
|
125
|
-
let inString = false;
|
|
126
|
-
let escaped = false;
|
|
127
|
-
let start = -1;
|
|
128
|
-
for (let i = 0; i < text.length; i++) {
|
|
129
|
-
const ch = text[i];
|
|
130
|
-
if (inString) {
|
|
131
|
-
if (escaped) escaped = false;
|
|
132
|
-
else if (ch === "\\") escaped = true;
|
|
133
|
-
else if (ch === '"') inString = false;
|
|
134
|
-
continue;
|
|
135
|
-
}
|
|
136
|
-
if (ch === '"') {
|
|
137
|
-
if (depth > 0) inString = true;
|
|
138
|
-
} else if (ch === "{") {
|
|
139
|
-
if (depth === 0) start = i;
|
|
140
|
-
depth++;
|
|
141
|
-
} else if (ch === "}" && depth > 0) {
|
|
142
|
-
depth--;
|
|
143
|
-
if (depth === 0) {
|
|
144
|
-
out.push(JSON.parse(text.slice(start, i + 1)));
|
|
145
|
-
start = -1;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
if (depth !== 0) throw new AuditToolError("truncated JSON output");
|
|
150
|
-
return out;
|
|
151
|
-
}
|
|
152
|
-
var REACH_RANK = { required: 0, imported: 1, called: 2 };
|
|
153
|
-
function parseGovulncheck(stdout) {
|
|
154
|
-
const messages = splitJsonStream(stdout).map(asRecord);
|
|
155
|
-
if (!messages.some((m) => isObject(m.config))) throw new AuditToolError("govulncheck produced no JSON report");
|
|
156
|
-
const osvs = /* @__PURE__ */ new Map();
|
|
157
|
-
for (const m of messages) {
|
|
158
|
-
const osv = asRecord(m.osv);
|
|
159
|
-
if (typeof osv.id === "string") osvs.set(osv.id, osv);
|
|
160
|
-
}
|
|
161
|
-
const found = /* @__PURE__ */ new Map();
|
|
162
|
-
for (const m of messages) {
|
|
163
|
-
const f = asRecord(m.finding);
|
|
164
|
-
if (typeof f.osv !== "string") continue;
|
|
165
|
-
const trace = (Array.isArray(f.trace) ? f.trace : []).map(asRecord);
|
|
166
|
-
const reach = trace.some((t) => typeof t.function === "string") ? "called" : trace.some((t) => typeof t.package === "string") ? "imported" : "required";
|
|
167
|
-
const first = trace[0] ?? {};
|
|
168
|
-
const prev = found.get(f.osv);
|
|
169
|
-
if (prev && REACH_RANK[prev.reach] >= REACH_RANK[reach]) continue;
|
|
170
|
-
found.set(f.osv, {
|
|
171
|
-
module: typeof first.module === "string" ? first.module : prev?.module,
|
|
172
|
-
version: typeof first.version === "string" ? first.version : prev?.version,
|
|
173
|
-
fixed: typeof f.fixed_version === "string" ? f.fixed_version : prev?.fixed,
|
|
174
|
-
reach
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
const label = { called: "called by your code", imported: "package imported, vulnerable symbol not called", required: "module required, package not imported" };
|
|
178
|
-
return [...found].map(([id, f]) => {
|
|
179
|
-
const osv = osvs.get(id) ?? {};
|
|
180
|
-
const affected = Array.isArray(osv.affected) ? asRecord(osv.affected[0]) : {};
|
|
181
|
-
return {
|
|
182
|
-
package: f.module ?? String(asRecord(affected.package).name ?? "unknown"),
|
|
183
|
-
severity: "unrated",
|
|
184
|
-
// the Go vulnerability database does not assign severities
|
|
185
|
-
title: `${String(osv.summary ?? id)} (${label[f.reach]})`,
|
|
186
|
-
id,
|
|
187
|
-
url: `https://pkg.go.dev/vuln/${id}`,
|
|
188
|
-
vulnerableRange: f.version ? `installed ${f.version}` : void 0,
|
|
189
|
-
fixAvailable: Boolean(f.fixed)
|
|
190
|
-
};
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
function parseCargoAudit(stdout) {
|
|
194
|
-
const json = parseJsonObject(stdout, "cargo audit");
|
|
195
|
-
if (!isObject(json.vulnerabilities)) throw new AuditToolError('cargo audit output has no "vulnerabilities" report');
|
|
196
|
-
const list = Array.isArray(json.vulnerabilities.list) ? json.vulnerabilities.list : [];
|
|
197
|
-
return list.map((raw) => {
|
|
198
|
-
const v = asRecord(raw);
|
|
199
|
-
const advisory = asRecord(v.advisory);
|
|
200
|
-
const pkg = asRecord(v.package);
|
|
201
|
-
return {
|
|
202
|
-
package: String(pkg.name ?? "unknown"),
|
|
203
|
-
severity: sev(asRecord(advisory.cvss).severity ?? advisory.severity),
|
|
204
|
-
title: String(advisory.title ?? "Known vulnerability"),
|
|
205
|
-
id: typeof advisory.id === "string" ? advisory.id : void 0,
|
|
206
|
-
url: typeof advisory.url === "string" ? advisory.url : void 0
|
|
207
|
-
};
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
function parseComposerAudit(stdout) {
|
|
211
|
-
const json = parseJsonObject(stdout, "composer audit");
|
|
212
|
-
if (json.advisories === void 0) throw new AuditToolError('composer audit output has no "advisories" report');
|
|
213
|
-
const advisories = asRecord(json.advisories);
|
|
214
|
-
const out = [];
|
|
215
|
-
for (const [pkg, raw] of Object.entries(advisories)) {
|
|
216
|
-
for (const aRaw of Array.isArray(raw) ? raw : Object.values(asRecord(raw))) {
|
|
217
|
-
const a = asRecord(aRaw);
|
|
218
|
-
out.push({
|
|
219
|
-
package: pkg,
|
|
220
|
-
severity: sev(a.severity),
|
|
221
|
-
title: String(a.title ?? "Known vulnerability"),
|
|
222
|
-
id: typeof a.cve === "string" ? a.cve : typeof a.advisoryId === "string" ? a.advisoryId : void 0,
|
|
223
|
-
url: typeof a.link === "string" ? a.link : void 0,
|
|
224
|
-
vulnerableRange: typeof a.affectedVersions === "string" ? a.affectedVersions : void 0
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
return out;
|
|
229
|
-
}
|
|
230
|
-
var MAX_PIP_TARGETS = 10;
|
|
231
|
-
var REQUIREMENTS_FILE = /(^|\/)requirements[\w.-]*\.txt$/i;
|
|
232
|
-
async function planPipAudit(ctx) {
|
|
233
|
-
const common = ["--format", "json", "--progress-spinner", "off"];
|
|
234
|
-
const reqs = ctx.files.filter((f) => REQUIREMENTS_FILE.test(f)).sort();
|
|
235
|
-
const reqDirs = new Set(reqs.map((f) => path.posix.dirname(f)));
|
|
236
|
-
const out = reqs.map((f) => ({ target: f, args: ["-r", f, ...common] }));
|
|
237
|
-
for (const f of ctx.files.filter((x) => x === "pyproject.toml" || x.endsWith("/pyproject.toml")).sort()) {
|
|
238
|
-
const dir = path.posix.dirname(f);
|
|
239
|
-
if (reqDirs.has(dir)) continue;
|
|
240
|
-
const text = await fs.readFile(path.join(ctx.root, f), "utf8").catch(() => "");
|
|
241
|
-
if (!/^\s*\[project\]\s*$/m.test(text)) continue;
|
|
242
|
-
out.push({ target: f, args: [...common, dir === "." ? "." : `./${dir}`] });
|
|
243
|
-
}
|
|
244
|
-
if (!out.length) return "no requirements file to audit (pip-audit needs requirements*.txt or a PEP 621 pyproject.toml; the active Python environment is never audited)";
|
|
245
|
-
return out.slice(0, MAX_PIP_TARGETS);
|
|
246
|
-
}
|
|
247
|
-
var single = (args) => async () => [{ args }];
|
|
248
|
-
var RUNNERS = [
|
|
249
|
-
{
|
|
250
|
-
tool: "npm audit",
|
|
251
|
-
ecosystem: "npm",
|
|
252
|
-
command: "npm",
|
|
253
|
-
applies: (_m, has) => has("package-lock.json") || has("npm-shrinkwrap.json"),
|
|
254
|
-
plan: single(["audit", "--json", "--audit-level=low"]),
|
|
255
|
-
parse: parseNpmAudit
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
tool: "pnpm audit",
|
|
259
|
-
ecosystem: "npm",
|
|
260
|
-
command: "pnpm",
|
|
261
|
-
applies: (_m, has) => has("pnpm-lock.yaml"),
|
|
262
|
-
plan: single(["audit", "--json"]),
|
|
263
|
-
parse: parsePnpmAudit
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
tool: "pip-audit",
|
|
267
|
-
ecosystem: "python",
|
|
268
|
-
command: "pip-audit",
|
|
269
|
-
applies: (m, _has, ctx) => m.manifests.some((x) => x.ecosystem === "python") || ctx.files.some((f) => REQUIREMENTS_FILE.test(f)),
|
|
270
|
-
plan: planPipAudit,
|
|
271
|
-
parse: parsePipAudit
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
tool: "govulncheck",
|
|
275
|
-
ecosystem: "go",
|
|
276
|
-
command: "govulncheck",
|
|
277
|
-
applies: (_m, has) => has("go.mod"),
|
|
278
|
-
plan: single(["-format=json", "./..."]),
|
|
279
|
-
parse: parseGovulncheck
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
tool: "cargo audit",
|
|
283
|
-
ecosystem: "cargo",
|
|
284
|
-
command: "cargo",
|
|
285
|
-
applies: (_m, has) => has("Cargo.lock"),
|
|
286
|
-
plan: single(["audit", "--json"]),
|
|
287
|
-
parse: parseCargoAudit
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
tool: "composer audit",
|
|
291
|
-
ecosystem: "composer",
|
|
292
|
-
command: "composer",
|
|
293
|
-
applies: (_m, has) => has("composer.lock"),
|
|
294
|
-
plan: single(["audit", "--format=json"]),
|
|
295
|
-
parse: parseComposerAudit
|
|
296
|
-
}
|
|
297
|
-
];
|
|
298
|
-
function run(command, args, cwd, timeoutMs) {
|
|
299
|
-
return new Promise((resolve) => {
|
|
300
|
-
execFile(command, args, { cwd, timeout: timeoutMs, maxBuffer: 32 * 1024 * 1024, windowsHide: true, env: { ...process.env, NO_COLOR: "1", npm_config_color: "false" } }, (error, stdout, stderr) => {
|
|
301
|
-
const timedOut = Boolean(error && (error.code === "ETIMEDOUT" || error.killed));
|
|
302
|
-
resolve({ stdout: String(stdout ?? ""), stderr: String(stderr ?? ""), timedOut, error: error ?? null });
|
|
303
|
-
});
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
async function runTool(runner, inv, root, timeoutMs) {
|
|
307
|
-
const t = Date.now();
|
|
308
|
-
const base = { tool: runner.tool, ecosystem: runner.ecosystem, ...inv.target ? { target: inv.target } : {} };
|
|
309
|
-
const r = await run(runner.command, inv.args, root, timeoutMs);
|
|
310
|
-
if (r.timedOut) return { ...base, status: "timeout", message: `Timed out after ${timeoutMs / 1e3}s`, durationMs: Date.now() - t, findings: [] };
|
|
311
|
-
try {
|
|
312
|
-
const findings = runner.parse(r.stdout, r.stderr);
|
|
313
|
-
return { ...base, status: "ok", durationMs: Date.now() - t, findings };
|
|
314
|
-
} catch (err) {
|
|
315
|
-
const reason = err instanceof AuditToolError ? err.message : `Could not parse output: ${r.stderr.trim().split("\n")[0] || r.error?.message || err.message || "unreadable output"}`;
|
|
316
|
-
return { ...base, status: "failed", message: reason.slice(0, 300), durationMs: Date.now() - t, findings: [] };
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
async function runSecurityScan(root, model, opts = {}) {
|
|
320
|
-
const started = Date.now();
|
|
321
|
-
const timeoutMs = opts.timeoutMs ?? 12e4;
|
|
322
|
-
const { config } = await loadConfig(root);
|
|
323
|
-
const walk = await walkProject(root, { config, signal: opts.signal });
|
|
324
|
-
const ctx = { root, files: walk.files.map((f) => f.path) };
|
|
325
|
-
const files = new Set(model.manifests.map((m) => m.path));
|
|
326
|
-
for (const pm of model.packageManagers) for (const e of pm.provenance.evidence) files.add(e.file);
|
|
327
|
-
for (const f of ctx.files) files.add(f);
|
|
328
|
-
const has = (file) => files.has(file);
|
|
329
|
-
const tools = [];
|
|
330
|
-
if (!opts.skipAudit) {
|
|
331
|
-
for (const runner of RUNNERS) {
|
|
332
|
-
if (!runner.applies(model, has, ctx)) continue;
|
|
333
|
-
opts.signal?.throwIfAborted();
|
|
334
|
-
const t = Date.now();
|
|
335
|
-
opts.onTool?.(runner.tool);
|
|
336
|
-
const bin = await whichExecutable(runner.command);
|
|
337
|
-
if (!bin) {
|
|
338
|
-
tools.push({ tool: runner.tool, ecosystem: runner.ecosystem, status: "unavailable", message: `${runner.command} is not installed or not on PATH`, durationMs: Date.now() - t, findings: [] });
|
|
339
|
-
continue;
|
|
340
|
-
}
|
|
341
|
-
const plan = await runner.plan(ctx);
|
|
342
|
-
if (typeof plan === "string") {
|
|
343
|
-
tools.push({ tool: runner.tool, ecosystem: runner.ecosystem, status: "unavailable", message: plan, durationMs: Date.now() - t, findings: [] });
|
|
344
|
-
continue;
|
|
345
|
-
}
|
|
346
|
-
for (const inv of plan) {
|
|
347
|
-
opts.signal?.throwIfAborted();
|
|
348
|
-
tools.push(await runTool(runner, inv, root, timeoutMs));
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
const counts = { critical: 0, high: 0, moderate: 0, low: 0, unrated: 0 };
|
|
353
|
-
for (const t of tools) for (const f of t.findings) counts[f.severity]++;
|
|
354
|
-
const secrets = await scanProjectSecrets(root, walk.files, opts.signal);
|
|
355
|
-
const scan = {
|
|
356
|
-
schemaVersion: 1,
|
|
357
|
-
scannedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
358
|
-
durationMs: Date.now() - started,
|
|
359
|
-
tools,
|
|
360
|
-
counts,
|
|
361
|
-
secrets: {
|
|
362
|
-
count: secrets.findings.length,
|
|
363
|
-
files: [...new Set(secrets.findings.map((s) => s.file))].slice(0, 50),
|
|
364
|
-
skippedLongLines: secrets.skippedLongLines,
|
|
365
|
-
...secrets.truncated ? { truncated: true } : {}
|
|
366
|
-
}
|
|
367
|
-
};
|
|
368
|
-
return scan;
|
|
369
|
-
}
|
|
370
|
-
async function scanProjectSecrets(root, files, signal) {
|
|
371
|
-
const fingerprint = await secretFingerprinter(root);
|
|
372
|
-
const read = async (rel) => fs.readFile(path.join(root, rel), "utf8").catch(() => null);
|
|
373
|
-
return scanFilesForSecrets(files, read, { fingerprint, signal });
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
export {
|
|
377
|
-
runSecurityScan
|
|
378
|
-
};
|
|
379
|
-
//# sourceMappingURL=chunk-LMOFZNTQ.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-FOHPRMQF-DzxwRta7.js";import{M as e}from"./mermaid-parser.core-BvFFklev.js";export{e as createArchitectureServices};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{at as e,ot as t}from"./chunk-O7XYJQB3-BH2gESvO.js";var n=(n,r)=>t.lang.round(e.parse(n)[r]);export{n as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-FOHPRMQF-DzxwRta7.js";import{O as e}from"./mermaid-parser.core-BvFFklev.js";export{e as createEventModelingServices};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./src-oBChb5qS.js";import"./chunk-O7XYJQB3-BH2gESvO.js";import"./chunk-ZIGJFQKS-BZYvP63G.js";import"./chunk-742MDFTN-BeZ7P5jB.js";import"./chunk-MBY4JIJT-DA_D1hjF.js";import"./chunk-7PRAP22T-DqQNS8oq.js";import"./chunk-7INBJB4K-IKy0pr5m.js";import"./chunk-5DYCD2WN-CZecgNhf.js";import"./chunk-Z7XXMR3K-BxcA-y5B.js";import"./chunk-GWA4HPMP-CE5GcwVN.js";import"./chunk-XXDRQBXY-BvKO0v-W.js";import"./chunk-WEXAMYUT-B4QwUZPM.js";import"./chunk-UA2S7LBM-BWr0xCux.js";import{n as e}from"./chunk-7M6MHVWA-Dg_QqJEX.js";import"./mermaid.core-Cd_Ssti9.js";export{e as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-FOHPRMQF-DzxwRta7.js";import{m as e}from"./mermaid-parser.core-BvFFklev.js";export{e as createRailroadAbnfServices};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-FOHPRMQF-DzxwRta7.js";import{f as e}from"./mermaid-parser.core-BvFFklev.js";export{e as createRailroadEbnfServices};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-FOHPRMQF-DzxwRta7.js";import{u as e}from"./mermaid-parser.core-BvFFklev.js";export{e as createRailroadPegServices};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./src-oBChb5qS.js";import"./chunk-O7XYJQB3-BH2gESvO.js";import"./chunk-ZIGJFQKS-BZYvP63G.js";import"./chunk-742MDFTN-BeZ7P5jB.js";import"./chunk-MBY4JIJT-DA_D1hjF.js";import"./chunk-7PRAP22T-DqQNS8oq.js";import"./chunk-7INBJB4K-IKy0pr5m.js";import"./chunk-5DYCD2WN-CZecgNhf.js";import"./chunk-Z7XXMR3K-BxcA-y5B.js";import"./chunk-GWA4HPMP-CE5GcwVN.js";import"./chunk-XXDRQBXY-BvKO0v-W.js";import"./chunk-WEXAMYUT-B4QwUZPM.js";import"./chunk-UA2S7LBM-BWr0xCux.js";import{r as t,t as n}from"./chunk-7M6MHVWA-Dg_QqJEX.js";import"./mermaid.core-Cd_Ssti9.js";var r=n({styles:e(e=>`${t(e)}
|
|
2
|
-
.swimlane.cluster:not([data-color-id]) rect {
|
|
3
|
-
stroke: ${e.clusterBorder} !important;
|
|
4
|
-
}
|
|
5
|
-
[data-look="neo"].cluster rect {
|
|
6
|
-
filter: none;
|
|
7
|
-
}
|
|
8
|
-
`,`getStyles`)});export{r as diagram};
|