@solongate/proxy 0.82.46 → 0.82.48

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.
@@ -1,5 +1,5 @@
1
1
  // src/global-install.ts
2
- import { readFileSync, writeFileSync, existsSync, mkdirSync, rmSync } from "fs";
2
+ import { readFileSync, writeFileSync, existsSync, mkdirSync, rmSync, chmodSync } from "fs";
3
3
  import { resolve, join, dirname } from "path";
4
4
  import { homedir } from "os";
5
5
  import { fileURLToPath } from "url";
@@ -12,7 +12,11 @@ function lockFile(file) {
12
12
  try {
13
13
  if (process.platform === "win32") {
14
14
  try {
15
- execFileSync("icacls", [file, "/deny", "*S-1-1-0:(WD,AD,DC,DE)"], { stdio: "ignore" });
15
+ execFileSync("icacls", [file, "/deny", "*S-1-1-0:(WD,AD,DC,DE,WDAC,WO)"], { stdio: "ignore" });
16
+ } catch {
17
+ }
18
+ try {
19
+ execFileSync("icacls", [file, "/grant", "*S-1-3-4:(RX)"], { stdio: "ignore" });
16
20
  } catch {
17
21
  }
18
22
  try {
@@ -29,6 +33,10 @@ function lockFile(file) {
29
33
  execFileSync("chattr", ["+i", file], { stdio: "ignore" });
30
34
  } catch {
31
35
  }
36
+ try {
37
+ chmodSync(file, 292);
38
+ } catch {
39
+ }
32
40
  }
33
41
  } catch {
34
42
  }
@@ -37,6 +45,10 @@ function unlockFile(file) {
37
45
  if (!existsSync(file)) return;
38
46
  try {
39
47
  if (process.platform === "win32") {
48
+ try {
49
+ execFileSync("icacls", [file, "/remove:g", "*S-1-3-4"], { stdio: "ignore" });
50
+ } catch {
51
+ }
40
52
  try {
41
53
  execFileSync("icacls", [file, "/remove:d", "*S-1-1-0"], { stdio: "ignore" });
42
54
  } catch {
@@ -59,6 +71,10 @@ function unlockFile(file) {
59
71
  execFileSync("chattr", ["-i", file], { stdio: "ignore" });
60
72
  } catch {
61
73
  }
74
+ try {
75
+ chmodSync(file, 420);
76
+ } catch {
77
+ }
62
78
  }
63
79
  } catch {
64
80
  }
@@ -274,7 +290,7 @@ function installGlobalQuiet() {
274
290
  installAntigravityGuard(p, join(p.hooksDir, "guard.mjs").replace(/\\/g, "/"));
275
291
  } catch {
276
292
  }
277
- if (process.env["SOLONGATE_OS_LOCK"] !== "0") lockProtected();
293
+ if (process.env["SOLONGATE_NO_OS_LOCK"] !== "1") lockProtected();
278
294
  return { ok: true, message: "guard installed (open a new session)" };
279
295
  } catch (e) {
280
296
  return { ok: false, message: e instanceof Error ? e.message : String(e) };
@@ -464,7 +480,7 @@ async function runGlobalInstall(opts = {}) {
464
480
  console.log(` Registered Antigravity CLI guard \u2192 ${p.antigravityHooksPath}`);
465
481
  } catch {
466
482
  }
467
- if (process.env["SOLONGATE_OS_LOCK"] !== "0") {
483
+ if (process.env["SOLONGATE_NO_OS_LOCK"] !== "1") {
468
484
  lockProtected();
469
485
  console.log(" Locked protection files (OS-level read-only/immutable).");
470
486
  }
package/dist/index.js CHANGED
@@ -6206,7 +6206,7 @@ __export(global_install_exports, {
6206
6206
  uninstallGlobalQuiet: () => uninstallGlobalQuiet,
6207
6207
  unlockProtected: () => unlockProtected
6208
6208
  });
6209
- import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, existsSync as existsSync3, mkdirSync as mkdirSync3, rmSync as rmSync2 } from "fs";
6209
+ import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, existsSync as existsSync3, mkdirSync as mkdirSync3, rmSync as rmSync2, chmodSync } from "fs";
6210
6210
  import { resolve as resolve3, join as join4, dirname } from "path";
6211
6211
  import { homedir as homedir2 } from "os";
6212
6212
  import { fileURLToPath } from "url";
@@ -6217,7 +6217,11 @@ function lockFile(file) {
6217
6217
  try {
6218
6218
  if (process.platform === "win32") {
6219
6219
  try {
6220
- execFileSync2("icacls", [file, "/deny", "*S-1-1-0:(WD,AD,DC,DE)"], { stdio: "ignore" });
6220
+ execFileSync2("icacls", [file, "/deny", "*S-1-1-0:(WD,AD,DC,DE,WDAC,WO)"], { stdio: "ignore" });
6221
+ } catch {
6222
+ }
6223
+ try {
6224
+ execFileSync2("icacls", [file, "/grant", "*S-1-3-4:(RX)"], { stdio: "ignore" });
6221
6225
  } catch {
6222
6226
  }
6223
6227
  try {
@@ -6234,6 +6238,10 @@ function lockFile(file) {
6234
6238
  execFileSync2("chattr", ["+i", file], { stdio: "ignore" });
6235
6239
  } catch {
6236
6240
  }
6241
+ try {
6242
+ chmodSync(file, 292);
6243
+ } catch {
6244
+ }
6237
6245
  }
6238
6246
  } catch {
6239
6247
  }
@@ -6242,6 +6250,10 @@ function unlockFile(file) {
6242
6250
  if (!existsSync3(file)) return;
6243
6251
  try {
6244
6252
  if (process.platform === "win32") {
6253
+ try {
6254
+ execFileSync2("icacls", [file, "/remove:g", "*S-1-3-4"], { stdio: "ignore" });
6255
+ } catch {
6256
+ }
6245
6257
  try {
6246
6258
  execFileSync2("icacls", [file, "/remove:d", "*S-1-1-0"], { stdio: "ignore" });
6247
6259
  } catch {
@@ -6264,6 +6276,10 @@ function unlockFile(file) {
6264
6276
  execFileSync2("chattr", ["-i", file], { stdio: "ignore" });
6265
6277
  } catch {
6266
6278
  }
6279
+ try {
6280
+ chmodSync(file, 420);
6281
+ } catch {
6282
+ }
6267
6283
  }
6268
6284
  } catch {
6269
6285
  }
@@ -6478,7 +6494,7 @@ function installGlobalQuiet() {
6478
6494
  installAntigravityGuard(p, join4(p.hooksDir, "guard.mjs").replace(/\\/g, "/"));
6479
6495
  } catch {
6480
6496
  }
6481
- if (process.env["SOLONGATE_OS_LOCK"] !== "0") lockProtected();
6497
+ if (process.env["SOLONGATE_NO_OS_LOCK"] !== "1") lockProtected();
6482
6498
  return { ok: true, message: "guard installed (open a new session)" };
6483
6499
  } catch (e) {
6484
6500
  return { ok: false, message: e instanceof Error ? e.message : String(e) };
@@ -6666,7 +6682,7 @@ async function runGlobalInstall(opts = {}) {
6666
6682
  console.log(` Registered Antigravity CLI guard \u2192 ${p.antigravityHooksPath}`);
6667
6683
  } catch {
6668
6684
  }
6669
- if (process.env["SOLONGATE_OS_LOCK"] !== "0") {
6685
+ if (process.env["SOLONGATE_NO_OS_LOCK"] !== "1") {
6670
6686
  lockProtected();
6671
6687
  console.log(" Locked protection files (OS-level read-only/immutable).");
6672
6688
  }
@@ -9500,7 +9516,6 @@ var init_Policies = __esm({
9500
9516
  { label: "Effect", kind: "effect", get: (r) => r.effect },
9501
9517
  { label: "Enabled", kind: "enabled", get: (r) => r.enabled ? "yes" : "no" },
9502
9518
  { label: "Priority", kind: "priority", get: (r) => String(r.priority) },
9503
- { label: "Tool pattern", kind: "text", get: (r) => r.toolPattern, set: (r, v) => ({ ...r, toolPattern: v || "*" }) },
9504
9519
  { label: "Description", kind: "text", get: (r) => r.description ?? "", set: (r, v) => ({ ...r, description: v }) },
9505
9520
  { label: "Cmd allow", kind: "text", get: (r) => constr(r, "commandConstraints", "allowed"), set: (r, v) => setConstr(r, "commandConstraints", "allowed", v) },
9506
9521
  { label: "Cmd deny", kind: "text", get: (r) => constr(r, "commandConstraints", "denied"), set: (r, v) => setConstr(r, "commandConstraints", "denied", v) },
@@ -13460,13 +13475,20 @@ function analyzeSecurityWarnings(policySet) {
13460
13475
  const allowRules = policySet.rules.filter(
13461
13476
  (r) => r.effect === "ALLOW" && r.enabled
13462
13477
  );
13463
- const wildcardAllows = allowRules.filter((r) => r.toolPattern === "*");
13478
+ const hasNoConstraint = (r) => {
13479
+ const groups = ["commandConstraints", "pathConstraints", "filenameConstraints", "urlConstraints"];
13480
+ return !groups.some((g) => {
13481
+ const c2 = r[g];
13482
+ return c2 ? (c2.allowed?.length ?? 0) + (c2.denied?.length ?? 0) > 0 : false;
13483
+ });
13484
+ };
13485
+ const wildcardAllows = allowRules.filter(hasNoConstraint);
13464
13486
  if (wildcardAllows.length > 0) {
13465
13487
  warnings.push({
13466
13488
  level: "CRITICAL",
13467
13489
  code: "WILDCARD_ALLOW",
13468
13490
  message: UNSAFE_CONFIGURATION_WARNINGS.WILDCARD_ALLOW,
13469
- recommendation: "Replace wildcard ALLOW rules with specific tool patterns."
13491
+ recommendation: "Add command or path constraints so an ALLOW rule does not permit everything."
13470
13492
  });
13471
13493
  }
13472
13494
  return warnings;
package/dist/lib.js CHANGED
@@ -7019,13 +7019,20 @@ function analyzeSecurityWarnings(policySet) {
7019
7019
  const allowRules = policySet.rules.filter(
7020
7020
  (r) => r.effect === "ALLOW" && r.enabled
7021
7021
  );
7022
- const wildcardAllows = allowRules.filter((r) => r.toolPattern === "*");
7022
+ const hasNoConstraint = (r) => {
7023
+ const groups = ["commandConstraints", "pathConstraints", "filenameConstraints", "urlConstraints"];
7024
+ return !groups.some((g) => {
7025
+ const c = r[g];
7026
+ return c ? (c.allowed?.length ?? 0) + (c.denied?.length ?? 0) > 0 : false;
7027
+ });
7028
+ };
7029
+ const wildcardAllows = allowRules.filter(hasNoConstraint);
7023
7030
  if (wildcardAllows.length > 0) {
7024
7031
  warnings.push({
7025
7032
  level: "CRITICAL",
7026
7033
  code: "WILDCARD_ALLOW",
7027
7034
  message: UNSAFE_CONFIGURATION_WARNINGS.WILDCARD_ALLOW,
7028
- recommendation: "Replace wildcard ALLOW rules with specific tool patterns."
7035
+ recommendation: "Add command or path constraints so an ALLOW rule does not permit everything."
7029
7036
  });
7030
7037
  }
7031
7038
  return warnings;
@@ -11,8 +11,9 @@ export declare function createDefaultDenyPolicySet(): PolicySet;
11
11
  */
12
12
  export declare function createPermissivePolicySet(): PolicySet;
13
13
  /**
14
- * Creates a read-only policy set for a specific tool pattern.
15
- * Allows reads for VERIFIED requests only.
14
+ * Internal helper. Builds a read-only policy set scoped by an internal tool
15
+ * selector fixed to "*" in the shipped product; no UI or CLI exposes it, so
16
+ * users can neither see nor change it. Allows reads for VERIFIED requests only.
16
17
  */
17
18
  export declare function createReadOnlyPolicySet(toolPattern: string): PolicySet;
18
19
  /**
package/dist/tui/index.js CHANGED
@@ -9,7 +9,7 @@ var __export = (target, all) => {
9
9
  };
10
10
 
11
11
  // src/global-install.ts
12
- import { readFileSync as readFileSync4, writeFileSync as writeFileSync5, existsSync as existsSync2, mkdirSync as mkdirSync4, rmSync } from "fs";
12
+ import { readFileSync as readFileSync4, writeFileSync as writeFileSync5, existsSync as existsSync2, mkdirSync as mkdirSync4, rmSync, chmodSync } from "fs";
13
13
  import { resolve as resolve2, join as join6, dirname } from "path";
14
14
  import { homedir as homedir6 } from "os";
15
15
  import { fileURLToPath } from "url";
@@ -20,7 +20,11 @@ function lockFile(file) {
20
20
  try {
21
21
  if (process.platform === "win32") {
22
22
  try {
23
- execFileSync("icacls", [file, "/deny", "*S-1-1-0:(WD,AD,DC,DE)"], { stdio: "ignore" });
23
+ execFileSync("icacls", [file, "/deny", "*S-1-1-0:(WD,AD,DC,DE,WDAC,WO)"], { stdio: "ignore" });
24
+ } catch {
25
+ }
26
+ try {
27
+ execFileSync("icacls", [file, "/grant", "*S-1-3-4:(RX)"], { stdio: "ignore" });
24
28
  } catch {
25
29
  }
26
30
  try {
@@ -37,6 +41,10 @@ function lockFile(file) {
37
41
  execFileSync("chattr", ["+i", file], { stdio: "ignore" });
38
42
  } catch {
39
43
  }
44
+ try {
45
+ chmodSync(file, 292);
46
+ } catch {
47
+ }
40
48
  }
41
49
  } catch {
42
50
  }
@@ -45,6 +53,10 @@ function unlockFile(file) {
45
53
  if (!existsSync2(file)) return;
46
54
  try {
47
55
  if (process.platform === "win32") {
56
+ try {
57
+ execFileSync("icacls", [file, "/remove:g", "*S-1-3-4"], { stdio: "ignore" });
58
+ } catch {
59
+ }
48
60
  try {
49
61
  execFileSync("icacls", [file, "/remove:d", "*S-1-1-0"], { stdio: "ignore" });
50
62
  } catch {
@@ -67,6 +79,10 @@ function unlockFile(file) {
67
79
  execFileSync("chattr", ["-i", file], { stdio: "ignore" });
68
80
  } catch {
69
81
  }
82
+ try {
83
+ chmodSync(file, 420);
84
+ } catch {
85
+ }
70
86
  }
71
87
  } catch {
72
88
  }
@@ -217,7 +233,7 @@ function installGlobalQuiet() {
217
233
  installAntigravityGuard(p, join6(p.hooksDir, "guard.mjs").replace(/\\/g, "/"));
218
234
  } catch {
219
235
  }
220
- if (process.env["SOLONGATE_OS_LOCK"] !== "0") lockProtected();
236
+ if (process.env["SOLONGATE_NO_OS_LOCK"] !== "1") lockProtected();
221
237
  return { ok: true, message: "guard installed (open a new session)" };
222
238
  } catch (e) {
223
239
  return { ok: false, message: e instanceof Error ? e.message : String(e) };
@@ -2414,7 +2430,6 @@ var FIELDS = [
2414
2430
  { label: "Effect", kind: "effect", get: (r) => r.effect },
2415
2431
  { label: "Enabled", kind: "enabled", get: (r) => r.enabled ? "yes" : "no" },
2416
2432
  { label: "Priority", kind: "priority", get: (r) => String(r.priority) },
2417
- { label: "Tool pattern", kind: "text", get: (r) => r.toolPattern, set: (r, v) => ({ ...r, toolPattern: v || "*" }) },
2418
2433
  { label: "Description", kind: "text", get: (r) => r.description ?? "", set: (r, v) => ({ ...r, description: v }) },
2419
2434
  { label: "Cmd allow", kind: "text", get: (r) => constr(r, "commandConstraints", "allowed"), set: (r, v) => setConstr(r, "commandConstraints", "allowed", v) },
2420
2435
  { label: "Cmd deny", kind: "text", get: (r) => constr(r, "commandConstraints", "denied"), set: (r, v) => setConstr(r, "commandConstraints", "denied", v) },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solongate/proxy",
3
- "version": "0.82.46",
3
+ "version": "0.82.48",
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": {