Skip to content

Commit 87cecf6

Browse files
committed
Emphasize read-only mode for security, closes #95
1 parent f994437 commit 87cecf6

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

docs/security.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
Allowing people to execute their own SQL directly against your database is risky business!
44

5+
The safest way to use this tool is to create a read-only replica of your PostgreSQL database with a read-only role that enforces a statement time-limit for executed queries. Different database providers have different mechanisms for doing this - consult your hosting provider's documentation.
6+
7+
You should only provide access to this tool to people you trust. Malicious users may be able to negatively affect the performance of your servers through constructing SQL queries that deliberately consume large amounts of resources.
8+
59
Configured correctly, Django SQL Dashboard uses a number of measures to keep your data and your database server safe:
610

711
- I strongly recommend creating a dedicated PostgreSQL role for accessing your database with read-only permissions granted to an allow-list of tables. PostgreSQL has extremely robust, well tested permissions which this tool can take full advantage of.

docs/setup.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ urlpatterns = [
2424

2525
## Setting up read-only PostgreSQL credentials
2626

27+
The safest way to use this tool is against a dedicated read-only replica of your database - see [security](./security) for more details.
28+
2729
Create a new PostgreSQL user or role that is limited to read-only SELECT access to a specific list of tables.
2830

2931
If your read-only role is called `my-read-only-role`, you can grant access using the following SQL (executed as a privileged user):

0 commit comments

Comments
 (0)