Learning mode (--learning) traces filesystem access with strace and generates minimal sandbox config templates. A background monitor kills strace when the main command exits so long-lived child processes (LSP servers, file watchers) don't cause hangs. Other changes: - Add 'greywall templates list/show' subcommand - Add --template flag to load specific learned templates - Fix DNS relay: use TCP DNS (options use-vc) instead of broken UDP relay through tun2socks - Filter O_DIRECTORY opens from learned read paths - Add docs/experience.md with development notes
22 lines
599 B
Go
22 lines
599 B
Go
//go:build !linux
|
|
|
|
package sandbox
|
|
|
|
import "fmt"
|
|
|
|
// StraceResult holds parsed read and write paths from an strace log.
|
|
type StraceResult struct {
|
|
WritePaths []string
|
|
ReadPaths []string
|
|
}
|
|
|
|
// CheckStraceAvailable returns an error on non-Linux platforms.
|
|
func CheckStraceAvailable() error {
|
|
return fmt.Errorf("learning mode is only available on Linux (requires strace and bubblewrap)")
|
|
}
|
|
|
|
// ParseStraceLog returns an error on non-Linux platforms.
|
|
func ParseStraceLog(logPath string, debug bool) (*StraceResult, error) {
|
|
return nil, fmt.Errorf("strace log parsing is only available on Linux")
|
|
}
|