Unix Technical Forum

BUG #1963: SSL certificate permission check is too strict

This is a discussion on BUG #1963: SSL certificate permission check is too strict within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 1963 Logged by: Martin Pitt Email address: mpitt@debian.org PostgreSQL version: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 10:19 AM
Martin Pitt
 
Posts: n/a
Default BUG #1963: SSL certificate permission check is too strict


The following bug has been logged online:

Bug reference: 1963
Logged by: Martin Pitt
Email address: mpitt@debian.org
PostgreSQL version: 8.1beta3
Operating system: Debian
Description: SSL certificate permission check is too strict
Details:

Currently the postmaster requires the private SSL key file to have the same
owner as the postmaster, and no permissions for group and others. However,
this is too strict to sensibly use the certificate with ACLs, which permits
other server processes to share it.

In Debian I applied a patch which relaxes the check a bit: in addition to
the currently allowed permissions, the file might be:
- owned by root
- group-readable if the file is in group root or the postmaster group.

Since this likely affects non-Debian server installations as well, do you
consider adopting this?

Thanks!

Martin

Original Debian bug report:
http://bugs.debian.org/327901

Debian patch against 8.1beta3:
http://people.debian.org/~mpitt/09-r...rmscheck.patch

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 10:19 AM
Tom Lane
 
Posts: n/a
Default Re: BUG #1963: SSL certificate permission check is too strict

"Martin Pitt" <mpitt@debian.org> writes:
> Currently the postmaster requires the private SSL key file to have the same
> owner as the postmaster, and no permissions for group and others. However,
> this is too strict to sensibly use the certificate with ACLs, which permits
> other server processes to share it.


> In Debian I applied a patch which relaxes the check a bit: in addition to
> the currently allowed permissions, the file might be:
> - owned by root
> - group-readable if the file is in group root or the postmaster group.


This was proposed and rejected before --- it's not clear why it's a good
idea to share a private key file with other servers, and even less clear
why it'd be a good idea to have such a file be group-readable by a large
group.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 10:19 AM
Martin Pitt
 
Posts: n/a
Default Re: BUG #1963: SSL certificate permission check is too strict

Hi Tom!

Tom Lane [2005-10-14 11:38 -0400]:
> "Martin Pitt" <mpitt@debian.org> writes:
> > Currently the postmaster requires the private SSL key file to have the same
> > owner as the postmaster, and no permissions for group and others. However,
> > this is too strict to sensibly use the certificate with ACLs, which permits
> > other server processes to share it.

>
> > In Debian I applied a patch which relaxes the check a bit: in addition to
> > the currently allowed permissions, the file might be:
> > - owned by root
> > - group-readable if the file is in group root or the postmaster group.

>
> This was proposed and rejected before --- it's not clear why it's a good
> idea to share a private key file with other servers,


On my own boxes I usually create one certificate per box, not per
server. This keeps certificate management easy and avoids redundancy -
why should I create separate certifictates for each server I run? I
want to validate the identity computers with the certificates, nothing
more. This seems to be a common practice.

> and even less clear why it'd be a good idea to have such a file be
> group-readable by a large group.


The group does not need to be big; for sharing certificates, you
basically have two options:

- Use ACLs; this is a clean way, but not supported by all file
systems, and even by less backup systems. It does not require
groups, though.

- Create a "sslkey" group and add all servers to it that need read
permission to the certificate.

AIUI this check should prevent admins from accidentially shooting
themselves in the foot, not make it totally impossible to configure
stuff as the admin wants. Or is that wrong?

At least the certificate could be permitted to be owned/in group root.
I cannot see how this should weaken the certificate's security.

Thanks and have a nice weekend!

Martin
--
Martin Pitt http://www.piware.de
Ubuntu Developer http://www.ubuntu.com
Debian Developer http://www.debian.org

In a world without walls and fences, who needs Windows and Gates?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDT+c/DecnbV4Fd/IRArwkAKCz3HPFetBtr5+UAb/DN4Ph3n5aOgCfW4yq
ioZtWHFuYHK4alI10wGF9B4=
=SAY2
-----END PGP SIGNATURE-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-10-2008, 10:20 AM
Tom Lane
 
Posts: n/a
Default Re: BUG #1963: SSL certificate permission check is too strict

Martin Pitt <mpitt@debian.org> writes:
> At least the certificate could be permitted to be owned/in group root.
> I cannot see how this should weaken the certificate's security.


Postgres doesn't run as root, hence could not use such a certificate
unless it was world-readable.

Or should I infer from this that you've also patched out that safety
check?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-10-2008, 10:20 AM
Martin Pitt
 
Posts: n/a
Default Re: BUG #1963: SSL certificate permission check is too strict

Hi Tom!

Tom Lane [2005-10-16 0:41 -0400]:
> Martin Pitt <mpitt@debian.org> writes:
> > At least the certificate could be permitted to be owned/in group root.
> > I cannot see how this should weaken the certificate's security.

>
> Postgres doesn't run as root, hence could not use such a certificate
> unless it was world-readable.


Please see my original mail. If you use ACLs, postgres can very well
be able to read the certificate.

The point was that a key's security is not weakened if it is owned by
root instead of "postgres" - to the contrary. So I don't see the point
of the check that actively prohibits a key being owned by root.

Martin

--
Martin Pitt http://www.piware.de
Ubuntu Developer http://www.ubuntulinux.org
Debian Developer http://www.debian.org

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDUiEwDecnbV4Fd/IRApjCAKC3Tyag+m7hy5Y0iAPz5i0HBgNeRwCgkrnW
B34qHzAWJlkC2eSsM3pJnOo=
=/TJw
-----END PGP SIGNATURE-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:46 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com