Skip to content
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

Grants to schema functions / custom SQL queries #72

Open
petteja opened this issue Mar 18, 2022 · 3 comments
Open

Grants to schema functions / custom SQL queries #72

petteja opened this issue Mar 18, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@petteja
Copy link
Contributor

petteja commented Mar 18, 2022

What problem are you facing?

We're using RDS for PostgreSQL and after using provider-sql to install aws_s3 extension we have to grant usage to the extension manually.
grant all on all functions in schema aws_s3 to <user>;

How could Crossplane help solve your problem?

Does it make sense to implement functionallity in extension.postgresql to give grants? Or have possibility to define custom queries which is run when reconciling? I know a few other use-cases where running custom SQL makes sense, like revoke all on database <database> from public after creating a database.

@petteja petteja added the enhancement New feature or request label Mar 18, 2022
@jmalloc
Copy link

jmalloc commented Jan 8, 2024

We are facing the same issue with the aws_s3 extension. I have not found a way to grant schema-specific privileges.

I think I had much the same kind of solution I'm mind:

  • Grant MR gains ability to target objects other than the database (such as schemas, tables, etc)
  • Add separate SchemaGrant MR (and by extension TableGrant, etc, potentially)

I also thought executing arbitrary SQL would be useful, but probably doesn't really fit the notion of a reconciliation loop particularly well. The most robust approach would probably be to execute the queries on each reconciliation, which would be fine if the queries were guaranteed to be idempotent, but could lead to some pretty expected results otherwise.

EDIT: Linking to some Issues in the same vein / that might also solve the aws_s3 problem:

@jmalloc
Copy link

jmalloc commented Jan 8, 2024

I believe the following queries grant the minimal permissions required to use the aws_s3 extension, so ideally the solution would allow us to grant this and nothing more.

GRANT USAGE ON schema aws_s3 TO <user>;
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA aws_s3 TO <user>;

@Bastichou
Copy link
Contributor

Many duplicated on this topic, merged on #217
This issue will be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

3 participants