Documentation
¶
Overview ¶
Package scheduler holds the fuzzing scheduler, glueing together all parts needed for fuzzing.
This includes the target dbms.DB, translator.Implementation and strategy.FuzzingStrategy. Additionally, the scheduler creates bug reports when a bug is found and handles keybindings usable during fuzzing.
The scheduler is invoked through its Run function and can be configured using a Config.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Reduce ¶
Reduce takes in a conf for regenerating the bugreport and a string holding the path where the reduced bugreport should be saved.
It then attempts to reduce the bug-triggering query to a minimal, reproducible example triggering the bug. However, some further manual reduction will almost always be necessary afterwards.
Types ¶
type BugreportMarkdownData ¶
type BugreportMarkdownData struct {
LastStatement string // The last statement that was run when the bug was triggered
LastResult dbms.QueryResult // The last result returned
Statements []string // All the statements that were run
StatementsString string // All the statements that were run, joined with "\n---\n"
Strategy string // The name of the strategy used
}
BugreportMarkdownData is the data passed to the bugreport template when writing a bugreport's markdown content
type Config ¶
type Config struct {
// The DB to run the queries against
DB dbms.DB
DBOptions dbms.DBOptions
// The OpenCypher implementation
Implementation translator.Implementation
// The fuzzing strategy for this run
Strategy strategy.Strategy
// The given byte string to use instead of generating a new one
ByteString []byte
// The seed to initialize the RNG to if no byte-string is given
InitialSeed int64
// How many times to retry connecting to the database before giving up
DBConnectionRetries int
// How long to wait before retrying to connect to the DB
DBConnectionRetryInterval time.Duration
// If true, not bug report will be created
SuppressBugreport bool
// Where bug reports should be written to
BugReportsDirectory string
// If true, the key bindings for the stats printer and adjusting the logging level won't be initialised
DisableKeybinds bool
// How many times to execute a fuzzing run by generating a query, -1 if unlimited
QueryLimit int
// The target DBMS. This only gets used for creating bug reports.
TargetDB string
// The target fuzzing strategy. This only gets used for creating bug reports.
TargetStrategy strategy.FuzzingStrategy
// ErrorMessageRegex holds regex strings, matching error messages the driver should ignore or treat as a previously reported bug.
// These are read from a config in cmd/config/config.go.
ErrorMessageRegex *dbms.ErrorMessageRegex
// BugReportTemplate holds the template used to create the bugreport when a bug is found.
BugReportTemplate *template.Template
}
The Config for the scheduler