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

Limit Spark SQL queries to SELECT + FLINT commands when Lake Formation is enabled #2907

Closed
asuresh8 opened this issue Aug 6, 2024 · 3 comments · Fixed by #2959
Closed

Limit Spark SQL queries to SELECT + FLINT commands when Lake Formation is enabled #2907

asuresh8 opened this issue Aug 6, 2024 · 3 comments · Fixed by #2959
Labels
enhancement New feature or request Priority-High

Comments

@asuresh8
Copy link
Contributor

asuresh8 commented Aug 6, 2024

When using Lake Formation, OpenSearch should limit the Spark SQL queries to only SELECT to limit the capability of users to escalate privilege beyond what Lake Formation actually grants the user.

This proposal includes 2 main pieces:

  1. Define a more limited ANTLR grammar that restricts SQL grammar to only SELECT, COVERING INDEX, and MATERIALIZED VIEW
  2. If Lake Formation is enabled, validate that SQL is restricted to that grammar.
@asuresh8 asuresh8 added enhancement New feature or request untriaged labels Aug 6, 2024
@penghuo
Copy link
Collaborator

penghuo commented Aug 14, 2024

OSD - QueryExplorer use SHOW TABLE EXTENDED and SHOW DATABASES, is it ok to allowlist them for LF datasource?

@asuresh8
Copy link
Contributor Author

We need to double check to make sure LF permissions are honored for those commands.

@asuresh8
Copy link
Contributor Author

This change should be pretty similar to #2790, where a different grammar file needs to be used that scopes down SQL commands. The ANTLR generated lexer for that grammar should be used to validate the query and throw an exception if grammar that is not permitted is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Priority-High
Projects
None yet
2 participants