Documentation
¶
Overview ¶
Package enforce reports the session-level execution capability.
Index ¶
- Constants
- Variables
- func ReceiveListener(channel *os.File, timeout time.Duration) (*os.File, error)
- func ReleaseHelper(channel *os.File) error
- func RunHelper(args []string) int
- func WritePolicyFrame(w io.Writer, p Policy) error
- type Broker
- type Capability
- type ConnectDecider
- type ConnectRegistrar
- type Leg
- type Policy
- type Refusal
- type Resolution
- type ResolveInput
Constants ¶
View Source
const ( HelperCommand = "__codemeld_confine" ProbeArg = "--probe" ControlArg = "--control" SetupFailureExitCode = 125 ModePlan = "plan" ModeAutoEdits = "auto_edits" NetworkAccessAuthority = "network access" MaxPolicyFrameBytes = 64 * 1024 BrokerNone = "" BrokerSlice = "slice" BrokerFull = "full" )
View Source
const HelperChannelFD = 3
Variables ¶
View Source
var ErrBrokerUnsupported = errors.New("enforce: broker mode is not supported on this platform")
Functions ¶
func ReceiveListener ¶ added in v0.4.11
func ReleaseHelper ¶ added in v0.4.11
Types ¶
type Broker ¶ added in v0.4.11
type Broker struct {
// contains filtered or unexported fields
}
func StartBroker ¶ added in v0.4.11
func StartBroker(listener *os.File, decide ConnectDecider) (*Broker, error)
func StartRegisteringBroker ¶ added in v0.4.11
func StartRegisteringBroker(listener *os.File, decide ConnectDecider, register ConnectRegistrar) (*Broker, error)
type Capability ¶
type Capability string
const ( Constrained Capability = "constrained" Refused Capability = "refused" )
type ConnectDecider ¶ added in v0.4.11
type ConnectRegistrar ¶ added in v0.4.11
type Policy ¶
type Policy struct {
Mode string `json:"mode"`
ExceptionalAuthority string `json:"exceptional_authority"`
BlockedPaths []string `json:"blocked_paths"`
WriteRoots []string `json:"write_roots"`
NoWritePaths []string `json:"no_write_paths"`
ReadRoots []string `json:"read_roots"`
TmpDir string `json:"tmp_dir"`
TmpDirDev uint64 `json:"tmp_dir_dev"`
TmpDirIno uint64 `json:"tmp_dir_ino"`
Broker string `json:"broker"`
}
type Resolution ¶
type Resolution struct {
Capability Capability
Reason string
Legs []Leg
SelfTestPassed bool
SliceSelfTestPassed bool
}
func Resolve ¶
func Resolve(in ResolveInput) Resolution
func (Resolution) SandboxLabel ¶
func (r Resolution) SandboxLabel(modeKey string) string
func (Resolution) SandboxState ¶
func (r Resolution) SandboxState(modeKey string) string
type ResolveInput ¶
Click to show internal directories.
Click to hide internal directories.