cantarella-framework 1.12.0 → 1.14.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-graphql-checker/index.mjs +44 -0
- package/modules/api-graphql-checker/module.json +14 -0
- package/modules/api-soap-checker/index.mjs +34 -0
- package/modules/api-soap-checker/module.json +14 -0
- package/modules/recon-crtsh/index.mjs +48 -0
- package/modules/recon-crtsh/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-arp-scan/index.mjs +41 -0
- package/modules/wrapper-arp-scan/module.json +21 -0
- package/modules/wrapper-brakeman/index.mjs +47 -0
- package/modules/wrapper-brakeman/module.json +21 -0
- package/modules/wrapper-cewl/index.mjs +40 -0
- package/modules/wrapper-cewl/module.json +21 -0
- package/modules/wrapper-chkrootkit/index.mjs +40 -0
- package/modules/wrapper-chkrootkit/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-kubectl/index.mjs +47 -0
- package/modules/wrapper-kubectl/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-snyk/index.mjs +47 -0
- package/modules/wrapper-snyk/module.json +21 -0
- package/modules/wrapper-sublist3r/index.mjs +41 -0
- package/modules/wrapper-sublist3r/module.json +21 -0
- package/modules/wrapper-terrascan/index.mjs +47 -0
- package/modules/wrapper-terrascan/module.json +21 -0
- package/modules/wrapper-xsstrike/index.mjs +39 -0
- package/modules/wrapper-xsstrike/module.json +21 -0
- package/modules/wrapper-yara/index.mjs +42 -0
- package/modules/wrapper-yara/module.json +28 -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.14.0
|
|
4
|
+
|
|
5
|
+
- 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.
|
|
6
|
+
|
|
7
|
+
## 1.13.0
|
|
8
|
+
|
|
9
|
+
- 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.
|
|
10
|
+
|
|
3
11
|
## 1.12.0
|
|
4
12
|
|
|
5
13
|
- New modules: ldapsearch LDAP rootDSE queries, Terraform plan summaries, Reaver WPS attacks, MobSFScan mobile code scans, osquery SQL queries, robots.txt checks, Shodan host lookups, URLhaus blocklist checks, OpenVAS import, and CSV export of run results.
|
|
@@ -0,0 +1,44 @@
|
|
|
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 base = target.replace(/\/$/, "");
|
|
15
|
+
const url = `${base}/graphql`;
|
|
16
|
+
let response;
|
|
17
|
+
try {
|
|
18
|
+
response = await fetch(url, {
|
|
19
|
+
method: "POST",
|
|
20
|
+
headers: { "content-type": "application/json" },
|
|
21
|
+
body: JSON.stringify({ query: "{ __schema { types { name } } }" }),
|
|
22
|
+
});
|
|
23
|
+
} catch (error) {
|
|
24
|
+
throw new Error(`GraphQL check failed: cannot reach ${url}: ${error.message}`);
|
|
25
|
+
}
|
|
26
|
+
if (!response.ok) {
|
|
27
|
+
throw new Error(`GraphQL check failed: HTTP ${response.status} for ${url}.`);
|
|
28
|
+
}
|
|
29
|
+
let report;
|
|
30
|
+
try {
|
|
31
|
+
report = await response.json();
|
|
32
|
+
} catch {
|
|
33
|
+
throw new Error(`GraphQL check failed: ${url} did not return JSON.`);
|
|
34
|
+
}
|
|
35
|
+
const types = report.data?.__schema?.types;
|
|
36
|
+
const enabled = Array.isArray(types);
|
|
37
|
+
const typeNames = enabled ? types.map((type) => type.name).filter(Boolean) : [];
|
|
38
|
+
emit({
|
|
39
|
+
type: "result",
|
|
40
|
+
summary: enabled ? `GraphQL introspection is enabled on ${target}: ${typeNames.length} types.` : `GraphQL introspection is disabled on ${target}.`,
|
|
41
|
+
data: { target, introspection: enabled, types: typeNames.length, type_names: typeNames.slice(0, 50) },
|
|
42
|
+
});
|
|
43
|
+
emit({ type: "done", summary: enabled ? `GraphQL check finished: introspection enabled, ${typeNames.length} types.` : "GraphQL check finished: introspection disabled." });
|
|
44
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "api",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Probes a GraphQL endpoint for an enabled introspection query and lists its types.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"id": "api/graphql-checker",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"maintenance": "active",
|
|
9
|
+
"name": "GraphQL Checker",
|
|
10
|
+
"options": [],
|
|
11
|
+
"risk": "low",
|
|
12
|
+
"schema_version": 1,
|
|
13
|
+
"version": "0.1.0"
|
|
14
|
+
}
|
|
@@ -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,48 @@
|
|
|
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_CRTSH_API_URL ?? "https://crt.sh").replace(/\/$/, "");
|
|
15
|
+
const url = `${base}/?q=${encodeURIComponent(target)}&output=json`;
|
|
16
|
+
let response;
|
|
17
|
+
try {
|
|
18
|
+
response = await fetch(url);
|
|
19
|
+
} catch (error) {
|
|
20
|
+
throw new Error(`crt.sh lookup failed: cannot reach ${base}: ${error.message}`);
|
|
21
|
+
}
|
|
22
|
+
if (!response.ok) {
|
|
23
|
+
throw new Error(`crt.sh lookup failed: HTTP ${response.status} for ${target}.`);
|
|
24
|
+
}
|
|
25
|
+
let entries;
|
|
26
|
+
try {
|
|
27
|
+
entries = await response.json();
|
|
28
|
+
} catch {
|
|
29
|
+
throw new Error(`crt.sh lookup failed: ${base} did not return JSON.`);
|
|
30
|
+
}
|
|
31
|
+
if (!Array.isArray(entries)) {
|
|
32
|
+
throw new Error(`crt.sh lookup failed: unexpected response for ${target}.`);
|
|
33
|
+
}
|
|
34
|
+
const subdomains = new Set();
|
|
35
|
+
for (const entry of entries) {
|
|
36
|
+
const value = String(entry.name_value ?? "");
|
|
37
|
+
for (const name of value.split("\n")) {
|
|
38
|
+
const clean = name.trim().replace(/^\*\./, "");
|
|
39
|
+
if (clean) subdomains.add(clean);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
emit({
|
|
43
|
+
type: "result",
|
|
44
|
+
summary: `crt.sh found ${entries.length} certificates and ${subdomains.size} subdomains for ${target}.`,
|
|
45
|
+
data: { target, certificates: entries.length, subdomains: [...subdomains].sort().slice(0, 200) },
|
|
46
|
+
});
|
|
47
|
+
emit({ type: "done", summary: `crt.sh lookup finished: ${subdomains.size} subdomains.` });
|
|
48
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "recon",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Queries crt.sh certificate transparency logs and lists subdomains for a domain.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"id": "recon/crtsh",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"maintenance": "active",
|
|
9
|
+
"name": "crt.sh Lookup",
|
|
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,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("arp-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: `arp-scan 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 hosts = [];
|
|
22
|
+
for (const line of plain.split("\n")) {
|
|
23
|
+
const trimmed = line.trim();
|
|
24
|
+
if (!trimmed) continue;
|
|
25
|
+
const match = trimmed.match(/^(\d+\.\d+\.\d+\.\d+)\t([0-9a-fA-F:]+)\t(.*)$/);
|
|
26
|
+
if (!match) continue;
|
|
27
|
+
hosts.push({ ip: match[1], mac: match[2], vendor: match[3].trim() });
|
|
28
|
+
}
|
|
29
|
+
if (code !== 0 && !hosts.length) {
|
|
30
|
+
emit({ type: "error", message: `arp-scan failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
31
|
+
process.exitCode = 1;
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
emit({
|
|
35
|
+
type: "result",
|
|
36
|
+
summary: `arp-scan found ${hosts.length} live hosts on ${target}.`,
|
|
37
|
+
data: { target, hosts: hosts.slice(0, 200) },
|
|
38
|
+
});
|
|
39
|
+
emit({ type: "done", summary: `arp-scan finished: ${hosts.length} hosts.` });
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "network",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Scans a network range with arp-scan and reports the live hosts and their MAC addresses.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "arp-scan",
|
|
9
|
+
"install_hint": "Install arp-scan from your distribution packages.",
|
|
10
|
+
"name": "arp-scan"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "network/arp-scan",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "arp-scan",
|
|
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("brakeman", ["--format", "json", "--no-pager", 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: `Brakeman 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 warnings = [];
|
|
27
|
+
const raw = Array.isArray(report?.warnings) ? report.warnings : [];
|
|
28
|
+
for (const warning of raw) {
|
|
29
|
+
warnings.push({ type: warning.warning_type ?? "", message: warning.message ?? "", file: warning.file ?? "", line: warning.line ?? null, confidence: warning.confidence ?? "" });
|
|
30
|
+
}
|
|
31
|
+
if (code !== 0 && !warnings.length && !report) {
|
|
32
|
+
emit({ type: "error", message: `Brakeman failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
33
|
+
process.exitCode = 1;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const byConfidence = {};
|
|
37
|
+
for (const warning of warnings) {
|
|
38
|
+
byConfidence[warning.confidence] = (byConfidence[warning.confidence] ?? 0) + 1;
|
|
39
|
+
}
|
|
40
|
+
emit({
|
|
41
|
+
type: "result",
|
|
42
|
+
summary: `Brakeman found ${warnings.length} warnings in ${target}.`,
|
|
43
|
+
data: { target, total: warnings.length, by_confidence: byConfidence, warnings: warnings.slice(0, 100) },
|
|
44
|
+
});
|
|
45
|
+
emit({ type: "done", summary: `Brakeman finished: ${warnings.length} warnings.` });
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "code-audit",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Audits Ruby on Rails code with Brakeman and reports the security warnings.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "brakeman",
|
|
9
|
+
"install_hint": "Install Brakeman from your distribution packages or with gem install brakeman.",
|
|
10
|
+
"name": "Brakeman"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "code-audit/brakeman",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "Brakeman",
|
|
17
|
+
"options": [],
|
|
18
|
+
"risk": "low",
|
|
19
|
+
"schema_version": 1,
|
|
20
|
+
"version": "0.1.0"
|
|
21
|
+
}
|
|
@@ -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("cewl", ["-m", "3", 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: `CeWL 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 words = [];
|
|
22
|
+
for (const line of plain.split("\n")) {
|
|
23
|
+
const trimmed = line.trim();
|
|
24
|
+
if (!trimmed) continue;
|
|
25
|
+
if (!/^[a-zA-Z0-9_-]+$/.test(trimmed)) continue;
|
|
26
|
+
words.push(trimmed);
|
|
27
|
+
}
|
|
28
|
+
if (code !== 0 && !words.length) {
|
|
29
|
+
emit({ type: "error", message: `CeWL failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
30
|
+
process.exitCode = 1;
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
emit({
|
|
34
|
+
type: "result",
|
|
35
|
+
summary: `CeWL collected ${words.length} words from ${target}.`,
|
|
36
|
+
data: { target, words: words.length, sample: words.slice(0, 20) },
|
|
37
|
+
});
|
|
38
|
+
emit({ type: "done", summary: `CeWL finished: ${words.length} words.` });
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "password",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Builds a wordlist from a website with CeWL and reports the words it found.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "cewl",
|
|
9
|
+
"install_hint": "Install CeWL from your distribution packages or with gem install cewl.",
|
|
10
|
+
"name": "CeWL"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "password/cewl",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "CeWL",
|
|
17
|
+
"options": [],
|
|
18
|
+
"risk": "low",
|
|
19
|
+
"schema_version": 1,
|
|
20
|
+
"version": "0.1.0"
|
|
21
|
+
}
|
|
@@ -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("chkrootkit", ["-q"], { 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: `chkrootkit 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 infected = [];
|
|
22
|
+
for (const line of plain.split("\n")) {
|
|
23
|
+
const trimmed = line.trim();
|
|
24
|
+
if (!trimmed) continue;
|
|
25
|
+
if (/not infected/i.test(trimmed)) continue;
|
|
26
|
+
if (/INFECTED/i.test(trimmed)) infected.push(trimmed);
|
|
27
|
+
}
|
|
28
|
+
if (code !== 0 && !infected.length && !plain.trim()) {
|
|
29
|
+
emit({ type: "error", message: `chkrootkit failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
30
|
+
process.exitCode = 1;
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
emit({
|
|
34
|
+
type: "result",
|
|
35
|
+
summary: infected.length ? `chkrootkit found ${infected.length} infected checks.` : "chkrootkit found no infected checks.",
|
|
36
|
+
data: { target, infected: infected.slice(0, 100), clean: infected.length === 0 },
|
|
37
|
+
});
|
|
38
|
+
emit({ type: "done", summary: infected.length ? `chkrootkit finished: ${infected.length} infected checks.` : "chkrootkit finished: clean." });
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "incident-response",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Runs chkrootkit and reports any infected system checks.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "chkrootkit",
|
|
9
|
+
"install_hint": "Install chkrootkit from your distribution packages.",
|
|
10
|
+
"name": "chkrootkit"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "incident-response/chkrootkit",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "chkrootkit",
|
|
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
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "devsecops",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Lints a Dockerfile with Hadolint and reports the findings.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "hadolint",
|
|
9
|
+
"install_hint": "Install Hadolint from your distribution packages or the Hadolint releases.",
|
|
10
|
+
"name": "Hadolint"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "devsecops/hadolint",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "Hadolint",
|
|
17
|
+
"options": [],
|
|
18
|
+
"risk": "low",
|
|
19
|
+
"schema_version": 1,
|
|
20
|
+
"version": "0.1.0"
|
|
21
|
+
}
|