Skip to content

fix: surface failed compose service scan information - #161

Merged
advaitpatel merged 2 commits into
OWASP:mainfrom
Dharshukutti:fix/compose-scan-failures
Aug 20, 2026
Merged

fix: surface failed compose service scan information#161
advaitpatel merged 2 commits into
OWASP:mainfrom
Dharshukutti:fix/compose-scan-failures

Conversation

@Dharshukutti

Copy link
Copy Markdown
Contributor

Summary

This PR improves compose scan visibility by tracking failed service scans and returning failed service details in the compose scan results.

Changes

  • Added failed_services tracking in ComposeOrchestrator.run_full_scan.
  • Recorded Dockerfile scan failures, image scan failures, and exceptions.
  • Included failed_services in the returned results dictionary.
  • Added a regression test verifying failed_services is empty for successful offline scans.

Testing

  • python -m py_compile docksec/compose_scanner.py
  • python -m pytest tests/test_compose_scanner.py -v

@github-actions github-actions Bot added core Changes to core scanning logic tests Changes to the test suite labels Aug 15, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 23.07692% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.88%. Comparing base (a2fe184) to head (7b9d764).
⚠️ Report is 22 commits behind head on main.

Files with missing lines Patch % Lines
docksec/compose_scanner.py 9.09% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #161      +/-   ##
==========================================
+ Coverage   78.95%   79.88%   +0.92%     
==========================================
  Files          26       32       +6     
  Lines        4158     4986     +828     
==========================================
+ Hits         3283     3983     +700     
- Misses        875     1003     +128     
Flag Coverage Δ
unittests 79.88% <23.07%> (+0.92%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@advaitpatel advaitpatel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me. thank you for your contributions

@advaitpatel
advaitpatel merged commit 77c0cd1 into OWASP:main Aug 20, 2026
11 checks passed
myukitty added a commit to myukitty/DockSec that referenced this pull request Aug 21, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

3 participants