Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add goofys as user agent for s3 request #698

Merged
merged 2 commits into from
Nov 3, 2022

Conversation

monthonk
Copy link
Contributor

This PR add "goofys/version-hash" to the user agent list for each request. You will be able to identify which requests come from goofys and which version if you enable server access logging or CloudTrail on your buckets.

example for debug_s3 log

2022/05/18 10:08:32.838728 s3.DEBUG DEBUG: Request s3/ListObjectsV2 Details:
---[ REQUEST POST-SIGN ]-----------------------------
GET /<REDACTED>?delimiter=%2F&list-type=2&prefix= HTTP/1.1
Host: s3.eu-west-1.amazonaws.com
User-Agent: goofys/0.24.0-829d8e5ce20faa3f9f6f054077a14325e00e9249 aws-sdk-go/1.38.7 (go1.18.2; linux; amd64)
Accept-Encoding: identity
Authorization: AWS4-HMAC-SHA256 Credential=<REDACTED>, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=<REDACTED>
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20220518T100832Z

example for server access log

fda01774e8671afabd99d08ccfcb4ef3a0fde3b84c04977a33cd49c863ac0b3e bucket-name [18/May/2022:10:07:30 +0000] <REDACTED> arn:aws:iam::<REDACTED>:user/<REDACTED> CVTB43X4F1MAXG2X REST.GET.OBJECT largefile "GET /bucket-name/largefile HTTP/1.1" 206 - 20971520 10240000000 685 128 "-" "goofys/0.24.0-829d8e5ce20faa3f9f6f054077a14325e00e9249 aws-sdk-go/1.38.7 (go1.18.2; linux; amd64)" - <REDACTED> SigV4 ECDHE-RSA-AES128-GCM-SHA256 AuthHeader s3.eu-west-1.amazonaws.com TLSv1.2 -

@monthonk monthonk changed the title S3 user agent Add goofys as user agent for s3 request May 20, 2022
Copy link

@dannycjones dannycjones left a comment

Choose a reason for hiding this comment

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

Looks good to me, I have run some basic tests locally (mount, list, read, unmount) on macOS against an eu-west-1 Amazon S3 Bucket.

@monthonk
Copy link
Contributor Author

monthonk commented Jun 8, 2022

@kahing would you be able to take a look?

I also think it might be a good opportunity to release a new version after this is merged, it's been a while since the last version and things are starting to break.
I'm happy to help if there are any tests required before the release.

@kahing kahing merged commit 5661a83 into kahing:master Nov 3, 2022
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.

3 participants