cantarella-framework 1.17.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.
Files changed (60) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/modules/api-burp-import/index.mjs +45 -0
  3. package/modules/api-burp-import/module.json +14 -0
  4. package/modules/code-audit-codeql-import/index.mjs +46 -0
  5. package/modules/code-audit-codeql-import/module.json +14 -0
  6. package/modules/forensics-autopsy-import/index.mjs +42 -0
  7. package/modules/forensics-autopsy-import/module.json +14 -0
  8. package/modules/internal-bloodhound-import/index.mjs +43 -0
  9. package/modules/internal-bloodhound-import/module.json +14 -0
  10. package/modules/mobile-mobsf-import/index.mjs +45 -0
  11. package/modules/mobile-mobsf-import/module.json +14 -0
  12. package/modules/wrapper-aapt/index.mjs +56 -0
  13. package/modules/wrapper-aapt/module.json +21 -0
  14. package/modules/wrapper-bettercap/index.mjs +41 -0
  15. package/modules/wrapper-bettercap/module.json +21 -0
  16. package/modules/wrapper-bulk-extractor/index.mjs +60 -0
  17. package/modules/wrapper-bulk-extractor/module.json +21 -0
  18. package/modules/wrapper-cloudsploit/index.mjs +61 -0
  19. package/modules/wrapper-cloudsploit/module.json +21 -0
  20. package/modules/wrapper-cupp/index.mjs +48 -0
  21. package/modules/wrapper-cupp/module.json +40 -0
  22. package/modules/wrapper-eslint/index.mjs +53 -0
  23. package/modules/wrapper-eslint/module.json +21 -0
  24. package/modules/wrapper-frida/index.mjs +41 -0
  25. package/modules/wrapper-frida/module.json +21 -0
  26. package/modules/wrapper-grype/index.mjs +48 -0
  27. package/modules/wrapper-grype/module.json +21 -0
  28. package/modules/wrapper-impacket/index.mjs +41 -0
  29. package/modules/wrapper-impacket/module.json +34 -0
  30. package/modules/wrapper-kismet/index.mjs +45 -0
  31. package/modules/wrapper-kismet/module.json +21 -0
  32. package/modules/wrapper-kiterunner/index.mjs +41 -0
  33. package/modules/wrapper-kiterunner/module.json +21 -0
  34. package/modules/wrapper-kube-hunter/index.mjs +44 -0
  35. package/modules/wrapper-kube-hunter/module.json +21 -0
  36. package/modules/wrapper-ldapdomaindump/index.mjs +48 -0
  37. package/modules/wrapper-ldapdomaindump/module.json +40 -0
  38. package/modules/wrapper-recon-ng/index.mjs +40 -0
  39. package/modules/wrapper-recon-ng/module.json +21 -0
  40. package/modules/wrapper-ripgrep/index.mjs +42 -0
  41. package/modules/wrapper-ripgrep/module.json +28 -0
  42. package/modules/wrapper-scoutsuite/index.mjs +61 -0
  43. package/modules/wrapper-scoutsuite/module.json +21 -0
  44. package/modules/wrapper-spiderfoot/index.mjs +44 -0
  45. package/modules/wrapper-spiderfoot/module.json +21 -0
  46. package/modules/wrapper-syft/index.mjs +43 -0
  47. package/modules/wrapper-syft/module.json +21 -0
  48. package/modules/wrapper-testssl/index.mjs +50 -0
  49. package/modules/wrapper-testssl/module.json +21 -0
  50. package/modules/wrapper-tfsec/index.mjs +43 -0
  51. package/modules/wrapper-tfsec/module.json +21 -0
  52. package/modules/wrapper-trufflehog/index.mjs +49 -0
  53. package/modules/wrapper-trufflehog/module.json +21 -0
  54. package/modules/wrapper-tshark/index.mjs +41 -0
  55. package/modules/wrapper-tshark/module.json +21 -0
  56. package/modules/wrapper-zap/index.mjs +44 -0
  57. package/modules/wrapper-zap/module.json +21 -0
  58. package/package.json +1 -1
  59. package/packages/cli/dist/cli.js +1 -1
  60. package/packages/gui/dist/server.js +2 -2
