@solongate/proxy 0.81.10 → 0.81.12
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/dist/index.js +3 -3
- package/dist/shield.js +3 -3
- package/hooks/audit.mjs +2 -2
- package/hooks/guard.bundled.mjs +2 -2
- package/hooks/guard.mjs +2 -2
- package/hooks/shield.mjs +7 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10927,7 +10927,7 @@ function redactString(s, cfg) {
|
|
|
10927
10927
|
for (const p of DLP_PATTERNS) if (allow.has(p.name)) out2 = out2.replace(p.re, `[REDACTED: ${p.name}]`);
|
|
10928
10928
|
for (const c2 of cfg.custom) {
|
|
10929
10929
|
try {
|
|
10930
|
-
out2 = out2.replace(dlpGlobToRe(c2.re, "
|
|
10930
|
+
out2 = out2.replace(dlpGlobToRe(c2.re, "gi"), `[REDACTED: ${c2.name || "custom"}]`);
|
|
10931
10931
|
} catch {
|
|
10932
10932
|
}
|
|
10933
10933
|
}
|
|
@@ -10960,9 +10960,9 @@ function pickUpstream() {
|
|
|
10960
10960
|
}
|
|
10961
10961
|
}
|
|
10962
10962
|
function startProxy(upstream) {
|
|
10963
|
-
const cfg = loadCfg();
|
|
10964
10963
|
const forward = upstream.protocol === "https:" ? httpsRequest : httpRequest;
|
|
10965
10964
|
const server = createServer((req, res) => {
|
|
10965
|
+
const cfg = loadCfg();
|
|
10966
10966
|
const chunks = [];
|
|
10967
10967
|
req.on("data", (c2) => chunks.push(c2));
|
|
10968
10968
|
req.on("end", () => {
|
|
@@ -11072,7 +11072,7 @@ var init_shield = __esm({
|
|
|
11072
11072
|
`);
|
|
11073
11073
|
DLP_PATTERNS = [
|
|
11074
11074
|
{ name: "AWS access key", re: /AKIA[0-9A-Z]{16}/g },
|
|
11075
|
-
{ name: "
|
|
11075
|
+
{ name: "Private key block", re: /-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z ]*PRIVATE KEY-----|-----BEGIN [A-Z ]*PRIVATE KEY-----/g },
|
|
11076
11076
|
{ name: "Anthropic key", re: /sk-ant-[A-Za-z0-9_-]{20,}/g },
|
|
11077
11077
|
{ name: "OpenAI key", re: /sk-(proj-)?[A-Za-z0-9_-]{20,}/g },
|
|
11078
11078
|
{ name: "GitHub token", re: /gh[pousr]_[A-Za-z0-9]{20,}/g },
|
package/dist/shield.js
CHANGED
|
@@ -10,7 +10,7 @@ var log = (...a) => process.stderr.write(`[SolonGate shield] ${a.map(String).joi
|
|
|
10
10
|
`);
|
|
11
11
|
var DLP_PATTERNS = [
|
|
12
12
|
{ name: "AWS access key", re: /AKIA[0-9A-Z]{16}/g },
|
|
13
|
-
{ name: "
|
|
13
|
+
{ name: "Private key block", re: /-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z ]*PRIVATE KEY-----|-----BEGIN [A-Z ]*PRIVATE KEY-----/g },
|
|
14
14
|
{ name: "Anthropic key", re: /sk-ant-[A-Za-z0-9_-]{20,}/g },
|
|
15
15
|
{ name: "OpenAI key", re: /sk-(proj-)?[A-Za-z0-9_-]{20,}/g },
|
|
16
16
|
{ name: "GitHub token", re: /gh[pousr]_[A-Za-z0-9]{20,}/g },
|
|
@@ -168,7 +168,7 @@ function redactString(s, cfg) {
|
|
|
168
168
|
for (const p of DLP_PATTERNS) if (allow.has(p.name)) out = out.replace(p.re, `[REDACTED: ${p.name}]`);
|
|
169
169
|
for (const c of cfg.custom) {
|
|
170
170
|
try {
|
|
171
|
-
out = out.replace(dlpGlobToRe(c.re, "
|
|
171
|
+
out = out.replace(dlpGlobToRe(c.re, "gi"), `[REDACTED: ${c.name || "custom"}]`);
|
|
172
172
|
} catch {
|
|
173
173
|
}
|
|
174
174
|
}
|
|
@@ -201,9 +201,9 @@ function pickUpstream() {
|
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
function startProxy(upstream) {
|
|
204
|
-
const cfg = loadCfg();
|
|
205
204
|
const forward = upstream.protocol === "https:" ? httpsRequest : httpRequest;
|
|
206
205
|
const server = createServer((req, res) => {
|
|
206
|
+
const cfg = loadCfg();
|
|
207
207
|
const chunks = [];
|
|
208
208
|
req.on("data", (c) => chunks.push(c));
|
|
209
209
|
req.on("end", () => {
|
package/hooks/audit.mjs
CHANGED
|
@@ -241,7 +241,7 @@ function buildGhostOutput(toolName, toolInput, toolResponse, toolOutput, pats) {
|
|
|
241
241
|
// the quote handling is exact — no escaping artifacts.
|
|
242
242
|
const DLP_PATTERNS = [
|
|
243
243
|
{ name: 'AWS access key', re: /AKIA[0-9A-Z]{16}/g },
|
|
244
|
-
{ name: '
|
|
244
|
+
{ name: 'Private key block', re: /-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z ]*PRIVATE KEY-----|-----BEGIN [A-Z ]*PRIVATE KEY-----/g },
|
|
245
245
|
{ name: 'Anthropic key', re: /sk-ant-[A-Za-z0-9_-]{20,}/g },
|
|
246
246
|
{ name: 'OpenAI key', re: /sk-(proj-)?[A-Za-z0-9_-]{20,}/g },
|
|
247
247
|
{ name: 'GitHub token', re: /gh[pousr]_[A-Za-z0-9]{20,}/g },
|
|
@@ -337,7 +337,7 @@ function dlpRedactText(text, cfg) {
|
|
|
337
337
|
if (allow.has(p.name)) out = out.replace(p.re, '[REDACTED:' + p.name + ']');
|
|
338
338
|
}
|
|
339
339
|
for (const c of Array.isArray(cfg.custom) ? cfg.custom : []) {
|
|
340
|
-
try { out = out.replace(dlpGlobToRe(c.re, '
|
|
340
|
+
try { out = out.replace(dlpGlobToRe(c.re, 'gi'), '[REDACTED:' + (c.name || 'custom') + ']'); } catch { /* skip invalid */ }
|
|
341
341
|
}
|
|
342
342
|
return out;
|
|
343
343
|
}
|
package/hooks/guard.bundled.mjs
CHANGED
|
@@ -7135,7 +7135,7 @@ function tamperCheck(toolName, args) {
|
|
|
7135
7135
|
}
|
|
7136
7136
|
var DLP_PATTERNS = [
|
|
7137
7137
|
{ name: "AWS access key", re: /AKIA[0-9A-Z]{16}/ },
|
|
7138
|
-
{ name: "
|
|
7138
|
+
{ name: "Private key block", re: /-----BEGIN [A-Z ]*PRIVATE KEY-----/ },
|
|
7139
7139
|
{ name: "Anthropic key", re: /sk-ant-[A-Za-z0-9_-]{20,}/ },
|
|
7140
7140
|
{ name: "OpenAI key", re: /sk-(proj-)?[A-Za-z0-9_-]{20,}/ },
|
|
7141
7141
|
{ name: "GitHub token", re: /gh[pousr]_[A-Za-z0-9]{20,}/ },
|
|
@@ -7159,7 +7159,7 @@ function dlpGlobToRe(glob) {
|
|
|
7159
7159
|
else
|
|
7160
7160
|
re += ch;
|
|
7161
7161
|
}
|
|
7162
|
-
return new RegExp(re);
|
|
7162
|
+
return new RegExp(re, "i");
|
|
7163
7163
|
}
|
|
7164
7164
|
function dlpScan(args, cfg) {
|
|
7165
7165
|
if (!cfg)
|
package/hooks/guard.mjs
CHANGED
|
@@ -810,7 +810,7 @@ function tamperCheck(toolName, args) {
|
|
|
810
810
|
// rules plus generic Bearer / secret-assignment catch-alls for the long tail.
|
|
811
811
|
const DLP_PATTERNS = [
|
|
812
812
|
{ name: 'AWS access key', re: /AKIA[0-9A-Z]{16}/ },
|
|
813
|
-
{ name: '
|
|
813
|
+
{ name: 'Private key block', re: /-----BEGIN [A-Z ]*PRIVATE KEY-----/ },
|
|
814
814
|
{ name: 'Anthropic key', re: /sk-ant-[A-Za-z0-9_-]{20,}/ },
|
|
815
815
|
{ name: 'OpenAI key', re: /sk-(proj-)?[A-Za-z0-9_-]{20,}/ },
|
|
816
816
|
{ name: 'GitHub token', re: /gh[pousr]_[A-Za-z0-9]{20,}/ },
|
|
@@ -834,7 +834,7 @@ function dlpGlobToRe(glob) {
|
|
|
834
834
|
else if ('.+?^${}()|[]\\'.indexOf(ch) !== -1) re += '\\' + ch;
|
|
835
835
|
else re += ch;
|
|
836
836
|
}
|
|
837
|
-
return new RegExp(re);
|
|
837
|
+
return new RegExp(re, 'i');
|
|
838
838
|
}
|
|
839
839
|
// Scan args against the enabled built-in patterns + any user custom patterns.
|
|
840
840
|
// `cfg` = { patterns: string[], custom: {name,re}[] }.
|
package/hooks/shield.mjs
CHANGED
|
@@ -29,7 +29,7 @@ const log = (...a) => process.stderr.write(`[SolonGate shield] ${a.map(String).j
|
|
|
29
29
|
|
|
30
30
|
const DLP_PATTERNS = [
|
|
31
31
|
{ name: 'AWS access key', re: /AKIA[0-9A-Z]{16}/g },
|
|
32
|
-
{ name: '
|
|
32
|
+
{ name: 'Private key block', re: /-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z ]*PRIVATE KEY-----|-----BEGIN [A-Z ]*PRIVATE KEY-----/g },
|
|
33
33
|
{ name: 'Anthropic key', re: /sk-ant-[A-Za-z0-9_-]{20,}/g },
|
|
34
34
|
{ name: 'OpenAI key', re: /sk-(proj-)?[A-Za-z0-9_-]{20,}/g },
|
|
35
35
|
{ name: 'GitHub token', re: /gh[pousr]_[A-Za-z0-9]{20,}/g },
|
|
@@ -176,7 +176,7 @@ function redactString(s, cfg) {
|
|
|
176
176
|
let out = s;
|
|
177
177
|
for (const p of DLP_PATTERNS) if (allow.has(p.name)) out = out.replace(p.re, `[REDACTED: ${p.name}]`);
|
|
178
178
|
for (const c of cfg.custom) {
|
|
179
|
-
try { out = out.replace(dlpGlobToRe(c.re, '
|
|
179
|
+
try { out = out.replace(dlpGlobToRe(c.re, 'gi'), `[REDACTED: ${c.name || 'custom'}]`); } catch { /* skip */ }
|
|
180
180
|
}
|
|
181
181
|
return out;
|
|
182
182
|
}
|
|
@@ -210,9 +210,13 @@ function pickUpstream() {
|
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
function startProxy(upstream) {
|
|
213
|
-
const cfg = loadCfg();
|
|
214
213
|
const forward = upstream.protocol === 'https:' ? httpsRequest : httpRequest;
|
|
215
214
|
const server = createServer((req, res) => {
|
|
215
|
+
// Re-read the DLP config on every request (cheap: a small JSON) so changing
|
|
216
|
+
// DLP mode / patterns in the dashboard takes effect WITHOUT restarting claude —
|
|
217
|
+
// the guard rewrites this cache within ~one call, matching how the audit hook
|
|
218
|
+
// already re-reads per call. Loading once at startup left the shield stale.
|
|
219
|
+
const cfg = loadCfg();
|
|
216
220
|
const chunks = [];
|
|
217
221
|
req.on('data', (c) => chunks.push(c));
|
|
218
222
|
req.on('end', () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solongate/proxy",
|
|
3
|
-
"version": "0.81.
|
|
3
|
+
"version": "0.81.12",
|
|
4
4
|
"description": "AI tool security proxy: protect any AI tool server with customizable policies, path/command constraints, rate limiting, and audit logging. No code changes required.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|