cantarella-framework 1.18.0 → 1.19.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 +4 -0
- package/modules/code-audit-codeql-import/index.mjs +46 -0
- package/modules/code-audit-codeql-import/module.json +14 -0
- package/modules/forensics-autopsy-import/index.mjs +42 -0
- package/modules/forensics-autopsy-import/module.json +14 -0
- package/modules/internal-bloodhound-import/index.mjs +43 -0
- package/modules/internal-bloodhound-import/module.json +14 -0
- package/modules/mobile-mobsf-import/index.mjs +45 -0
- package/modules/mobile-mobsf-import/module.json +14 -0
- package/modules/wrapper-cloudsploit/index.mjs +61 -0
- package/modules/wrapper-cloudsploit/module.json +21 -0
- package/modules/wrapper-eslint/index.mjs +53 -0
- package/modules/wrapper-eslint/module.json +21 -0
- package/modules/wrapper-grype/index.mjs +48 -0
- package/modules/wrapper-grype/module.json +21 -0
- package/modules/wrapper-kube-hunter/index.mjs +44 -0
- package/modules/wrapper-kube-hunter/module.json +21 -0
- package/modules/wrapper-recon-ng/index.mjs +40 -0
- package/modules/wrapper-recon-ng/module.json +21 -0
- package/modules/wrapper-ripgrep/index.mjs +42 -0
- package/modules/wrapper-ripgrep/module.json +28 -0
- package/modules/wrapper-scoutsuite/index.mjs +61 -0
- package/modules/wrapper-scoutsuite/module.json +21 -0
- package/modules/wrapper-syft/index.mjs +43 -0
- package/modules/wrapper-syft/module.json +21 -0
- package/modules/wrapper-tfsec/index.mjs +43 -0
- package/modules/wrapper-tfsec/module.json +21 -0
- package/modules/wrapper-trufflehog/index.mjs +49 -0
- package/modules/wrapper-trufflehog/module.json +21 -0
- package/package.json +1 -1
- package/packages/cli/dist/cli.js +1 -1
- package/packages/gui/dist/server.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.19.0
|
|
4
|
+
|
|
5
|
+
- New modules: Recon-ng module search, MobSF report import, BloodHound export import, ScoutSuite AWS auditing, CloudSploit cloud checks, kube-hunter Kubernetes hunting, Grype vulnerability scanning, Syft package inventory, tfsec Terraform checks, TruffleHog secret scanning, CodeQL SARIF import, ESLint code linting, ripgrep code search, and Autopsy report import.
|
|
6
|
+
|
|
3
7
|
## 1.18.0
|
|
4
8
|
|
|
5
9
|
- New modules: tshark packet reading, SpiderFoot OSINT scanning, OWASP ZAP quick scanning, testssl.sh TLS auditing, Kiterunner API route discovery, Burp Suite issue import, aapt APK metadata, frida-ps device process listing, Bettercap network probing, Kismet device extraction, CUPP targeted wordlists, Impacket GetNPUsers AS-REP requests, ldapdomaindump domain user dumping, and bulk_extractor email and URL carving.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
|
|
3
|
+
let input = "";
|
|
4
|
+
process.stdin.setEncoding("utf8");
|
|
5
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
6
|
+
process.stdin.on("end", () => {
|
|
7
|
+
const request = JSON.parse(input || "{}");
|
|
8
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
9
|
+
try {
|
|
10
|
+
const result = build(String(request.target ?? ""));
|
|
11
|
+
emit({ type: "result", summary: result.summary, data: result.data });
|
|
12
|
+
emit({ type: "done", summary: `CodeQL import finished: ${result.data.issues.length} issues.` });
|
|
13
|
+
} catch (error) {
|
|
14
|
+
emit({ type: "error", message: error.message });
|
|
15
|
+
process.exitCode = 1;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
function build(target) {
|
|
20
|
+
let raw;
|
|
21
|
+
try {
|
|
22
|
+
raw = readFileSync(target, "utf8");
|
|
23
|
+
} catch {
|
|
24
|
+
throw new Error(`Cannot read CodeQL SARIF file: ${target}.`);
|
|
25
|
+
}
|
|
26
|
+
let parsed;
|
|
27
|
+
try {
|
|
28
|
+
parsed = JSON.parse(raw);
|
|
29
|
+
} catch {
|
|
30
|
+
throw new Error(`Invalid CodeQL SARIF file: ${target} is not valid JSON.`);
|
|
31
|
+
}
|
|
32
|
+
const runs = Array.isArray(parsed.runs) ? parsed.runs : [];
|
|
33
|
+
const results = runs.length > 0 && Array.isArray(runs[0].results) ? runs[0].results : [];
|
|
34
|
+
const issues = [];
|
|
35
|
+
for (const entry of results) {
|
|
36
|
+
issues.push({
|
|
37
|
+
rule: entry.ruleId ?? "",
|
|
38
|
+
level: entry.level ?? "",
|
|
39
|
+
message: entry.message?.text ?? "",
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
summary: `CodeQL import read ${issues.length} issues from ${target}.`,
|
|
44
|
+
data: { source: target, issues: issues.slice(0, 100) },
|
|
45
|
+
};
|
|
46
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "code-audit",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Imports findings from a CodeQL SARIF file and reports them.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"id": "code-audit/codeql-import",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"maintenance": "active",
|
|
9
|
+
"name": "CodeQL Import",
|
|
10
|
+
"options": [],
|
|
11
|
+
"risk": "info",
|
|
12
|
+
"schema_version": 1,
|
|
13
|
+
"version": "0.1.0"
|
|
14
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
|
|
3
|
+
let input = "";
|
|
4
|
+
process.stdin.setEncoding("utf8");
|
|
5
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
6
|
+
process.stdin.on("end", () => {
|
|
7
|
+
const request = JSON.parse(input || "{}");
|
|
8
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
9
|
+
try {
|
|
10
|
+
const result = build(String(request.target ?? ""));
|
|
11
|
+
emit({ type: "result", summary: result.summary, data: result.data });
|
|
12
|
+
emit({ type: "done", summary: `Autopsy import finished: ${result.data.sections.length} sections.` });
|
|
13
|
+
} catch (error) {
|
|
14
|
+
emit({ type: "error", message: error.message });
|
|
15
|
+
process.exitCode = 1;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
function build(target) {
|
|
20
|
+
let raw;
|
|
21
|
+
try {
|
|
22
|
+
raw = readFileSync(target, "utf8");
|
|
23
|
+
} catch {
|
|
24
|
+
throw new Error(`Cannot read Autopsy report file: ${target}.`);
|
|
25
|
+
}
|
|
26
|
+
const sections = [];
|
|
27
|
+
const parts = raw.split(/<h2[^>]*>/i);
|
|
28
|
+
for (let index = 1; index < parts.length; index += 1) {
|
|
29
|
+
const part = parts[index];
|
|
30
|
+
const name = part.split("</h2>")[0].replace(/<[^>]+>/g, "").trim();
|
|
31
|
+
const rows = (part.match(/<tr>/gi) ?? []).length;
|
|
32
|
+
if (name) sections.push({ name, artifacts: rows });
|
|
33
|
+
}
|
|
34
|
+
if (!sections.length) {
|
|
35
|
+
throw new Error(`No report sections found in ${target}.`);
|
|
36
|
+
}
|
|
37
|
+
const total = sections.reduce((sum, section) => sum + section.artifacts, 0);
|
|
38
|
+
return {
|
|
39
|
+
summary: `Autopsy import read ${total} artifacts across ${sections.length} sections from ${target}.`,
|
|
40
|
+
data: { source: target, total, sections },
|
|
41
|
+
};
|
|
42
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "forensics",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Imports artifact counts from an Autopsy HTML report and reports them by section.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"id": "forensics/autopsy-import",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"maintenance": "active",
|
|
9
|
+
"name": "Autopsy Import",
|
|
10
|
+
"options": [],
|
|
11
|
+
"risk": "info",
|
|
12
|
+
"schema_version": 1,
|
|
13
|
+
"version": "0.1.0"
|
|
14
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
|
|
3
|
+
let input = "";
|
|
4
|
+
process.stdin.setEncoding("utf8");
|
|
5
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
6
|
+
process.stdin.on("end", () => {
|
|
7
|
+
const request = JSON.parse(input || "{}");
|
|
8
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
9
|
+
try {
|
|
10
|
+
const result = build(String(request.target ?? ""));
|
|
11
|
+
emit({ type: "result", summary: result.summary, data: result.data });
|
|
12
|
+
emit({ type: "done", summary: `BloodHound import finished: ${result.data.total} ${result.data.type}.` });
|
|
13
|
+
} catch (error) {
|
|
14
|
+
emit({ type: "error", message: error.message });
|
|
15
|
+
process.exitCode = 1;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
function build(target) {
|
|
20
|
+
let raw;
|
|
21
|
+
try {
|
|
22
|
+
raw = readFileSync(target, "utf8");
|
|
23
|
+
} catch {
|
|
24
|
+
throw new Error(`Cannot read BloodHound export file: ${target}.`);
|
|
25
|
+
}
|
|
26
|
+
let parsed;
|
|
27
|
+
try {
|
|
28
|
+
parsed = JSON.parse(raw);
|
|
29
|
+
} catch {
|
|
30
|
+
throw new Error(`Invalid BloodHound export file: ${target} is not valid JSON.`);
|
|
31
|
+
}
|
|
32
|
+
const data = Array.isArray(parsed.data) ? parsed.data : [];
|
|
33
|
+
const type = parsed.meta?.type ?? "objects";
|
|
34
|
+
const names = [];
|
|
35
|
+
for (const entry of data) {
|
|
36
|
+
const name = entry.properties?.name ?? entry.name ?? "";
|
|
37
|
+
if (name) names.push(name);
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
summary: `BloodHound import read ${data.length} ${type} from ${target}.`,
|
|
41
|
+
data: { source: target, type, total: data.length, names: names.slice(0, 100) },
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "internal",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Imports objects from a BloodHound JSON export and reports what it contains.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"id": "internal/bloodhound-import",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"maintenance": "active",
|
|
9
|
+
"name": "BloodHound Import",
|
|
10
|
+
"options": [],
|
|
11
|
+
"risk": "info",
|
|
12
|
+
"schema_version": 1,
|
|
13
|
+
"version": "0.1.0"
|
|
14
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
|
|
3
|
+
let input = "";
|
|
4
|
+
process.stdin.setEncoding("utf8");
|
|
5
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
6
|
+
process.stdin.on("end", () => {
|
|
7
|
+
const request = JSON.parse(input || "{}");
|
|
8
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
9
|
+
try {
|
|
10
|
+
const result = build(String(request.target ?? ""));
|
|
11
|
+
emit({ type: "result", summary: result.summary, data: result.data });
|
|
12
|
+
emit({ type: "done", summary: `MobSF import finished: ${result.data.findings} findings.` });
|
|
13
|
+
} catch (error) {
|
|
14
|
+
emit({ type: "error", message: error.message });
|
|
15
|
+
process.exitCode = 1;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
function build(target) {
|
|
20
|
+
let raw;
|
|
21
|
+
try {
|
|
22
|
+
raw = readFileSync(target, "utf8");
|
|
23
|
+
} catch {
|
|
24
|
+
throw new Error(`Cannot read MobSF report file: ${target}.`);
|
|
25
|
+
}
|
|
26
|
+
let parsed;
|
|
27
|
+
try {
|
|
28
|
+
parsed = JSON.parse(raw);
|
|
29
|
+
} catch {
|
|
30
|
+
throw new Error(`Invalid MobSF report file: ${target} is not valid JSON.`);
|
|
31
|
+
}
|
|
32
|
+
const findings = parsed.findings ?? parsed.results ?? {};
|
|
33
|
+
const count = Array.isArray(findings) ? findings.length : Object.keys(findings).length;
|
|
34
|
+
return {
|
|
35
|
+
summary: `MobSF import read ${parsed.app_name ?? target}: ${count} findings, average CVSS ${parsed.average_cvss ?? "unknown"}.`,
|
|
36
|
+
data: {
|
|
37
|
+
source: target,
|
|
38
|
+
app_name: parsed.app_name ?? "",
|
|
39
|
+
package_name: parsed.package_name ?? "",
|
|
40
|
+
average_cvss: parsed.average_cvss ?? null,
|
|
41
|
+
security_score: parsed.security_score ?? null,
|
|
42
|
+
findings: count,
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "mobile",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Imports findings from a MobSF JSON report and reports the app score and findings.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"id": "mobile/mobsf-import",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"maintenance": "active",
|
|
9
|
+
"name": "MobSF Import",
|
|
10
|
+
"options": [],
|
|
11
|
+
"risk": "info",
|
|
12
|
+
"schema_version": 1,
|
|
13
|
+
"version": "0.1.0"
|
|
14
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
|
|
3
|
+
let input = "";
|
|
4
|
+
process.stdin.setEncoding("utf8");
|
|
5
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
6
|
+
process.stdin.on("end", () => {
|
|
7
|
+
const request = JSON.parse(input || "{}");
|
|
8
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
9
|
+
const target = String(request.target ?? "");
|
|
10
|
+
const child = spawn("cloudsploit", ["scan", "--config", target, "--console", "json"], { stdio: ["ignore", "pipe", "pipe"] });
|
|
11
|
+
let stdout = "";
|
|
12
|
+
let stderr = "";
|
|
13
|
+
child.stdout.on("data", (chunk) => (stdout += chunk));
|
|
14
|
+
child.stderr.on("data", (chunk) => (stderr += chunk));
|
|
15
|
+
child.on("error", (error) => {
|
|
16
|
+
emit({ type: "error", message: `CloudSploit failed: ${error.message}` });
|
|
17
|
+
process.exitCode = 1;
|
|
18
|
+
});
|
|
19
|
+
child.on("close", (code) => {
|
|
20
|
+
const plain = stdout.replace(/\x1b\[[0-9;]*m/g, "");
|
|
21
|
+
const results = [];
|
|
22
|
+
const whole = plain.trim();
|
|
23
|
+
if (whole.startsWith("[")) {
|
|
24
|
+
try {
|
|
25
|
+
const parsed = JSON.parse(whole);
|
|
26
|
+
if (Array.isArray(parsed)) results.push(...parsed);
|
|
27
|
+
} catch {
|
|
28
|
+
// fall through to line parsing
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (!results.length) {
|
|
32
|
+
for (const line of plain.split("\n")) {
|
|
33
|
+
const trimmed = line.trim();
|
|
34
|
+
if (!trimmed) continue;
|
|
35
|
+
try {
|
|
36
|
+
const parsed = JSON.parse(trimmed);
|
|
37
|
+
if (parsed.plugin) results.push(parsed);
|
|
38
|
+
} catch {
|
|
39
|
+
// not a JSON line, skip
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (code !== 0 && !results.length && !plain.trim()) {
|
|
44
|
+
emit({ type: "error", message: `CloudSploit failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
45
|
+
process.exitCode = 1;
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const failures = results.filter((entry) => String(entry.result ?? "").toUpperCase() === "FAIL");
|
|
49
|
+
emit({
|
|
50
|
+
type: "result",
|
|
51
|
+
summary: `CloudSploit ran ${results.length} checks, ${failures.length} failed.`,
|
|
52
|
+
data: {
|
|
53
|
+
target,
|
|
54
|
+
total: results.length,
|
|
55
|
+
failures: failures.length,
|
|
56
|
+
results: results.slice(0, 100).map((entry) => ({ plugin: entry.plugin ?? "", resource: entry.resource ?? "", region: entry.region ?? "", result: entry.result ?? "" })),
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
emit({ type: "done", summary: `CloudSploit finished: ${failures.length} failures.` });
|
|
60
|
+
});
|
|
61
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "cloud",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Scans cloud configuration with CloudSploit and reports the failed checks.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "cloudsploit",
|
|
9
|
+
"install_hint": "Install CloudSploit from your distribution packages or the CloudSploit repository.",
|
|
10
|
+
"name": "CloudSploit"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "cloud/cloudsploit",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "CloudSploit",
|
|
17
|
+
"options": [],
|
|
18
|
+
"risk": "low",
|
|
19
|
+
"schema_version": 1,
|
|
20
|
+
"version": "0.1.0"
|
|
21
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
|
|
3
|
+
let input = "";
|
|
4
|
+
process.stdin.setEncoding("utf8");
|
|
5
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
6
|
+
process.stdin.on("end", () => {
|
|
7
|
+
const request = JSON.parse(input || "{}");
|
|
8
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
9
|
+
const target = String(request.target ?? "");
|
|
10
|
+
const child = spawn("eslint", [target, "--format", "json"], { stdio: ["ignore", "pipe", "pipe"] });
|
|
11
|
+
let stdout = "";
|
|
12
|
+
let stderr = "";
|
|
13
|
+
child.stdout.on("data", (chunk) => (stdout += chunk));
|
|
14
|
+
child.stderr.on("data", (chunk) => (stderr += chunk));
|
|
15
|
+
child.on("error", (error) => {
|
|
16
|
+
emit({ type: "error", message: `ESLint failed: ${error.message}` });
|
|
17
|
+
process.exitCode = 1;
|
|
18
|
+
});
|
|
19
|
+
child.on("close", (code) => {
|
|
20
|
+
const plain = stdout.replace(/\x1b\[[0-9;]*m/g, "");
|
|
21
|
+
const issues = [];
|
|
22
|
+
try {
|
|
23
|
+
const parsed = JSON.parse(plain.trim());
|
|
24
|
+
if (Array.isArray(parsed)) {
|
|
25
|
+
for (const file of parsed) {
|
|
26
|
+
const messages = Array.isArray(file.messages) ? file.messages : [];
|
|
27
|
+
for (const message of messages) {
|
|
28
|
+
issues.push({
|
|
29
|
+
file: file.filePath ?? "",
|
|
30
|
+
rule: message.ruleId ?? "",
|
|
31
|
+
severity: message.severity ?? 0,
|
|
32
|
+
line: message.line ?? null,
|
|
33
|
+
message: message.message ?? "",
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
} catch {
|
|
39
|
+
// not JSON, keep empty
|
|
40
|
+
}
|
|
41
|
+
if (code !== 0 && !issues.length && !plain.trim()) {
|
|
42
|
+
emit({ type: "error", message: `ESLint failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
43
|
+
process.exitCode = 1;
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
emit({
|
|
47
|
+
type: "result",
|
|
48
|
+
summary: `ESLint found ${issues.length} issues in ${target}.`,
|
|
49
|
+
data: { target, issues: issues.slice(0, 100) },
|
|
50
|
+
});
|
|
51
|
+
emit({ type: "done", summary: `ESLint finished: ${issues.length} issues.` });
|
|
52
|
+
});
|
|
53
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "code-audit",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Lints JavaScript and TypeScript with ESLint and reports the issues.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "eslint",
|
|
9
|
+
"install_hint": "Install ESLint from your distribution packages or with npm install -g eslint.",
|
|
10
|
+
"name": "ESLint"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "code-audit/eslint",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "ESLint",
|
|
17
|
+
"options": [],
|
|
18
|
+
"risk": "low",
|
|
19
|
+
"schema_version": 1,
|
|
20
|
+
"version": "0.1.0"
|
|
21
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
|
|
3
|
+
let input = "";
|
|
4
|
+
process.stdin.setEncoding("utf8");
|
|
5
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
6
|
+
process.stdin.on("end", () => {
|
|
7
|
+
const request = JSON.parse(input || "{}");
|
|
8
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
9
|
+
const target = String(request.target ?? "");
|
|
10
|
+
const child = spawn("grype", [target, "-o", "json"], { stdio: ["ignore", "pipe", "pipe"] });
|
|
11
|
+
let stdout = "";
|
|
12
|
+
let stderr = "";
|
|
13
|
+
child.stdout.on("data", (chunk) => (stdout += chunk));
|
|
14
|
+
child.stderr.on("data", (chunk) => (stderr += chunk));
|
|
15
|
+
child.on("error", (error) => {
|
|
16
|
+
emit({ type: "error", message: `Grype failed: ${error.message}` });
|
|
17
|
+
process.exitCode = 1;
|
|
18
|
+
});
|
|
19
|
+
child.on("close", (code) => {
|
|
20
|
+
const plain = stdout.replace(/\x1b\[[0-9;]*m/g, "");
|
|
21
|
+
let vulnerabilities = [];
|
|
22
|
+
try {
|
|
23
|
+
const parsed = JSON.parse(plain.trim());
|
|
24
|
+
const matches = Array.isArray(parsed.matches) ? parsed.matches : [];
|
|
25
|
+
for (const match of matches) {
|
|
26
|
+
vulnerabilities.push({
|
|
27
|
+
id: match.vulnerability?.id ?? "",
|
|
28
|
+
severity: match.vulnerability?.severity ?? "",
|
|
29
|
+
package: match.artifact?.name ?? "",
|
|
30
|
+
version: match.artifact?.version ?? "",
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
} catch {
|
|
34
|
+
vulnerabilities = [];
|
|
35
|
+
}
|
|
36
|
+
if (code !== 0 && !vulnerabilities.length && !plain.trim()) {
|
|
37
|
+
emit({ type: "error", message: `Grype failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
38
|
+
process.exitCode = 1;
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
emit({
|
|
42
|
+
type: "result",
|
|
43
|
+
summary: `Grype found ${vulnerabilities.length} vulnerabilities in ${target}.`,
|
|
44
|
+
data: { target, vulnerabilities: vulnerabilities.slice(0, 100) },
|
|
45
|
+
});
|
|
46
|
+
emit({ type: "done", summary: `Grype finished: ${vulnerabilities.length} vulnerabilities.` });
|
|
47
|
+
});
|
|
48
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "devsecops",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Scans an image or directory for known vulnerabilities with Grype and reports them.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "grype",
|
|
9
|
+
"install_hint": "Install Grype from your distribution packages or the Grype releases.",
|
|
10
|
+
"name": "Grype"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "devsecops/grype",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "Grype",
|
|
17
|
+
"options": [],
|
|
18
|
+
"risk": "low",
|
|
19
|
+
"schema_version": 1,
|
|
20
|
+
"version": "0.1.0"
|
|
21
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
|
|
3
|
+
let input = "";
|
|
4
|
+
process.stdin.setEncoding("utf8");
|
|
5
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
6
|
+
process.stdin.on("end", () => {
|
|
7
|
+
const request = JSON.parse(input || "{}");
|
|
8
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
9
|
+
const target = String(request.target ?? "");
|
|
10
|
+
const child = spawn("kube-hunter", ["--remote", target, "--report", "json"], { stdio: ["ignore", "pipe", "pipe"] });
|
|
11
|
+
let stdout = "";
|
|
12
|
+
let stderr = "";
|
|
13
|
+
child.stdout.on("data", (chunk) => (stdout += chunk));
|
|
14
|
+
child.stderr.on("data", (chunk) => (stderr += chunk));
|
|
15
|
+
child.on("error", (error) => {
|
|
16
|
+
emit({ type: "error", message: `kube-hunter failed: ${error.message}` });
|
|
17
|
+
process.exitCode = 1;
|
|
18
|
+
});
|
|
19
|
+
child.on("close", (code) => {
|
|
20
|
+
const plain = stdout.replace(/\x1b\[[0-9;]*m/g, "");
|
|
21
|
+
let vulnerabilities = [];
|
|
22
|
+
try {
|
|
23
|
+
const parsed = JSON.parse(plain.trim());
|
|
24
|
+
if (Array.isArray(parsed.vulnerabilities)) vulnerabilities = parsed.vulnerabilities;
|
|
25
|
+
else if (Array.isArray(parsed)) vulnerabilities = parsed;
|
|
26
|
+
} catch {
|
|
27
|
+
vulnerabilities = [];
|
|
28
|
+
}
|
|
29
|
+
if (code !== 0 && !vulnerabilities.length && !plain.trim()) {
|
|
30
|
+
emit({ type: "error", message: `kube-hunter failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
31
|
+
process.exitCode = 1;
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
emit({
|
|
35
|
+
type: "result",
|
|
36
|
+
summary: `kube-hunter found ${vulnerabilities.length} vulnerabilities on ${target}.`,
|
|
37
|
+
data: {
|
|
38
|
+
target,
|
|
39
|
+
vulnerabilities: vulnerabilities.slice(0, 100).map((entry) => ({ vulnerability: entry.vulnerability ?? entry.name ?? "", severity: entry.severity ?? "" })),
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
emit({ type: "done", summary: `kube-hunter finished: ${vulnerabilities.length} vulnerabilities.` });
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "cloud",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Hunts Kubernetes misconfigurations with kube-hunter and reports the vulnerabilities.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "kube-hunter",
|
|
9
|
+
"install_hint": "Install kube-hunter from your distribution packages or with pipx install kube-hunter.",
|
|
10
|
+
"name": "kube-hunter"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "cloud/kube-hunter",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "kube-hunter",
|
|
17
|
+
"options": [],
|
|
18
|
+
"risk": "low",
|
|
19
|
+
"schema_version": 1,
|
|
20
|
+
"version": "0.1.0"
|
|
21
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
|
|
3
|
+
let input = "";
|
|
4
|
+
process.stdin.setEncoding("utf8");
|
|
5
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
6
|
+
process.stdin.on("end", () => {
|
|
7
|
+
const request = JSON.parse(input || "{}");
|
|
8
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
9
|
+
const target = String(request.target ?? "");
|
|
10
|
+
const child = spawn("recon-ng", ["-w", "cantarella", "-C", `marketplace search ${target}`], { stdio: ["ignore", "pipe", "pipe"] });
|
|
11
|
+
let stdout = "";
|
|
12
|
+
let stderr = "";
|
|
13
|
+
child.stdout.on("data", (chunk) => (stdout += chunk));
|
|
14
|
+
child.stderr.on("data", (chunk) => (stderr += chunk));
|
|
15
|
+
child.on("error", (error) => {
|
|
16
|
+
emit({ type: "error", message: `Recon-ng failed: ${error.message}` });
|
|
17
|
+
process.exitCode = 1;
|
|
18
|
+
});
|
|
19
|
+
child.on("close", (code) => {
|
|
20
|
+
const plain = stdout.replace(/\x1b\[[0-9;]*m/g, "");
|
|
21
|
+
const modules = [];
|
|
22
|
+
for (const line of plain.split("\n")) {
|
|
23
|
+
const trimmed = line.trim();
|
|
24
|
+
if (!trimmed) continue;
|
|
25
|
+
const match = trimmed.match(/^(recon\/\S+)/);
|
|
26
|
+
if (match) modules.push(match[1]);
|
|
27
|
+
}
|
|
28
|
+
if (code !== 0 && !modules.length && !plain.trim()) {
|
|
29
|
+
emit({ type: "error", message: `Recon-ng failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
30
|
+
process.exitCode = 1;
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
emit({
|
|
34
|
+
type: "result",
|
|
35
|
+
summary: `Recon-ng found ${modules.length} modules matching ${target}.`,
|
|
36
|
+
data: { target, modules: modules.slice(0, 100) },
|
|
37
|
+
});
|
|
38
|
+
emit({ type: "done", summary: `Recon-ng finished: ${modules.length} modules.` });
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "osint",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Searches Recon-ng modules for a keyword and reports what is available.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "recon-ng",
|
|
9
|
+
"install_hint": "Install Recon-ng from your distribution packages or with pipx install recon-ng.",
|
|
10
|
+
"name": "Recon-ng"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "osint/recon-ng",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "Recon-ng",
|
|
17
|
+
"options": [],
|
|
18
|
+
"risk": "low",
|
|
19
|
+
"schema_version": 1,
|
|
20
|
+
"version": "0.1.0"
|
|
21
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
|
|
3
|
+
let input = "";
|
|
4
|
+
process.stdin.setEncoding("utf8");
|
|
5
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
6
|
+
process.stdin.on("end", () => {
|
|
7
|
+
const request = JSON.parse(input || "{}");
|
|
8
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
9
|
+
const target = String(request.target ?? "");
|
|
10
|
+
const pattern = String(request.options?.pattern ?? "TODO|FIXME");
|
|
11
|
+
const child = spawn("rg", ["-n", "--no-heading", pattern, target], { stdio: ["ignore", "pipe", "pipe"] });
|
|
12
|
+
let stdout = "";
|
|
13
|
+
let stderr = "";
|
|
14
|
+
child.stdout.on("data", (chunk) => (stdout += chunk));
|
|
15
|
+
child.stderr.on("data", (chunk) => (stderr += chunk));
|
|
16
|
+
child.on("error", (error) => {
|
|
17
|
+
emit({ type: "error", message: `ripgrep failed: ${error.message}` });
|
|
18
|
+
process.exitCode = 1;
|
|
19
|
+
});
|
|
20
|
+
child.on("close", (code) => {
|
|
21
|
+
const plain = stdout.replace(/\x1b\[[0-9;]*m/g, "");
|
|
22
|
+
const matches = [];
|
|
23
|
+
for (const line of plain.split("\n")) {
|
|
24
|
+
const trimmed = line.trim();
|
|
25
|
+
if (!trimmed) continue;
|
|
26
|
+
const match = trimmed.match(/^(.+?):(\d+):(.*)$/);
|
|
27
|
+
if (!match) continue;
|
|
28
|
+
matches.push({ file: match[1], line: Number(match[2]), content: match[3].trim().slice(0, 200) });
|
|
29
|
+
}
|
|
30
|
+
if (code !== 0 && code !== 1 && !matches.length) {
|
|
31
|
+
emit({ type: "error", message: `ripgrep failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
32
|
+
process.exitCode = 1;
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
emit({
|
|
36
|
+
type: "result",
|
|
37
|
+
summary: `ripgrep found ${matches.length} matches for ${pattern} in ${target}.`,
|
|
38
|
+
data: { target, pattern, matches: matches.slice(0, 100) },
|
|
39
|
+
});
|
|
40
|
+
emit({ type: "done", summary: `ripgrep finished: ${matches.length} matches.` });
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "code-audit",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Searches code for a pattern with ripgrep and reports the matches.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "rg",
|
|
9
|
+
"install_hint": "Install ripgrep from your distribution packages.",
|
|
10
|
+
"name": "ripgrep"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "code-audit/ripgrep",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "ripgrep",
|
|
17
|
+
"options": [
|
|
18
|
+
{
|
|
19
|
+
"default": "TODO|FIXME",
|
|
20
|
+
"description": "Pattern to search for.",
|
|
21
|
+
"name": "pattern",
|
|
22
|
+
"type": "string"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"risk": "low",
|
|
26
|
+
"schema_version": 1,
|
|
27
|
+
"version": "0.1.0"
|
|
28
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { mkdtemp, readdir, readFile } from "node:fs/promises";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
|
|
6
|
+
let input = "";
|
|
7
|
+
process.stdin.setEncoding("utf8");
|
|
8
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
9
|
+
process.stdin.on("end", async () => {
|
|
10
|
+
const request = JSON.parse(input || "{}");
|
|
11
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
12
|
+
const target = String(request.target ?? "");
|
|
13
|
+
const dir = await mkdtemp(join(tmpdir(), "cantarella-scoutsuite-"));
|
|
14
|
+
const child = spawn("scout", ["aws", "--report-dir", dir, "--no-browser"], { stdio: ["ignore", "pipe", "pipe"] });
|
|
15
|
+
let stdout = "";
|
|
16
|
+
let stderr = "";
|
|
17
|
+
child.stdout.on("data", (chunk) => (stdout += chunk));
|
|
18
|
+
child.stderr.on("data", (chunk) => (stderr += chunk));
|
|
19
|
+
child.on("error", (error) => {
|
|
20
|
+
emit({ type: "error", message: `ScoutSuite failed: ${error.message}` });
|
|
21
|
+
process.exitCode = 1;
|
|
22
|
+
});
|
|
23
|
+
child.on("close", async (code) => {
|
|
24
|
+
const details = [];
|
|
25
|
+
let services = 0;
|
|
26
|
+
let danger = 0;
|
|
27
|
+
try {
|
|
28
|
+
const resultsDir = join(dir, "scoutsuite-report", "scoutsuite-results");
|
|
29
|
+
const files = await readdir(resultsDir);
|
|
30
|
+
const reportFile = files.find((file) => file.startsWith("scoutsuite_results_"));
|
|
31
|
+
if (reportFile) {
|
|
32
|
+
const raw = await readFile(join(resultsDir, reportFile), "utf8");
|
|
33
|
+
const jsonText = raw.replace(/^scoutsuite_results\s*=\s*/, "").replace(/;\s*$/, "").trim();
|
|
34
|
+
const parsed = JSON.parse(jsonText);
|
|
35
|
+
const servicesData = parsed.services ?? {};
|
|
36
|
+
services = Object.keys(servicesData).length;
|
|
37
|
+
for (const [service, serviceData] of Object.entries(servicesData)) {
|
|
38
|
+
const findings = serviceData.findings ?? {};
|
|
39
|
+
for (const [rule, finding] of Object.entries(findings)) {
|
|
40
|
+
const level = String(finding.level ?? "").toLowerCase();
|
|
41
|
+
if (level === "danger") danger += 1;
|
|
42
|
+
details.push({ service, rule, level, items: Array.isArray(finding.items) ? finding.items.slice(0, 10) : [] });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
} catch {
|
|
47
|
+
// no report file, keep empty
|
|
48
|
+
}
|
|
49
|
+
if (code !== 0 && !details.length) {
|
|
50
|
+
emit({ type: "error", message: `ScoutSuite failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
51
|
+
process.exitCode = 1;
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
emit({
|
|
55
|
+
type: "result",
|
|
56
|
+
summary: `ScoutSuite found ${details.length} findings across ${services} services (${danger} danger).`,
|
|
57
|
+
data: { target, services, findings: details.length, danger, details: details.slice(0, 100) },
|
|
58
|
+
});
|
|
59
|
+
emit({ type: "done", summary: `ScoutSuite finished: ${details.length} findings.` });
|
|
60
|
+
});
|
|
61
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "cloud",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Audits an AWS account with ScoutSuite and reports the findings.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "scout",
|
|
9
|
+
"install_hint": "Install ScoutSuite from your distribution packages or with pipx install scoutsuite.",
|
|
10
|
+
"name": "ScoutSuite"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "cloud/scoutsuite",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "ScoutSuite",
|
|
17
|
+
"options": [],
|
|
18
|
+
"risk": "low",
|
|
19
|
+
"schema_version": 1,
|
|
20
|
+
"version": "0.1.0"
|
|
21
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
|
|
3
|
+
let input = "";
|
|
4
|
+
process.stdin.setEncoding("utf8");
|
|
5
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
6
|
+
process.stdin.on("end", () => {
|
|
7
|
+
const request = JSON.parse(input || "{}");
|
|
8
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
9
|
+
const target = String(request.target ?? "");
|
|
10
|
+
const child = spawn("syft", [target, "-o", "json"], { stdio: ["ignore", "pipe", "pipe"] });
|
|
11
|
+
let stdout = "";
|
|
12
|
+
let stderr = "";
|
|
13
|
+
child.stdout.on("data", (chunk) => (stdout += chunk));
|
|
14
|
+
child.stderr.on("data", (chunk) => (stderr += chunk));
|
|
15
|
+
child.on("error", (error) => {
|
|
16
|
+
emit({ type: "error", message: `Syft failed: ${error.message}` });
|
|
17
|
+
process.exitCode = 1;
|
|
18
|
+
});
|
|
19
|
+
child.on("close", (code) => {
|
|
20
|
+
const plain = stdout.replace(/\x1b\[[0-9;]*m/g, "");
|
|
21
|
+
let packages = [];
|
|
22
|
+
try {
|
|
23
|
+
const parsed = JSON.parse(plain.trim());
|
|
24
|
+
const artifacts = Array.isArray(parsed.artifacts) ? parsed.artifacts : [];
|
|
25
|
+
for (const artifact of artifacts) {
|
|
26
|
+
packages.push({ name: artifact.name ?? "", version: artifact.version ?? "", type: artifact.type ?? "" });
|
|
27
|
+
}
|
|
28
|
+
} catch {
|
|
29
|
+
packages = [];
|
|
30
|
+
}
|
|
31
|
+
if (code !== 0 && !packages.length && !plain.trim()) {
|
|
32
|
+
emit({ type: "error", message: `Syft failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
33
|
+
process.exitCode = 1;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
emit({
|
|
37
|
+
type: "result",
|
|
38
|
+
summary: `Syft found ${packages.length} packages in ${target}.`,
|
|
39
|
+
data: { target, packages: packages.slice(0, 100) },
|
|
40
|
+
});
|
|
41
|
+
emit({ type: "done", summary: `Syft finished: ${packages.length} packages.` });
|
|
42
|
+
});
|
|
43
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "devsecops",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Lists software packages in an image or directory with Syft and reports the inventory.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "syft",
|
|
9
|
+
"install_hint": "Install Syft from your distribution packages or the Syft releases.",
|
|
10
|
+
"name": "Syft"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "devsecops/syft",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "Syft",
|
|
17
|
+
"options": [],
|
|
18
|
+
"risk": "low",
|
|
19
|
+
"schema_version": 1,
|
|
20
|
+
"version": "0.1.0"
|
|
21
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
|
|
3
|
+
let input = "";
|
|
4
|
+
process.stdin.setEncoding("utf8");
|
|
5
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
6
|
+
process.stdin.on("end", () => {
|
|
7
|
+
const request = JSON.parse(input || "{}");
|
|
8
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
9
|
+
const target = String(request.target ?? "");
|
|
10
|
+
const child = spawn("tfsec", [target, "--format", "json"], { stdio: ["ignore", "pipe", "pipe"] });
|
|
11
|
+
let stdout = "";
|
|
12
|
+
let stderr = "";
|
|
13
|
+
child.stdout.on("data", (chunk) => (stdout += chunk));
|
|
14
|
+
child.stderr.on("data", (chunk) => (stderr += chunk));
|
|
15
|
+
child.on("error", (error) => {
|
|
16
|
+
emit({ type: "error", message: `tfsec failed: ${error.message}` });
|
|
17
|
+
process.exitCode = 1;
|
|
18
|
+
});
|
|
19
|
+
child.on("close", (code) => {
|
|
20
|
+
const plain = stdout.replace(/\x1b\[[0-9;]*m/g, "");
|
|
21
|
+
let findings = [];
|
|
22
|
+
try {
|
|
23
|
+
const parsed = JSON.parse(plain.trim());
|
|
24
|
+
const results = Array.isArray(parsed.results) ? parsed.results : [];
|
|
25
|
+
for (const entry of results) {
|
|
26
|
+
findings.push({ rule: entry.rule_id ?? "", severity: entry.severity ?? "", description: entry.description ?? "", resource: entry.resource ?? "" });
|
|
27
|
+
}
|
|
28
|
+
} catch {
|
|
29
|
+
findings = [];
|
|
30
|
+
}
|
|
31
|
+
if (code !== 0 && !findings.length && !plain.trim()) {
|
|
32
|
+
emit({ type: "error", message: `tfsec failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
33
|
+
process.exitCode = 1;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
emit({
|
|
37
|
+
type: "result",
|
|
38
|
+
summary: `tfsec found ${findings.length} findings in ${target}.`,
|
|
39
|
+
data: { target, findings: findings.slice(0, 100) },
|
|
40
|
+
});
|
|
41
|
+
emit({ type: "done", summary: `tfsec finished: ${findings.length} findings.` });
|
|
42
|
+
});
|
|
43
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "devsecops",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Scans Terraform files with tfsec and reports the failed checks.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "tfsec",
|
|
9
|
+
"install_hint": "Install tfsec from your distribution packages or the tfsec releases.",
|
|
10
|
+
"name": "tfsec"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "devsecops/tfsec",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "tfsec",
|
|
17
|
+
"options": [],
|
|
18
|
+
"risk": "low",
|
|
19
|
+
"schema_version": 1,
|
|
20
|
+
"version": "0.1.0"
|
|
21
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
|
|
3
|
+
let input = "";
|
|
4
|
+
process.stdin.setEncoding("utf8");
|
|
5
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
6
|
+
process.stdin.on("end", () => {
|
|
7
|
+
const request = JSON.parse(input || "{}");
|
|
8
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
9
|
+
const target = String(request.target ?? "");
|
|
10
|
+
const child = spawn("trufflehog", ["filesystem", target, "--json"], { stdio: ["ignore", "pipe", "pipe"] });
|
|
11
|
+
let stdout = "";
|
|
12
|
+
let stderr = "";
|
|
13
|
+
child.stdout.on("data", (chunk) => (stdout += chunk));
|
|
14
|
+
child.stderr.on("data", (chunk) => (stderr += chunk));
|
|
15
|
+
child.on("error", (error) => {
|
|
16
|
+
emit({ type: "error", message: `TruffleHog failed: ${error.message}` });
|
|
17
|
+
process.exitCode = 1;
|
|
18
|
+
});
|
|
19
|
+
child.on("close", (code) => {
|
|
20
|
+
const plain = stdout.replace(/\x1b\[[0-9;]*m/g, "");
|
|
21
|
+
const secrets = [];
|
|
22
|
+
for (const line of plain.split("\n")) {
|
|
23
|
+
const trimmed = line.trim();
|
|
24
|
+
if (!trimmed) continue;
|
|
25
|
+
try {
|
|
26
|
+
const parsed = JSON.parse(trimmed);
|
|
27
|
+
if (!parsed.DetectorName) continue;
|
|
28
|
+
secrets.push({
|
|
29
|
+
detector: parsed.DetectorName,
|
|
30
|
+
verified: Boolean(parsed.Verified),
|
|
31
|
+
file: parsed.SourceMetadata?.Data?.Filesystem?.file ?? "",
|
|
32
|
+
});
|
|
33
|
+
} catch {
|
|
34
|
+
// not a JSON line, skip
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (code !== 0 && !secrets.length && !plain.trim()) {
|
|
38
|
+
emit({ type: "error", message: `TruffleHog failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
39
|
+
process.exitCode = 1;
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
emit({
|
|
43
|
+
type: "result",
|
|
44
|
+
summary: secrets.length ? `TruffleHog found ${secrets.length} secrets in ${target}.` : `TruffleHog found no secrets in ${target}.`,
|
|
45
|
+
data: { target, secrets: secrets.slice(0, 100) },
|
|
46
|
+
});
|
|
47
|
+
emit({ type: "done", summary: secrets.length ? `TruffleHog finished: ${secrets.length} secrets.` : "TruffleHog finished: no secrets." });
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "devsecops",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Scans a directory for leaked secrets with TruffleHog and reports the detectors that fired.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "trufflehog",
|
|
9
|
+
"install_hint": "Install TruffleHog from your distribution packages or the TruffleHog releases.",
|
|
10
|
+
"name": "TruffleHog"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "devsecops/trufflehog",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "TruffleHog",
|
|
17
|
+
"options": [],
|
|
18
|
+
"risk": "low",
|
|
19
|
+
"schema_version": 1,
|
|
20
|
+
"version": "0.1.0"
|
|
21
|
+
}
|
package/package.json
CHANGED
package/packages/cli/dist/cli.js
CHANGED
|
@@ -11,7 +11,7 @@ process.stdout.on("error", (error) => {
|
|
|
11
11
|
process.exit(0);
|
|
12
12
|
throw error;
|
|
13
13
|
});
|
|
14
|
-
const VERSION = "1.
|
|
14
|
+
const VERSION = "1.19.0";
|
|
15
15
|
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../..");
|
|
16
16
|
function banner() {
|
|
17
17
|
return (process.stdout.columns ?? 80) >= 72 ? BANNER : COMPACT_BANNER;
|
|
@@ -78,8 +78,8 @@ export function createGuiServer(root) {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
sendJson(response, 200, {
|
|
81
|
-
version: "1.
|
|
82
|
-
update_message: (await checkForUpdate("1.
|
|
81
|
+
version: "1.19.0",
|
|
82
|
+
update_message: (await checkForUpdate("1.19.0")).message,
|
|
83
83
|
categories: CATEGORIES,
|
|
84
84
|
modules: modules.map(({ manifest }) => manifest),
|
|
85
85
|
external_tools: [...tools.values()],
|