@solongate/proxy 0.82.54 → 0.82.56

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/hooks/audit.mjs CHANGED
@@ -11,7 +11,7 @@ import { homedir } from 'node:os';
11
11
  // Bump on every audit hook change. The cloud serves the newest version; the guard
12
12
  // hook installs it on its next run (no re-login needed). See guard.mjs
13
13
  // fetchAndInstallHook / maybeSelfUpdate.
14
- const HOOK_VERSION = 16;
14
+ const HOOK_VERSION = 17;
15
15
 
16
16
  function loadEnvKey(dir) {
17
17
  try {
@@ -131,6 +131,15 @@ function ghostMatch(targetPath, patterns) {
131
131
  continue;
132
132
  }
133
133
  if (re.test(norm)) return true;
134
+ // A path ghost must also hide the file when a tool lists it by BARE name —
135
+ // `ls dir/` prints just "secret-plan.txt" (no slash), which a slash-pattern
136
+ // like `*/secret-plan.txt` would otherwise miss. Match the pattern's last
137
+ // segment against the target's basename.
138
+ const patBase = pat.slice(pat.lastIndexOf('/') + 1);
139
+ if (patBase && patBase !== pat) {
140
+ const reBase = ghostGlobToRegExp(patBase);
141
+ if (reBase && reBase.test(base)) return true;
142
+ }
134
143
  }
135
144
  return false;
136
145
  }
@@ -151,6 +160,10 @@ function ghostStripLines(text, pats) {
151
160
  const trimmed = line.trim();
152
161
  if (!trimmed) { kept.push(line); continue; }
153
162
  if (ghostMatch(trimmed, pats)) continue; // full-path listing line
163
+ // grep -n / ripgrep output is `path:line:content` (or `path:content`) — the
164
+ // path is the first colon field. Drop the whole match line if it's a ghost.
165
+ const firstField = trimmed.split(':')[0];
166
+ if (firstField && firstField !== trimmed && ghostMatch(firstField, pats)) continue;
154
167
  const toks = trimmed.split(/\s+/);
155
168
  const anyHit = toks.some((t) => ghostMatch(ghostCleanToken(t), pats));
156
169
  if (!anyHit) { kept.push(line); continue; }
@@ -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 = 46;
6539
+ var HOOK_VERSION = 47;
6540
6540
  function localLogsOnly(security) {
6541
6541
  if (security && typeof security === "object") {
6542
6542
  const l = security.localLogs;
@@ -7064,9 +7064,17 @@ var TAMPER_BASENAMES = [
7064
7064
  "guard.mjs",
7065
7065
  "audit.mjs",
7066
7066
  "stop.mjs",
7067
+ "shield.mjs",
7067
7068
  "policy.json",
7068
- ".policy-cache.json",
7069
- ".pi-config-cache.json",
7069
+ // Prefixes (substring match) so per-agent runtime state can't be deleted or
7070
+ // rewritten via a shell command either — `.policy-cache-<agent>.json`,
7071
+ // `.ratelimit-<agent>.json`, `.opa-wasm-<agent>.json`. Editing these could
7072
+ // otherwise flip enforcement off until the next cloud refresh; deleting just
7073
+ // forces a refetch, but neither should be reachable from an agent tool call.
7074
+ ".policy-cache",
7075
+ ".ratelimit-",
7076
+ ".opa-wasm-",
7077
+ ".pi-config-cache",
7070
7078
  "cloud-guard.json",
7071
7079
  // Customer install: DB and wizard exe
7072
7080
  "solongate.db",
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 = 46;
35
+ const HOOK_VERSION = 47;
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.
@@ -799,9 +799,15 @@ const TAMPER_PROTECTED_GLOBS = [
799
799
  '**' + TAMPER_INSTALL + '/setup.sh',
800
800
  ];
801
801
  const TAMPER_BASENAMES = [
802
- 'guard.mjs', 'audit.mjs', 'stop.mjs',
803
- 'policy.json', '.policy-cache.json',
804
- '.pi-config-cache.json', 'cloud-guard.json',
802
+ 'guard.mjs', 'audit.mjs', 'stop.mjs', 'shield.mjs',
803
+ 'policy.json',
804
+ // Prefixes (substring match) so per-agent runtime state can't be deleted or
805
+ // rewritten via a shell command either — `.policy-cache-<agent>.json`,
806
+ // `.ratelimit-<agent>.json`, `.opa-wasm-<agent>.json`. Editing these could
807
+ // otherwise flip enforcement off until the next cloud refresh; deleting just
808
+ // forces a refetch, but neither should be reachable from an agent tool call.
809
+ '.policy-cache', '.ratelimit-', '.opa-wasm-', '.pi-config-cache',
810
+ 'cloud-guard.json',
805
811
  // Customer install: DB and wizard exe
806
812
  'solongate.db', 'solongate.exe',
807
813
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solongate/proxy",
3
- "version": "0.82.54",
3
+ "version": "0.82.56",
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": {