CM-67391: Use S3 presigned upload for secret CLI scans#476
Open
ilia-cy wants to merge 3 commits into
Open
Conversation
Add secret to PRESIGNED_UPLOAD_SCAN_TYPES and give it the 5GB presigned zip-size limit so async secret scans upload as a single file directly to object storage (BYOS-aware), mirroring SAST. Gate the presigned single-file path on non-sync flow so a --sync secret scan keeps its bounded batched inline upload. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Switching secret scans to the presigned upload path routed them through get_upload_link -> S3 -> scan_repository_from_upload_id, none of which were registered by mock_scan_async_responses. The scan hit an unmocked endpoint, returned 0 violations, and failed test_passing_output_option. - Extend mock_scan_async_responses to register the presigned endpoints (upload-link, S3 POST, repository) for presigned scan types, branching on should_use_presigned_upload. - Widen the presigned-upload fallback in _perform_scan to also catch the client's wrapped RequestError/SlowUploadConnectionError, not just raw requests.RequestException. A connection/timeout error from get_upload_link or the scan trigger otherwise never fell back to the Cycode-API upload. - Add a regression test covering the wrapped-exception fallback. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
secrettoPRESIGNED_UPLOAD_SCAN_TYPESand give it the 5GB presigned zip-size limit, so async secret scans upload as a single file directly to object storage (BYOS-aware) — mirroring SASTs existing v4 flow instead of batching multipart through the API gateway.--syncsecret scan keeps its bounded batched inline upload. This is the only net-new logic: secret is the first scan type that is both presigned-eligible and--sync-capable, a combination SAST never exercised.--sync-secret → batched).Merge ordering / dependency
Requires the secret-detector memory refactor (CM-67389) to deploy first — a single multi-GB zip would otherwise exceed the detector memory limit. Do not release a CLI build with this change ahead of CM-67389.
Jira
CM-67391