{"id":28481468,"url":"https://github.com/dev-sec/puppet-postgres-hardening","last_synced_at":"2025-07-04T17:30:21.119Z","repository":{"id":73219326,"uuid":"21823013","full_name":"dev-sec/puppet-postgres-hardening","owner":"dev-sec","description":"Postgres Web Server Hardening with Puppet","archived":false,"fork":false,"pushed_at":"2024-08-06T07:42:17.000Z","size":28,"stargazers_count":11,"open_issues_count":1,"forks_count":6,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-06-07T20:07:27.818Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://dev-sec.io/","language":"Puppet","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dev-sec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2014-07-14T14:40:36.000Z","updated_at":"2024-05-25T03:35:30.000Z","dependencies_parsed_at":"2024-02-06T03:29:23.471Z","dependency_job_id":"53f97b3b-c096-4760-9cb8-8a05256d1602","html_url":"https://github.com/dev-sec/puppet-postgres-hardening","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dev-sec/puppet-postgres-hardening","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-sec%2Fpuppet-postgres-hardening","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-sec%2Fpuppet-postgres-hardening/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-sec%2Fpuppet-postgres-hardening/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-sec%2Fpuppet-postgres-hardening/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dev-sec","download_url":"https://codeload.github.com/dev-sec/puppet-postgres-hardening/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-sec%2Fpuppet-postgres-hardening/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263587855,"owners_count":23484819,"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":"2025-06-07T20:07:27.361Z","updated_at":"2025-07-04T17:30:21.113Z","avatar_url":"https://github.com/dev-sec.png","language":"Puppet","funding_links":[],"categories":[],"sub_categories":[],"readme":"# postgres_hardening (Puppet module)\n\n[![Puppet Forge](https://img.shields.io/puppetforge/dt/hardening/postgres_hardening.svg)][1]\n[![Build Status](http://img.shields.io/travis/hardening-io/puppet-postgres-hardening.svg)][2]\n[![Gitter Chat](https://badges.gitter.im/Join%20Chat.svg)][3]\n\n## Description\n\nThis module provides hardening configuration for Postgres.\n\n## Requirements\n\n* Puppet\n\n## Parameters\n\n* `config_entry_logging_collector = 'on'`\n   This parameter enables the logging collector, which is a background process \n   that captures log messages sent to stderr and redirects them into log files. \n   See http://www.postgresql.org/docs/9.1/static/runtime-config-logging.html for details\n   Defaults to: `on`\n\n* `config_entry_log_directory = 'pg_log'`\n   When logging_collector is enabled, this parameter determines the \n   directory in which log files will be created. \n   See http://www.postgresql.org/docs/9.1/static/runtime-config-logging.html for details\n   Defaults to: `pg_log`\n\n* `config_entry_log_connections = 'on'`\n   Causes each attempted connection to the server to be logged, as well as successful \n   completion of client authentication. \n   See http://www.postgresql.org/docs/9.1/static/runtime-config-logging.html for details\n   Defaults to: `on`\n\n* `config_entry_log_disconnections = 'on'`\n   This outputs a line in the server log similar to log_connections but at session \n   termination, and includes the duration of the session. \n   See http://www.postgresql.org/docs/9.1/static/runtime-config-logging.html for details\n   Defaults to: `on`\n\n* `config_entry_log_duration = 'on'`\n   Causes the duration of every completed statement to be logged \n   See http://www.postgresql.org/docs/9.1/static/runtime-config-logging.html for details\n   Defaults to: `on`\n\n* `config_entry_log_hostname = 'on'`\n   By default, connection log messages only show the IP address of the connecting host. \n   See http://www.postgresql.org/docs/9.1/static/runtime-config-logging.html for details\n   Defaults to: `on`\n\n* `config_entry_log_line_prefix = '%t %u %d %h'`\n   This is a printf-style string that is output at the beginning of each log line. \n   See http://www.postgresql.org/docs/9.1/static/runtime-config-logging.html for details\n   Defaults to: `%t %u %d %h`\n\n* `config_entry_password_encryption = 'on'`\n   When a password is specified in CREATE USER or ALTER ROLE without writing either \n   ENCRYPTED or UNENCRYPTED, this parameter determines whether the password is to be encrypted. \n   See http://www.postgresql.org/docs/9.1/static/runtime-config-connection.html for details\n   Defaults to: `on`\n\n* `config_entry_ssl = 'off'`\n   Enables SSL connections. Please read http://www.postgresql.org/docs/9.1/static/ssl-tcp.html \n   SSL certificates are out of scope of this module. This is why this setting defaults to `off`.\n   You have to provide ssl certificates *before* the startup of postgres, otherwise it will fail to start.  \n   See http://www.postgresql.org/docs/9.1/static/runtime-config-connection.html for details\n   Defaults to: `off`\n\n## Usage\n\n```\nclass { '::postgresql::server':\n  postgres_password          =\u003e 'iloverandompasswordsbutthiswilldo',\n}\n\nclass { '::postgres_hardening':\n  provider =\u003e 'puppetlabs/postgresql',\n}\n```\n\n### Enable SSL\n\nPlease read http://www.postgresql.org/docs/9.1/static/ssl-tcp.html first. \n\nThis module will delete the links from `/var/lib/postgresql/${postgresql::server::version}/main/server.crt` to `/etc/ssl/certs/ssl-cert-snakeoil.pem` and `/var/lib/postgresql/${postgresql::server::version}/main/server.key` to `/etc/ssl/private/ssl-cert-snakeoil.key` on Debian systems. This certificates are self-signed (see http://en.wikipedia.org/wiki/Snake_oil_%28cryptography%29) and therefore not trusted. You have to provide your own trusted certificates for SSL.\n\n```\nclass { '::postgresql::server':\n  postgres_password          =\u003e 'iloverandompasswordsbutthiswilldo',\n}\n\nclass { '::postgres_hardening':\n  provider =\u003e 'puppetlabs/postgresql',\n  config_entry_ssl =\u003e 'on'\n}\n```\n\n## Local Testing\n\nFor local testing you can use vagrant and Virtualbox of VMWare to run tests locally. You will have to install Virtualbox and Vagrant on your system. See [Vagrant Downloads](http://downloads.vagrantup.com/) for a vagrant package suitable for your system. For all our tests we use `test-kitchen`. If you are not familiar with `test-kitchen` please have a look at [their guide](http://kitchen.ci/docs/getting-started).\n\nNext install test-kitchen:\n\n```bash\n# Install dependencies\ngem install bundler\nbundle install\n\n# Fetch tests\nbundle exec thor kitchen:fetch-remote-tests\n\n# Do lint checks\nbundle exec rake lint\n\n# Do spec checks\nbundle exec rake spec\n\n# fast test on one machine\nbundle exec kitchen test default-ubuntu-1204\n\n# test on Debian-based machines\nbundle exec kitchen test\n\n# for development\nbundle exec kitchen create default-ubuntu-1204\nbundle exec kitchen converge default-ubuntu-1204\n```\n\nFor more information see [test-kitchen](http://kitchen.ci/docs/getting-started)\n\n## Contributors + Kudos\n\n* Edmund Haselwanter [ehaselwanter](https://github.com/ehaselwanter)\n\n## License and Author\n\n* Author:: Deutsche Telekom AG\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n[1]: https://forge.puppetlabs.com/hardening/postgres_hardening\n[2]: http://travis-ci.org/hardening-io/puppet-postgres-hardening\n[3]: https://gitter.im/hardening-io/general\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev-sec%2Fpuppet-postgres-hardening","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdev-sec%2Fpuppet-postgres-hardening","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev-sec%2Fpuppet-postgres-hardening/lists"}