@@ -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,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("spiderfoot", ["-s", 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: `SpiderFoot 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 events = [];
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.type || parsed.data) events.push(parsed);
28
+ } catch {
29
+ // not a JSON line, skip
30
+ }
31
+ }
32
+ if (code !== 0 && !events.length && !plain.trim()) {
33
+ emit({ type: "error", message: `SpiderFoot failed: ${stderr.trim() || `exited with ${code}`}` });
34
+ process.exitCode = 1;
35
+ return;
36
+ }
37
+ emit({
38
+ type: "result",
39
+ summary: `SpiderFoot found ${events.length} events for ${target}.`,
40
+ data: { target, events: events.slice(0, 100) },
41
+ });
42
+ emit({ type: "done", summary: `SpiderFoot finished: ${events.length} events.` });
43
+ });
44
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "recon",
3
+ "core_api": "^0.1.0",
4
+ "description": "Runs a SpiderFoot scan on a target and reports the events it found.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "spiderfoot",
9
+ "install_hint": "Install SpiderFoot from your distribution packages or with pipx install spiderfoot.",
10
+ "name": "SpiderFoot"
11
+ }
12
+ ],
13
+ "id": "recon/spiderfoot",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "SpiderFoot",
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,50 @@
1
+ import { spawn } from "node:child_process";
2
+ import { mkdtemp, 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-testssl-"));
14
+ const report = join(dir, "report.json");
15
+ const child = spawn("testssl.sh", ["--jsonfile", report, target], { stdio: ["ignore", "pipe", "pipe"] });
16
+ let stdout = "";
17
+ let stderr = "";
18
+ child.stdout.on("data", (chunk) => (stdout += chunk));
19
+ child.stderr.on("data", (chunk) => (stderr += chunk));
20
+ child.on("error", (error) => {
21
+ emit({ type: "error", message: `testssl.sh failed: ${error.message}` });
22
+ process.exitCode = 1;
23
+ });
24
+ child.on("close", async (code) => {
25
+ let findings = [];
26
+ try {
27
+ const parsed = JSON.parse(await readFile(report, "utf8"));
28
+ const scanResult = Array.isArray(parsed.scanResult) ? parsed.scanResult : [];
29
+ for (const entry of scanResult) {
30
+ const severity = String(entry.severity ?? "").toUpperCase();
31
+ if (severity && severity !== "OK" && severity !== "INFO") {
32
+ findings.push({ id: entry.id ?? "", severity, finding: entry.finding ?? "" });
33
+ }
34
+ }
35
+ } catch {
36
+ findings = [];
37
+ }
38
+ if (code !== 0 && !findings.length) {
39
+ emit({ type: "error", message: `testssl.sh failed: ${stderr.trim() || `exited with ${code}`}` });
40
+ process.exitCode = 1;
41
+ return;
42
+ }
43
+ emit({
44
+ type: "result",
45
+ summary: `testssl.sh found ${findings.length} findings on ${target}.`,
46
+ data: { target, findings: findings.slice(0, 100) },
47
+ });
48
+ emit({ type: "done", summary: `testssl.sh finished: ${findings.length} findings.` });
49
+ });
50
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "web",
3
+ "core_api": "^0.1.0",
4
+ "description": "Audits a TLS server with testssl.sh and reports the findings.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "testssl.sh",
9
+ "install_hint": "Install testssl.sh from your distribution packages or the testssl.sh releases.",
10
+ "name": "testssl.sh"
11
+ }
12
+ ],
13
+ "id": "web/testssl",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "testssl.sh",
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
+ }
@@ -0,0 +1,41 @@
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("tshark", ["-r", target, "-T", "fields", "-e", "frame.number", "-e", "ip.src", "-e", "ip.dst", "-e", "_ws.col.Protocol"], { 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: `tshark 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 packets = [];
22
+ for (const line of plain.split("\n")) {
23
+ const trimmed = line.trim();
24
+ if (!trimmed) continue;
25
+ const parts = trimmed.split("\t");
26
+ if (parts.length < 4) continue;
27
+ packets.push({ number: Number(parts[0]), src: parts[1], dst: parts[2], protocol: parts[3] });
28
+ }
29
+ if (code !== 0 && !packets.length && !plain.trim()) {
30
+ emit({ type: "error", message: `tshark failed: ${stderr.trim() || `exited with ${code}`}` });
31
+ process.exitCode = 1;
32
+ return;
33
+ }
34
+ emit({
35
+ type: "result",
36
+ summary: `tshark read ${packets.length} packets from ${target}.`,
37
+ data: { target, packets: packets.slice(0, 100) },
38
+ });
39
+ emit({ type: "done", summary: `tshark finished: ${packets.length} packets.` });
40
+ });
41
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "network",
3
+ "core_api": "^0.1.0",
4
+ "description": "Reads packets from a capture file with tshark and reports the traffic it found.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "tshark",
9
+ "install_hint": "Install tshark from your distribution packages (wireshark-cli or tshark).",
10
+ "name": "tshark"
11
+ }
12
+ ],
13
+ "id": "network/tshark",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "tshark",
17
+ "options": [],
18
+ "risk": "low",
19
+ "schema_version": 1,
20
+ "version": "0.1.0"
21
+ }