pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jonathan S. Katz <jkatz@postgresql.org>
To: Pg Docs <pgsql-docs@lists.postgresql.org>
Subject: Additional "Creating a Cluster" Guidance for Windows Users
Date: Sun, 12 May 2019 12:28:47 -0400
Message-ID: <5e25223c-700d-3559-a7af-cf15941b093d@postgresql.org> (raw)

Hi,

Per the last update release[1] I was going through some of our
documentation around creating clusters and noticed that we may want to
provide a bit more guidance around creating clusters on Windows:

https://www.postgresql.org/docs/current/creating-cluster.html

i.e.:

"Because the data directory contains all the data stored in the
database, it is essential that it be secured from unauthorized access.
initdb therefore revokes access permissions from everyone but the
PostgreSQL user, and optionally, group."

However, this does not explicitly state that initdb performs this
revocation only for *non-Windows systems* -- to lock down the data
directory after an initdb run on a Windows system, it requires manual
intervention.

I've attached a patch that explicitly states the above. I wrapped the
guidance in a "Warning" box given the data directory is exposed if not
locked down properly.

I would also recommend this is backpatched to 9.4. If in agreement on
the above methodology + wording, I can generate the backpatches.

Thanks,

Jonathan

[1] https://www.postgresql.org/about/news/1939/

Attachments:

initdb-win-v1.patch (text/plain, 1.4K) download diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml index e784268512..2ca49d2482 100644 --- a/doc/src/sgml/runtime.sgml +++ b/doc/src/sgml/runtime.sgml @@ -135,14 +135,23 @@ postgres$ <userinput>initdb -D /usr/local/pgsql/data</userinput> <para> Because the data directory contains all the data stored in the database, it is essential that it be secured from unauthorized - access. <command>initdb</command> therefore revokes access - permissions from everyone but the + access. On all operating systems other than Windows, + <command>initdb</command> revokes access permissions from everyone but the <productname>PostgreSQL</productname> user, and optionally, group. Group access, when enabled, is read-only. This allows an unprivileged user in the same group as the cluster owner to take a backup of the cluster data or perform other operations that only require read access. </para> + <warning> + <para> + If you are running PostgreSQL on Windows and create your cluster using + <command>initdb</command>, you will need to set the permissions on the data + directory manually. You should revoke all user access to the data directory + except for the <productname>PostgreSQL</productname> user. + </para> + </warning> + <para> Note that enabling or disabling group access on an existing cluster requires the cluster to be shut down and the appropriate mode to be set on all
signature.asc (application/pgp-signature, 832B) download

Message-ID: <5e25223c-700d-3559-a7af-cf15941b093d@postgresql.org>
Permalink:  ../5e25223c-700d-3559-a7af-cf15941b093d@postgresql.org/
Also on:    postgresql.org/message-id/5e25223c-700d-3559-a7af-cf15941b093d@postgresql.org

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: jkatz@postgresql.org, pgsql-docs@lists.postgresql.org
  Subject: Re: Additional "Creating a Cluster" Guidance for Windows Users
  In-Reply-To: <5e25223c-700d-3559-a7af-cf15941b093d@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox