fad-checker 2.4.1 → 2.4.2

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.
@@ -42,12 +42,25 @@ function depCoord(dep) {
42
42
  return name;
43
43
  }
44
44
 
45
+ // Certificate / key-material finding-type metadata → SARIF rule + level. Keyed by
46
+ // the analyze.js issue `type`. security-severity is a CVSS-like number for GitHub.
47
+ const CERT_RULES = {
48
+ "private-key-committed": { level: "error", score: "9.8", desc: "Committed private key" },
49
+ "keystore-committed": { level: "warning", score: "5.0", desc: "Committed keystore" },
50
+ "public-key-committed": { level: "note", score: "2.0", desc: "Committed public key" },
51
+ "cert-expired": { level: "error", score: "7.5", desc: "Expired certificate" },
52
+ "cert-expiring": { level: "warning", score: "4.0", desc: "Certificate expiring soon" },
53
+ "cert-weak-key": { level: "error", score: "7.5", desc: "Weak certificate key" },
54
+ "cert-weak-signature": { level: "error", score: "7.5", desc: "Weak certificate signature algorithm" },
55
+ "cert-self-signed": { level: "note", score: "2.0", desc: "Self-signed certificate" },
56
+ };
57
+
45
58
  /**
46
59
  * Build a SARIF 2.1.0 object from matches.
47
- * opts: { projectInfo, toolVersion }
60
+ * opts: { projectInfo, toolVersion, certFindings }
48
61
  */
49
62
  function buildSarif(matches, opts = {}) {
50
- const { projectInfo = {}, toolVersion = "0" } = opts;
63
+ const { projectInfo = {}, toolVersion = "0", certFindings = [] } = opts;
51
64
  const srcRoot = projectInfo.src && projectInfo.src.startsWith("(") ? null : projectInfo.src;
52
65
 
53
66
  const rulesById = new Map();
@@ -108,6 +121,39 @@ function buildSarif(matches, opts = {}) {
108
121
  });
109
122
  }
110
123
 
124
+ // Certificate / key-material findings: one rule per finding-type, one result per
125
+ // (file, issue). Located at the file itself (not a manifest).
126
+ for (const c of certFindings || []) {
127
+ for (const issue of c.issues || []) {
128
+ const meta = CERT_RULES[issue.type];
129
+ if (!meta) continue;
130
+ const ruleId = `FAD-${issue.type.toUpperCase()}`;
131
+ if (!rulesById.has(ruleId)) {
132
+ rulesById.set(ruleId, {
133
+ id: ruleId, name: ruleId,
134
+ shortDescription: { text: meta.desc },
135
+ properties: { "security-severity": meta.score, tags: ["security", "cryptography", "key-material"] },
136
+ });
137
+ }
138
+ const uri = relUri(c.path, srcRoot);
139
+ const vis = c.keyVisibility ? ` [${c.keyVisibility} key]` : "";
140
+ results.push({
141
+ ruleId,
142
+ level: meta.level,
143
+ message: { text: `${meta.desc}${vis}: ${issue.message} — ${uri || c.path}` },
144
+ ...(uri ? { locations: [{ physicalLocation: { artifactLocation: { uri } } }] } : {}),
145
+ partialFingerprints: { fadKey: `${c.sha256 || c.path}|${issue.type}` },
146
+ properties: {
147
+ kind: c.kind,
148
+ ...(c.keyVisibility ? { keyVisibility: c.keyVisibility } : {}),
149
+ ...(c.algorithm ? { algorithm: c.algorithm } : {}),
150
+ ...(c.format ? { format: c.format } : {}),
151
+ ...(c.sha256 ? { sha256: c.sha256 } : {}),
152
+ },
153
+ });
154
+ }
155
+ }
156
+
111
157
  return {
112
158
  $schema: "https://json.schemastore.org/sarif-2.1.0.json",
113
159
  version: "2.1.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fad-checker",
3
- "version": "2.4.1",
3
+ "version": "2.4.2",
4
4
  "description": "Scan ALL Maven, Gradle, npm, Yarn, Composer, Python, C#/.NET, Go & Ruby dependencies — plus embedded JARs (fat-jars/war/ear) — in a source tree ONE SHOT without mvn/python/etc — CVE (EPSS/KEV-prioritised), EOL, obsolete, outdated & licenses, with SBOM/CSAF/SARIF/JSON exports, CI gating and fix recos",
5
5
  "keywords": [
6
6
  "sca",