Reflex tools¶
Experimental
Tested against recorded tool output only so far; the API may change in minor releases.
Wrappers for the standalone Reflex Rust CLIs. Install the tools as described in Installation.
tools
¶
Thin wrappers around the standalone Reflex Rust CLIs.
Each tool is a separate project, installed with
cargo install --git https://github.com/reflex-hs/<name> (they are not on crates.io yet);
hwntools runs it with --json and parses the result into dataclasses:
fwsift.scan- firmware rootfs / image triagebootlint.audit- U-Boot env, FIT/DTB, kernel config auditbaudhound.analyze- UART detection in logic-analyzer capturesmcpwarden.scan- MCP server config / tool metadata audit
Binaries are found via $HWNTOOLS_<NAME>, PATH or ~/.cargo/bin.
SEVERITIES
module-attribute
¶
Finding
dataclass
¶
Finding(tool: str, rule_id: str, severity: str, message: str, title: str = '', path: str | None = None, line: int | None = None, offset: int | None = None, location: str | None = None, evidence: str | None = None, raw: Mapping[str, Any] = dict())
One finding from any tool, normalised to common fields. raw keeps the original.
Report
dataclass
¶
Report(tool: str, version: str, findings: list[Finding], raw: dict[str, Any], exit_code: int = 0)
Common report shape. Tool-specific subclasses add more fields.
ToolError
¶
find_tool
¶
Locate the name binary.
Order: $HWNTOOLS_<NAME> (path to the executable), PATH, ~/.cargo/bin.
Raises ToolNotFoundError with an install hint.
severity_rank
¶
Position of sev in info < low < medium < high < critical (-1 if unknown).
fwsift
¶
Wrapper for fwsift: static triage of an extracted rootfs or a raw firmware image.
https://github.com/reflex-hs/fwsift (cargo install --git https://github.com/reflex-hs/fwsift)
Component
dataclass
¶
Component(name: str, version: str, kind: str, purl: str, cpe: str | None, paths: list[str], vulnerabilities: list[str])
A software component found in the rootfs (SBOM entry), with its version and identifiers.
ImageSignature
dataclass
¶
A signature found in a raw image during image triage.
FwsiftReport
dataclass
¶
FwsiftReport(tool: str, version: str, findings: list[Finding], raw: dict[str, Any], exit_code: int = 0, rootfs: str | None = None, image: str | None = None, summary: dict[str, int] = dict(), components: list[Component] = list(), signatures: list[ImageSignature] = list(), hardening: dict[str, int] = dict(), stats: dict[str, int] = dict())
parse
¶
parse(data: dict[str, Any], exit_code: int = 0) -> FwsiftReport
Build a FwsiftReport from fwsift's --json document.
scan
¶
scan(target: str | PathLike[str], osv: bool = False, image: str | PathLike[str] | None = None, min_severity: str | None = None, max_file_size_mib: int | None = None, extra_args: tuple[str, ...] = (), timeout: float | None = None) -> FwsiftReport
Run fwsift <target> --json.
target is an extracted rootfs directory or a raw image file (signature triage only).
image adds a raw image to triage next to a rootfs directory. osv=True queries
api.osv.dev for known vulnerabilities (network access).
bootlint
¶
Wrapper for bootlint: audit U-Boot env, FIT/DTB/DTS and kernel configs.
https://github.com/reflex-hs/bootlint (cargo install --git https://github.com/reflex-hs/bootlint)
Score
dataclass
¶
bootlint's overall score for one analysed file.
BootlintFile
dataclass
¶
BootlintFile(path: str, kind: str | None, findings: list[Finding], details: list[str] = list(), score: Score | None = None, error: str | None = None)
One analysed file: its detected type, score and findings, or the error that stopped it.
BootlintReport
dataclass
¶
BootlintReport(tool: str, version: str, findings: list[Finding], raw: dict[str, Any], exit_code: int = 0, files: list[BootlintFile] = list(), summary: dict[str, int] = dict())
parse
¶
parse(data: dict[str, Any], exit_code: int = 0) -> BootlintReport
Build a BootlintReport from bootlint's --json document.
audit
¶
audit(paths: str | PathLike[str] | Iterable[str | PathLike[str]], type: str = 'auto', env_size: int | str | None = None, env_offset: int | str | None = None, min_severity: str | None = None, timeout: float | None = None) -> BootlintReport
Run bootlint <paths> --json.
type is auto, env, env-bin, fit, dtb or kconfig. Files that fail
to parse are reported in BootlintReport.errors instead of raising.
baudhound
¶
Wrapper for baudhound: find the UART and its settings in a logic-analyzer capture.
https://github.com/reflex-hs/baudhound (cargo install --git https://github.com/reflex-hs/baudhound)
Candidate
dataclass
¶
Candidate(baud: float, standard: int | None, framing: str, inverted: bool, frames: int, framing_errors: int, parity_errors: int, printable_ratio: float, phase_error: float | None, score: float)
One baud rate / framing hypothesis for a channel, with its score and error counts.
UartResult
dataclass
¶
Channel
dataclass
¶
Channel(file: str, index: int, name: str, role: str, edges: int, idle_high: bool, note: str | None, uart: UartResult | None, candidates: list[Candidate], clock: dict[str, Any] | None, text: str | None, findings: list[Finding])
One logic-analyzer channel: its detected role, the UART result if any and decoded text.
BaudhoundReport
dataclass
¶
parse
¶
parse(data: dict[str, Any], exit_code: int = 0) -> BaudhoundReport
Build a BaudhoundReport from baudhound's --json document.
analyze
¶
analyze(capture: str | PathLike[str] | Iterable[str | PathLike[str]], samplerate: str | int | None = None, channels: Iterable[str | int] = (), baud: int | None = None, framing: str | None = None, top: int | None = None, fmt: str | None = None, unitsize: int | None = None, timeout: float | None = None) -> BaudhoundReport
Run baudhound <capture> --json.
capture is a sigrok .sr, a sigrok/Saleae CSV export or raw samples (then
samplerate, e.g. "24M", is required).
mcpwarden
¶
Wrapper for mcpwarden: audit MCP server configs, tool metadata and server source.
Edge-AI devices increasingly ship MCP (Model Context Protocol) servers; this scans the configs and tool descriptions pulled from a device or a project.
https://github.com/reflex-hs/mcpwarden (cargo install --git https://github.com/reflex-hs/mcpwarden)
McpwardenReport
dataclass
¶
McpwardenReport(tool: str, version: str, findings: list[Finding], raw: dict[str, Any], exit_code: int = 0, summary: dict[str, Any] = dict(), configs: list[dict[str, Any]] = list(), warnings: list[str] = list())
parse
¶
parse(data: dict[str, Any], exit_code: int = 0) -> McpwardenReport
Build a McpwardenReport from mcpwarden scan --json output.
scan
¶
scan(paths: PathArg | Iterable[PathArg] | None = None, tools: PathArg | Iterable[PathArg] | None = None, source: PathArg | Iterable[PathArg] | None = None, min_severity: str | None = None, ignore: Iterable[str] = (), discover: bool = False, timeout: float | None = None) -> McpwardenReport
Run mcpwarden scan ... --json --fail-on none.
paths are MCP config files or project dirs, tools saved tools/list JSON files,
source server source dirs/files. With no inputs mcpwarden would scan the local user's
own MCP configs; that only happens when discover=True is passed explicitly.