Skip to content

fix(compose): surface per-service scan failures in user-facing summary - #160

Open
myukitty wants to merge 1 commit into
OWASP:mainfrom
myukitty:fix/surface-compose-scan-failures
Open

fix(compose): surface per-service scan failures in user-facing summary#160
myukitty wants to merge 1 commit into
OWASP:mainfrom
myukitty:fix/surface-compose-scan-failures

Conversation

@myukitty

Copy link
Copy Markdown

Summary

Closes #131

When scanning Docker Compose setups containing multiple services, if one or more services encounter scan execution failures (e.g. missing Dockerfile build context, daemon errors, or unresolvable targets), the failures were logged but not clearly surfaced in the user-facing quick take summary or structured JSON output.

This change:

  1. Tracks and deduplicates per-service failures: \ComposeOrchestrator.run_full_scan\ collects \ ailed_services\ (service name and failure reasons) and \ otal_services\ count.
  2. Surfaces scan failures in Quick Take and JSON:
    • In _quick_take_lines: Appends \"{N} of {total} services had scan failures: {service_names}"\ when failures occur.
    • In _print_json_results: Includes \ ailed_services\ and \ otal_services\ in \scan_info\ when failures are present.
  3. Robust diagnostics classification: Correctly distinguishes Hadolint lint diagnostics from tool execution errors so lint warnings are presented as lint counts rather than tool failures.
  4. Early validation & path safety: Validates services mappings before scanner invocation and resolves relative build contexts relative to the Compose file directory.

Testing

  • Added comprehensive unit tests in \ ests/test_compose_scanner.py\ covering failure tracking, deduping, Hadolint diagnostics classification, parse/malformed-services handling, and summary/JSON formatting.
  • Full test suite passed (228/228 tests passing).

Fixes OWASP#131. Track failed services and their error reasons during ComposeOrchestrator.run_full_scan and include a failed-services summary line in the CLI quick take block.
@github-actions github-actions Bot added cli Changes to the CLI entry point core Changes to core scanning logic tests Changes to the test suite labels Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Changes to the CLI entry point core Changes to core scanning logic tests Changes to the test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GOOD FIRST ISSUE] Surface per-service compose scan failures in user-facing output

1 participant