-
Notifications
You must be signed in to change notification settings - Fork 212
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
Revoking public schema access not working as expected #33
Comments
I can confirm. did not work for me as well |
Hi @gwkunze , Thanks for opening this issue, I also discovered this bug recently. To grant/revoke access on schema, you can now use the resource "postgresql_grant" "revoke_public" {
database = "test_db"
role = "public"
schema = "public"
object_type = "schema"
privileges = []
} I close this issue but feel free to answer/open it back if needed. |
Hi, The "policy" is Deprecated but it provided for a "*_with_grant" option. I don't see that as a privilege in the postgresql_grant resource, is that option available? privileges - (Required) The list of privileges to grant. There are different kinds of privileges: SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER, CREATE, CONNECT, TEMPORARY, EXECUTE, and USAGE. |
@firestrtur There's the option but not in the documentation apparently 🤦♂️ (I'll add it) Resource resource "postgresql_grant" "revoke_public" {
database = "test_db"
role = "test_role"
schema = "test_schema"
object_type = "schema"
privileges = []
with_grant_option = true
} |
That worked. Thanks! |
Copied from hashicorp/terraform-provider-postgresql#165
Terraform Version
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Expected Behavior
I'd expect the
public
role not to have the (default)usage
andcreate
permissions on thepublic
schemaActual Behavior
The
public
schema still allows any user (with thepublic
role) to use and create tables. Note that settingcreate
andusage
totrue
and applying, followed by setting them back tofalse
and applying again does remove the permissions as expected.Important Factoids
Running on RDS created Postgres 12.3 instance
Just tested with both
role = "public"
androle = ""
(since postgres seems to store ACLS for public as""
) but the same behaviour is shown for bothReading the code, I think there are two problems:
The text was updated successfully, but these errors were encountered: