-
Notifications
You must be signed in to change notification settings - Fork 866
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
Cross Account Buckets get region calls fail with 403 #5634
Comments
Hi @HarshitGupta11, Thank you for reporting the issue. We are looking into it and will get back to you soon. Meanwhile, are you able to share the error stack trace for the same? -update
Can you please confirm if your earlier SDK version was older than 2.23.13? Regards, |
Hi @HarshitGupta11, Kindly share below details to be able to determine the problem you are facing.
Regards, |
Hi @bhoradc, no we are using
7.2.18 raz logs_SDK_2.21.46.txt |
Hi @HarshitGupta11, Thanks for providing above details. Below are the steps I took to reproduce the 403 error for cross-accounts, cross-region bucket access.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "statement1",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<<accountA>>:user/<<testuser>>"
},
"Action": "*",
"Resource": "arn:aws:s3:::x/*"
}
]
}
String bucketName ="x";
S3Client s3 = S3Client.builder()
.crossRegionAccessEnabled(true)
.region(Region.US_EAST_1)
.build();
GetBucketLocationRequest request = GetBucketLocationRequest.builder()
.bucket(bucketName)
.build();
GetBucketLocationResponse response = s3.getBucketLocation(request); Using above reproduction steps, I receive Therefore, I do not see this as a regression, but there seems an issue with the For cross-region bucket access within same account, the I will work with the Java SDK team to further investigate on this issue. But for now, as a workaround you can try doing s3.headBucket(h->h.bucket(bucketName));
GetBucketLocationResponse response = s3.getBucketLocation(request); Regards, |
Hi @bhoradc, thanks for the response and resolution of the issue, we reverted back the sdk for the time being as we were already late for the release but I will keep this method of getting the location in mind when we are updating next. |
@HarshitGupta11 we discussed this issue further and I want to give some additional details. To make the With So our recommendation here is the same as S3's: use Let us know if you have any questions or comments. |
Describe the bug
We have a cross region bukcet setting. Both the accounts have all the permissions on the bucket but after performing an sdk upgrade to 2.25.3 our getBucketRegion calls fail with 403.
After some investigation we found that in the earlier versio(2.21.) we were sending the call to the global endpoint whereas for the newer version(2.25.) we see its being sent to the local endpoint.
Regression Issue
Expected Behavior
The bucket region call should work.
Current Behavior
Described above.
Reproduction Steps
Create two buckets in different accounts and create trust relationships between them. Then make a get bucket location call from both the accounts to both the buckets.
Possible Solution
No response
Additional Information/Context
No response
AWS Java SDK version used
2.25.53
JDK version used
1.8
Operating System and version
Redhat 8
The text was updated successfully, but these errors were encountered: