Skip to content

dm discover file-report prints an empty list when no report exists #20

Description

@ClassicMMT

What happens

dm discover file-report <run-id> prints [] on stdout, prints nothing on
stderr, and exits 0 in three conditions:

  • the run is still in progress
  • the run failed
  • the run is a database discovery run, not a file discovery run

Why this is a problem

A completed file run that found no sensitive data gives the same output.
The caller cannot see the difference. An agent that calls file-report after
run start reads "the run scanned nothing" as "the run found nothing".

Cause

The server answers with HTTP 200 and an empty list in all three conditions.
The 404 handler in the command does not run.

Suggested fix

When the report is empty, get the run status.

  • For a run that is not in a final state, abort with the hint from
    _abort_if_run_output_missing: "Discovery output is written once the run
    reaches a final state."
  • For a database run, abort with a different message.

Source

Issue found here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions