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,45 @@
|
|
|
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("ausearch", ["-k", 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: `ausearch 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 records = 0;
|
|
22
|
+
const types = new Set();
|
|
23
|
+
for (const line of plain.split("\n")) {
|
|
24
|
+
const trimmed = line.trim();
|
|
25
|
+
if (!trimmed) continue;
|
|
26
|
+
if (trimmed === "----") {
|
|
27
|
+
records += 1;
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
const match = trimmed.match(/^type=(\S+)/);
|
|
31
|
+
if (match) types.add(match[1]);
|
|
32
|
+
}
|
|
33
|
+
if (code !== 0 && !records && !plain.trim()) {
|
|
34
|
+
emit({ type: "error", message: `ausearch failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
35
|
+
process.exitCode = 1;
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
emit({
|
|
39
|
+
type: "result",
|
|
40
|
+
summary: `ausearch found ${records} records for key ${target}.`,
|
|
41
|
+
data: { target, records, types: [...types].sort() },
|
|
42
|
+
});
|
|
43
|
+
emit({ type: "done", summary: `ausearch finished: ${records} records.` });
|
|
44
|
+
});
|
|
45
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "blue-team",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Searches the audit log for a key with ausearch and reports the matching records.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "ausearch",
|
|
9
|
+
"install_hint": "Install ausearch from your distribution packages (auditd).",
|
|
10
|
+
"name": "ausearch"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "blue-team/auditd",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "ausearch",
|
|
17
|
+
"options": [],
|
|
18
|
+
"risk": "low",
|
|
19
|
+
"schema_version": 1,
|
|
20
|
+
"version": "0.1.0"
|
|
21
|
+
}
|
|
@@ -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("beef", ["--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: `BeEF 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(/(\d+\.\d+\.\d+(?:\.\d+)?)/);
|
|
22
|
+
const version = match ? match[1] : "";
|
|
23
|
+
if (code !== 0 && !version && !plain.trim()) {
|
|
24
|
+
emit({ type: "error", message: `BeEF failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
25
|
+
process.exitCode = 1;
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
emit({
|
|
29
|
+
type: "result",
|
|
30
|
+
summary: version ? `BeEF version ${version} is installed.` : "BeEF is installed.",
|
|
31
|
+
data: { target, version },
|
|
32
|
+
});
|
|
33
|
+
emit({ type: "done", summary: version ? `BeEF finished: version ${version}.` : "BeEF finished." });
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "exploitation",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Checks the installed BeEF version and reports it.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "beef",
|
|
9
|
+
"install_hint": "Install BeEF from your distribution packages or the BeEF repository.",
|
|
10
|
+
"name": "BeEF"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "exploitation/beef",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "BeEF",
|
|
17
|
+
"options": [],
|
|
18
|
+
"risk": "high",
|
|
19
|
+
"schema_version": 1,
|
|
20
|
+
"version": "0.1.0"
|
|
21
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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-chainsaw-"));
|
|
14
|
+
const child = spawn("chainsaw", ["hunt", target, "--output", dir, "--json"], { 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: `Chainsaw failed: ${error.message}` });
|
|
21
|
+
process.exitCode = 1;
|
|
22
|
+
});
|
|
23
|
+
child.on("close", async (code) => {
|
|
24
|
+
const detections = [];
|
|
25
|
+
try {
|
|
26
|
+
const files = await readdir(dir);
|
|
27
|
+
for (const file of files) {
|
|
28
|
+
if (!file.endsWith(".json")) continue;
|
|
29
|
+
try {
|
|
30
|
+
const parsed = JSON.parse(await readFile(join(dir, file), "utf8"));
|
|
31
|
+
const list = Array.isArray(parsed) ? parsed : Array.isArray(parsed.detections) ? parsed.detections : [];
|
|
32
|
+
for (const entry of list) {
|
|
33
|
+
detections.push({ name: entry.name ?? entry.title ?? "", level: entry.level ?? "" });
|
|
34
|
+
}
|
|
35
|
+
} catch {
|
|
36
|
+
// not parseable, skip
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
} catch {
|
|
40
|
+
// no output dir, keep empty
|
|
41
|
+
}
|
|
42
|
+
if (code !== 0 && !detections.length) {
|
|
43
|
+
emit({ type: "error", message: `Chainsaw failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
44
|
+
process.exitCode = 1;
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
emit({
|
|
48
|
+
type: "result",
|
|
49
|
+
summary: `Chainsaw found ${detections.length} detections in ${target}.`,
|
|
50
|
+
data: { target, detections: detections.slice(0, 100) },
|
|
51
|
+
});
|
|
52
|
+
emit({ type: "done", summary: `Chainsaw finished: ${detections.length} detections.` });
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "incident-response",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Hunts for threats in Windows event logs with Chainsaw and reports the detections.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "chainsaw",
|
|
9
|
+
"install_hint": "Install Chainsaw from your distribution packages or the Chainsaw releases.",
|
|
10
|
+
"name": "Chainsaw"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "incident-response/chainsaw",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "Chainsaw",
|
|
17
|
+
"options": [],
|
|
18
|
+
"risk": "low",
|
|
19
|
+
"schema_version": 1,
|
|
20
|
+
"version": "0.1.0"
|
|
21
|
+
}
|
|
@@ -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,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("Covenant", ["--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: `Covenant 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(/(\d+\.\d+(?:\.\d+)?)/);
|
|
22
|
+
const version = match ? match[1] : "";
|
|
23
|
+
if (code !== 0 && !version && !plain.trim()) {
|
|
24
|
+
emit({ type: "error", message: `Covenant failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
25
|
+
process.exitCode = 1;
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
emit({
|
|
29
|
+
type: "result",
|
|
30
|
+
summary: version ? `Covenant version ${version} is installed.` : "Covenant is installed.",
|
|
31
|
+
data: { target, version },
|
|
32
|
+
});
|
|
33
|
+
emit({ type: "done", summary: version ? `Covenant finished: version ${version}.` : "Covenant finished." });
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "exploitation",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Checks the installed Covenant version and reports it.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "Covenant",
|
|
9
|
+
"install_hint": "Install Covenant from your distribution packages or the Covenant releases.",
|
|
10
|
+
"name": "Covenant"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "exploitation/covenant",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "Covenant",
|
|
17
|
+
"options": [],
|
|
18
|
+
"risk": "high",
|
|
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,57 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { mkdtemp, readdir } from "node:fs/promises";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { extname, 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-foremost-"));
|
|
14
|
+
const child = spawn("foremost", ["-i", target, "-o", dir], { 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: `Foremost failed: ${error.message}` });
|
|
21
|
+
process.exitCode = 1;
|
|
22
|
+
});
|
|
23
|
+
child.on("close", async (code) => {
|
|
24
|
+
const carved = {};
|
|
25
|
+
async function walk(current, depth) {
|
|
26
|
+
if (depth > 2) return;
|
|
27
|
+
let entries;
|
|
28
|
+
try {
|
|
29
|
+
entries = await readdir(current, { withFileTypes: true });
|
|
30
|
+
} catch {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
for (const entry of entries) {
|
|
34
|
+
const full = join(current, entry.name);
|
|
35
|
+
if (entry.isDirectory()) {
|
|
36
|
+
await walk(full, depth + 1);
|
|
37
|
+
} else if (entry.isFile()) {
|
|
38
|
+
const type = extname(entry.name).replace(/^\./, "").toLowerCase() || "unknown";
|
|
39
|
+
carved[type] = (carved[type] ?? 0) + 1;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
await walk(dir, 0);
|
|
44
|
+
const total = Object.values(carved).reduce((sum, count) => sum + count, 0);
|
|
45
|
+
if (code !== 0 && !total) {
|
|
46
|
+
emit({ type: "error", message: `Foremost failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
47
|
+
process.exitCode = 1;
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
emit({
|
|
51
|
+
type: "result",
|
|
52
|
+
summary: `Foremost carved ${total} files from ${target}.`,
|
|
53
|
+
data: { target, total, carved },
|
|
54
|
+
});
|
|
55
|
+
emit({ type: "done", summary: `Foremost finished: ${total} files.` });
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "forensics",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Carves files from a disk image with Foremost and reports what it recovered.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "foremost",
|
|
9
|
+
"install_hint": "Install Foremost from your distribution packages.",
|
|
10
|
+
"name": "Foremost"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "forensics/foremost",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "Foremost",
|
|
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,55 @@
|
|
|
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-hayabusa-"));
|
|
14
|
+
const report = join(dir, "timeline.csv");
|
|
15
|
+
const child = spawn("hayabusa", ["csv-timeline", "-d", target, "-o", report], { 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: `Hayabusa failed: ${error.message}` });
|
|
22
|
+
process.exitCode = 1;
|
|
23
|
+
});
|
|
24
|
+
child.on("close", async (code) => {
|
|
25
|
+
const byLevel = {};
|
|
26
|
+
let events = 0;
|
|
27
|
+
try {
|
|
28
|
+
const raw = await readFile(report, "utf8");
|
|
29
|
+
const lines = raw.split("\n").filter((line) => line.trim());
|
|
30
|
+
if (lines.length > 1) {
|
|
31
|
+
const header = lines[0].split(",").map((cell) => cell.trim().toLowerCase());
|
|
32
|
+
const levelIndex = header.indexOf("level");
|
|
33
|
+
for (const line of lines.slice(1)) {
|
|
34
|
+
const cells = line.split(",");
|
|
35
|
+
const level = levelIndex >= 0 ? (cells[levelIndex] ?? "").trim().toLowerCase() : "";
|
|
36
|
+
if (level) byLevel[level] = (byLevel[level] ?? 0) + 1;
|
|
37
|
+
events += 1;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
} catch {
|
|
41
|
+
// no report file, keep empty
|
|
42
|
+
}
|
|
43
|
+
if (code !== 0 && !events) {
|
|
44
|
+
emit({ type: "error", message: `Hayabusa failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
45
|
+
process.exitCode = 1;
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
emit({
|
|
49
|
+
type: "result",
|
|
50
|
+
summary: `Hayabusa found ${events} timeline events in ${target}.`,
|
|
51
|
+
data: { target, events, by_level: byLevel },
|
|
52
|
+
});
|
|
53
|
+
emit({ type: "done", summary: `Hayabusa finished: ${events} events.` });
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "incident-response",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Builds a timeline from Windows event logs with Hayabusa and reports the detections.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "hayabusa",
|
|
9
|
+
"install_hint": "Install Hayabusa from your distribution packages or the Hayabusa releases.",
|
|
10
|
+
"name": "Hayabusa"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "incident-response/hayabusa",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "Hayabusa",
|
|
17
|
+
"options": [],
|
|
18
|
+
"risk": "low",
|
|
19
|
+
"schema_version": 1,
|
|
20
|
+
"version": "0.1.0"
|
|
21
|
+
}
|