saktum 0.3.0 → 0.3.2
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/README.md +2 -1
- package/package.json +1 -1
- package/saktum.mjs +69 -6
package/README.md
CHANGED
|
@@ -59,13 +59,14 @@ grade. Every report ends with **OWASP MCP Top 10 coverage**: which categories th
|
|
|
59
59
|
| `saktum snapshot -- <server>` | Writes `saktum.lock.json`, a lock file of your tools |
|
|
60
60
|
| `saktum diff saktum.lock.json -- <server>` | Breaking changes (removed tools, new required fields, changed types), changes to review (descriptions, annotations: silent tool changes), additions, and the version bump they need; fails CI on breaking or risky changes |
|
|
61
61
|
| `saktum docs -- <server>` | A Markdown tools table and ready-to-paste configuration for Claude Desktop, Cursor and VS Code |
|
|
62
|
+
| `saktum allowlist reports/*.json` | An allowlist for MCP firewalls and gateways: only servers meeting your grades, each pinned to the exact tools that were checked (signatures verified first) |
|
|
62
63
|
| `saktum packet saktum-report.json` | A printable **security packet** for customers' security reviews, built from a verified signed result, with a section for your own statements (clearly marked as not verified) |
|
|
63
64
|
|
|
64
65
|
## In CI (GitHub Action)
|
|
65
66
|
|
|
66
67
|
```yaml
|
|
67
68
|
- uses: actions/checkout@v4
|
|
68
|
-
- uses: soodhere/saktum-check@v0.3.
|
|
69
|
+
- uses: soodhere/saktum-check@v0.3.2
|
|
69
70
|
with:
|
|
70
71
|
target: "-- node build/index.js" # or an https URL
|
|
71
72
|
args: "--active --tests saktum.tests.yaml" # optional; --active only for your own server
|
package/package.json
CHANGED
package/saktum.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// Saktum Check 0.3.
|
|
2
|
+
// Saktum Check 0.3.2 (private beta). Licensed Apache-2.0; bundled dependencies keep their own licences.
|
|
3
3
|
import { createRequire as __saktumCreateRequire } from "node:module";
|
|
4
4
|
const require = __saktumCreateRequire(import.meta.url);
|
|
5
5
|
var __create = Object.create;
|
|
@@ -20262,13 +20262,14 @@ var words = (name) => name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").toLowerCase().
|
|
|
20262
20262
|
var READ = /* @__PURE__ */ new Set(["get", "list", "read", "search", "find", "fetch", "query", "describe", "show", "view", "lookup", "count", "check", "status", "retrieve", "browse", "inspect", "resolve", "validate", "analyze", "analyse", "summarize", "summarise", "explain", "compare", "preview", "info", "stats", "download", "export", "diff", "log", "history", "whoami", "ping", "health", "extract", "crawl", "scrape", "research", "map", "summary", "lookup", "tail", "watch"]);
|
|
20263
20263
|
var DESTROY = /* @__PURE__ */ new Set(["delete", "remove", "drop", "purge", "destroy", "reset", "revoke", "cancel", "terminate", "kill", "wipe", "truncate", "overwrite", "uninstall", "unpublish", "archive"]);
|
|
20264
20264
|
var WRITE = /* @__PURE__ */ new Set(["create", "add", "insert", "update", "set", "put", "patch", "edit", "write", "save", "upload", "send", "post", "publish", "deploy", "run", "execute", "exec", "start", "stop", "restart", "move", "rename", "merge", "commit", "push", "install", "enable", "disable", "assign", "invite", "approve", "pay", "charge", "refund", "transfer", "book", "order", "replace", "import", "sync", "trigger", "schedule", "close", "open", "submit", "apply", "generate", "upsert"]);
|
|
20265
|
+
var AMBIGUOUS = /* @__PURE__ */ new Set(["open", "close", "run", "start", "stop", "restart", "generate", "apply", "import", "sync", "trigger", "schedule", "submit", "execute", "exec", "export", "download", "log", "watch", "tail", "map"]);
|
|
20265
20266
|
var IDEMPOTENT_WRITE = /* @__PURE__ */ new Set(["set", "put", "update", "upsert", "enable", "disable", "replace"]);
|
|
20266
20267
|
function suggestAnnotations(tools) {
|
|
20267
20268
|
const caps = capabilityProfile(tools).capabilities;
|
|
20268
20269
|
const hasCap = (tool, c) => caps.some((x) => x.capability === c && x.tools.includes(sanitizeText(tool, 60)));
|
|
20269
20270
|
return tools.map((t) => {
|
|
20270
20271
|
const w = words(t.name);
|
|
20271
|
-
const verb = w.find((x) => READ.has(x) || DESTROY.has(x) || WRITE.has(x));
|
|
20272
|
+
const verb = w.find((x) => !AMBIGUOUS.has(x) && (READ.has(x) || DESTROY.has(x) || WRITE.has(x)));
|
|
20272
20273
|
const current = t.annotations && Object.keys(t.annotations).length ? t.annotations : void 0;
|
|
20273
20274
|
const openWorld = hasCap(t.name, "network") || hasCap(t.name, "untrusted-content") || hasCap(t.name, "sends-messages") ? true : void 0;
|
|
20274
20275
|
let suggested;
|
|
@@ -20305,7 +20306,7 @@ function renderFix(tools, format = "ts") {
|
|
|
20305
20306
|
const conflicts = s.filter((x) => x.conflict);
|
|
20306
20307
|
const lines = [];
|
|
20307
20308
|
lines.push(`Saktum fix: annotation suggestions for ${tools.length} tools (review each before applying; Saktum suggests, you decide).`);
|
|
20308
|
-
lines.push(`${todo.length} to add, ${review.length} need your judgement, ${conflicts.length} possible conflicts, ${s.filter((x) => x.current && !x.conflict).length} already annotated.`);
|
|
20309
|
+
lines.push(`${todo.length} to add, ${review.length} need your judgement, ${conflicts.length} possible conflict${conflicts.length === 1 ? "" : "s"}, ${s.filter((x) => x.current && !x.conflict).length} already annotated.`);
|
|
20309
20310
|
lines.push("");
|
|
20310
20311
|
if (format === "py")
|
|
20311
20312
|
lines.push("from mcp.types import ToolAnnotations", "");
|
|
@@ -20462,6 +20463,48 @@ function clientCompatibility(tools) {
|
|
|
20462
20463
|
issues.push(`${tools.length} tools: some clients limit how many tools they load or show; check your target clients and consider grouping or splitting the server`);
|
|
20463
20464
|
return issues;
|
|
20464
20465
|
}
|
|
20466
|
+
var GRADES = ["A", "B", "C", "D", "F"];
|
|
20467
|
+
var atLeast = (g, min) => g != null && GRADES.indexOf(g) <= GRADES.indexOf(min);
|
|
20468
|
+
function buildAllowlist(results, criteria) {
|
|
20469
|
+
const allowed = [], excluded = [];
|
|
20470
|
+
for (const { result: r, signedBy } of results) {
|
|
20471
|
+
const server = String(r.target.serverInfo?.["name"] ?? r.target.description);
|
|
20472
|
+
const why = [];
|
|
20473
|
+
if (!atLeast(r.grade, criteria.minTrust))
|
|
20474
|
+
why.push(`trust ${r.grade ?? "not graded"} is below ${criteria.minTrust}`);
|
|
20475
|
+
if (!atLeast(r.readiness?.grade, criteria.minReadiness))
|
|
20476
|
+
why.push(`agent readiness ${r.readiness?.grade ?? "not graded"} is below ${criteria.minReadiness}`);
|
|
20477
|
+
if (criteria.noFailedCritical && r.findings.some((f) => f.severity === "critical" && f.status === "fail" && !f.suppressed))
|
|
20478
|
+
why.push("a critical check failed");
|
|
20479
|
+
if (!r.target.toolsFingerprint)
|
|
20480
|
+
why.push("no tool fingerprint to pin");
|
|
20481
|
+
if (why.length) {
|
|
20482
|
+
excluded.push({ server, reason: why.join("; ") });
|
|
20483
|
+
continue;
|
|
20484
|
+
}
|
|
20485
|
+
allowed.push({
|
|
20486
|
+
server,
|
|
20487
|
+
version: r.target.serverInfo?.["version"],
|
|
20488
|
+
transport: r.target.transport,
|
|
20489
|
+
target: r.target.description,
|
|
20490
|
+
toolsFingerprint: r.target.toolsFingerprint,
|
|
20491
|
+
toolCount: r.target.toolCount,
|
|
20492
|
+
trustGrade: r.grade ?? null,
|
|
20493
|
+
readinessGrade: r.readiness?.grade ?? null,
|
|
20494
|
+
checkedAt: r.run.startedAt,
|
|
20495
|
+
checkedWith: `Saktum Check ${r.tool.version}`,
|
|
20496
|
+
signedBy
|
|
20497
|
+
});
|
|
20498
|
+
}
|
|
20499
|
+
return {
|
|
20500
|
+
allowlistFormat: "0.1",
|
|
20501
|
+
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
20502
|
+
criteria,
|
|
20503
|
+
allowed,
|
|
20504
|
+
excluded,
|
|
20505
|
+
note: "Allow each server only while its tools match toolsFingerprint; re-check after any change (saktum diff). Self-tested evidence (assurance L1) unless stated otherwise."
|
|
20506
|
+
};
|
|
20507
|
+
}
|
|
20465
20508
|
|
|
20466
20509
|
// node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/util.js
|
|
20467
20510
|
var util_exports = {};
|
|
@@ -32275,7 +32318,7 @@ var StreamableHTTPClientTransport = class {
|
|
|
32275
32318
|
};
|
|
32276
32319
|
|
|
32277
32320
|
// packages/transports/dist/index.js
|
|
32278
|
-
var USER_AGENT = "saktum-check/0.3.
|
|
32321
|
+
var USER_AGENT = "saktum-check/0.3.2 (+https://saktum.dev/check)";
|
|
32279
32322
|
var LIMITS = { requestTimeoutMs: 1e4, connectTimeoutMs: 6e4, maxResponseChars: 5e6 };
|
|
32280
32323
|
var LimitError = class extends Error {
|
|
32281
32324
|
};
|
|
@@ -32410,7 +32453,7 @@ var INIT_BODY = JSON.stringify({
|
|
|
32410
32453
|
jsonrpc: "2.0",
|
|
32411
32454
|
id: 1,
|
|
32412
32455
|
method: "initialize",
|
|
32413
|
-
params: { protocolVersion: "2025-06-18", capabilities: {}, clientInfo: { name: "saktum-trust-check-probe", version: "0.3.
|
|
32456
|
+
params: { protocolVersion: "2025-06-18", capabilities: {}, clientInfo: { name: "saktum-trust-check-probe", version: "0.3.2" } }
|
|
32414
32457
|
});
|
|
32415
32458
|
async function httpRequest(url2, init = {}) {
|
|
32416
32459
|
const t0 = Date.now();
|
|
@@ -33477,7 +33520,7 @@ async function measureLoad(session, op) {
|
|
|
33477
33520
|
}
|
|
33478
33521
|
|
|
33479
33522
|
// packages/testkit-core/dist/engine.js
|
|
33480
|
-
var ENGINE_VERSION = "0.3.
|
|
33523
|
+
var ENGINE_VERSION = "0.3.2";
|
|
33481
33524
|
var UNKNOWN_TOOL = "saktum_trust_check_no_such_tool";
|
|
33482
33525
|
var INVALID_TOKEN = "saktum-check-deliberately-invalid-token";
|
|
33483
33526
|
function isProtocolFailure(e) {
|
|
@@ -34217,6 +34260,26 @@ ${d.summary}
|
|
|
34217
34260
|
throw new Error(`The result's signature is not valid (${v.reason}); a packet must be built from an unaltered signed result.`);
|
|
34218
34261
|
writeFileSync2(o.out, renderPacket(doc, v.kid));
|
|
34219
34262
|
process.stdout.write(`Wrote ${sanitizeText(o.out)}: open it in a browser and print to PDF. Send it with ${sanitizeText(file)} so customers can verify it.
|
|
34263
|
+
`);
|
|
34264
|
+
});
|
|
34265
|
+
program2.command("allowlist").description("Build an allowlist for MCP firewalls and gateways from signed results: only servers meeting your criteria, pinned to the tools that were checked").argument("<results...>", "signed results (saktum-report.json files)").option("--min-trust <grade>", "minimum trust grade", "A").option("--min-readiness <grade>", "minimum agent-readiness grade", "B").option("--allow-critical", "do not exclude servers with a failed critical check", false).option("--out <file>", "allowlist file", "saktum-allowlist.json").action((files, o) => {
|
|
34266
|
+
const inputs = files.map((f) => {
|
|
34267
|
+
const doc = JSON.parse(readFileSync4(f, "utf8"));
|
|
34268
|
+
const v = verifyDocument(doc);
|
|
34269
|
+
if (!v.valid)
|
|
34270
|
+
throw new Error(`${f}: signature not valid (${v.reason}); only unaltered signed results can be allowlisted.`);
|
|
34271
|
+
return { result: doc, signedBy: v.kid };
|
|
34272
|
+
});
|
|
34273
|
+
const list = buildAllowlist(inputs, { minTrust: o.minTrust.toUpperCase(), minReadiness: o.minReadiness.toUpperCase(), noFailedCritical: !o.allowCritical });
|
|
34274
|
+
writeFileSync2(o.out, JSON.stringify(list, null, 2) + "\n");
|
|
34275
|
+
for (const a of list.allowed)
|
|
34276
|
+
process.stdout.write(`\u2713 ${sanitizeText(a.server, 60)} ${sanitizeText(a.version ?? "", 20)} trust ${a.trustGrade} \xB7 readiness ${a.readinessGrade} \xB7 ${a.toolCount} tools pinned
|
|
34277
|
+
`);
|
|
34278
|
+
for (const x of list.excluded)
|
|
34279
|
+
process.stdout.write(`\u2717 ${sanitizeText(x.server, 60)}: ${sanitizeText(x.reason, 200)}
|
|
34280
|
+
`);
|
|
34281
|
+
process.stdout.write(`
|
|
34282
|
+
Wrote ${sanitizeText(o.out)}: ${list.allowed.length} allowed, ${list.excluded.length} excluded.
|
|
34220
34283
|
`);
|
|
34221
34284
|
});
|
|
34222
34285
|
program2.command("doctor").description("Check your environment, and why a server will not start or connect").argument("[target...]", "optional: the same target you would pass to check").option("--env <KEY=VALUE>", "environment variable for a local server (repeatable)", collect, []).option("--header <Name: value>", "HTTP header for a remote server (repeatable)", collect, []).action(async (targetParts, o) => {
|