Re: add a MAC check for TRUNCATE

Yuli Khodorkovskiy <yuli.khodorkovskiy@crunchydata.com>

From: Yuli Khodorkovskiy <yuli.khodorkovskiy@crunchydata.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Stephen Frost <sfrost@snowman.net>, Kohei KaiGai <kaigai@heterodb.com>, pgsql-hackers@lists.postgresql.org
Date: 2019-09-06T15:52:32Z
Lists: pgsql-hackers
On Fri, Sep 6, 2019 at 11:47 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Yuli Khodorkovskiy <yuli.khodorkovskiy@crunchydata.com> writes:
> > Ah, now I remember why I didn't add regressions to the original patch.
> > As stated at the top of the thread, the "db_table: { truncate }"
> > permission does not currently exist in refpolicy. A workaround would
> > be to add the policy with CIL, but that adds unneeded complexity to
> > the regressions. I think the correct path forward is:
>
> > 1) Get the sepgsql changes in without policy/regressions
> > 2) Send a patch to refpolicy for the new permission
> > 3) Once Redhat updates the selinux-policy-targeted RPM to include the
> > new permissions, I will send an update to the sepgsql regressions and
> > policy.
>
> That's going to be a problem.  I do not think it will be acceptable
> to commit tests that fail on less-than-bleeding-edge SELinux.
>
>                         regards, tom lane

The tests pass as long as deny_unknown is set to 0, which is the
default on fedora 30.



Commits

  1. Update sepgsql to add mandatory access control for TRUNCATE

  2. Add object TRUNCATE hook

  3. postgres_fdw: Fix error message for PREPARE TRANSACTION.