@checkstack/healthcheck-ping-backend 0.2.1 → 0.2.2
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/CHANGELOG.md +19 -0
- package/package.json +2 -2
- package/src/strategy.test.ts +47 -0
- package/src/strategy.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @checkstack/healthcheck-ping-backend
|
|
2
2
|
|
|
3
|
+
## 0.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0ebbe56: Security Vulnerability Remediation completed:
|
|
8
|
+
- Refactored core authorization to Fail-Closed architecture with secure defaults.
|
|
9
|
+
- Implemented `assertTeamManagementAccess` to resolve BOLA in Teams Management.
|
|
10
|
+
- Protected internal S2S capabilities via explicit wildcard `serviceScope` definitions.
|
|
11
|
+
- Disarmed OS Command Injection in DiskCollector via strict regex validation and bash escaping.
|
|
12
|
+
- Re-architected inline script processing executing scripts in sandboxed Web Worker contexts.
|
|
13
|
+
- Isolated subprocess environment scopes in PingStrategy limiting variable leakage.
|
|
14
|
+
- Enforced strict token/API Key parsing with URLSearchParams checking.
|
|
15
|
+
- Explicitly fail-fast on missing DATABASE_URL configuration across independent backend clusters.
|
|
16
|
+
- Activated strict HTTP Security Headers (HSTS, CSP, X-Frame-Options) across the API automatically.
|
|
17
|
+
- Updated dependencies [0ebbe56]
|
|
18
|
+
- @checkstack/backend-api@0.8.1
|
|
19
|
+
- @checkstack/common@0.6.3
|
|
20
|
+
- @checkstack/healthcheck-common@0.8.3
|
|
21
|
+
|
|
3
22
|
## 0.2.1
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@checkstack/healthcheck-ping-backend",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"lint:code": "eslint . --max-warnings 0"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@checkstack/backend-api": "0.
|
|
12
|
+
"@checkstack/backend-api": "0.8.0",
|
|
13
13
|
"@checkstack/common": "0.6.2",
|
|
14
14
|
"@checkstack/healthcheck-common": "0.8.2"
|
|
15
15
|
},
|
package/src/strategy.test.ts
CHANGED
|
@@ -202,4 +202,51 @@ describe("PingHealthCheckStrategy", () => {
|
|
|
202
202
|
expect(aggregated.errorCount.count).toBe(1);
|
|
203
203
|
});
|
|
204
204
|
});
|
|
205
|
+
describe("Environment Isolation", () => {
|
|
206
|
+
it("should pass explicit env to Bun.spawn with only PATH, HOME, and LANG", async () => {
|
|
207
|
+
let spawnOptions: any = null;
|
|
208
|
+
Bun.spawn = mock((options) => {
|
|
209
|
+
spawnOptions = options;
|
|
210
|
+
throw new Error("Command not found");
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
const connectedClient = await strategy.createClient({ timeout: 5000 });
|
|
214
|
+
await connectedClient.client.exec({
|
|
215
|
+
host: "8.8.8.8",
|
|
216
|
+
count: 3,
|
|
217
|
+
timeout: 5000,
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
expect(spawnOptions).toBeDefined();
|
|
221
|
+
expect(spawnOptions.env).toBeDefined();
|
|
222
|
+
expect(spawnOptions.env.PATH).toBeDefined();
|
|
223
|
+
expect(spawnOptions.env.HOME).toBeDefined();
|
|
224
|
+
expect(spawnOptions.env.LANG).toBeDefined();
|
|
225
|
+
expect(spawnOptions.env.DATABASE_URL).toBeUndefined();
|
|
226
|
+
|
|
227
|
+
connectedClient.close();
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
it("should not leak parent process environment variables", async () => {
|
|
231
|
+
let spawnOptions: any = null;
|
|
232
|
+
Bun.spawn = mock((options) => {
|
|
233
|
+
spawnOptions = options;
|
|
234
|
+
throw new Error("Command not found");
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
process.env.SUPER_SECRET = "leaked";
|
|
238
|
+
|
|
239
|
+
const connectedClient = await strategy.createClient({ timeout: 5000 });
|
|
240
|
+
await connectedClient.client.exec({
|
|
241
|
+
host: "8.8.8.8",
|
|
242
|
+
count: 3,
|
|
243
|
+
timeout: 5000,
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
expect(spawnOptions.env.SUPER_SECRET).toBeUndefined();
|
|
247
|
+
delete process.env.SUPER_SECRET;
|
|
248
|
+
|
|
249
|
+
connectedClient.close();
|
|
250
|
+
});
|
|
251
|
+
});
|
|
205
252
|
});
|
package/src/strategy.ts
CHANGED
|
@@ -215,6 +215,12 @@ export class PingHealthCheckStrategy implements HealthCheckStrategy<
|
|
|
215
215
|
cmd: ["ping", ...args],
|
|
216
216
|
stdout: "pipe",
|
|
217
217
|
stderr: "pipe",
|
|
218
|
+
env: {
|
|
219
|
+
// SECURITY: Only pass necessary env vars to subprocess
|
|
220
|
+
PATH: process.env.PATH ?? "/usr/bin:/bin:/usr/sbin:/sbin",
|
|
221
|
+
HOME: process.env.HOME ?? "/tmp",
|
|
222
|
+
LANG: process.env.LANG ?? "en_US.UTF-8",
|
|
223
|
+
},
|
|
218
224
|
});
|
|
219
225
|
|
|
220
226
|
const output = await new Response(proc.stdout).text();
|