Documentation
¶
Overview ¶
Package tooladapter turns an external command-line security tool into a Draugr Scanner declaratively: describe how to build the command for a target, and the adapter runs it and parses its SARIF output. This covers the majority of scanners (many emit SARIF natively) with no bespoke code.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter is a Scanner backed by an external tool.
func New ¶
New builds an Adapter. If cfg.Run is nil, the command is executed and its stdout is used as SARIF.
func (*Adapter) Info ¶
func (a *Adapter) Info() plugin.ScannerInfo
Info describes the underlying tool.
type Config ¶
type Config struct {
Name string
Binary string
Version string
Controls []string
TargetKinds []plugin.TargetKind
// Argv builds the command line (argv[0] is the executable) for a target and config.
Argv func(target plugin.Target, cfg plugin.Config) ([]string, error)
// Run executes argv and returns the tool's SARIF output. Optional; defaults to
// executing the command and capturing stdout.
Run func(ctx context.Context, argv []string) ([]byte, error)
}
Config declares how to adapt a tool.
Click to show internal directories.
Click to hide internal directories.