fix(compose): surface per-service scan failures in user-facing summary - #160
Open
myukitty wants to merge 1 commit into
Open
fix(compose): surface per-service scan failures in user-facing summary#160myukitty wants to merge 1 commit into
myukitty wants to merge 1 commit into
Conversation
myukitty
force-pushed
the
fix/surface-compose-scan-failures
branch
from
August 17, 2026 17:27
f76a1d8 to
04f8171
Compare
Collaborator
|
Hello @myukitty - can you please update your branch and PR and resubmit this PR again? |
OWASP#161 records failed services in the compose results dict, but nothing reads them back out. A run where some services could not be scanned still prints a summary and a score as if every service had been covered, which is the visibility gap OWASP#131 describes. Add the missing user-facing half: - carry total_services next to failed_services so the summary has a denominator, and - print "N of M services could not be scanned: <names>" in the Quick take block, and include failed_services/total_services in --json. run_full_scan records a service twice when both its Dockerfile and its image scan fail, so the names are de-duplicated before counting. Fixes OWASP#131. Builds on OWASP#161.
myukitty
force-pushed
the
fix/surface-compose-scan-failures
branch
from
August 21, 2026 01:52
04f8171 to
e596d9b
Compare
Author
|
Thanks @advaitpatel — updated and rebased onto current Since #161 merged in the meantime, I rewrote the PR rather than just resolving the conflict. #161 already tracks What is left is 4 files, +141/-3:
No change to exit codes, scoring, or scan behaviour. Full details and before/after output are in the updated description. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
Rebased onto current
mainand rewritten now that #161 has merged.#161 added
failed_servicestracking insideComposeOrchestrator.run_full_scan, which covers the first two acceptance criteria of #131. Nothing reads that field back out, so the third one is still open: a compose run where some services could not be scanned still prints a Quick take and a security score as if every service had been covered. That is the misleading behaviour #131 was filed about.This PR adds only the missing user-facing half, on top of #161:
compose_scanner.pycarriestotal_servicesalongsidefailed_services, so the summary has a denominator.cli.pyprints one Quick take line —N of M services could not be scanned: <names>— and includesfailed_services/total_servicesin--jsonoutput.run_full_scan, so names are de-duplicated before counting.No change to exit codes, scoring, or scan behaviour — this is purely the visibility fix #131 asked for.
Before (current
main, 2 of 3 services unscannable):After:
The per-service
reasonstrings are available in--jsonunderscan_info.failed_services; I kept them out of the one-line Quick take because they vary per service. Happy to inline the reason if you would rather match the issue's example wording exactly.Closes #131
Type of Change
How Has This Been Tested?
Added 7 tests: 4 in
tests/test_cli.pycovering the summary line, the de-duplication, the no-total fallback, and silence when nothing failed; 3 intests/test_compose_scanner.pycoveringtotal_services, populatedfailed_services, and the unparseable-compose path.pytest tests/— 254 passed, 2 skipped. The 2 failures intests/test_utils.pyon my machine are the optionaldocksec[ai]extras not being installed, and reproduce unchanged onmain.ruff check .— all checks passed.Test Configuration:
main@ 77c0cd1Checklist
Related Issues / PRs
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.