public inbox for [email protected]
help / color / mirror / Atom feedRe: Bypassing Directory Ownership Check in PostgreSQL 16.6 with Secure z/OS NFS (AT-TLS)
3+ messages / 2 participants
[nested] [flat]
* Re: Bypassing Directory Ownership Check in PostgreSQL 16.6 with Secure z/OS NFS (AT-TLS)
@ 2025-07-14 13:02 Amol Inamdar <[email protected]>
2025-07-14 14:41 ` Re: Bypassing Directory Ownership Check in PostgreSQL 16.6 with Secure z/OS NFS (AT-TLS) Laurenz Albe <[email protected]>
0 siblings, 1 reply; 3+ messages in thread
From: Amol Inamdar @ 2025-07-14 13:02 UTC (permalink / raw)
To: Laurenz Albe <[email protected]>; +Cc: [email protected]
Thanks Laurenz,
The data directory can either be created by "initdb", in which case
the mount point must allow the PostgreSQL user to create a directory.
You could set the group of the mount point to the group of the
PostgreSQL user and use permissions 1770, which should be perfectly safe.
This exactly is the problem we are facing, to give you a summary,
our NFS server is enabled with AT-TLS authentication
and we are accessing the server via a proxy server (Haproxy).
This acts as our NFS client and it is configured with the
required client certificates.
The outcome of above configuration is that any directory created
in the NFS mount is always owned by the user in the certificates
and if that user isn't present in the proxy container it is marked
as nobody:nogroup, we tried various things like
created the user similar to postgres user so that the users ids match but
always ended up giving error “data directory “/var/lib” has wrong ownership
Hence, we thought of skipping this check (Directory owner and postgres user
validation) and
wanted to understand the implication of the same.
Thanks,
Amol,
On Mon, Jul 14, 2025 at 6:14 PM Laurenz Albe <[email protected]>
wrote:
> On Mon, 2025-07-14 at 17:59 +0530, Amol Inamdar wrote:
> > If I am not mistaken, below is my understanding of your suggestion.
> >
> > Suppose that My mount point on the NFS server is say
> /nfs-mount/postgres/
> > and you are suggesting to have a data directory as say
> /nfs-mount/postgres/db or something like that ?
> > and assign this value to the PGDATA ?
> >
> > If that is the case, then when and who should be creating the directory
> DB ?
> >
> > Please correct me if I am wrong about the understanding.
>
> You understood me perfectly well.
>
> The data directory can either be created by "initdb", in which case
> the mount point must allow the PostgreSQL user to create a directory.
> You could set the group of the mount point to the group of the
> PostgreSQL user and use permissions 1770, which should be perfectly safe.
>
> Alternatively, the root user could create the data directory with the
> correct ownership and permissions prior to running "initdb".
>
> Yours,
> Laurenz Albe
>
--
-regards
Amol
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Bypassing Directory Ownership Check in PostgreSQL 16.6 with Secure z/OS NFS (AT-TLS)
2025-07-14 13:02 Re: Bypassing Directory Ownership Check in PostgreSQL 16.6 with Secure z/OS NFS (AT-TLS) Amol Inamdar <[email protected]>
@ 2025-07-14 14:41 ` Laurenz Albe <[email protected]>
2025-07-15 11:35 ` Re: Bypassing Directory Ownership Check in PostgreSQL 16.6 with Secure z/OS NFS (AT-TLS) Amol Inamdar <[email protected]>
0 siblings, 1 reply; 3+ messages in thread
From: Laurenz Albe @ 2025-07-14 14:41 UTC (permalink / raw)
To: Amol Inamdar <[email protected]>; +Cc: [email protected]
On Mon, 2025-07-14 at 18:32 +0530, Amol Inamdar wrote:
> > The data directory can either be created by "initdb", in which case
> > the mount point must allow the PostgreSQL user to create a directory.
> > You could set the group of the mount point to the group of the
> > PostgreSQL user and use permissions 1770, which should be perfectly safe.
>
> This exactly is the problem we are facing, to give you a summary,
> our NFS server is enabled with AT-TLS authentication
> and we are accessing the server via a proxy server (Haproxy).
> This acts as our NFS client and it is configured with the
> required client certificates.
>
> The outcome of above configuration is that any directory created
> in the NFS mount is always owned by the user in the certificates
> and if that user isn't present in the proxy container it is marked
> as nobody:nogroup, we tried various things like
> created the user similar to postgres user so that the users ids match but
> always ended up giving error “data directory “/var/lib” has wrong ownership
>
> Hence, we thought of skipping this check (Directory owner and postgres user validation) and
> wanted to understand the implication of the same.
No; don't.
Simply mount the directory once, create a subdirectory with the
appropriate ownership and permissions, and there you go.
Problem solved.
Yours,
Laurenz Albe
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Bypassing Directory Ownership Check in PostgreSQL 16.6 with Secure z/OS NFS (AT-TLS)
2025-07-14 13:02 Re: Bypassing Directory Ownership Check in PostgreSQL 16.6 with Secure z/OS NFS (AT-TLS) Amol Inamdar <[email protected]>
2025-07-14 14:41 ` Re: Bypassing Directory Ownership Check in PostgreSQL 16.6 with Secure z/OS NFS (AT-TLS) Laurenz Albe <[email protected]>
@ 2025-07-15 11:35 ` Amol Inamdar <[email protected]>
0 siblings, 0 replies; 3+ messages in thread
From: Amol Inamdar @ 2025-07-15 11:35 UTC (permalink / raw)
To: Laurenz Albe <[email protected]>; +Cc: [email protected]
Thanks Laurenz.
On Mon, Jul 14, 2025 at 8:11 PM Laurenz Albe <[email protected]>
wrote:
> On Mon, 2025-07-14 at 18:32 +0530, Amol Inamdar wrote:
> > > The data directory can either be created by "initdb", in which case
> > > the mount point must allow the PostgreSQL user to create a directory.
> > > You could set the group of the mount point to the group of the
> > > PostgreSQL user and use permissions 1770, which should be perfectly
> safe.
> >
> > This exactly is the problem we are facing, to give you a summary,
> > our NFS server is enabled with AT-TLS authentication
> > and we are accessing the server via a proxy server (Haproxy).
> > This acts as our NFS client and it is configured with the
> > required client certificates.
> >
> > The outcome of above configuration is that any directory created
> > in the NFS mount is always owned by the user in the certificates
> > and if that user isn't present in the proxy container it is marked
> > as nobody:nogroup, we tried various things like
> > created the user similar to postgres user so that the users ids match
> but
> > always ended up giving error “data directory “/var/lib” has wrong
> ownership
> >
> > Hence, we thought of skipping this check (Directory owner and postgres
> user validation) and
> > wanted to understand the implication of the same.
>
> No; don't.
>
> Simply mount the directory once, create a subdirectory with the
> appropriate ownership and permissions, and there you go.
> Problem solved.
>
> Yours,
> Laurenz Albe
>
--
-regards
Amol
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2025-07-15 11:35 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-07-14 13:02 Re: Bypassing Directory Ownership Check in PostgreSQL 16.6 with Secure z/OS NFS (AT-TLS) Amol Inamdar <[email protected]>
2025-07-14 14:41 ` Laurenz Albe <[email protected]>
2025-07-15 11:35 ` Amol Inamdar <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox