codeslick-cli 1.5.4 → 1.5.5
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/dist/codeslick-bundle.cjs +1 -33
- package/package.json +1 -1
|
@@ -22699,15 +22699,11 @@ var init_performance_analyzer = __esm({
|
|
|
22699
22699
|
|
|
22700
22700
|
// ../../src/lib/security/epss-service.ts
|
|
22701
22701
|
async function getEPSSScores(cveIds) {
|
|
22702
|
-
console.log("[EPSS] getEPSSScores called with", cveIds.length, "CVE IDs:", cveIds);
|
|
22703
22702
|
if (!cveIds || cveIds.length === 0) {
|
|
22704
|
-
console.log("[EPSS] No CVE IDs provided, returning empty array");
|
|
22705
22703
|
return [];
|
|
22706
22704
|
}
|
|
22707
22705
|
const validCveIds = [...new Set(cveIds.filter(isValidCveId))];
|
|
22708
|
-
console.log("[EPSS] Valid CVE IDs after filtering:", validCveIds);
|
|
22709
22706
|
if (validCveIds.length === 0) {
|
|
22710
|
-
console.log("[EPSS] No valid CVE IDs found, returning empty array");
|
|
22711
22707
|
return [];
|
|
22712
22708
|
}
|
|
22713
22709
|
const results = [];
|
|
@@ -22971,34 +22967,22 @@ function triageSingleIssue(issue, epssScores, config) {
|
|
|
22971
22967
|
};
|
|
22972
22968
|
}
|
|
22973
22969
|
async function triageSecurityIssues(issues, config = {}) {
|
|
22974
|
-
console.log("[TRIAGE] Service called with", issues.length, "issues");
|
|
22975
|
-
console.log("[TRIAGE] Config:", config);
|
|
22976
22970
|
if (!issues || issues.length === 0) {
|
|
22977
|
-
console.log("[TRIAGE] No issues to triage, returning empty array");
|
|
22978
22971
|
return [];
|
|
22979
22972
|
}
|
|
22980
22973
|
const cves = issues.map(extractCVE).filter((cve) => cve !== null);
|
|
22981
|
-
console.log("[TRIAGE] Extracted CVEs:", cves);
|
|
22982
22974
|
let epssScores = /* @__PURE__ */ new Map();
|
|
22983
22975
|
if (cves.length > 0) {
|
|
22984
22976
|
try {
|
|
22985
22977
|
const scores = await getEPSSScores(cves);
|
|
22986
22978
|
epssScores = new Map(scores.map((score) => [score.cve, score]));
|
|
22987
22979
|
} catch (error) {
|
|
22988
|
-
console.warn("[TRIAGE] Failed to fetch EPSS scores:", error);
|
|
22989
22980
|
}
|
|
22990
22981
|
}
|
|
22991
22982
|
const results = issues.map(
|
|
22992
22983
|
(issue) => triageSingleIssue(issue, epssScores, config)
|
|
22993
22984
|
);
|
|
22994
22985
|
results.sort((a, b) => b.priorityScore - a.priorityScore);
|
|
22995
|
-
console.log("[TRIAGE] Triage complete. Returning", results.length, "results");
|
|
22996
|
-
console.log("[TRIAGE] Sample result:", results[0] ? {
|
|
22997
|
-
priority: results[0].priority,
|
|
22998
|
-
triageReason: results[0].triageReason,
|
|
22999
|
-
epssScore: results[0].epssScore,
|
|
23000
|
-
priorityScore: results[0].priorityScore
|
|
23001
|
-
} : "No results");
|
|
23002
22986
|
return results;
|
|
23003
22987
|
}
|
|
23004
22988
|
var OWASP_WEIGHTS;
|
|
@@ -26342,10 +26326,8 @@ function checkCodeQuality(code, lines) {
|
|
|
26342
26326
|
}
|
|
26343
26327
|
const consoleMatch = trimmed.match(/console\.(log|info)\b/);
|
|
26344
26328
|
if (consoleMatch) {
|
|
26345
|
-
const consoleMethod = consoleMatch[1];
|
|
26346
26329
|
const isTestFileContext = trimmed.toLowerCase().includes("test") || trimmed.toLowerCase().includes("spec") || trimmed.toLowerCase().includes("loaded successfully") || trimmed.toLowerCase().includes("fixture") || trimmed.toLowerCase().includes("mock") || code.includes("describe(") || code.includes("it(") || code.includes("test(") || code.includes("expect(");
|
|
26347
26330
|
if (!isTestFileContext) {
|
|
26348
|
-
console.log(`[code-quality.ts] Line ${lineNumber}: FLAGGING console.${consoleMethod}`);
|
|
26349
26331
|
vulnerabilities.push(createTypeScriptSecurityVulnerability(
|
|
26350
26332
|
"console-log",
|
|
26351
26333
|
"console.log can leak sensitive information in production",
|
|
@@ -34903,20 +34885,15 @@ var init_python_analyzer = __esm({
|
|
|
34903
34885
|
result.security.vulnerabilities,
|
|
34904
34886
|
input.filename
|
|
34905
34887
|
);
|
|
34906
|
-
console.log("[Python Analyzer] Starting triage for", result.security.vulnerabilities.length, "vulnerabilities");
|
|
34907
34888
|
try {
|
|
34908
34889
|
if (result.security.vulnerabilities.length > 0) {
|
|
34909
34890
|
const isProduction = this.detectProductionContext(input.filename || "");
|
|
34910
|
-
console.log("[Python Analyzer] Environment context - isProduction:", isProduction, "filename:", input.filename);
|
|
34911
34891
|
const triageResults = await triageSecurityIssues(result.security.vulnerabilities, {
|
|
34912
34892
|
environmentContext: {
|
|
34913
34893
|
isProduction
|
|
34914
34894
|
}
|
|
34915
34895
|
});
|
|
34916
|
-
console.log("[Python Analyzer] Triage completed. Results:", triageResults.length);
|
|
34917
|
-
console.log("[Python Analyzer] First triaged issue:", triageResults[0]);
|
|
34918
34896
|
result.security.vulnerabilities = triageResults.map((tr) => tr.issue);
|
|
34919
|
-
console.log("[Python Analyzer] Vulnerabilities updated with triage data");
|
|
34920
34897
|
}
|
|
34921
34898
|
} catch (triageError) {
|
|
34922
34899
|
console.error("[Python Analyzer] Triage service failed:", triageError);
|
|
@@ -48118,15 +48095,6 @@ function parseKubernetes(yamlContent) {
|
|
|
48118
48095
|
if (parsed && isKubernetesResource(parsed)) {
|
|
48119
48096
|
resources.push(parsed);
|
|
48120
48097
|
} else {
|
|
48121
|
-
console.log("[K8s Parser] Resource rejected:", {
|
|
48122
|
-
parsed: !!parsed,
|
|
48123
|
-
hasApiVersion: parsed && "apiVersion" in parsed,
|
|
48124
|
-
hasKind: parsed && "kind" in parsed,
|
|
48125
|
-
hasMetadata: parsed && "metadata" in parsed,
|
|
48126
|
-
hasName: parsed && parsed.metadata && "name" in parsed.metadata,
|
|
48127
|
-
kind: parsed?.kind,
|
|
48128
|
-
name: parsed?.metadata?.name
|
|
48129
|
-
});
|
|
48130
48098
|
}
|
|
48131
48099
|
} catch (err) {
|
|
48132
48100
|
console.error("[K8s Parser] Failed to parse YAML document:", err);
|
|
@@ -50114,7 +50082,7 @@ var require_package = __commonJS({
|
|
|
50114
50082
|
"package.json"(exports2, module2) {
|
|
50115
50083
|
module2.exports = {
|
|
50116
50084
|
name: "codeslick-cli",
|
|
50117
|
-
version: "1.5.
|
|
50085
|
+
version: "1.5.5",
|
|
50118
50086
|
description: "CodeSlick CLI tool for pre-commit security scanning \u2014 308 checks across JS, TS, Python, Java, Go",
|
|
50119
50087
|
main: "dist/index.js",
|
|
50120
50088
|
bin: {
|