Documentation
¶
Index ¶
- func CalculateContentHash(content string) string
- func CreateBackup(filePath string) (string, error)
- func ExecuteExec(cmd scanner.Command, cfg *config.Config, ...) scanner.ExecutionResult
- func ExecuteOpen(filepath string, cfg *config.Config, ...) scanner.ExecutionResult
- func ExecuteSearch(query string, cfg *config.Config, searchCfg *search.SearchConfig, ...) scanner.ExecutionResult
- func ExecuteWrite(filePath, content string, cfg *config.Config, ...) scanner.ExecutionResult
- func FormatContent(filePath, content string) string
- func SanitizeError(err error) error
- type Executor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateContentHash ¶
CalculateContentHash calculates SHA256 hash of content
func CreateBackup ¶
CreateBackup creates a backup of an existing file
func ExecuteExec ¶
func ExecuteExec(cmd scanner.Command, cfg *config.Config, auditLog func(cmdType, arg string, success bool, errMsg string)) scanner.ExecutionResult
ExecuteExec handles the "exec" command
func ExecuteOpen ¶
func ExecuteOpen(filepath string, cfg *config.Config, auditLog func(cmd, arg string, success bool, errMsg string), pool *sandbox.ContainerPool) scanner.ExecutionResult
ExecuteOpen handles the "open" command
func ExecuteSearch ¶
func ExecuteSearch(query string, cfg *config.Config, searchCfg *search.SearchConfig, auditLog func(cmd, arg string, success bool, errMsg string)) scanner.ExecutionResult
ExecuteSearch handles the "search" command
func ExecuteWrite ¶
func ExecuteWrite(filePath, content string, cfg *config.Config, auditLog func(cmd, arg string, success bool, errMsg string), pool *sandbox.ContainerPool) scanner.ExecutionResult
ExecuteWrite handles the "write" command
func FormatContent ¶
FormatContent formats content based on file type. Returns the original content unchanged if formatting fails or the file type is not supported.
func SanitizeError ¶
SanitizeError removes sensitive information from error messages Returns a safe error suitable for untrusted LLM consumption
Types ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor handles command execution
Security Model: - Container is the security boundary (all mounted repo is sacrificial on compromise) - No path-level validation; LLM has unrestricted filesystem access within container - Symlinks are treated as normal filesystem objects - All operations audited to audit.log - Host protected by container namespace isolation and read-only mounts where appropriate
func NewExecutor ¶
func NewExecutor(cfg *config.Config, searchCfg *search.SearchConfig, auditLog func(cmd, arg string, success bool, errMsg string), pool *sandbox.ContainerPool) *Executor
NewExecutor creates a new executor instance
func (*Executor) Execute ¶
func (e *Executor) Execute(cmd scanner.Command) scanner.ExecutionResult
Execute dispatches command execution based on type
func (*Executor) GetCommandsRun ¶
GetCommandsRun returns the number of successfully executed commands
func (*Executor) GetPool ¶
func (e *Executor) GetPool() *sandbox.ContainerPool
GetPool returns the executor's container pool
func (*Executor) GetSearchConfig ¶
func (e *Executor) GetSearchConfig() *search.SearchConfig
GetSearchConfig returns the executor's search configuration