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

Role config per database [was: How to rewrite "Defining Custom Privilege" in version 6.] #572

Open
HermanPool opened this issue Oct 11, 2023 · 4 comments
Labels

Comments

@HermanPool
Copy link

We had a custom privilege in ldap2pg version 5.
See the example: https://ldap2pg.readthedocs.io/en/v5/privileges/

How do implement that in version 6?

with regards,
Herman Pool

@bersace
Copy link
Member

bersace commented Oct 11, 2023

Hi @HermanPool . This is a regression of ldap2pg 6.0. Can you share your custom privilege to see how you could implement this in 6.0 ?

In 6.0, privileges are distinct from ACL. An ACL retruns all aclitem from a system catalog. A privilege references a privilege type in an ACL.

I plan to add custom ACL so that you can reference more system catalog acls like foreign data wrapper, etc.

Waiting for your use case.

Étienne

@HermanPool
Copy link
Author

See the attached zip file for the ldap2pg.yml file
ldap2pg.zip

@bersace
Copy link
Member

bersace commented Oct 12, 2023

Ok, interesting. You used privileges to configure a role.
ldap2pg 6 allows you to configure global role parameters.
I suggest to implement per database role parameters.

See https://ldap2pg.readthedocs.io/en/latest/config/#role-options

I suggest the following configuration format :

rules:
- role:
    name: alice
    config:
      __global__:
        log_statement: all
      db1:
        edb_audit_statement: all

What do you think of this ? Do you need LDAP attribute injection in config ?

@bersace bersace changed the title How to rewrite "Defining Custom Privilege" in version 6. Role config per database [was: How to rewrite "Defining Custom Privilege" in version 6.] Oct 12, 2023
@HermanPool
Copy link
Author

In the attached file is my version 6 yml file.
ldap2pg_20231012.zip

The purpose is that everybody in the App_DBApg_ddl , App_DBApg_write and App_DBApg_read group, the value "all" gets for the config property edb_audit_statement.
After running ldap2pg, if I login and do a "show edb_audit_statement" , I get the default value "none" where I expected the value "all".
I am a member of the App_DBApg_ddl and ldap_roles role in postgres.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants