cantarella-framework 1.13.0 → 1.15.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/api-soap-checker/index.mjs +34 -0
- package/modules/api-soap-checker/module.json +14 -0
- package/modules/api-websocket-checker/index.mjs +65 -0
- package/modules/api-websocket-checker/module.json +14 -0
- package/modules/threat-intel-greynoise/index.mjs +43 -0
- package/modules/threat-intel-greynoise/module.json +14 -0
- package/modules/wrapper-crunch/index.mjs +42 -0
- package/modules/wrapper-crunch/module.json +34 -0
- package/modules/wrapper-detect-secrets/index.mjs +46 -0
- package/modules/wrapper-detect-secrets/module.json +21 -0
- package/modules/wrapper-dnsrecon/index.mjs +41 -0
- package/modules/wrapper-dnsrecon/module.json +21 -0
- package/modules/wrapper-docker-bench/index.mjs +41 -0
- package/modules/wrapper-docker-bench/module.json +21 -0
- package/modules/wrapper-file-type/index.mjs +33 -0
- package/modules/wrapper-file-type/module.json +21 -0
- package/modules/wrapper-gosec/index.mjs +47 -0
- package/modules/wrapper-gosec/module.json +21 -0
- package/modules/wrapper-hadolint/index.mjs +48 -0
- package/modules/wrapper-hadolint/module.json +21 -0
- package/modules/wrapper-medusa/index.mjs +44 -0
- package/modules/wrapper-medusa/module.json +40 -0
- package/modules/wrapper-onesixtyone/index.mjs +42 -0
- package/modules/wrapper-onesixtyone/module.json +28 -0
- package/modules/wrapper-pdf-parser/index.mjs +43 -0
- package/modules/wrapper-pdf-parser/module.json +21 -0
- package/modules/wrapper-rkhunter/index.mjs +39 -0
- package/modules/wrapper-rkhunter/module.json +21 -0
- package/modules/wrapper-routersploit/index.mjs +42 -0
- package/modules/wrapper-routersploit/module.json +28 -0
- package/modules/wrapper-shellcheck/index.mjs +47 -0
- package/modules/wrapper-shellcheck/module.json +21 -0
- package/modules/wrapper-snmpwalk/index.mjs +42 -0
- package/modules/wrapper-snmpwalk/module.json +28 -0
- package/modules/wrapper-sublist3r/index.mjs +41 -0
- package/modules/wrapper-sublist3r/module.json +21 -0
- package/modules/wrapper-sysdig/index.mjs +39 -0
- package/modules/wrapper-sysdig/module.json +21 -0
- package/modules/wrapper-terrascan/index.mjs +47 -0
- package/modules/wrapper-terrascan/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,47 @@
|
|
|
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("terrascan", ["scan", "-t", "terraform", "-d", 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: `Terrascan failed: ${error.message}` });
|
|
17
|
+
process.exitCode = 1;
|
|
18
|
+
});
|
|
19
|
+
child.on("close", (code) => {
|
|
20
|
+
let report = null;
|
|
21
|
+
try {
|
|
22
|
+
report = JSON.parse(stdout);
|
|
23
|
+
} catch {
|
|
24
|
+
report = null;
|
|
25
|
+
}
|
|
26
|
+
const violations = [];
|
|
27
|
+
const raw = Array.isArray(report?.results?.violations) ? report.results.violations : [];
|
|
28
|
+
for (const violation of raw) {
|
|
29
|
+
violations.push({ rule: violation.rule_name ?? "", severity: violation.severity ?? "unknown", description: violation.description ?? "", resource: violation.resource_name ?? "" });
|
|
30
|
+
}
|
|
31
|
+
if (code !== 0 && !violations.length && !report) {
|
|
32
|
+
emit({ type: "error", message: `Terrascan failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
33
|
+
process.exitCode = 1;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const bySeverity = {};
|
|
37
|
+
for (const violation of violations) {
|
|
38
|
+
bySeverity[violation.severity] = (bySeverity[violation.severity] ?? 0) + 1;
|
|
39
|
+
}
|
|
40
|
+
emit({
|
|
41
|
+
type: "result",
|
|
42
|
+
summary: `Terrascan found ${violations.length} violations in ${target}.`,
|
|
43
|
+
data: { target, total: violations.length, by_severity: bySeverity, violations: violations.slice(0, 100) },
|
|
44
|
+
});
|
|
45
|
+
emit({ type: "done", summary: `Terrascan finished: ${violations.length} violations.` });
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "cloud",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Scans Terraform code with Terrascan and reports the policy violations.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "terrascan",
|
|
9
|
+
"install_hint": "Install Terrascan from your distribution packages or the Terrascan releases.",
|
|
10
|
+
"name": "Terrascan"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "cloud/terrascan",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "Terrascan",
|
|
17
|
+
"options": [],
|
|
18
|
+
"risk": "low",
|
|
19
|
+
"schema_version": 1,
|
|
20
|
+
"version": "0.1.0"
|
|
21
|
+
}
|
package/package.json
CHANGED
package/packages/cli/dist/cli.js
CHANGED
|
@@ -11,7 +11,7 @@ process.stdout.on("error", (error) => {
|
|
|
11
11
|
process.exit(0);
|
|
12
12
|
throw error;
|
|
13
13
|
});
|
|
14
|
-
const VERSION = "1.
|
|
14
|
+
const VERSION = "1.15.0";
|
|
15
15
|
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../..");
|
|
16
16
|
function banner() {
|
|
17
17
|
return (process.stdout.columns ?? 80) >= 72 ? BANNER : COMPACT_BANNER;
|
|
@@ -78,8 +78,8 @@ export function createGuiServer(root) {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
sendJson(response, 200, {
|
|
81
|
-
version: "1.
|
|
82
|
-
update_message: (await checkForUpdate("1.
|
|
81
|
+
version: "1.15.0",
|
|
82
|
+
update_message: (await checkForUpdate("1.15.0")).message,
|
|
83
83
|
categories: CATEGORIES,
|
|
84
84
|
modules: modules.map(({ manifest }) => manifest),
|
|
85
85
|
external_tools: [...tools.values()],
|