{"id":21883152,"url":"https://github.com/eendroroy/passwordpolicy","last_synced_at":"2025-04-15T06:08:22.126Z","repository":{"id":71992053,"uuid":"126974965","full_name":"eendroroy/passwordpolicy","owner":"eendroroy","description":"passwordcheck plugin with configuration options","archived":false,"fork":false,"pushed_at":"2020-01-02T16:37:42.000Z","size":79,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T06:08:17.205Z","etag":null,"topics":["passwordpolicy","postgresql-extension"],"latest_commit_sha":null,"homepage":"","language":"C","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/eendroroy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-27T11:16:32.000Z","updated_at":"2024-04-17T20:47:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"5819ea5d-a324-4477-a591-126faad50ea5","html_url":"https://github.com/eendroroy/passwordpolicy","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eendroroy%2Fpasswordpolicy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eendroroy%2Fpasswordpolicy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eendroroy%2Fpasswordpolicy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eendroroy%2Fpasswordpolicy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eendroroy","download_url":"https://codeload.github.com/eendroroy/passwordpolicy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249016627,"owners_count":21198833,"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":["passwordpolicy","postgresql-extension"],"created_at":"2024-11-28T09:39:30.605Z","updated_at":"2025-04-15T06:08:22.120Z","avatar_url":"https://github.com/eendroroy.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# passwordpolicy\n\n[![GitHub tag](https://img.shields.io/github/tag/eendroroy/passwordpolicy.svg)](https://github.com/eendroroy/passwordpolicy/tags)\n\n[![Contributors](https://img.shields.io/github/contributors/eendroroy/passwordpolicy.svg)](https://github.com/eendroroy/passwordpolicy/graphs/contributors)\n[![GitHub last commit (branch)](https://img.shields.io/github/last-commit/eendroroy/passwordpolicy/master.svg)](https://github.com/eendroroy/passwordpolicy)\n[![license](https://img.shields.io/github/license/eendroroy/passwordpolicy.svg)](https://github.com/eendroroy/passwordpolicy/blob/master/LICENSE)\n[![GitHub issues](https://img.shields.io/github/issues/eendroroy/passwordpolicy.svg)](https://github.com/eendroroy/passwordpolicy/issues)\n[![GitHub closed issues](https://img.shields.io/github/issues-closed/eendroroy/passwordpolicy.svg)](https://github.com/eendroroy/passwordpolicy/issues?q=is%3Aissue+is%3Aclosed)\n[![GitHub pull requests](https://img.shields.io/github/issues-pr/eendroroy/passwordpolicy.svg)](https://github.com/eendroroy/passwordpolicy/pulls)\n[![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/eendroroy/passwordpolicy.svg)](https://github.com/eendroroy/passwordpolicy/pulls?q=is%3Apr+is%3Aclosed)\n\n\nThe `passwordpolicy` is like the regular PostgreSQL passwordcheck extension, except it is built with cracklib and has some configurations options. Unlike the original module, this one has more strict password checks. The `passwordpolicy` module checks users' passwords whenever they are set with `CREATE ROLE` or `ALTER ROLE`. If a password is considered too weak, it will be rejected and the command will terminate with an error. \n\n## Installing by compiling source code\n\n**Prerequisit**\n\n`Ubuntu`:\n\n```bash\n# add postgres repo\nadd-apt-repository 'deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main'\nwget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -\n\n# install postgres\napt-get -y update\napt-get -y install postgresql postgresql-contrib libpq-dev postgresql-server-dev-all\n\n# install build requirements\napt-get -y install make build-essential\n\n# install cracklib\napt-get -y install libpam-cracklib libcrack2-dev\n```\n\n\n`RHEL`:\n\n```bash\nyum -y install openssl-devel\n\n# add postgres repo\nrpm -Uvh https://yum.postgresql.org/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm\n\n# install postgres\nyum -y install postgresql10-server postgresql10-libs postgresql10-devel postgresql10-contrib\n\n# install cracklib\nyum -y install cracklib cracklib-devel cracklib-dicts words\n\n# create dictionary\nmkdict /usr/share/dict/* | packer /usr/lib/cracklib_dict\n\n# initialize databasse\n/usr/pgsql-10/bin/postgresql-10-setup initdb\n```\n\nTo build it, just do this:\n\n```bash\nmake\nmake install\n```\n\nIf you encounter an error such as:\n\n```\nmake: pg_config: Command not found\n```\n\nBe sure that you have pg_config installed and in your path. If you used \na package management system such as RPM to install PostgreSQL, be sure \nthat the -devel package is also installed. If necessary tell the build \nprocess where to find it. Edit Makefile, and change PG_CONFIG variable:\n\n```bash\nPG_CONFIG=/path/to/pg_config\n```\n\nfollowed by the\n\n```bash\nmake\nmake install\n```\n\n`pg_config` is usually under `/usr/pgsql-10/bin/pg_config` on \nRHEL/CentOS/Fedora. Replace 10 with your major PostgreSQL version.\n\nAlternatively the following will work too:\n\n```bash\nPATH=\"/usr/pgsql-10/bin:$PATH\" make\nsudo PATH=\"/usr/pgsql-10/bin:$PATH\" make install\nPATH=\"/usr/pgsql-10/bin:$PATH\" make installcheck\n```\n\n## Using the module\n\nTo enable this module, add '`$libdir/passwordpolicy`' to \nshared_preload_libraries in postgresql.conf, then restart the server.\n\n## Configurations\n\nConfigure the `passwordpolicy` plugin in `postgresql.conf`.\n\n```\np_policy.min_password_len = 8       # Set minimum Password length\np_policy.min_special_chars = 2      # Set minimum number of special chracters\np_policy.min_numbers = 2            # Set minimum number of numeric characters\np_policy.min_uppercase_letter = 2   # Set minimum number of upper case letters\np_policy.min_lowercase_letter = 2   # Set minimum number of lower casae letters\n```\n\n## Testing\n\nUsing vagrant:\n\n```bash\nvagrant up\nvagrant provision --provision-with install\n```\n\n## More information\n\nFor more details, please read the manual of the original module:\n\n[https://www.postgresql.org/docs/current/static/passwordcheck.html](https://www.postgresql.org/docs/current/static/passwordcheck.html)\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at [passwordpolicy](https://github.com/eendroroy/passwordpolicy) repository.\nThis project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## Author\n\n* **indrajit** - *Owner* - [eendroroy](https://github.com/eendroroy)\n\n## License\n\nThe project is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feendroroy%2Fpasswordpolicy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feendroroy%2Fpasswordpolicy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feendroroy%2Fpasswordpolicy/lists"}