Skip to content

bug: unexpected anonymous HeadBucket API calls from CloudQuery #10548

@RyPeck

Description

@RyPeck

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The call s3manager.GetBucketRegion() makes unsigned API requests generating unauthorized anonymous access attempts in AWS CloudTrail logs.

The request will not be signed, and will not use your AWS credentials.
https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/feature/s3/manager#GetBucketRegion

Expected Behavior

CloudQuery retrieve the S3 Bucket Region with an authenticated call. GetBucketLocation would be appropiate.

https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/s3#Client.GetBucketLocation

CloudQuery (redacted) config

Any CQ config with aws_s3_buckets as a table.

Steps To Reproduce

Run a CQ config with aws_s3_buckets as a table in DEBUG mode.
You will see unsigned HEAD requests to buckets that respond with a 403.

CloudQuery (redacted) logs

n/a

CloudQuery version

3.0.2

Additional Context

No response

Pull request (optional)

  • I can submit a pull request

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions