cantarella-framework 1.18.0 → 1.20.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 +8 -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/incident-response-velociraptor-import/index.mjs +48 -0
- package/modules/incident-response-velociraptor-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/reporting-docx-export/index.mjs +145 -0
- package/modules/reporting-docx-export/module.json +14 -0
- package/modules/reporting-pdf-export/index.mjs +88 -0
- package/modules/reporting-pdf-export/module.json +14 -0
- package/modules/vuln-management-qualys-import/index.mjs +46 -0
- package/modules/vuln-management-qualys-import/module.json +14 -0
- package/modules/wrapper-auditd/index.mjs +45 -0
- package/modules/wrapper-auditd/module.json +21 -0
- package/modules/wrapper-beef/index.mjs +35 -0
- package/modules/wrapper-beef/module.json +21 -0
- package/modules/wrapper-chainsaw/index.mjs +54 -0
- package/modules/wrapper-chainsaw/module.json +21 -0
- package/modules/wrapper-cloudsploit/index.mjs +61 -0
- package/modules/wrapper-cloudsploit/module.json +21 -0
- package/modules/wrapper-covenant/index.mjs +35 -0
- package/modules/wrapper-covenant/module.json +21 -0
- package/modules/wrapper-eslint/index.mjs +53 -0
- package/modules/wrapper-eslint/module.json +21 -0
- package/modules/wrapper-foremost/index.mjs +57 -0
- package/modules/wrapper-foremost/module.json +21 -0
- package/modules/wrapper-grype/index.mjs +48 -0
- package/modules/wrapper-grype/module.json +21 -0
- package/modules/wrapper-hayabusa/index.mjs +55 -0
- package/modules/wrapper-hayabusa/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-mythic/index.mjs +42 -0
- package/modules/wrapper-mythic/module.json +21 -0
- package/modules/wrapper-openscap/index.mjs +47 -0
- package/modules/wrapper-openscap/module.json +28 -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-sigma/index.mjs +34 -0
- package/modules/wrapper-sigma/module.json +28 -0
- package/modules/wrapper-sliver/index.mjs +35 -0
- package/modules/wrapper-sliver/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
|
@@ -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,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 child = spawn("mythic", ["status"], { 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: `Mythic 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 services = [];
|
|
22
|
+
for (const line of plain.split("\n")) {
|
|
23
|
+
const trimmed = line.trim();
|
|
24
|
+
if (!trimmed) continue;
|
|
25
|
+
const match = trimmed.match(/^(\S+):\s*(running|stopped|exited)/i);
|
|
26
|
+
if (!match) continue;
|
|
27
|
+
services.push({ name: match[1], status: match[2].toLowerCase() });
|
|
28
|
+
}
|
|
29
|
+
if (code !== 0 && !services.length && !plain.trim()) {
|
|
30
|
+
emit({ type: "error", message: `Mythic failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
31
|
+
process.exitCode = 1;
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const running = services.filter((service) => service.status === "running").length;
|
|
35
|
+
emit({
|
|
36
|
+
type: "result",
|
|
37
|
+
summary: `Mythic has ${services.length} services, ${running} running.`,
|
|
38
|
+
data: { target, services },
|
|
39
|
+
});
|
|
40
|
+
emit({ type: "done", summary: `Mythic finished: ${running} of ${services.length} services running.` });
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "exploitation",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Checks the Mythic server status and reports which services are running.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "mythic",
|
|
9
|
+
"install_hint": "Install Mythic from your distribution packages or the Mythic repository.",
|
|
10
|
+
"name": "Mythic"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "exploitation/mythic",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "Mythic",
|
|
17
|
+
"options": [],
|
|
18
|
+
"risk": "high",
|
|
19
|
+
"schema_version": 1,
|
|
20
|
+
"version": "0.1.0"
|
|
21
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
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 profile = String(request.options?.profile ?? "xccdf_org.ssgproject.content_profile_standard");
|
|
14
|
+
const dir = await mkdtemp(join(tmpdir(), "cantarella-openscap-"));
|
|
15
|
+
const report = join(dir, "results.xml");
|
|
16
|
+
const child = spawn("oscap", ["xccdf", "eval", "--profile", profile, "--results", report, target], { stdio: ["ignore", "pipe", "pipe"] });
|
|
17
|
+
let stdout = "";
|
|
18
|
+
let stderr = "";
|
|
19
|
+
child.stdout.on("data", (chunk) => (stdout += chunk));
|
|
20
|
+
child.stderr.on("data", (chunk) => (stderr += chunk));
|
|
21
|
+
child.on("error", (error) => {
|
|
22
|
+
emit({ type: "error", message: `OpenSCAP failed: ${error.message}` });
|
|
23
|
+
process.exitCode = 1;
|
|
24
|
+
});
|
|
25
|
+
child.on("close", async (code) => {
|
|
26
|
+
let pass = 0;
|
|
27
|
+
let fail = 0;
|
|
28
|
+
try {
|
|
29
|
+
const xml = await readFile(report, "utf8");
|
|
30
|
+
pass = (xml.match(/result="pass"/g) ?? []).length;
|
|
31
|
+
fail = (xml.match(/result="fail"/g) ?? []).length;
|
|
32
|
+
} catch {
|
|
33
|
+
// no results file, keep zero
|
|
34
|
+
}
|
|
35
|
+
if (code !== 0 && code !== 2 && !pass && !fail) {
|
|
36
|
+
emit({ type: "error", message: `OpenSCAP failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
37
|
+
process.exitCode = 1;
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
emit({
|
|
41
|
+
type: "result",
|
|
42
|
+
summary: `OpenSCAP evaluated ${target}: ${pass} passed, ${fail} failed.`,
|
|
43
|
+
data: { target, profile, pass, fail },
|
|
44
|
+
});
|
|
45
|
+
emit({ type: "done", summary: `OpenSCAP finished: ${pass} passed, ${fail} failed.` });
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "blue-team",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Evaluates a system against a compliance profile with OpenSCAP and reports the pass and fail counts.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "oscap",
|
|
9
|
+
"install_hint": "Install OpenSCAP from your distribution packages (openscap-scanner).",
|
|
10
|
+
"name": "OpenSCAP"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "blue-team/openscap",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "OpenSCAP",
|
|
17
|
+
"options": [
|
|
18
|
+
{
|
|
19
|
+
"default": "xccdf_org.ssgproject.content_profile_standard",
|
|
20
|
+
"description": "Compliance profile to evaluate.",
|
|
21
|
+
"name": "profile",
|
|
22
|
+
"type": "string"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"risk": "low",
|
|
26
|
+
"schema_version": 1,
|
|
27
|
+
"version": "0.1.0"
|
|
28
|
+
}
|
|
@@ -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,34 @@
|
|
|
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 backend = String(request.options?.backend ?? "splunk");
|
|
11
|
+
const child = spawn("sigma", ["convert", "--target", backend, 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: `Sigma failed: ${error.message}` });
|
|
18
|
+
process.exitCode = 1;
|
|
19
|
+
});
|
|
20
|
+
child.on("close", (code) => {
|
|
21
|
+
const query = stdout.replace(/\x1b\[[0-9;]*m/g, "").trim();
|
|
22
|
+
if (code !== 0 && !query) {
|
|
23
|
+
emit({ type: "error", message: `Sigma failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
24
|
+
process.exitCode = 1;
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
emit({
|
|
28
|
+
type: "result",
|
|
29
|
+
summary: `Sigma converted ${target} to a ${backend} query.`,
|
|
30
|
+
data: { target, backend, query },
|
|
31
|
+
});
|
|
32
|
+
emit({ type: "done", summary: `Sigma finished: query for ${backend}.` });
|
|
33
|
+
});
|
|
34
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "incident-response",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Converts a Sigma rule into a backend query and reports the query.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "sigma",
|
|
9
|
+
"install_hint": "Install Sigma from your distribution packages or with pipx install pysigma.",
|
|
10
|
+
"name": "Sigma"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "incident-response/sigma",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "Sigma",
|
|
17
|
+
"options": [
|
|
18
|
+
{
|
|
19
|
+
"default": "splunk",
|
|
20
|
+
"description": "Backend to convert the rule to.",
|
|
21
|
+
"name": "backend",
|
|
22
|
+
"type": "string"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"risk": "low",
|
|
26
|
+
"schema_version": 1,
|
|
27
|
+
"version": "0.1.0"
|
|
28
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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("sliver-server", ["--version"], { 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: `Sliver 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 match = plain.match(/v?(\d+\.\d+\.\d+)/);
|
|
22
|
+
const version = match ? match[1] : "";
|
|
23
|
+
if (code !== 0 && !version && !plain.trim()) {
|
|
24
|
+
emit({ type: "error", message: `Sliver failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
25
|
+
process.exitCode = 1;
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
emit({
|
|
29
|
+
type: "result",
|
|
30
|
+
summary: version ? `Sliver server version ${version} is installed.` : "Sliver server is installed.",
|
|
31
|
+
data: { target, version },
|
|
32
|
+
});
|
|
33
|
+
emit({ type: "done", summary: version ? `Sliver finished: version ${version}.` : "Sliver finished." });
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "exploitation",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Checks the installed Sliver server version and reports it.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "sliver-server",
|
|
9
|
+
"install_hint": "Install Sliver from your distribution packages or the Sliver releases.",
|
|
10
|
+
"name": "Sliver"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "exploitation/sliver",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "Sliver",
|
|
17
|
+
"options": [],
|
|
18
|
+
"risk": "high",
|
|
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
|
+
});
|