Class LinuxSandbox
Linux sandbox using Landlock LSM for filesystem restrictions and seccomp-bpf for syscall filtering. Requires Linux kernel 5.13+ for full Landlock support. No third-party dependencies.
public sealed class LinuxSandbox : ISandbox
- Inheritance
-
LinuxSandbox
- Implements
- Inherited Members
Constructors
LinuxSandbox(SandboxPolicy)
public LinuxSandbox(SandboxPolicy policy)
Parameters
policySandboxPolicy
Properties
Platform
Which platform this sandbox targets.
public SandboxPlatform Platform { get; }
Property Value
Policy
The policy this sandbox enforces.
public SandboxPolicy Policy { get; }
Property Value
Methods
RunAsync(string, string, CancellationToken)
Runs the sandboxed process to completion and returns the result.
public Task<SandboxExecutionResult> RunAsync(string executablePath, string arguments = "", CancellationToken ct = default)
Parameters
executablePathstringargumentsstringctCancellationToken
Returns
StartAsync(string, string, CancellationToken)
Starts a new sandboxed process using the configured policy.
public Task<SandboxedProcess> StartAsync(string executablePath, string arguments = "", CancellationToken ct = default)
Parameters
executablePathstringPath to the executable to run.
argumentsstringCommand-line arguments.
ctCancellationTokenCancellation token.
Returns
- Task<SandboxedProcess>
A handle to the running sandboxed process.