security

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateAllowlist

func ValidateAllowlist(command string, allowlist *Allowlist, mode AllowlistMode) (string, error)

func ValidateCommand

func ValidateCommand(command string, risk string, allowUnsafe bool) error

Types

type Allowlist

type Allowlist struct {
	// contains filtered or unexported fields
}

func LoadAllowlist

func LoadAllowlist(path string) (*Allowlist, error)

func (*Allowlist) IsEmpty

func (allowlist *Allowlist) IsEmpty() bool

func (*Allowlist) Matches

func (allowlist *Allowlist) Matches(command string) bool

type AllowlistMode

type AllowlistMode string
const (
	AllowlistModeOff     AllowlistMode = "off"
	AllowlistModeWarn    AllowlistMode = "warn"
	AllowlistModeEnforce AllowlistMode = "enforce"
)

func ParseAllowlistMode

func ParseAllowlistMode(value string) (AllowlistMode, error)

type CommandAssessment

type CommandAssessment struct {
	RequiresRiskConfirmation bool
	RiskLevel                string
	RiskReason               string
}

func AssessCommand

func AssessCommand(command string, risk string, allowUnsafe bool) (CommandAssessment, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL