{"id":13611386,"url":"https://github.com/larskanis/pg-ldap-sync","last_synced_at":"2025-04-05T17:09:18.000Z","repository":{"id":677762,"uuid":"1793114","full_name":"larskanis/pg-ldap-sync","owner":"larskanis","description":"Use LDAP permissions in PostgreSQL","archived":false,"fork":false,"pushed_at":"2023-08-28T06:04:32.000Z","size":76,"stargazers_count":126,"open_issues_count":8,"forks_count":34,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-03-14T18:35:57.832Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://github.com/larskanis/pg-ldap-sync","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/larskanis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2011-05-24T12:00:23.000Z","updated_at":"2024-03-03T12:58:24.000Z","dependencies_parsed_at":"2024-01-14T06:56:37.831Z","dependency_job_id":null,"html_url":"https://github.com/larskanis/pg-ldap-sync","commit_stats":{"total_commits":103,"total_committers":6,"mean_commits":"17.166666666666668","dds":0.2815533980582524,"last_synced_commit":"0166bf8cdbbbc84b04dc82535d9a01b292c1b2ab"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larskanis%2Fpg-ldap-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larskanis%2Fpg-ldap-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larskanis%2Fpg-ldap-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larskanis%2Fpg-ldap-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/larskanis","download_url":"https://codeload.github.com/larskanis/pg-ldap-sync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247369953,"owners_count":20927928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T19:01:54.754Z","updated_at":"2025-04-05T17:09:17.974Z","avatar_url":"https://github.com/larskanis.png","language":"Ruby","readme":"[![Build Status](https://app.travis-ci.com/larskanis/pg-ldap-sync.svg?branch=master)](https://app.travis-ci.com/larskanis/pg-ldap-sync) [![Build status](https://ci.appveyor.com/api/projects/status/09xn9q5p64jbxtka/branch/master?svg=true)](https://ci.appveyor.com/project/larskanis/pg-ldap-sync/branch/master)\n\n# Use LDAP permissions in PostgreSQL\n\n* http://github.com/larskanis/pg-ldap-sync\n\n## DESCRIPTION:\n\nLDAP is often used for a centralized user and role management in an enterprise environment.\nPostgreSQL offers different authentication methods, like LDAP, SSPI, GSSAPI or SSL.\nHowever, for any method the user must already exist in the database, before the authentication can be used.\nThere is currently no direct authorization of database users on LDAP.\nSo roles and memberships has to be administered twice.\n\nThis program helps to solve the issue by synchronizing users, groups and their memberships from LDAP to PostgreSQL.\nAccess to LDAP is used read-only.\n`pg_ldap_sync` issues proper CREATE ROLE, DROP ROLE, GRANT and REVOKE commands to synchronize users and groups.\n\nIt is meant to be started as a cron job.\n\n## FEATURES:\n\n* User+group creation, deletion and changes in memberships are synchronized from LDAP to PostgreSQL\n* Nested groups/roles supported\n* Configurable per YAML config file\n* Can use Active Directory as LDAP-Server\n* Set scope of considered users/groups on LDAP and PG side\n* Test mode which doesn't do any changes to the DBMS\n* Both LDAP and PG connections can be secured by SSL/TLS\n* NTLM and Kerberos authentication to LDAP server\n\n## REQUIREMENTS:\n\n* Ruby-2.0+\n* LDAP-v3 server\n* PostgreSQL-server v9.0+\n\n## INSTALL:\n\nInstall Ruby:\n\n* on Windows: http://rubyinstaller.org\n* on Debian/Ubuntu: `apt-get install ruby libpq-dev`\n\nInstall pg-ldap-sync and required dependencies:\n```sh\n  gem install pg-ldap-sync\n```\n\n### Install from Git:\n```sh\n  git clone https://github.com/larskanis/pg-ldap-sync.git\n  cd pg-ldap-sync\n  gem install bundler\n  bundle install\n  bundle exec rake install\n```\n\n## USAGE:\n\nCreate a config file based on\n[config/sample-config.yaml](https://github.com/larskanis/pg-ldap-sync/blob/master/config/sample-config.yaml)\nor even better\n[config/sample-config2.yaml](https://github.com/larskanis/pg-ldap-sync/blob/master/config/sample-config2.yaml)\n\nRun in test-mode:\n```sh\n  pg_ldap_sync -c my_config.yaml -vv -t\n```\nRun in modify-mode:\n```sh\n  pg_ldap_sync -c my_config.yaml -vv\n```\n\nIt is recommended to avoid granting permissions to synchronized users on the PostgreSQL server, but to grant permissions to groups instead.\nThis is because `DROP USER` statements invoked when a user leaves otherwise fail due to depending objects.\n`DROP GROUP` equally fails if there are depending objects, but groups are typically more stable and removed rarely.\n\n\n## TEST:\nThere is a small test suite in the `test` directory that runs against an internal LDAP server and a PostgreSQL server. Ensure `pg_ctl`, `initdb` and `psql` commands are in the `PATH` like so:\n```sh\n  cd pg-ldap-sync\n  bundle install\n  PATH=$PATH:/usr/lib/postgresql/10/bin/ bundle exec rake test\n```\n\n## ISSUES:\n\n* There is currently no way to set certain user attributes in PG based on individual attributes in LDAP (expiration date etc.)\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","funding_links":[],"categories":["Ruby","Compiled list","Uncategorized"],"sub_categories":["plv8:","Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flarskanis%2Fpg-ldap-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flarskanis%2Fpg-ldap-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flarskanis%2Fpg-ldap-sync/lists"}