Skip to content

fix(scan): require a real bucket listing body before flagging s3 exposure - #282

Merged
vmfunc merged 1 commit into
vmfunc:mainfrom
TBX3D:fix/cloudstorage-listing-check
Jul 22, 2026
Merged

vmfunc merged 1 commit into
vmfunc:mainfrom
TBX3D:fix/cloudstorage-listing-check

Conversation

@TBX3D

@TBX3D TBX3D commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@TBX3D
TBX3D requested a review from vmfunc as a code owner July 3, 2026 19:29
@github-actions github-actions Bot added size/m <200 lines changed scan changes to scan engine tests test changes labels Jul 3, 2026
@codecov-commenter

codecov-commenter commented Jul 3, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@7ea1cd2). Learn more about missing BASE report.

Files with missing lines Patch % Lines
internal/scan/cloudstorage.go 85.71% 1 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #282   +/-   ##
=======================================
  Coverage        ?   54.87%           
=======================================
  Files           ?       81           
  Lines           ?     6887           
  Branches        ?        0           
=======================================
  Hits            ?     3779           
  Misses          ?     2836           
  Partials        ?      272           

☔ 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.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

pr summary

3 files changed (+164 -6)

category files
go source 3
tests 2

@TBX3D
TBX3D force-pushed the fix/cloudstorage-listing-check branch from 47349cc to 826825e Compare July 4, 2026 02:10

@vmfunc vmfunc left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

good catch on the 200-alone false positive, and the tests actually pin the pre-fix bug (200 + AccessDenied body). LimitReader keeps the read bounded and DrainClose still returns the conn, so no leak.

one thing worth noting: the denial markers are matched with strings.Contains over the whole body, not scoped to .... so a genuinely listable bucket whose listing contains an object key like AccessDenied.txt or a PermanentRedirect/ prefix would get scored not-public. edge case, but if you want to tighten it later, matching AccessDenied would remove the collision. not blocking.

in.

@vmfunc
vmfunc merged commit 6b7762f into vmfunc:main Jul 22, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scan changes to scan engine size/m <200 lines changed tests test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants