Skip to content

fix(security): finish accepted bulk scans after request completion - #1247

Merged
scttbnsn merged 1 commit into
dev/v1.6from
fix/v1.6-bulk-scan-completion
Sep 16, 2026
Merged

scttbnsn merged 1 commit into
dev/v1.6from
fix/v1.6-bulk-scan-completion

Conversation

@scttbnsn

@scttbnsn scttbnsn commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • Keep accepted bulk vulnerability scans running when the HTTP request closes normally. Only a prematurely closed, incomplete request aborts queued scans.
  • Correct the API docs to distinguish accepted background work from an incomplete request.
  • Add real Express/HTTP regressions for requests without a body and with {}, and strengthen the incomplete-request cancellation test.

Reproduction

POST /api/v1/containers/scan-all returned 202 with scheduledCount: 6, but only four containers scanned. Normal request completion emitted close, which aborted the remaining queue. Both request-body forms reproduced this on the maintenance line. After the fix, all six complete.

Verification

  • Test-first: both HTTP regressions failed with four scans instead of six before the runtime change.
  • 231 focused API tests pass, including the existing validation, concurrency and cancellation checks.
  • Backend build passes. The real compiled-handler HTTP probe also completes all six scans for both body forms.
  • Full normal pre-push passed in 357.90 seconds: configured app/UI coverage, both builds, 197 repository-script tests, 102 workflow tests, 57 website-script tests, static analysis and UI typecheck. No hooks or thresholds bypassed.

Threat model: an authorized bulk scan continuing its accepted asynchronous work. Request validation, authentication, rate limits, scanner concurrency, image selection and scan-result policy are unchanged. This is not an authorization bypass or a change to vulnerability decisions.

Targets dev/v1.6 first. The same defect exists on 1.7 and 1.8; forward-ports follow review. No release tag, main advancement or production deployment is part of this PR.

Changelog

  • 🐛 Fixed scanAll so normal request completion does not abort accepted bulk scans.
  • 🐛 Incomplete client requests still abort queued scans.
  • ✨ Added HTTP regression coverage for undefined and {} request bodies.
  • 🔧 Updated API documentation for cancellation behavior.

Concerns

  • Review finding counts: unavailable from supplied evidence.
  • Test and build results: reported as passing in objectives, but not independently verified.

@vercel

vercel Bot commented Sep 16, 2026

Copy link
Copy Markdown

Deployment failed for project drydock-website with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/codeswhat?upgradeToPro=build-rate-limit

@coderabbitai

coderabbitai Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: e17ec07f-89be-45b8-b901-fb38dd4c50c5

📥 Commits

Reviewing files that changed from the base of the PR and between 299b034 and 1bd4723.

⛔ Files ignored due to path filters (1)
  • CHANGELOG.md is excluded by !CHANGELOG.md
📒 Files selected for processing (3)
  • app/api/container/bulk-security.test.ts
  • app/api/container/bulk-security.ts
  • content/docs/current/api/container.mdx

Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

scanAll now aborts only when a close event occurs before the request completes. Integration tests cover undefined and empty request bodies, continued scans after a 202 response, and incomplete-request cancellation. Abort tests now require exactly MAX_CONCURRENT_BULK_SCANS scans. API documentation describes the updated cancellation behavior.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 1bd47

The bulk scan lifecycle change preserves accepted scans after normal request completion while retaining cancellation for incomplete requests. The documented behavior is covered by regression tests.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/v1.6-bulk-scan-completion

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@scttbnsn

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@codecov

codecov Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@biggest-littlest biggest-littlest left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed the complete-request guard and real HTTP regression coverage. This preserves incomplete-request cancellation and scan concurrency. CodeRabbit completed review on 1bd4723 with no actionable findings.

@scttbnsn
scttbnsn enabled auto-merge (squash) September 16, 2026 23:40
@scttbnsn
scttbnsn merged commit b52da9c into dev/v1.6 Sep 16, 2026
29 of 32 checks passed
@scttbnsn
scttbnsn deleted the fix/v1.6-bulk-scan-completion branch September 16, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants