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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.15.0
|
|
4
|
+
|
|
5
|
+
- New modules: RouterSploit router exploits, WebSocket upgrade checks, dnsrecon DNS enumeration, ShellCheck script linting, Docker Bench security checks, detect-secrets secret scanning, file type identification, sysdig event capture, crunch wordlist generation, and snmpwalk SNMP enumeration.
|
|
6
|
+
|
|
7
|
+
## 1.14.0
|
|
8
|
+
|
|
9
|
+
- New modules: SOAP endpoint checks, Sublist3r subdomain enumeration, gosec Go audits, Terrascan IaC scans, Hadolint Dockerfile linting, pdf-parser PDF analysis, rkhunter rootkit checks, Medusa credential testing, onesixtyone SNMP scans, and GreyNoise IP lookups.
|
|
10
|
+
|
|
3
11
|
## 1.13.0
|
|
4
12
|
|
|
5
13
|
- New modules: XSStrike XSS scans, GraphQL introspection checks, crt.sh subdomain lookups, Brakeman Rails audits, kubectl pod listings, Snyk dependency tests, YARA rule scans, chkrootkit rootkit checks, CeWL wordlist building, and arp-scan host discovery.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
let input = "";
|
|
2
|
+
process.stdin.setEncoding("utf8");
|
|
3
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
4
|
+
process.stdin.on("end", () => {
|
|
5
|
+
const request = JSON.parse(input || "{}");
|
|
6
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
7
|
+
check(String(request.target ?? ""), emit).catch((error) => {
|
|
8
|
+
emit({ type: "error", message: error.message });
|
|
9
|
+
process.exitCode = 1;
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
async function check(target, emit) {
|
|
14
|
+
const envelope = '<?xml version="1.0"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><Probe/></soap:Body></soap:Envelope>';
|
|
15
|
+
let response;
|
|
16
|
+
try {
|
|
17
|
+
response = await fetch(target, {
|
|
18
|
+
method: "POST",
|
|
19
|
+
headers: { "content-type": "text/xml", SOAPAction: '""' },
|
|
20
|
+
body: envelope,
|
|
21
|
+
});
|
|
22
|
+
} catch (error) {
|
|
23
|
+
throw new Error(`SOAP check failed: cannot reach ${target}: ${error.message}`);
|
|
24
|
+
}
|
|
25
|
+
const text = await response.text();
|
|
26
|
+
const isSoap = /soap:Envelope/i.test(text) || /<Envelope/i.test(text);
|
|
27
|
+
const isFault = /<soap:Fault/i.test(text) || /<Fault/i.test(text);
|
|
28
|
+
emit({
|
|
29
|
+
type: "result",
|
|
30
|
+
summary: isFault ? `${target} answered with a SOAP fault.` : isSoap ? `${target} answered with a SOAP envelope.` : `${target} did not answer with SOAP.`,
|
|
31
|
+
data: { target, soap: isSoap, fault: isFault, status: response.status },
|
|
32
|
+
});
|
|
33
|
+
emit({ type: "done", summary: isFault ? "SOAP check finished: fault." : isSoap ? "SOAP check finished: envelope." : "SOAP check finished: no SOAP." });
|
|
34
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "api",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Sends a SOAP request to an endpoint and reports whether it answers with a valid envelope or a fault.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"id": "api/soap-checker",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"maintenance": "active",
|
|
9
|
+
"name": "SOAP Checker",
|
|
10
|
+
"options": [],
|
|
11
|
+
"risk": "low",
|
|
12
|
+
"schema_version": 1,
|
|
13
|
+
"version": "0.1.0"
|
|
14
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import http from "node:http";
|
|
2
|
+
import https from "node:https";
|
|
3
|
+
|
|
4
|
+
let input = "";
|
|
5
|
+
process.stdin.setEncoding("utf8");
|
|
6
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
7
|
+
process.stdin.on("end", () => {
|
|
8
|
+
const request = JSON.parse(input || "{}");
|
|
9
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
10
|
+
check(String(request.target ?? ""), emit).catch((error) => {
|
|
11
|
+
emit({ type: "error", message: error.message });
|
|
12
|
+
process.exitCode = 1;
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
function check(target, emit) {
|
|
17
|
+
return new Promise((resolve, reject) => {
|
|
18
|
+
let url;
|
|
19
|
+
try {
|
|
20
|
+
url = new URL(target);
|
|
21
|
+
} catch {
|
|
22
|
+
reject(new Error(`WebSocket check failed: invalid URL ${target}.`));
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const lib = url.protocol === "https:" || url.protocol === "wss:" ? https : http;
|
|
26
|
+
const request = lib.request(url, {
|
|
27
|
+
method: "GET",
|
|
28
|
+
headers: {
|
|
29
|
+
Connection: "Upgrade",
|
|
30
|
+
Upgrade: "websocket",
|
|
31
|
+
"Sec-WebSocket-Key": "dGhlIHNhbXBsZSBub25jZQ==",
|
|
32
|
+
"Sec-WebSocket-Version": "13",
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
const timer = setTimeout(() => {
|
|
36
|
+
request.destroy(new Error("timeout"));
|
|
37
|
+
}, 5000);
|
|
38
|
+
request.on("upgrade", (response) => {
|
|
39
|
+
clearTimeout(timer);
|
|
40
|
+
emit({
|
|
41
|
+
type: "result",
|
|
42
|
+
summary: `${target} accepts WebSocket upgrades.`,
|
|
43
|
+
data: { target, websocket: true, status: response.statusCode },
|
|
44
|
+
});
|
|
45
|
+
emit({ type: "done", summary: "WebSocket check finished: upgrade accepted." });
|
|
46
|
+
resolve();
|
|
47
|
+
});
|
|
48
|
+
request.on("response", (response) => {
|
|
49
|
+
clearTimeout(timer);
|
|
50
|
+
emit({
|
|
51
|
+
type: "result",
|
|
52
|
+
summary: `${target} does not accept WebSocket upgrades (HTTP ${response.statusCode}).`,
|
|
53
|
+
data: { target, websocket: false, status: response.statusCode },
|
|
54
|
+
});
|
|
55
|
+
emit({ type: "done", summary: "WebSocket check finished: no upgrade." });
|
|
56
|
+
response.resume();
|
|
57
|
+
resolve();
|
|
58
|
+
});
|
|
59
|
+
request.on("error", (error) => {
|
|
60
|
+
clearTimeout(timer);
|
|
61
|
+
reject(new Error(`WebSocket check failed: cannot reach ${target}: ${error.message}`));
|
|
62
|
+
});
|
|
63
|
+
request.end();
|
|
64
|
+
});
|
|
65
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "api",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Checks whether an endpoint accepts a WebSocket upgrade and reports the result.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"id": "api/websocket-checker",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"maintenance": "active",
|
|
9
|
+
"name": "WebSocket Checker",
|
|
10
|
+
"options": [],
|
|
11
|
+
"risk": "low",
|
|
12
|
+
"schema_version": 1,
|
|
13
|
+
"version": "0.1.0"
|
|
14
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
let input = "";
|
|
2
|
+
process.stdin.setEncoding("utf8");
|
|
3
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
4
|
+
process.stdin.on("end", () => {
|
|
5
|
+
const request = JSON.parse(input || "{}");
|
|
6
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
7
|
+
lookup(String(request.target ?? ""), emit).catch((error) => {
|
|
8
|
+
emit({ type: "error", message: error.message });
|
|
9
|
+
process.exitCode = 1;
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
async function lookup(target, emit) {
|
|
14
|
+
const base = (process.env.CANTA_GREYNOISE_API_URL ?? "https://api.greynoise.io/v3/community").replace(/\/$/, "");
|
|
15
|
+
const url = `${base}/${encodeURIComponent(target)}`;
|
|
16
|
+
let response;
|
|
17
|
+
try {
|
|
18
|
+
response = await fetch(url);
|
|
19
|
+
} catch (error) {
|
|
20
|
+
throw new Error(`GreyNoise lookup failed: cannot reach ${base}: ${error.message}`);
|
|
21
|
+
}
|
|
22
|
+
if (response.status === 404) {
|
|
23
|
+
emit({
|
|
24
|
+
type: "result",
|
|
25
|
+
summary: `${target} is not seen by GreyNoise.`,
|
|
26
|
+
data: { target, noise: false, riot: false, classification: null },
|
|
27
|
+
});
|
|
28
|
+
emit({ type: "done", summary: "GreyNoise lookup finished: not seen." });
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (!response.ok) {
|
|
32
|
+
throw new Error(`GreyNoise lookup failed: HTTP ${response.status} for ${target}.`);
|
|
33
|
+
}
|
|
34
|
+
const report = await response.json();
|
|
35
|
+
const noise = report.noise === true;
|
|
36
|
+
const riot = report.riot === true;
|
|
37
|
+
emit({
|
|
38
|
+
type: "result",
|
|
39
|
+
summary: noise ? `${target} is flagged as internet noise by GreyNoise (${report.classification ?? "unknown"}).` : `${target} is not flagged as noise by GreyNoise.`,
|
|
40
|
+
data: { target, noise, riot, classification: report.classification ?? null, name: report.name ?? null },
|
|
41
|
+
});
|
|
42
|
+
emit({ type: "done", summary: noise ? "GreyNoise lookup finished: noise." : "GreyNoise lookup finished: not noise." });
|
|
43
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "threat-intel",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Checks an IP against the GreyNoise community API and reports whether it is internet noise.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"id": "threat-intel/greynoise",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"maintenance": "active",
|
|
9
|
+
"name": "GreyNoise Lookup",
|
|
10
|
+
"options": [],
|
|
11
|
+
"risk": "low",
|
|
12
|
+
"schema_version": 1,
|
|
13
|
+
"version": "0.1.0"
|
|
14
|
+
}
|
|
@@ -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 min = String(request.options?.min ?? "1");
|
|
11
|
+
const max = String(request.options?.max ?? "3");
|
|
12
|
+
const child = spawn("crunch", [min, max, target], { stdio: ["ignore", "pipe", "pipe"] });
|
|
13
|
+
let stdout = "";
|
|
14
|
+
let stderr = "";
|
|
15
|
+
child.stdout.on("data", (chunk) => (stdout += chunk));
|
|
16
|
+
child.stderr.on("data", (chunk) => (stderr += chunk));
|
|
17
|
+
child.on("error", (error) => {
|
|
18
|
+
emit({ type: "error", message: `crunch failed: ${error.message}` });
|
|
19
|
+
process.exitCode = 1;
|
|
20
|
+
});
|
|
21
|
+
child.on("close", (code) => {
|
|
22
|
+
const plain = stdout.replace(/\x1b\[[0-9;]*m/g, "");
|
|
23
|
+
const words = [];
|
|
24
|
+
for (const line of plain.split("\n")) {
|
|
25
|
+
const trimmed = line.trim();
|
|
26
|
+
if (!trimmed) continue;
|
|
27
|
+
if (trimmed.startsWith("Crunch")) continue;
|
|
28
|
+
words.push(trimmed);
|
|
29
|
+
}
|
|
30
|
+
if (code !== 0 && !words.length) {
|
|
31
|
+
emit({ type: "error", message: `crunch failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
32
|
+
process.exitCode = 1;
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
emit({
|
|
36
|
+
type: "result",
|
|
37
|
+
summary: `crunch generated ${words.length} words from ${target}.`,
|
|
38
|
+
data: { target, min, max, words: words.length, sample: words.slice(0, 20) },
|
|
39
|
+
});
|
|
40
|
+
emit({ type: "done", summary: `crunch finished: ${words.length} words.` });
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "password",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Generates a wordlist with crunch and reports the words it produced.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "crunch",
|
|
9
|
+
"install_hint": "Install crunch from your distribution packages.",
|
|
10
|
+
"name": "crunch"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "password/crunch",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "crunch",
|
|
17
|
+
"options": [
|
|
18
|
+
{
|
|
19
|
+
"default": "1",
|
|
20
|
+
"description": "Minimum word length.",
|
|
21
|
+
"name": "min",
|
|
22
|
+
"type": "string"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"default": "3",
|
|
26
|
+
"description": "Maximum word length.",
|
|
27
|
+
"name": "max",
|
|
28
|
+
"type": "string"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"risk": "low",
|
|
32
|
+
"schema_version": 1,
|
|
33
|
+
"version": "0.1.0"
|
|
34
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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("detect-secrets", ["scan", 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: `detect-secrets 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 secrets = [];
|
|
27
|
+
const results = report?.results && typeof report.results === "object" ? report.results : {};
|
|
28
|
+
for (const [file, entries] of Object.entries(results)) {
|
|
29
|
+
if (!Array.isArray(entries)) continue;
|
|
30
|
+
for (const entry of entries) {
|
|
31
|
+
secrets.push({ file, type: entry.type ?? "", line: entry.line_number ?? null });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (code !== 0 && !secrets.length && !report) {
|
|
35
|
+
emit({ type: "error", message: `detect-secrets failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
36
|
+
process.exitCode = 1;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
emit({
|
|
40
|
+
type: "result",
|
|
41
|
+
summary: `detect-secrets found ${secrets.length} secrets in ${target}.`,
|
|
42
|
+
data: { target, total: secrets.length, secrets: secrets.slice(0, 100) },
|
|
43
|
+
});
|
|
44
|
+
emit({ type: "done", summary: `detect-secrets finished: ${secrets.length} secrets.` });
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "devsecops",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Scans a directory for leaked secrets with detect-secrets and reports what it found.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "detect-secrets",
|
|
9
|
+
"install_hint": "Install detect-secrets from your distribution packages or with pipx install detect-secrets.",
|
|
10
|
+
"name": "detect-secrets"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "devsecops/detect-secrets",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "detect-secrets",
|
|
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("dnsrecon", ["-d", target, "-t", "std"], { 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: `dnsrecon 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 records = [];
|
|
22
|
+
for (const line of plain.split("\n")) {
|
|
23
|
+
const trimmed = line.trim();
|
|
24
|
+
if (!trimmed) continue;
|
|
25
|
+
const match = trimmed.match(/^\[\*\]\s+(\w+)\s+(\S+)\s+(.+)$/);
|
|
26
|
+
if (!match) continue;
|
|
27
|
+
records.push({ type: match[1], name: match[2], value: match[3].trim() });
|
|
28
|
+
}
|
|
29
|
+
if (code !== 0 && !records.length) {
|
|
30
|
+
emit({ type: "error", message: `dnsrecon failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
31
|
+
process.exitCode = 1;
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
emit({
|
|
35
|
+
type: "result",
|
|
36
|
+
summary: `dnsrecon found ${records.length} DNS records for ${target}.`,
|
|
37
|
+
data: { target, records: records.slice(0, 200) },
|
|
38
|
+
});
|
|
39
|
+
emit({ type: "done", summary: `dnsrecon finished: ${records.length} records.` });
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "recon",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Enumerates DNS records of a domain with dnsrecon and reports what it found.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "dnsrecon",
|
|
9
|
+
"install_hint": "Install dnsrecon from your distribution packages or with pipx install dnsrecon.",
|
|
10
|
+
"name": "dnsrecon"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "recon/dnsrecon",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "dnsrecon",
|
|
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("docker-bench-security", [], { 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: `Docker Bench 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 warnings = [];
|
|
22
|
+
let passes = 0;
|
|
23
|
+
for (const line of plain.split("\n")) {
|
|
24
|
+
const trimmed = line.trim();
|
|
25
|
+
if (!trimmed) continue;
|
|
26
|
+
if (/\[WARN\]/.test(trimmed)) warnings.push(trimmed);
|
|
27
|
+
else if (/\[PASS\]/.test(trimmed)) passes += 1;
|
|
28
|
+
}
|
|
29
|
+
if (code !== 0 && !warnings.length && !plain.trim()) {
|
|
30
|
+
emit({ type: "error", message: `Docker Bench failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
31
|
+
process.exitCode = 1;
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
emit({
|
|
35
|
+
type: "result",
|
|
36
|
+
summary: `Docker Bench found ${warnings.length} warnings and ${passes} passes.`,
|
|
37
|
+
data: { target, warnings: warnings.slice(0, 100), passes },
|
|
38
|
+
});
|
|
39
|
+
emit({ type: "done", summary: `Docker Bench finished: ${warnings.length} warnings.` });
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "cloud",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Runs the Docker Bench for Security and reports the warnings it finds.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "docker-bench-security",
|
|
9
|
+
"install_hint": "Install Docker Bench for Security from the Docker Bench repository.",
|
|
10
|
+
"name": "Docker Bench"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "cloud/docker-bench",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "Docker Bench",
|
|
17
|
+
"options": [],
|
|
18
|
+
"risk": "low",
|
|
19
|
+
"schema_version": 1,
|
|
20
|
+
"version": "0.1.0"
|
|
21
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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("file", ["-b", 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: `file failed: ${error.message}` });
|
|
17
|
+
process.exitCode = 1;
|
|
18
|
+
});
|
|
19
|
+
child.on("close", (code) => {
|
|
20
|
+
const type = stdout.trim().split("\n")[0] ?? "";
|
|
21
|
+
if (code !== 0 || !type) {
|
|
22
|
+
emit({ type: "error", message: `file failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
23
|
+
process.exitCode = 1;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
emit({
|
|
27
|
+
type: "result",
|
|
28
|
+
summary: `${target} is ${type}.`,
|
|
29
|
+
data: { target, type },
|
|
30
|
+
});
|
|
31
|
+
emit({ type: "done", summary: `file finished: ${type}.` });
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "forensics",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Identifies a file type with the file command and reports its description.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "file",
|
|
9
|
+
"install_hint": "Install file from your distribution packages.",
|
|
10
|
+
"name": "file"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "forensics/file-type",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "File Type",
|
|
17
|
+
"options": [],
|
|
18
|
+
"risk": "low",
|
|
19
|
+
"schema_version": 1,
|
|
20
|
+
"version": "0.1.0"
|
|
21
|
+
}
|
|
@@ -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("gosec", ["-fmt", "json", 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: `gosec 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 issues = [];
|
|
27
|
+
const raw = Array.isArray(report?.Issues) ? report.Issues : [];
|
|
28
|
+
for (const issue of raw) {
|
|
29
|
+
issues.push({ rule: issue.rule_id ?? "", severity: issue.severity ?? "unknown", confidence: issue.confidence ?? "", details: issue.details ?? "", file: issue.file ?? "", line: issue.line ?? null });
|
|
30
|
+
}
|
|
31
|
+
if (code !== 0 && !issues.length && !report) {
|
|
32
|
+
emit({ type: "error", message: `gosec failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
33
|
+
process.exitCode = 1;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const bySeverity = {};
|
|
37
|
+
for (const issue of issues) {
|
|
38
|
+
bySeverity[issue.severity] = (bySeverity[issue.severity] ?? 0) + 1;
|
|
39
|
+
}
|
|
40
|
+
emit({
|
|
41
|
+
type: "result",
|
|
42
|
+
summary: `gosec found ${issues.length} issues in ${target}.`,
|
|
43
|
+
data: { target, total: issues.length, by_severity: bySeverity, issues: issues.slice(0, 100) },
|
|
44
|
+
});
|
|
45
|
+
emit({ type: "done", summary: `gosec finished: ${issues.length} issues.` });
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "code-audit",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Audits Go source code with gosec and reports the security issues.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "gosec",
|
|
9
|
+
"install_hint": "Install gosec from your distribution packages or with go install github.com/securego/gosec/v2/cmd/gosec@latest.",
|
|
10
|
+
"name": "gosec"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "code-audit/gosec",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "gosec",
|
|
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("hadolint", ["--format", "json", 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: `Hadolint failed: ${error.message}` });
|
|
17
|
+
process.exitCode = 1;
|
|
18
|
+
});
|
|
19
|
+
child.on("close", (code) => {
|
|
20
|
+
let findings = null;
|
|
21
|
+
try {
|
|
22
|
+
findings = JSON.parse(stdout);
|
|
23
|
+
} catch {
|
|
24
|
+
findings = null;
|
|
25
|
+
}
|
|
26
|
+
const items = [];
|
|
27
|
+
if (Array.isArray(findings)) {
|
|
28
|
+
for (const finding of findings) {
|
|
29
|
+
items.push({ line: finding.line ?? null, code: finding.code ?? "", level: finding.level ?? "", message: finding.message ?? "" });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (code !== 0 && !items.length && !findings) {
|
|
33
|
+
emit({ type: "error", message: `Hadolint failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
34
|
+
process.exitCode = 1;
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const byLevel = {};
|
|
38
|
+
for (const item of items) {
|
|
39
|
+
byLevel[item.level] = (byLevel[item.level] ?? 0) + 1;
|
|
40
|
+
}
|
|
41
|
+
emit({
|
|
42
|
+
type: "result",
|
|
43
|
+
summary: `Hadolint found ${items.length} findings in ${target}.`,
|
|
44
|
+
data: { target, total: items.length, by_level: byLevel, findings: items.slice(0, 100) },
|
|
45
|
+
});
|
|
46
|
+
emit({ type: "done", summary: `Hadolint finished: ${items.length} findings.` });
|
|
47
|
+
});
|
|
48
|
+
});
|