Discover Packages
github.com/BlackVectorOps/semantic_firewall/v3
internal
sandbox
package
Version:
v3.1.3
Opens a new window with list of versions in this module.
Published: Jan 30, 2026
License: MIT
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
-- internal/sandbox/manager.go --
-- internal/sandbox/types.go --
View Source
const (
MemLimitBytes = 512 * 1024 * 1024
CPUShares = 1024
PidsMax = 64
EnvSandboxID = "SFW_SANDBOX_ID"
RuntimeBinary = "runsc"
)
Checks if the current process is already running inside the sandbox.
Run executes the current binary (self) inside a gVisor sandbox.
type CPU struct {
Shares uint64 `json:"shares"`
}
type Capabilities struct {
Bounding []string `json:"bounding"`
Effective []string `json:"effective"`
Inheritable []string `json:"inheritable"`
Permitted []string `json:"permitted"`
Ambient []string `json:"ambient"`
}
Config defines the execution parameters for the sandboxed process.
type IDMapping struct {
ContainerID int `json:"containerID"`
HostID int `json:"hostID"`
Size int `json:"size"`
}
type Linux struct {
Namespaces []Namespace `json:"namespaces"`
UIDMappings []IDMapping `json:"uidMappings"`
GIDMappings []IDMapping `json:"gidMappings"`
Resources *Resources `json:"resources"`
}
type Memory struct {
Limit int64 `json:"limit"`
}
type Mount struct {
Destination string `json:"destination"`
Type string `json:"type"`
Source string `json:"source"`
Options []string `json:"options"`
}
type Namespace struct {
Type string `json:"type"`
}
type Pids struct {
Limit int64 `json:"limit"`
}
type Process struct {
User User `json:"user"`
Args []string `json:"args"`
Env []string `json:"env"`
Cwd string `json:"cwd"`
Capabilities *Capabilities `json:"capabilities"`
Rlimits []Rlimit `json:"rlimits"`
NoNewPrivileges bool `json:"noNewPrivileges"`
}
type Resources struct {
Memory *Memory `json:"memory"`
CPU *CPU `json:"cpu"`
Pids *Pids `json:"pids"`
}
type Rlimit struct {
Type string `json:"type"`
Hard uint64 `json:"hard"`
Soft uint64 `json:"soft"`
}
type Root struct {
Path string `json:"path"`
Readonly bool `json:"readonly"`
}
type Spec struct {
Version string `json:"ociVersion"`
Process *Process `json:"process"`
Root *Root `json:"root"`
Mounts []Mount `json:"mounts"`
Linux *Linux `json:"linux"`
}
type User struct {
UID int `json:"uid"`
GID int `json:"gid"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.