-
-
Notifications
You must be signed in to change notification settings - Fork 201
fix: grant Vault privs to service_role #1539
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c38bfab
fix: grant Vault privs to service_role
soedirgo 62afdda
adjust tests according to the fix
steve-chavez df38858
chore: bump versions
steve-chavez a74b26a
fix: missing Vault privileges for postgres
soedirgo fadfbe7
fix: also privs in the migration
soedirgo a911b07
test: schema snapshots changed
soedirgo 832e2cb
Merge branch 'develop' into fix/grant-vault-privs-to-service_role
soedirgo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
7 changes: 6 additions & 1 deletion
7
ansible/files/postgresql_extension_custom_scripts/supabase_vault/after-create.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
grant usage on schema vault to postgres with grant option; | ||
grant select, delete on vault.secrets, vault.decrypted_secrets to postgres with grant option; | ||
grant select, delete, truncate, references on vault.secrets, vault.decrypted_secrets to postgres with grant option; | ||
grant execute on function vault.create_secret, vault.update_secret, vault._crypto_aead_det_decrypt to postgres with grant option; | ||
|
||
-- service_role used to be able to manage secrets in Vault <=0.2.8 because it had privileges to pgsodium functions | ||
grant usage on schema vault to service_role; | ||
grant select, delete on vault.secrets, vault.decrypted_secrets to service_role; | ||
grant execute on function vault.create_secret, vault.update_secret, vault._crypto_aead_det_decrypt to service_role; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,13 +28,19 @@ ORDER BY object_name, grantee, privilege_type; | |
schema | object_name | grantee | privilege_type | ||
--------+---------------------------+----------------+---------------- | ||
vault | _crypto_aead_det_decrypt | postgres | EXECUTE | ||
vault | _crypto_aead_det_decrypt | service_role | EXECUTE | ||
vault | _crypto_aead_det_decrypt | supabase_admin | EXECUTE | ||
vault | _crypto_aead_det_encrypt | supabase_admin | EXECUTE | ||
vault | _crypto_aead_det_noncegen | supabase_admin | EXECUTE | ||
vault | create_secret | postgres | EXECUTE | ||
vault | create_secret | service_role | EXECUTE | ||
vault | create_secret | supabase_admin | EXECUTE | ||
vault | decrypted_secrets | postgres | DELETE | ||
vault | decrypted_secrets | postgres | REFERENCES | ||
vault | decrypted_secrets | postgres | SELECT | ||
vault | decrypted_secrets | postgres | TRUNCATE | ||
vault | decrypted_secrets | service_role | DELETE | ||
vault | decrypted_secrets | service_role | SELECT | ||
vault | decrypted_secrets | supabase_admin | DELETE | ||
vault | decrypted_secrets | supabase_admin | INSERT | ||
vault | decrypted_secrets | supabase_admin | REFERENCES | ||
|
@@ -43,7 +49,11 @@ ORDER BY object_name, grantee, privilege_type; | |
vault | decrypted_secrets | supabase_admin | TRUNCATE | ||
vault | decrypted_secrets | supabase_admin | UPDATE | ||
vault | secrets | postgres | DELETE | ||
vault | secrets | postgres | REFERENCES | ||
vault | secrets | postgres | SELECT | ||
vault | secrets | postgres | TRUNCATE | ||
vault | secrets | service_role | DELETE | ||
vault | secrets | service_role | SELECT | ||
vault | secrets | supabase_admin | DELETE | ||
vault | secrets | supabase_admin | INSERT | ||
vault | secrets | supabase_admin | REFERENCES | ||
|
@@ -52,8 +62,9 @@ ORDER BY object_name, grantee, privilege_type; | |
vault | secrets | supabase_admin | TRUNCATE | ||
vault | secrets | supabase_admin | UPDATE | ||
vault | update_secret | postgres | EXECUTE | ||
vault | update_secret | service_role | EXECUTE | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Effects of the changes now can be clearly visualized. |
||
vault | update_secret | supabase_admin | EXECUTE | ||
(26 rows) | ||
(37 rows) | ||
|
||
-- vault indexes with owners | ||
SELECT | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.