Analysis Results API and Files
The Analysis Results page and Image Analysis History read per-tool execution
metadata from analysis_executions and reports from the shared tasks volume.
Results Dashboard uses CVE snapshots from the same job-run window. These
read-only endpoints do not start scanners or write findings.
Storage and migration
The database schema describes every column,
foreign key, index and unique constraint of analysis_executions. The table
stores execution metadata, not full reports or another set of findings.
Existing CVE, binwalk, TruffleHog, boot and SBOM tables remain in use; repeated
identical findings are deduplicated when written. Existing historical duplicates
are not removed by the dashboard migration.
Migration 6f8f1f2a4c91 creates the history table and backfills old tasks.
Their statuses are inferred from the combined task outcome, counts are unknown,
and logs point to the old output.txt. Historical structured results cannot
be reconstructed. Migration b7c42a90e615 joins this migration and main's boot
fixes. Apply them through the normal db_migrations service; see
Database Migrations.
List recent analyses
GET /api/analyses returns analyses, tools, images and scope.
| Query parameter | Default | Meaning |
|---|---|---|
job_limit | 5 | Integer from 1 to 100; number of recent job runs to include. |
image_id | None | Restrict returned analyses to this image ID. |
tool_name | None | Exact registered tool name, for example cve-bin-tool or binwalk. |
limit | None | Optional positive integer limiting rows; capped at 5000 for legacy clients. |
A job run is the pair (job_id, execution_nr), including all its images and
tools. Runs are selected globally by latest completion time, then analysis ID,
before image and tool filters. An image with only older runs can therefore
have no results in the selected window; increase job_limit or use its complete
image history. The row limit is applied after these filters and can cut a run
short, so the dashboard uses job_limit instead.
Example request:
GET /api/analyses?job_limit=5&image_id=7&tool_name=cve-bin-tool
Each analysis contains:
| Fields | Meaning |
|---|---|
analysis_id, image_id, job_id, tool_id, execution_nr | Execution identity and references. |
job_name, tool_name | Display names from existing job and tool records. |
status, status_label, status_message | Final state, display label and optional diagnostic summary. |
finding_count | Reported count; null means unknown or incomplete, not zero. |
completed_at | ISO-formatted completion timestamp, or null if unavailable. |
output_available | Whether the recorded text log exists and is nonempty. |
result_summary | Structured report without items, or null if unavailable. |
image_name, manufacturer, version | Image display metadata; also present in the images list. |
The tools array contains sorted tool names from returned rows, not a registry
of all supported tools. The images array contains metadata for the images
represented in those rows. scope describes the global window, not the filtered
row count:
{
"job_limit": 5,
"job_count": 5,
"has_older": true
}
job_count is the number of selected runs; has_older indicates that more
runs exist. No matches return empty arrays with HTTP 200. Invalid job_limit
or limit values return HTTP 400 with an error string.
Complete image history and execution details
GET /api/images/{image_id}/analyses returns:
image:id,version,product_typeand associatedproducts, each withproduct_id,manufacturerandproduct_name.analyses: all recorded final tool states for that image, ordered by completion time and analysis ID, newest first. These have the common execution fields above, without the global list's extra image display fields.
This endpoint has no job-run window or pagination parameters. An existing image
without history returns an empty analyses array. An unknown image returns
HTTP 404.
GET /api/images/{image_id}/analyses/{analysis_id} returns the common execution
fields plus output (complete text log) and result (full structured report,
including items). Missing logs return output: ""; missing, unreadable or
unsupported reports return result: null. The recorded execution remains
visible. An unknown analysis, including one belonging to a different image,
returns HTTP 404 with an error string.
Final statuses are success, failure, timeout and skipped. A successful
count of 0 is labelled Finished without findings. Failed, timed-out or
skipped runs have unknown counts and must not be interpreted as clean scans.
If a worker writes a report after a timeout, the API keeps the database status,
count and diagnostic summary authoritative; any late entries may be incomplete.
CVE finding snapshots
GET /get_cve_results?job_limit=5 selects the same global job-run window.
It returns data (CVE entries), unavailable_runs and scope. Each entry
contains result_id (analysis_id:index), image_id, cve_number, severity,
score, product, vendor, version, source, cvss_version, cvss_vector,
paths, remarks and comments.
unavailable_runs counts unsuccessful CVE executions or those without usable
structured entries. Successful empty snapshots contribute no findings and are
not unavailable. Invalid job_limit returns HTTP 400. This endpoint does not
apply image or tool filters; the CVE dashboard filters the returned data.
Without job_limit, the existing GET /get_cve_results endpoint retains its
legacy response: a bare array of up to 500 entries from cumulative cve_results,
not execution snapshots. Results Dashboard explicitly supplies job_limit.
Output files by tool
Each task has its own directory, shared by the tools and API:
/tasks/job_<job_id>/execution_<execution_nr>/image_<image_id>/
analysis_executions.output_path points to the text log, not the task directory.
The registered tool name determines its filename:
| Registered tool | Text log | Additional tool-specific output |
|---|---|---|
binwalk | extractor-output.txt | extractor-output.json: extraction metadata and selected root filesystem, also used by dependent tools. |
cve-bin-tool | cve-bin-tool-output.txt | cve-output.json: native CVE report. |
firmwalker | firmwalker-output.txt | firmwalker-output.report.txt: native text report. |
trufflehog | trufflehog-output.txt | trufflehog-output.json: native secret records. |
boot-analysis | boot-analysis-output.txt | boot-analysis-output.json: detected boot configuration. |
sbom-gen | sbom-output.txt | sbom-cve-output.json and sbom.cyclonedx.json: component reports from cve-bin-tool and Syft. |
Native output files may be absent when a tool fails before producing them.
The task-level output.txt contains the final task status; it is not the
per-tool log. The legacy Job Details API combines the logs and task status
on read.
Every tool log also has two normalized reports, for example:
cve-bin-tool-output.txt.result.json
cve-bin-tool-output.txt.summary.json
The full report has this envelope (a successful empty scan):
{
"schema_version": 1,
"status": "success",
"summary": "Scan completed successfully. No CVEs found.",
"finding_count": 0,
"metrics": {},
"items": [],
"categories": {}
}
items contains tool-specific entries. Common display fields are name,
category, path and value; tools add fields such as CVE score, extractor
size or secret verified. categories maps category names to item counts;
metrics holds additional tool-specific KPI values. Finding counts describe
different things per tool (files, CVEs, review candidates, secrets, boot records
or components), not a uniform vulnerability count.
The summary report has the same envelope without items. List endpoints read
this lightweight file; for older reports without a summary they fall back to
the full report and omit its entries in the response. Full entries and logs
are fetched only for details. Reports use schema_version: 1 and are written
via temporary files followed by an atomic rename.
Older <tool>_output.txt names and their adjacent reports remain readable through
the recorded path; do not copy or rename historical files. Backfilled combined
logs usually have no structured report and remain explicitly unavailable for
statistics. Rebuild the tool, executor and API images and run new analyses to
produce new snapshots; migration and page views never rescan old firmware.
Logs and reports can contain credentials and other sensitive firmware content, especially TruffleHog results. Treat the task volume and downloaded reports as sensitive data.