-
Notifications
You must be signed in to change notification settings - Fork 223
fix(Catalog): Add List PolarisStorageAction for all metadata read operations #1391
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
base: main
Are you sure you want to change the base?
fix(Catalog): Add List PolarisStorageAction for all metadata read operations #1391
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, we should in general go with a prinicipal of least priviledges, how hard is this to catch this / parse this and re:throw 404 ?
That being set I do see catalog such as Unity does this already code, mean while can you please add an UT for this ?
Generally, I'd agree about the least privilege concern, but I'm opposed to reinterpreting AWS exceptions. I think we ought to get AWS to return the correct error code so we don't have to guess at runtime |
@fivetran-ashokborra i was mostly coming from the fact that this was not catched by a test case, so to be it future proof, if some one removes or adds new permission this would fail. |
Fixes #1380
Issue:
Currently, loadTable returns a 403 error when the metadata file is not found, which can be misleading. Since users are expected to have configured the appropriate ListBucket permissions in their IAM policy, a 404 error would be more accurate in this scenario.
Access Denied or Forbidden error: User: arn:aws:sts::{account}:assumed-role/{role}/PolarisAwsCredentialsStorageIntegration is not authorized to perform: s3:ListBucket on resource: \"arn:aws:s3:::ashok-test-local\" because no session policy allows the s3:ListBucket action (Service: S3, Status Code: 403, Request ID: W6Q2D563ETEKR6XZ, Extended Request ID: Izq3QS7eZmGjhjfyoxJWMHeCgrFvUlpZjj73JYMO8i/qnKw6CjOaPVgOWVLFr/JsToTeTxO0YaM=)
As per S3 GetObject documentation, the error message returned depens on ListBucket permission
We are adding ListBucket statement to the session policy only when PolarisStorageAction.List is passed