just-bash 2.8.1 → 2.9.0
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/dist/Bash.d.ts +29 -0
- package/dist/bin/chunks/chunk-2ODUA7YH.js +74 -0
- package/dist/bin/chunks/{expansion-D4M4UY4T.js → expansion-QOAPT4NU.js} +1 -1
- package/dist/bin/just-bash.js +269 -263
- package/dist/bin/shell/chunks/chunk-2ODUA7YH.js +74 -0
- package/dist/bin/shell/chunks/{expansion-D4M4UY4T.js → expansion-QOAPT4NU.js} +1 -1
- package/dist/bin/shell/shell.js +270 -264
- package/dist/bundle/browser.js +787 -781
- package/dist/bundle/chunks/chunk-2AON5K3E.js +73 -0
- package/dist/bundle/chunks/{expansion-6T6M7TZI.js → expansion-7IMG6HKQ.js} +1 -1
- package/dist/bundle/index.js +282 -272
- package/dist/index.d.ts +2 -0
- package/dist/interpreter/errors.d.ts +2 -2
- package/dist/interpreter/types.d.ts +2 -0
- package/dist/limits.d.ts +10 -0
- package/dist/types.d.ts +5 -0
- package/package.json +1 -1
- package/dist/bin/chunks/chunk-CQZVMYQ3.js +0 -74
- package/dist/bin/shell/chunks/chunk-CQZVMYQ3.js +0 -74
- package/dist/bundle/chunks/chunk-ZRCBN2U4.js +0 -73
package/dist/Bash.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { type CustomCommand } from "./custom-commands.js";
|
|
|
12
12
|
import type { IFileSystem, InitialFiles } from "./fs/interface.js";
|
|
13
13
|
import { type ExecutionLimits } from "./limits.js";
|
|
14
14
|
import { type NetworkConfig } from "./network/index.js";
|
|
15
|
+
import type { DefenseInDepthConfig } from "./security/types.js";
|
|
15
16
|
import type { BashExecResult, Command, TraceCallback } from "./types.js";
|
|
16
17
|
export type { ExecutionLimits } from "./limits.js";
|
|
17
18
|
/**
|
|
@@ -99,6 +100,33 @@ export interface BashOptions {
|
|
|
99
100
|
* Useful for identifying performance bottlenecks.
|
|
100
101
|
*/
|
|
101
102
|
trace?: TraceCallback;
|
|
103
|
+
/**
|
|
104
|
+
* Defense-in-depth configuration.
|
|
105
|
+
*
|
|
106
|
+
* When enabled, monkey-patches dangerous JavaScript globals (Function, eval,
|
|
107
|
+
* setTimeout, process, etc.) during script execution to block potential
|
|
108
|
+
* escape vectors.
|
|
109
|
+
*
|
|
110
|
+
* IMPORTANT: This is a SECONDARY defense layer. It should never be relied
|
|
111
|
+
* upon as the primary security mechanism. The primary security comes from
|
|
112
|
+
* proper sandboxing, input validation, and architectural constraints.
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```ts
|
|
116
|
+
* // Simple enable
|
|
117
|
+
* const bash = new Bash({ defenseInDepth: true });
|
|
118
|
+
*
|
|
119
|
+
* // With custom configuration
|
|
120
|
+
* const bash = new Bash({
|
|
121
|
+
* defenseInDepth: {
|
|
122
|
+
* enabled: true,
|
|
123
|
+
* auditMode: false, // Set to true to log but not block
|
|
124
|
+
* onViolation: (v) => console.warn('Violation:', v),
|
|
125
|
+
* },
|
|
126
|
+
* });
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
defenseInDepth?: DefenseInDepthConfig | boolean;
|
|
102
130
|
}
|
|
103
131
|
export interface ExecOptions {
|
|
104
132
|
/**
|
|
@@ -127,6 +155,7 @@ export declare class Bash {
|
|
|
127
155
|
private sleepFn?;
|
|
128
156
|
private traceFn?;
|
|
129
157
|
private logger?;
|
|
158
|
+
private defenseInDepthConfig?;
|
|
130
159
|
private state;
|
|
131
160
|
constructor(options?: BashOptions);
|
|
132
161
|
registerCommand(command: Command): void;
|