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:
- Define a more limited ANTLR grammar that restricts SQL grammar to only SELECT, COVERING INDEX, and MATERIALIZED VIEW
- If Lake Formation is enabled, validate that SQL is restricted to that grammar.