saktum 0.4.0 → 0.4.1
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 +1 -1
- package/package.json +1 -1
- package/saktum.mjs +17 -9
package/README.md
CHANGED
|
@@ -145,7 +145,7 @@ servers not on your allowlist, and the weakest grades. Configured secrets are ne
|
|
|
145
145
|
|
|
146
146
|
```yaml
|
|
147
147
|
- uses: actions/checkout@v4
|
|
148
|
-
- uses: soodhere/saktum-check@v0.4.
|
|
148
|
+
- uses: soodhere/saktum-check@v0.4.1
|
|
149
149
|
with:
|
|
150
150
|
target: "-- node build/index.js" # or an https URL
|
|
151
151
|
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.4.
|
|
2
|
+
// Saktum Check 0.4.1 (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;
|
|
@@ -33511,7 +33511,7 @@ var init_dist3 = __esm({
|
|
|
33511
33511
|
init_stdio2();
|
|
33512
33512
|
init_streamableHttp();
|
|
33513
33513
|
init_types2();
|
|
33514
|
-
USER_AGENT = "saktum-check/0.4.
|
|
33514
|
+
USER_AGENT = "saktum-check/0.4.1 (+https://saktum.dev/check)";
|
|
33515
33515
|
LIMITS = { requestTimeoutMs: 1e4, connectTimeoutMs: 6e4, maxResponseChars: 5e6 };
|
|
33516
33516
|
LimitError = class extends Error {
|
|
33517
33517
|
};
|
|
@@ -33549,7 +33549,7 @@ var init_dist3 = __esm({
|
|
|
33549
33549
|
jsonrpc: "2.0",
|
|
33550
33550
|
id: 1,
|
|
33551
33551
|
method: "initialize",
|
|
33552
|
-
params: { protocolVersion: "2025-06-18", capabilities: {}, clientInfo: { name: "saktum-trust-check-probe", version: "0.4.
|
|
33552
|
+
params: { protocolVersion: "2025-06-18", capabilities: {}, clientInfo: { name: "saktum-trust-check-probe", version: "0.4.1" } }
|
|
33553
33553
|
});
|
|
33554
33554
|
}
|
|
33555
33555
|
});
|
|
@@ -33819,7 +33819,7 @@ var init_leakage = __esm({
|
|
|
33819
33819
|
"use strict";
|
|
33820
33820
|
init_safe();
|
|
33821
33821
|
SECRET_PATTERNS = [
|
|
33822
|
-
{ name: "AWS access key", re: /\b(?:AKIA|ASIA)[0-9A-Z]{16}\b
|
|
33822
|
+
{ name: "AWS access key", re: /\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/, valid: (m) => !/EXAMPLE$/.test(m[0]) },
|
|
33823
33823
|
{ name: "GitHub token", re: /\bgh[pousr]_[A-Za-z0-9]{36,}\b/ },
|
|
33824
33824
|
{ name: "Slack token", re: /\bxox[abprs]-[A-Za-z0-9-]{10,}\b/ },
|
|
33825
33825
|
{ name: "Stripe live key", re: /\b(?:sk|rk)_live_[0-9a-zA-Z]{20,}\b/ },
|
|
@@ -33827,7 +33827,14 @@ var init_leakage = __esm({
|
|
|
33827
33827
|
{ name: "AI provider key", re: /\bsk-(?:ant-|proj-)?[A-Za-z0-9_-]{32,}\b/ },
|
|
33828
33828
|
{ name: "private key", re: /-----BEGIN (?:RSA |EC |OPENSSH |DSA |ENCRYPTED )?PRIVATE KEY-----/ },
|
|
33829
33829
|
{ name: "JSON Web Token", re: /\beyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/ },
|
|
33830
|
-
{
|
|
33830
|
+
{
|
|
33831
|
+
name: "password or secret assignment",
|
|
33832
|
+
re: /\b(?:password|passwd|client_secret|api_secret|secret_key)\b["']?\s*[:=]\s*["']?(?!\{|\$|<|%|x{4})([^\s"',;]{8,})/i,
|
|
33833
|
+
valid: (m) => {
|
|
33834
|
+
const v = (m[1] ?? "").replace(/[).,;:!?]+$/, "");
|
|
33835
|
+
return v.length >= 8 && /[A-Za-z]/.test(v) && /\d/.test(v) && !/example|placeholder|changeme|your[-_]?|redacted/i.test(v);
|
|
33836
|
+
}
|
|
33837
|
+
}
|
|
33831
33838
|
];
|
|
33832
33839
|
LEAK_PATTERNS = [
|
|
33833
33840
|
{ name: "JavaScript stack trace", re: /\n?\s+at\s+[\w$.<>\[\] ]+\s+\(?(?:file:\/\/)?[\w./\\:-]+:\d+:\d+\)?/ },
|
|
@@ -33841,9 +33848,10 @@ var init_leakage = __esm({
|
|
|
33841
33848
|
secrets: (ctx) => {
|
|
33842
33849
|
for (const s of sources(ctx))
|
|
33843
33850
|
for (const p of SECRET_PATTERNS) {
|
|
33844
|
-
const
|
|
33845
|
-
|
|
33846
|
-
|
|
33851
|
+
const all = new RegExp(p.re.source, p.re.flags.includes("g") ? p.re.flags : p.re.flags + "g");
|
|
33852
|
+
for (const m of s.text.matchAll(all))
|
|
33853
|
+
if (!p.valid || p.valid(m))
|
|
33854
|
+
return { status: "fail", subject: s.where, message: `Found what looks like ${/^[aeiou]/i.test(p.name) ? "an" : "a"} ${p.name} in ${s.where}. Anyone who can list tools or trigger an error can read it.`, evidence: { excerpt: redact(s.text, m[0]) } };
|
|
33847
33855
|
}
|
|
33848
33856
|
return { status: "pass", message: "No secrets found in tool definitions or probe responses." };
|
|
33849
33857
|
},
|
|
@@ -34854,7 +34862,7 @@ var init_engine = __esm({
|
|
|
34854
34862
|
init_runner();
|
|
34855
34863
|
init_safe();
|
|
34856
34864
|
init_scoring();
|
|
34857
|
-
ENGINE_VERSION = "0.4.
|
|
34865
|
+
ENGINE_VERSION = "0.4.1";
|
|
34858
34866
|
UNKNOWN_TOOL = "saktum_trust_check_no_such_tool";
|
|
34859
34867
|
INVALID_TOKEN = "saktum-check-deliberately-invalid-token";
|
|
34860
34868
|
baseOf = (pack, check) => ({
|