Distributed Query Engine AST Sanitization for Secure Execution
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Distributed databases face challenges in achieving security without sacrificing performance and flexibility, particularly in multiuser environments where user-defined functions can pose security risks.
Innovation Solution
A distributed database system isolates a query engine coordinator into a frontend and backend, using a sanitizer to analyze and sanitize abstract syntax trees (ASTs) before compilation, preventing unauthorized access and ensuring security while maintaining performance and flexibility.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If user-defined functions are allowed in distributed databases to improve flexibility and functionality, then the system becomes more versatile and adaptable, but security risks increase due to potential unauthorized access and malicious code execution
Solution Approach 1:
The query engine coordinator is segmented into frontend and backend portions. The frontend handles user interactions and function definitions, while the backend executes queries. This segmentation isolates user-defined functions from the core execution engine, allowing flexibility to be added through the frontend without compromising the security of the backend execution environment.
Solution Approach 2:
A sanitizer component is introduced as an intermediary between the frontend and backend. The sanitizer analyzes abstract syntax trees (ASTs) generated by the frontend, identifies potentially harmful operations, and blocks them before execution. This intermediary layer enables the system to maintain flexibility while preventing security risks from user-defined functions.
2Reliability
If security measures are implemented to prevent unauthorized access and malicious code execution, then security is improved, but system performance and operational flexibility may be compromised
Solution Approach 1:
Security validation is performed in advance through the sanitizer component that analyzes ASTs before query execution. By identifying and blocking harmful operations during the parsing and validation phase rather than during execution, the system ensures security without adding overhead to the actual query processing, thus maintaining performance.
Solution Approach 2:
The sanitizer acts as a lightweight intermediary that performs security checks on ASTs. It operates during the query preparation phase and allows legitimate queries to pass through with minimal overhead. The sanitizer only blocks malicious operations, ensuring that security measures do not compromise the performance of valid queries.
3Reliability
If the query engine coordinator is isolated into frontend and backend portions with sanitization, then security is enhanced by preventing unauthorized access, but device complexity increases
Solution Approach 1:
The coordinator is divided into frontend and backend portions with clear responsibility boundaries. The frontend handles user interactions and AST generation, while the backend handles query execution. This segmentation organizes complexity into manageable, well-defined components that can be independently developed and maintained, reducing overall system complexity despite the added security layer.
Solution Approach 2:
The sanitizer is implemented as a modular intermediary component that sits between the frontend and backend. It processes ASTs through a standardized interface and returns validation results, maintaining a clean separation of concerns. This modular design adds security functionality without significantly increasing overall system complexity, as the sanitizer can be integrated into existing query processing pipelines.
Data Source
AI summary
A distributed database keeps an abstract syntax tree (AST) and an included user code from interacting with a query engine coordinator during the performance of query execution processes. The query engine coordinator is separated into a frontend and backend, where a compiler on the frontend generates an AST and serializes it to be sent to the backend. The backend is implemented in a security environment separate from the front end. The backend deserializes the AST, sanitizes it, and generates a query plan based on the sanitized AST.


