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 ConnectAsker
- type ConnectDecider
- type ConnectDecision
- type ConnectRegistrar
- type ConnectRules
- type DenyList
- 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" BrokerConnect = "connect" )
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 StartConnectBroker ¶ added in v0.4.12
func StartConnectBroker(listener *os.File, rules ConnectRules, register ConnectRegistrar) (*Broker, error)
func StartRegisteringBroker ¶ added in v0.4.11
func StartRegisteringBroker(listener *os.File, decide ConnectDecider, register ConnectRegistrar) (*Broker, error)
func (*Broker) Decisions ¶ added in v0.4.12
func (b *Broker) Decisions() []ConnectDecision
type Capability ¶
type Capability string
const ( Constrained Capability = "constrained" Refused Capability = "refused" )
type ConnectAsker ¶ added in v0.4.12
type ConnectDecider ¶ added in v0.4.11
type ConnectDecision ¶ added in v0.4.12
type ConnectRegistrar ¶ added in v0.4.11
type ConnectRules ¶ added in v0.4.12
type ConnectRules struct {
Grants []string
Deny *DenyList
Proxy ConnectDecider
WriteRoots []string
TmpDir string
Ask ConnectAsker
Policy Policy
}
type DenyList ¶ added in v0.4.12
type DenyList struct {
// contains filtered or unexported fields
}
func NewDenyList ¶ added in v0.4.12
func NewDenyList() *DenyList
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
ConnectSelfTestPassed bool
FullSelfTestPassed 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.