-
Notifications
You must be signed in to change notification settings - Fork 32
♻️ Update postgres configuration ⚠️ DEVOPS #7997
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
♻️ Update postgres configuration ⚠️ DEVOPS #7997
Conversation
1. create readonly role to reuse for users that need to access database
* can be reused for readonly user and for metabase's user
2. fix security issue with public schema in Postgres 14
3. make readonly user rely on readonly role
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds and refactors SQL scripts to enforce a read-only role for Postgres databases and lock down the public schema in Postgres 14.
- Introduce
init.sqlto revoke CREATE on the public schema for all new databases. - Create and remove templates for a reusable
${POSTGRES_DB}_readonlyrole, and refactor the read-only user scripts to grant/revoke this role. - Update
.gitignoreto track template files and the newinit.sql.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| services/postgres/scripts/init.sql | New script to revoke CREATE on public schema per DB |
| services/postgres/scripts/create-readonly-role.sql.template | New template for creating the ${POSTGRES_DB}_readonly role |
| services/postgres/scripts/create-readonly-user.sql.template | Refactored user script to grant the readonly role |
| services/postgres/scripts/remove-readonly-role.sql.template | New template for revoking privileges and dropping the readonly role |
| services/postgres/scripts/remove-readonly-user.sql.template | Updated script to revoke the readonly role before dropping the user |
| services/postgres/scripts/.gitignore | Kept template files and init.sql tracked |
sanderegg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
our colleague copilot has some valid points
pcrespov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx
Co-authored-by: Copilot <[email protected]>
|
@Mergifyio queue |
🛑 The pull request has been removed from the queue
|
|
|
This pull request has been removed from the queue for the following reason: The merge conditions cannot be satisfied due to failing checks:You may have to fix your CI before adding the pull request to the queue again. |



What do these changes do?
Actions:
init.sqlscript shall be executed in all deployments.Related issue/s
How to test
Dev-ops
NOTE: for templating env use repo config