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

Investigate restricting third-party access to user's container #1312

Closed
rohank07 opened this issue Aug 18, 2022 · 5 comments
Closed

Investigate restricting third-party access to user's container #1312

rohank07 opened this issue Aug 18, 2022 · 5 comments
Assignees

Comments

@rohank07
Copy link
Contributor

rohank07 commented Aug 18, 2022

Able to create table and insert data into another user's blob container. Investigate either at Trino/Azure level to restrict access using the blob URI.
image

@rohank07 rohank07 mentioned this issue Aug 18, 2022
54 tasks
@rohank07 rohank07 self-assigned this Aug 19, 2022
@rohank07
Copy link
Contributor Author

rohank07 commented Aug 19, 2022

Disabling these properties hive.non-managed-table-creates-enabled=false hive.non-managed-table-writes-enabled=false does not allow you to specify external_location on the CREATE TABLE query.
We would want user to create internal (managed) table rather than external (non-managed). We don't reference files on remote locations. https://ahana.io/answers/what-is-the-difference-between-a-managed-table-and-external-tables/
image
image

The only issue remains is the location specified on CREATE SCHEMA query. A user can still run this and Create a table and insert into another user's container.
CREATE SCHEMA unclassified.rohankatkar WITH (location = 'wasbs://jose-matsuda@aawdevcc00samgstandard.blob.core.windows.net/');

Write a controller that uses the Trino client REST API to pre-create schemas.

@rohank07
Copy link
Contributor Author

Confirmation ✔️ : Unable to run CREATE TABLE query when specifiying property location
image

@rohank07
Copy link
Contributor Author

rohank07 commented Aug 20, 2022

Todo: Write a controller in aaw-kubeflow-profiles-controller to create schemas using Trino Client REST API
Example command:
curl --header "X-Trino-User: rohan-katkar" --header "X-Trino-Catalog: unclassified" --header "X-Trino-Set-Set-Session" --request POST --data 'CREATE SCHEMA IF NOT EXISTS unclassified.rohankatkar WITH (location = '\''wasbs://rohan-katkar@aawdevcc00samgstandard.blob.core.windows.net/'\'')' https://trino.aaw-dev.cloud.statcan.ca/v1/statement

@rohank07
Copy link
Contributor Author

Apache Ranger will be able to resolve this type of use case. There is a trino-ranger plugin in the works: trinodb/trino#13297

@rohank07
Copy link
Contributor Author

Closing. Going to create another task for schema profiles controller in next sprint.

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

No branches or pull requests

1 participant