Documentation
¶
Index ¶
- func NewPolicy(opts ...PolicyOption) ports.Policy
- type NopDenialHandler
- type Policy
- func (p *Policy) CheckEnvironment(req entities.EnvironmentRequest, grants *entities.GrantSet) bool
- func (p *Policy) CheckExec(req entities.ExecCapabilityRequest, grants *entities.GrantSet) bool
- func (p *Policy) CheckFileSystem(req entities.FileSystemRequest, grants *entities.GrantSet) bool
- func (p *Policy) CheckKeyValue(req entities.KeyValueRequest, grants *entities.GrantSet) bool
- func (p *Policy) CheckNetwork(req entities.NetworkRequest, grants *entities.GrantSet) bool
- type PolicyOption
- type StderrDenialHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NopDenialHandler ¶
type NopDenialHandler struct{}
NopDenialHandler does nothing.
func (*NopDenialHandler) OnDenial ¶
func (h *NopDenialHandler) OnDenial(kind string, request interface{}, reason string)
type Policy ¶
type Policy struct {
// contains filtered or unexported fields
}
Policy implements the Policy interface with stateless enforcement.
func (*Policy) CheckEnvironment ¶
func (*Policy) CheckFileSystem ¶
func (*Policy) CheckKeyValue ¶
func (*Policy) CheckNetwork ¶
type PolicyOption ¶
type PolicyOption func(*policyConfig)
PolicyOption configures the Policy.
func WithDenialHandler ¶
func WithDenialHandler(h ports.DenialHandler) PolicyOption
WithDenialHandler sets the denial handler.
func WithSymlinkResolution ¶
func WithSymlinkResolution(enabled bool) PolicyOption
WithSymlinkResolution enables/disables symlink resolution. Default is true (secure). Disable only for testing.
func WithWorkingDirectory ¶
func WithWorkingDirectory(cwd string) PolicyOption
WithWorkingDirectory sets the working directory for relative path resolution.
type StderrDenialHandler ¶
type StderrDenialHandler struct{}
StderrDenialHandler logs denials to stderr.
func (*StderrDenialHandler) OnDenial ¶
func (h *StderrDenialHandler) OnDenial(kind string, request interface{}, reason string)
Click to show internal directories.
Click to hide internal directories.