bughunt

Settings

bughunt needs no settings. A bughunt.toml in the repo's top folder changes its defaults for that repo.

[scan]
ignore_rules = ["detected-private-key"]
ignore_paths = ["^fuzz/seeds/", "^examples/"]
baseline = "bughunt-baseline.json"

[api]
path_prefix = "/api/"
public = ["status"]
skip = ["payments"]

[fuzz]
seconds = 120
ignore_paths = ["^vendor/"]
c_flags = ["src/codec.c", "-Iinclude"]
java_classpath = ["build/classes"]

[[fuzz.target]]
name = "decode"
run = ["sh", "fuzz/run_decode.sh", "{seconds}", "{corpus}"]

Every key is optional. A misspelt key stops the run with an error naming it, so a typo cannot silently do nothing.

[scan]

KeyWhat it does
ignore_rulesPatterns for rule names to leave out, on top of the built-in style rules.
ignore_pathsPatterns for paths that are not shipped code.
baselineThe file of reviewed findings, as a plain path inside the repo. See the baseline.

[api]

Read from the folder you run bughunt api in. These apply when the description is made from a routes listing.

KeyWhat it does
path_prefixOnly routes under this prefix are described (default /api/).
publicPatterns for controllers that need no login on purpose, so they are not reported.
skipPatterns for routes never to call.

[fuzz]

KeyWhat it does
secondsSeconds per target when --seconds is not given (default 60).
ignore_pathsPatterns for paths never searched for targets: vendored code, examples.
c_flagsExtra compiler arguments for C and C++ targets: the project's sources, include folders, libraries.
java_classpathThe project's compiled classes and jars, for Java targets.
[[fuzz.target]]A target given as its own command: name, run, and optionally build, engine and env. See your own fuzzer.

Patterns

Patterns are regular expressions matched anywhere in the name or path. ^fuzz/seeds/ matches paths that start with that folder; private-key matches any rule with those words in its name.

A settings file cannot hide findings quietly

Whatever a repo's settings leave out is counted in every report (left out: …), and --all shows it.

For scan, the settings can only leave findings out and name a baseline inside the repo; nothing in them is run. The commands under [[fuzz.target]] are run by fuzz and audit, which run the repo's code anyway.

Options for every command

OptionWhat it does
--format text|markdown|html|json|sarifHow the report is written. See Reports.
--output FILEWrite the report to a file instead of the terminal.
--out-dir DIRWhere logs and raw tool output go (default ~/.cache/bughunt/out; also BUGHUNT_OUT).
--config FILEUse this settings file instead of the repo's.