cantarella-framework 1.0.0 → 1.1.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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.1.0
4
+
5
+ - New modules: evidence indexer, workflow plan validator, Exploit-DB reference search through searchsploit, and cookie security checker.
6
+
3
7
  ## 1.0.0
4
8
 
5
9
  - First stable release: CLI and local GUI sharing one engine, 22 modules across the framework categories, module installation and templates, correlation, reports, and self-update through npm.
@@ -0,0 +1,27 @@
1
+ import { readFile } from "node:fs/promises";
2
+
3
+ let input = "";
4
+ process.stdin.setEncoding("utf8");
5
+ process.stdin.on("data", (chunk) => (input += chunk));
6
+ process.stdin.on("end", async () => {
7
+ const request = JSON.parse(input || "{}");
8
+ const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
9
+ try {
10
+ const plan = JSON.parse(await readFile(request.target, "utf8"));
11
+ const steps = Array.isArray(plan) ? plan : plan.steps;
12
+ if (!Array.isArray(steps)) throw new Error("Workflow plan must be an array or an object with a steps array.");
13
+ const normalized = steps.map((step, index) => {
14
+ if (!step?.module) throw new Error(`Step ${index + 1} is missing a module.`);
15
+ return { step: index + 1, module: step.module, target: step.target ?? null, options: step.options ?? {} };
16
+ });
17
+ emit({
18
+ type: "result",
19
+ summary: `Workflow plan is valid with ${normalized.length} steps.`,
20
+ data: { name: plan.name ?? null, steps: normalized },
21
+ });
22
+ emit({ type: "done", summary: "Workflow plan validation finished." });
23
+ } catch (error) {
24
+ emit({ type: "error", message: `Workflow plan failed: ${error.message}` });
25
+ process.exitCode = 1;
26
+ }
27
+ });
@@ -0,0 +1,14 @@
1
+ {
2
+ "schema_version": 1,
3
+ "id": "automation/workflow-plan",
4
+ "name": "Workflow Plan",
5
+ "version": "0.1.0",
6
+ "category": "automation",
7
+ "kind": "native",
8
+ "risk": "info",
9
+ "description": "Validates and summarizes a JSON workflow plan of Cantarella modules.",
10
+ "entry": "index.mjs",
11
+ "core_api": "^0.1.0",
12
+ "maintenance": "active",
13
+ "options": []
14
+ }
@@ -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 query = String(request.target ?? "").trim();
10
+ if (!query) {
11
+ emit({ type: "error", message: "A search query is required." });
12
+ process.exitCode = 1;
13
+ return;
14
+ }
15
+ const child = spawn("searchsploit", ["--json", query], { 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: `Exploit reference search failed: ${error.message}` });
22
+ process.exitCode = 1;
23
+ });
24
+ child.on("close", (code) => {
25
+ if (code !== 0) {
26
+ emit({ type: "error", message: `Exploit reference search failed: ${stderr.trim() || `searchsploit exited with ${code}`}` });
27
+ process.exitCode = 1;
28
+ return;
29
+ }
30
+ let results = [];
31
+ try {
32
+ const parsed = JSON.parse(stdout);
33
+ results = (parsed.RESULTS_EXPLOIT ?? []).slice(0, 50).map((item) => ({
34
+ title: item.Title,
35
+ path: item.Path,
36
+ type: item.Type,
37
+ platform: item.Platform,
38
+ }));
39
+ } catch {
40
+ results = stdout.split("\n").filter(Boolean).slice(0, 50).map((line) => ({ title: line.trim() }));
41
+ }
42
+ emit({
43
+ type: "result",
44
+ summary: `Found ${results.length} Exploit-DB references for ${query}.`,
45
+ data: { query, results },
46
+ });
47
+ emit({ type: "done", summary: "Exploit reference search finished." });
48
+ });
49
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "schema_version": 1,
3
+ "id": "exploitation/exploit-reference",
4
+ "name": "Exploit Reference",
5
+ "version": "0.1.0",
6
+ "category": "exploitation",
7
+ "kind": "wrapper",
8
+ "risk": "high",
9
+ "description": "Searches local Exploit-DB references through searchsploit.",
10
+ "entry": "index.mjs",
11
+ "core_api": "^0.1.0",
12
+ "maintenance": "active",
13
+ "options": [],
14
+ "external_tools": [
15
+ {
16
+ "name": "Exploit-DB",
17
+ "command": "searchsploit",
18
+ "install_hint": "Install exploitdb from your distribution packages."
19
+ }
20
+ ]
21
+ }
@@ -0,0 +1,41 @@
1
+ import { createHash } from "node:crypto";
2
+ import { readdir, readFile, stat } from "node:fs/promises";
3
+ import path from "node:path";
4
+
5
+ let input = "";
6
+ process.stdin.setEncoding("utf8");
7
+ process.stdin.on("data", (chunk) => (input += chunk));
8
+ process.stdin.on("end", async () => {
9
+ const request = JSON.parse(input || "{}");
10
+ const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
11
+ const target = String(request.target ?? ".");
12
+ const files = [];
13
+ async function walk(entry) {
14
+ const info = await stat(entry);
15
+ if (info.isDirectory()) {
16
+ if (["node_modules", ".git", ".cantarella"].includes(path.basename(entry))) return;
17
+ for (const child of await readdir(entry)) await walk(path.join(entry, child));
18
+ return;
19
+ }
20
+ const data = await readFile(entry);
21
+ files.push({
22
+ file: entry,
23
+ size_bytes: info.size,
24
+ modified_at: info.mtime.toISOString(),
25
+ sha256: createHash("sha256").update(data).digest("hex"),
26
+ });
27
+ }
28
+ try {
29
+ await walk(target);
30
+ files.sort((a, b) => a.file.localeCompare(b.file));
31
+ emit({
32
+ type: "result",
33
+ summary: `Indexed ${files.length} evidence files under ${target}.`,
34
+ data: { target, files: files.slice(0, 500), total_files: files.length },
35
+ });
36
+ emit({ type: "done", summary: "Evidence indexing finished." });
37
+ } catch (error) {
38
+ emit({ type: "error", message: `Evidence indexing failed: ${error.message}` });
39
+ process.exitCode = 1;
40
+ }
41
+ });
@@ -0,0 +1,14 @@
1
+ {
2
+ "schema_version": 1,
3
+ "id": "reporting/evidence-indexer",
4
+ "name": "Evidence Indexer",
5
+ "version": "0.1.0",
6
+ "category": "reporting",
7
+ "kind": "native",
8
+ "risk": "info",
9
+ "description": "Indexes local evidence files with sizes and SHA-256 hashes.",
10
+ "entry": "index.mjs",
11
+ "core_api": "^0.1.0",
12
+ "maintenance": "active",
13
+ "options": []
14
+ }
@@ -0,0 +1,40 @@
1
+ let input = "";
2
+ process.stdin.setEncoding("utf8");
3
+ process.stdin.on("data", (chunk) => (input += chunk));
4
+ process.stdin.on("end", async () => {
5
+ const request = JSON.parse(input || "{}");
6
+ const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
7
+ const target = /^https?:\/\//.test(request.target) ? request.target : `https://${request.target}`;
8
+ try {
9
+ const response = await fetch(target, { redirect: "manual", signal: AbortSignal.timeout(8000) });
10
+ const raw = response.headers.getSetCookie ? response.headers.getSetCookie() : [response.headers.get("set-cookie")].filter(Boolean);
11
+ const cookies = raw.map((value) => {
12
+ const [pair, ...attributes] = value.split(";").map((part) => part.trim());
13
+ const flags = attributes.map((part) => part.split("=")[0].toLowerCase());
14
+ return {
15
+ name: pair.split("=")[0],
16
+ secure: flags.includes("secure"),
17
+ http_only: flags.includes("httponly"),
18
+ same_site: attributes.find((part) => part.toLowerCase().startsWith("samesite="))?.split("=")[1] ?? null,
19
+ };
20
+ });
21
+ const weak = cookies.filter((cookie) => !cookie.secure || !cookie.http_only || !cookie.same_site);
22
+ if (weak.length) {
23
+ emit({
24
+ type: "finding",
25
+ title: "Cookies missing security attributes",
26
+ severity: "low",
27
+ description: `${weak.length} cookies are missing Secure, HttpOnly, or SameSite attributes.`,
28
+ });
29
+ }
30
+ emit({
31
+ type: "result",
32
+ summary: `${target} set ${cookies.length} cookies; ${weak.length} are missing security attributes.`,
33
+ data: { url: target, status: response.status, cookies },
34
+ });
35
+ emit({ type: "done", summary: "Cookie check finished." });
36
+ } catch (error) {
37
+ emit({ type: "error", message: `Cookie check failed: ${error.message}` });
38
+ process.exitCode = 1;
39
+ }
40
+ });
@@ -0,0 +1,14 @@
1
+ {
2
+ "schema_version": 1,
3
+ "id": "web/cookie-checker",
4
+ "name": "Cookie Checker",
5
+ "version": "0.1.0",
6
+ "category": "web",
7
+ "kind": "native",
8
+ "risk": "low",
9
+ "description": "Checks cookie security attributes on a web response.",
10
+ "entry": "index.mjs",
11
+ "core_api": "^0.1.0",
12
+ "maintenance": "active",
13
+ "options": []
14
+ }
package/package.json CHANGED
@@ -19,7 +19,7 @@
19
19
  "release:notes": "node scripts/release-notes.mjs"
20
20
  },
21
21
  "type": "module",
22
- "version": "1.0.0",
22
+ "version": "1.1.0",
23
23
  "workspaces": [
24
24
  "packages/*"
25
25
  ],
@@ -11,7 +11,7 @@ process.stdout.on("error", (error) => {
11
11
  process.exit(0);
12
12
  throw error;
13
13
  });
14
- const VERSION = "1.0.0";
14
+ const VERSION = "1.1.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.0.0",
82
- update_message: (await checkForUpdate("1.0.0")).message,
81
+ version: "1.1.0",
82
+ update_message: (await checkForUpdate("1.1.0")).message,
83
83
  categories: CATEGORIES,
84
84
  modules: modules.map(({ manifest }) => manifest),
85
85
  external_tools: [...tools.values()],