Documentation
¶
Overview ¶
Package democmd implements the `fendix demo` subcommand: spin up OWASP Juice Shop locally in Docker, run a stock fendix scan against it, render an HTML report, and (optionally) open the report in the default browser. Removes the cold-start "what does a real scan look like?" question for first-time evaluators.
The command shells out to the host's docker CLI rather than using a Docker SDK; this avoids a heavy dependency, matches the existing scripts/benchmark/run-juice-shop.sh pattern, and works everywhere the user's docker setup works (Docker Desktop, Colima, OrbStack, etc.).
Index ¶
Constants ¶
const ( DefaultImageRef = "bkimminich/juice-shop:v17.1.1" DefaultPort = 3000 DefaultContainerName = "fendix-demo" DefaultHealthTimeout = 90 * time.Second DefaultScanTimeout = 5 * time.Minute DefaultHealthInterval = 2 * time.Second )
Defaults — can be overridden via Options.
Variables ¶
var ( ErrDockerMissing = errors.New("docker not found on PATH") ErrFendixBinaryMissing = errors.New("could not locate fendix binary; pass --fendix-bin") ErrPortInUse = errors.New("local port already in use") ErrJuiceShopNotReady = errors.New("juice-shop did not become healthy within the timeout") ErrScanFailed = errors.New("fendix scan failed") )
Errors returned by Run. Distinguished so the calling cobra command can map them to actionable user messages.
Functions ¶
Types ¶
type Options ¶
type Options struct {
ImageRef string
Port int
ContainerName string
OutputPath string // HTML report path. If empty, derived to $TMPDIR/fendix-demo-<unix>.html.
OpenAfter bool
FendixBin string // Defaults to /proc/self/exe (the running fendix binary).
HealthTimeout time.Duration
ScanTimeout time.Duration
HealthInterval time.Duration
// Stdout, Stderr are where progress and command output stream.
// Default to os.Stdout / os.Stderr when nil.
Stdout, Stderr io.Writer
// contains filtered or unexported fields
}
Options configures Run. Zero-valued fields use the Default* constants above. The struct is deliberately public so callers (cobra subcommand, future fendix-demo Docker recipe) can wire in their own paths.