@solongate/proxy 0.81.61 → 0.81.63
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.
|
@@ -27,3 +27,34 @@
|
|
|
27
27
|
{"ms":2,"ts":1784360134508,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
28
28
|
{"ms":5,"ts":1784360234461,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
29
29
|
{"ms":4,"ts":1784360256656,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
30
|
+
{"ms":5,"ts":1784365255204,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
31
|
+
{"ms":4,"ts":1784365279092,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
32
|
+
{"ms":4,"ts":1784365328385,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
33
|
+
{"ms":4,"ts":1784365360712,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
34
|
+
{"ms":4,"ts":1784365375478,"tool":"Write","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
35
|
+
{"ms":3,"ts":1784365383985,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
36
|
+
{"ms":9,"ts":1784365415903,"tool":"Write","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
37
|
+
{"ms":4,"ts":1784365422626,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
38
|
+
{"ms":5,"ts":1784365497358,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
39
|
+
{"ms":4,"ts":1784365509533,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
40
|
+
{"ms":4,"ts":1784365523577,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
41
|
+
{"ms":1,"ts":1784365524083,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
42
|
+
{"ms":2,"ts":1784365525077,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
43
|
+
{"ms":3,"ts":1784365525605,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
44
|
+
{"ms":3,"ts":1784365526627,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
45
|
+
{"ms":2,"ts":1784365527031,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
46
|
+
{"ms":5,"ts":1784366243066,"tool":"Write","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
47
|
+
{"ms":3,"ts":1784366250503,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
48
|
+
{"ms":4,"ts":1784366281171,"tool":"Write","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
49
|
+
{"ms":2,"ts":1784366288049,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
50
|
+
{"ms":3,"ts":1784367337998,"tool":"Write","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
51
|
+
{"ms":2,"ts":1784367345104,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
52
|
+
{"ms":4,"ts":1784367420866,"tool":"Write","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
53
|
+
{"ms":2,"ts":1784367428790,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
54
|
+
{"ms":3,"ts":1784369708978,"tool":"Write","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
55
|
+
{"ms":4,"ts":1784369720104,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
56
|
+
{"ms":4,"ts":1784374757475,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
57
|
+
{"ms":2,"ts":1784374762962,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
58
|
+
{"ms":4,"ts":1784374792946,"tool":"Write","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
59
|
+
{"ms":4,"ts":1784374838495,"tool":"Write","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
60
|
+
{"ms":3,"ts":1784374848281,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"tool":"Bash","ts":
|
|
1
|
+
{"tool":"Bash","ts":1784365527031}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"ms":
|
|
1
|
+
{"ms":3,"ts":1784374848281,"tool":"Bash","session":"f5933c65-c315-4440-9afb-7136fce6b695"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1784374838541
|
package/hooks/guard.bundled.mjs
CHANGED
|
@@ -6536,7 +6536,7 @@ import { resolve, join, dirname, isAbsolute } from "node:path";
|
|
|
6536
6536
|
import { homedir } from "node:os";
|
|
6537
6537
|
import { gunzipSync } from "node:zlib";
|
|
6538
6538
|
import { createHash } from "node:crypto";
|
|
6539
|
-
var HOOK_VERSION =
|
|
6539
|
+
var HOOK_VERSION = 37;
|
|
6540
6540
|
function localLogsOnly(security) {
|
|
6541
6541
|
if (security && typeof security === "object") {
|
|
6542
6542
|
const l = security.localLogs;
|
|
@@ -6557,6 +6557,7 @@ function writeLocalMarker(security) {
|
|
|
6557
6557
|
} catch {
|
|
6558
6558
|
}
|
|
6559
6559
|
}
|
|
6560
|
+
var _invalidPathNoted = false;
|
|
6560
6561
|
function resolveLocalLogDir(rawPath) {
|
|
6561
6562
|
const dir = String(rawPath || "").trim().replace(/[\\/]+$/, "");
|
|
6562
6563
|
if (!dir)
|
|
@@ -6564,13 +6565,16 @@ function resolveLocalLogDir(rawPath) {
|
|
|
6564
6565
|
if (isAbsolute(dir))
|
|
6565
6566
|
return dir;
|
|
6566
6567
|
const fallback = resolve(homedir(), ".solongate", "local-logs");
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
resolve(homedir(), ".solongate",
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6568
|
+
if (!_invalidPathNoted) {
|
|
6569
|
+
_invalidPathNoted = true;
|
|
6570
|
+
try {
|
|
6571
|
+
mkdirSync(resolve(homedir(), ".solongate"), { recursive: true });
|
|
6572
|
+
writeFileSync(
|
|
6573
|
+
resolve(homedir(), ".solongate", ".local-logs-invalid-path"),
|
|
6574
|
+
JSON.stringify({ configured: dir, fallback, ts: Date.now() })
|
|
6575
|
+
);
|
|
6576
|
+
} catch {
|
|
6577
|
+
}
|
|
6574
6578
|
}
|
|
6575
6579
|
return fallback;
|
|
6576
6580
|
}
|
|
@@ -6582,11 +6586,9 @@ function writeLocalLog(security, entry) {
|
|
|
6582
6586
|
const dir = resolveLocalLogDir(l.path);
|
|
6583
6587
|
if (!dir)
|
|
6584
6588
|
return;
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
}
|
|
6589
|
-
appendFileSync(join(dir, "solongate-audit.jsonl"), JSON.stringify(entry) + "\n");
|
|
6589
|
+
const line = JSON.stringify(entry) + "\n";
|
|
6590
|
+
const payload = Buffer.from(JSON.stringify({ dir, line }), "utf-8").toString("base64");
|
|
6591
|
+
spawn(process.execPath, [process.argv[1], "--sg-log-write", payload], { detached: true, stdio: "ignore" }).unref();
|
|
6590
6592
|
} catch {
|
|
6591
6593
|
}
|
|
6592
6594
|
}
|
|
@@ -6730,6 +6732,23 @@ var AGENT_TYPE = process.argv[2] || "claude-code";
|
|
|
6730
6732
|
var POLICY_SELECTOR = process.env.SOLONGATE_AGENT_ID || "";
|
|
6731
6733
|
var AGENT_ID = POLICY_SELECTOR || AGENT_TYPE;
|
|
6732
6734
|
var AGENT_NAME = process.env.SOLONGATE_AGENT_NAME || process.argv[3] || AGENT_TYPE;
|
|
6735
|
+
{
|
|
6736
|
+
const _wi = process.argv.indexOf("--sg-log-write");
|
|
6737
|
+
if (_wi !== -1) {
|
|
6738
|
+
try {
|
|
6739
|
+
const _pl = JSON.parse(Buffer.from(process.argv[_wi + 1] || "", "base64").toString("utf-8"));
|
|
6740
|
+
if (_pl && _pl.dir && _pl.line) {
|
|
6741
|
+
try {
|
|
6742
|
+
mkdirSync(_pl.dir, { recursive: true });
|
|
6743
|
+
} catch {
|
|
6744
|
+
}
|
|
6745
|
+
appendFileSync(join(_pl.dir, "solongate-audit.jsonl"), _pl.line);
|
|
6746
|
+
}
|
|
6747
|
+
} catch {
|
|
6748
|
+
}
|
|
6749
|
+
process.exit(0);
|
|
6750
|
+
}
|
|
6751
|
+
}
|
|
6733
6752
|
var REFRESH_MODE = process.argv.includes("--sg-refresh-policy");
|
|
6734
6753
|
async function refreshPolicyCache() {
|
|
6735
6754
|
try {
|
package/hooks/guard.mjs
CHANGED
|
@@ -32,7 +32,7 @@ import { createHash } from 'node:crypto';
|
|
|
32
32
|
// the installed hook self-updates when the cloud version is higher (see
|
|
33
33
|
// maybeSelfUpdate). This is what makes guard fixes propagate without a manual
|
|
34
34
|
// reinstall — the same trust model as the OPA WASM this hook already runs.
|
|
35
|
-
const HOOK_VERSION =
|
|
35
|
+
const HOOK_VERSION = 37;
|
|
36
36
|
|
|
37
37
|
// True when local log storage is ON. In that mode logs are kept LOCAL ONLY and
|
|
38
38
|
// nothing is sent to the cloud audit log.
|
|
@@ -72,16 +72,24 @@ function writeLocalMarker(security) {
|
|
|
72
72
|
// When the configured path isn't absolute here, fall back to a fixed home folder
|
|
73
73
|
// so entries are never lost and never leak into a project, and record the bad
|
|
74
74
|
// path so the dashboard/user can be told their path isn't valid on this device.
|
|
75
|
+
let _invalidPathNoted = false;
|
|
75
76
|
function resolveLocalLogDir(rawPath) {
|
|
76
77
|
const dir = String(rawPath || '').trim().replace(/[\\/]+$/, '');
|
|
77
78
|
if (!dir) return null;
|
|
78
79
|
if (isAbsolute(dir)) return dir;
|
|
79
80
|
const fallback = resolve(homedir(), '.solongate', 'local-logs');
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
// Non-absolute path (e.g. a Windows path on Linux): fall back. The diagnostic
|
|
82
|
+
// marker is written at most ONCE per process, NOT on every denial — a per-call
|
|
83
|
+
// writeFileSync here widened the window where a concurrent guard process dies
|
|
84
|
+
// before its audit append lands (dropped denials under a simultaneous burst).
|
|
85
|
+
if (!_invalidPathNoted) {
|
|
86
|
+
_invalidPathNoted = true;
|
|
87
|
+
try {
|
|
88
|
+
mkdirSync(resolve(homedir(), '.solongate'), { recursive: true });
|
|
89
|
+
writeFileSync(resolve(homedir(), '.solongate', '.local-logs-invalid-path'),
|
|
90
|
+
JSON.stringify({ configured: dir, fallback, ts: Date.now() }));
|
|
91
|
+
} catch { /* ignore */ }
|
|
92
|
+
}
|
|
85
93
|
return fallback;
|
|
86
94
|
}
|
|
87
95
|
|
|
@@ -94,8 +102,13 @@ function writeLocalLog(security, entry) {
|
|
|
94
102
|
if (!l || !l.enabled || typeof l.path !== 'string' || !l.path.trim()) return;
|
|
95
103
|
const dir = resolveLocalLogDir(l.path);
|
|
96
104
|
if (!dir) return;
|
|
97
|
-
|
|
98
|
-
|
|
105
|
+
const line = JSON.stringify(entry) + '\n';
|
|
106
|
+
// GUARANTEED write: hand the append to a DETACHED child in its own process
|
|
107
|
+
// group. Even if Claude Code kills this hook mid-write during a concurrent
|
|
108
|
+
// denial burst, the child survives and completes the append — no denial is
|
|
109
|
+
// ever lost from the local log. (Inline appends dropped under burst.)
|
|
110
|
+
const payload = Buffer.from(JSON.stringify({ dir, line }), 'utf-8').toString('base64');
|
|
111
|
+
spawn(process.execPath, [process.argv[1], '--sg-log-write', payload], { detached: true, stdio: 'ignore' }).unref();
|
|
99
112
|
} catch { /* best-effort */ }
|
|
100
113
|
}
|
|
101
114
|
|
|
@@ -277,6 +290,24 @@ const AGENT_NAME = process.env.SOLONGATE_AGENT_NAME || process.argv[3] || AGENT_
|
|
|
277
290
|
// serves the cached (or local) policy INSTANTLY and spawns this detached mode to
|
|
278
291
|
// fetch a fresh policy and rewrite the cache for the NEXT call. Result: fast tool
|
|
279
292
|
// calls AND ~one-call propagation of policy changes — no long-TTL tradeoff.
|
|
293
|
+
// Survivable local-log writer. A denial's audit line is written by a DETACHED
|
|
294
|
+
// child (this same file, invoked with --sg-log-write <base64>) so the entry
|
|
295
|
+
// lands even if Claude Code kills the parent hook mid-write during a concurrent
|
|
296
|
+
// denial burst. Handled FIRST and exits immediately — the child never loads the
|
|
297
|
+
// heavy guard logic below.
|
|
298
|
+
{
|
|
299
|
+
const _wi = process.argv.indexOf('--sg-log-write');
|
|
300
|
+
if (_wi !== -1) {
|
|
301
|
+
try {
|
|
302
|
+
const _pl = JSON.parse(Buffer.from(process.argv[_wi + 1] || '', 'base64').toString('utf-8'));
|
|
303
|
+
if (_pl && _pl.dir && _pl.line) {
|
|
304
|
+
try { mkdirSync(_pl.dir, { recursive: true }); } catch {}
|
|
305
|
+
appendFileSync(join(_pl.dir, 'solongate-audit.jsonl'), _pl.line);
|
|
306
|
+
}
|
|
307
|
+
} catch {}
|
|
308
|
+
process.exit(0);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
280
311
|
const REFRESH_MODE = process.argv.includes('--sg-refresh-policy');
|
|
281
312
|
async function refreshPolicyCache() {
|
|
282
313
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solongate/proxy",
|
|
3
|
-
"version": "0.81.
|
|
3
|
+
"version": "0.81.63",
|
|
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": {
|