@parel/security-basic 0.1.1 → 0.1.3

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Parall
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # @parel/security-basic
2
+
3
+ > PAREL plugin for basic command and secret safety checks.
4
+
5
+ A first-party runtime plugin for [PAREL](https://github.com/parall-hq/parel-opensource).
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @parel/security-basic
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```yaml
16
+ plugins:
17
+ - security-basic
18
+ ```
19
+
20
+ It enforces a command allowlist and redacts known secret patterns from tool
21
+ output.
22
+
23
+ > **Scope.** This is a best-effort policy layer, **not** an isolation boundary.
24
+ > A program-name allowlist cannot see inside an allowlisted interpreter's
25
+ > arguments (e.g. `python -c`, `awk`, `find -exec`), so treat it as a guard
26
+ > rail, not a sandbox. For untrusted workloads, run inside a real sandbox.
27
+
28
+ ## License
29
+
30
+ MIT — see [LICENSE](./LICENSE).
package/dist/index.js CHANGED
@@ -193,7 +193,10 @@ function tokenize(input) {
193
193
  }
194
194
  if (c === "$" && input[i + 1] === "(") {
195
195
  if (input[i + 2] === "(") {
196
- const [, next2] = readBalanced(i + 3, "(", ")");
196
+ const [arith, next2] = readBalanced(i + 3, "(", ")");
197
+ for (const tok of tokenize(arith)) {
198
+ for (const sub of tok.nested) currentNested.push(sub);
199
+ }
197
200
  hasWord = true;
198
201
  i = input[next2] === ")" ? next2 + 1 : next2;
199
202
  continue;
@@ -313,7 +316,8 @@ function collectPrograms(tokens, out) {
313
316
  if (inWrapperArgs && (token.value.startsWith("-") || /^\d+$/.test(token.value))) {
314
317
  continue;
315
318
  }
316
- if (token.value === "" && token.nested.length > 0) {
319
+ if (token.nested.length > 0) {
320
+ out.push("$(...)");
317
321
  expectProgram = false;
318
322
  inWrapperArgs = false;
319
323
  continue;
@@ -343,7 +347,6 @@ function extractAllPrograms(command) {
343
347
  }
344
348
  var index_default = definePlugin({
345
349
  name: "@parel/security-basic",
346
- version: "0.0.2",
347
350
  async setup(ctx) {
348
351
  const mode = ctx.config.mode ?? "allowlist";
349
352
  const customExecTools = ctx.config.exec_tools;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parel/security-basic",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "PAREL plugin for basic command and secret safety checks.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -20,10 +20,12 @@
20
20
  }
21
21
  },
22
22
  "files": [
23
- "dist"
23
+ "dist",
24
+ "LICENSE",
25
+ "README.md"
24
26
  ],
25
27
  "dependencies": {
26
- "@parel/plugin-sdk": "0.2.0"
28
+ "@parel/plugin-sdk": "0.2.2"
27
29
  },
28
30
  "devDependencies": {
29
31
  "tsup": "^8.0.0",