Re: add a MAC check for TRUNCATE - Mailing list pgsql-hackers

From Yuli Khodorkovskiy
Subject Re: add a MAC check for TRUNCATE
Date
Msg-id CAFL5wJf6K5mNjP4gjZGSS+iTwKBkwu-bSQ0H1Ph2SOXj3es=CA@mail.gmail.com
Whole thread Raw
In response to Re: add a MAC check for TRUNCATE  (Joe Conway <mail@joeconway.com>)
Responses Re: add a MAC check for TRUNCATE
List pgsql-hackers
On Fri, Sep 6, 2019 at 9:09 PM Joe Conway <mail@joeconway.com> wrote:
>
> On 9/6/19 8:07 PM, Tom Lane wrote:
> > Joe Conway <mail@joeconway.com> writes:
> >> On 9/6/19 2:18 PM, Tom Lane wrote:
> >>> sepgsql hasn't worked on RHEL6 in a long time, if ever; it requires
> >>> a newer version of libselinux than what ships in RHEL6.  So I'm not
> >>> concerned about that.  We do need to worry about RHEL7, and whatever
> >>> is the oldest version of Fedora that is running the sepgsql tests
> >>> in the buildfarm.
> >
> >> I could be wrong, but as far as I know rhinoceros is the only buildfarm
> >> animal running sepgsql tests.
> >
> > It seems reasonable to define RHEL7 as the oldest SELinux version we
> > still care about.  But it'd be a good idea for somebody to be running
> > a fairly bleeding-edge Fedora animal with sepgsql enabled, so we get
> > coverage of the other end of the scale.
>
>
> Yeah -- I was planning to eventually register a RHEL8 animal, but I
> should probably do one for Fedora as well. I'll bump the priority for
> that on my personal TODO.
>
> Joe
> --
> Crunchy Data - http://crunchydata.com
> PostgreSQL Support for Secure Enterprises
> Consulting, Training, & Open Source Development

Hello,

I have included an updated version of the sepgql patch. The
Truncate-Hook patch is unchanged from the last version.

The sepgsql changes now check if the db_table:{ truncate } permission
exists in the loaded SELinux policy before running the truncate
regression test. If the permission does not exist, then the new
regression test will not run.

Testing the TRUNCATE regression test can be done by manually adding
the permission with CIL:

```
sudo semodule -cE base
sudo sed -i -E 's/(class db_table.*?) \)/\1 truncate\)/' base.cil
sudo semodule -i base.cil
```

Thanks,

Yuli

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_regress restart cluster?
Next
From: Alexander Korotkov
Date:
Subject: Re: Bug in GiST paring heap comparator