Skip site navigation (1) Skip section navigation (2)

Re: Largeobject Access Controls (r2460)

From: Takahiro Itagaki <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>, Greg Smith <greg(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Largeobject Access Controls (r2460)
Date: 2009-12-11 05:17:31
Message-ID: 20091211141731.8C8A.52131E4D@oss.ntt.co.jp (view raw or flat)
Thread:
Lists: pgsql-hackers
KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com> wrote:

> Tom Lane wrote:
> > Takahiro Itagaki <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> writes:
> >>    <structname>pg_largeobject</structname> should not be readable by the
> >>    public, since the catalog contains data in large objects of all users.
> > 
> > This is going to be a problem, because it will break applications that
> > expect to be able to read pg_largeobject.  Like, say, pg_dump.
> 
> Is it a right behavior, even if we have permission checks on large objects?

Can we use column-level access control here?

   REVOKE ALL ON pg_largeobject FROM PUBLIC;
=> GRANT SELECT (loid) ON pg_largeobject TO PUBLIC;

We use "SELECT loid FROM pg_largeobject LIMIT 1" in pg_dump. We could
replace pg_largeobject_metadata instead if we try to fix only pg_dump,
but it's no wonder that any other user applications use such queries.
I think to allow reading loid is a balanced solution.

> If so, we can inject a hardwired rule to prevent to select pg_largeobject
> when lo_compat_privileges is turned off, instead of REVOKE ALL FROM PUBLIC.

Is it enough to run "GRANT SELECT ON pg_largeobject TO PUBLIC" ?

Regards,
---
Takahiro Itagaki
NTT Open Source Software Center



In response to

Responses

pgsql-hackers by date

Next:From: KaiGai KoheiDate: 2009-12-11 05:24:19
Subject: Re: Largeobject Access Controls (r2460)
Previous:From: Robert HaasDate: 2009-12-11 05:17:25
Subject: Re: Adding support for SE-Linux security

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group