I want limit the database access for a client. How can I define a explicit white list of SQL queries, witch can only execute a database user?
Advertisement
Answer
You would do the following:
- Remove read access from all tables for the user.
- Define views for each of the allowed queries.
- Be sure that the security for the views is declared as
DEFINER
rather thanINVOKER
.
Voila! The user has access to the views, but not to the underlying tables.