-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Figure out robust pattern for read-only queries #16
Comments
|
After much experimentation, I think I've found a good pattern for this - at least for PostgreSQL. Setting
But... So the patter that seems to work is:
I'd also like to prevent users from running multiple queries. The cheap way to do this is to ban any occurrences of a django-sql-dashboard/django_sql_dashboard/views.py Lines 34 to 43 in 87fc304
|
I can't find a better way to forbid multiple SQL queries than banning |
I'm pleased with this, next step is to document it in #6. |
Split from #15 (comment)_
Dashboard queries should only execute read-only. There should be zero risk of a malicious
/dashboard/?sql=update+blah
query ever being executed.The best way to do this is using a dedicated read-only PostgreSQL read-only role, see https://til.simonwillison.net/postgresql/read-only-postgresql-user
There's just one catch: on Heroku you need to pay at least $50/month to gain the ability to set up additional read-only roles! So ideally I'd like a working Heroku workaround here.
The text was updated successfully, but these errors were encountered: