Skip to content

Added S3 support: --aws-profile, --include-extensions, --exclude-extensions#4879

Open
ustayready wants to merge 3 commits intotrufflesecurity:mainfrom
ustayready:master
Open

Added S3 support: --aws-profile, --include-extensions, --exclude-extensions#4879
ustayready wants to merge 3 commits intotrufflesecurity:mainfrom
ustayready:master

Conversation

@ustayready
Copy link
Copy Markdown

@ustayready ustayready commented Apr 8, 2026

Description:

Explain the purpose of the PR.

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

Note

Medium Risk
Medium risk because it changes S3 credential resolution (introducing shared profile support and altering how credentials providers are configured), which could affect access/assume-role behavior and scan coverage; also adds new filtering that can skip objects if misconfigured.

Overview
Adds new S3 scan configuration and CLI flags for AWS shared credentials profile (--aws-profile/AWS_PROFILE) and object key extension filtering (--include-extensions/--exclude-extensions).

Updates the S3 scan pipeline end-to-end (CLI → sources.S3Config → protobuf sourcespb.S3 → S3 source) to enforce mutual exclusivity between profile/static creds/cloud creds and between include/exclude extension lists, and to skip S3 objects based on the configured extension filter during enumeration.

Also updates generated protobuf outputs and ignores .claude in .gitignore.

Reviewed by Cursor Bugbot for commit 7135cca. Bugbot is set up for automated code reviews on this repo. Configure here.

@ustayready ustayready requested a review from a team April 8, 2026 22:01
@ustayready ustayready requested review from a team as code owners April 8, 2026 22:01
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 7135cca. Configure here.

s3ScanBuckets = s3Scan.Flag("bucket", "Name of S3 bucket to scan. You can repeat this flag. Incompatible with --ignore-bucket.").Strings()
s3ScanIgnoreBuckets = s3Scan.Flag("ignore-bucket", "Name of S3 bucket to ignore. You can repeat this flag. Incompatible with --bucket.").Strings()
s3ScanMaxObjectSize = s3Scan.Flag("max-object-size", "Maximum size of objects to scan. Objects larger than this will be skipped. (Byte units eg. 512B, 2KB, 4MB)").Default("250MB").Bytes()
s3ScanProfile = s3Scan.Flag("aws-profile", "AWS shared credentials profile to use. Cannot be used with --key, --secret, --session-token, or --cloud-environment.").Envar("AWS_PROFILE").String()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

AWS_PROFILE env var breaks existing --cloud-environment usage

High Severity

The --aws-profile flag binds to AWS_PROFILE via .Envar("AWS_PROFILE"). Since AWS_PROFILE is a standard, widely-set AWS environment variable, any user who has it configured will now get an error when using --cloud-environment, because the validation in ScanS3 rejects hasProfile && c.CloudCred. Previously, AWS_PROFILE was transparently handled by the AWS SDK's default credential chain and didn't conflict with --cloud-environment. This is a regression that breaks existing workflows.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7135cca. Configure here.

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.

1 participant