From: Joe Conway <mail@joeconway.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Update sepgsql to add mandatory access control for TRUNCATE
Date: Sat, 23 Nov 2019 15:47:46 +0000
Message-ID: <E1iYXdS-0000ik-Kv@gemulon.postgresql.org> (raw)
Update sepgsql to add mandatory access control for TRUNCATE
Use SELinux "db_table: { truncate }" to check if permission is granted to
TRUNCATE. Update example SELinux policy to grant needed permission for
TRUNCATE. Add new regression test to demonstrate a positive and negative
cases. Test will only be run if the loaded SELinux policy has the
"db_table: { truncate }" permission. Makes use of recent commit which added
object TRUNCATE hook. Patch by Yuli Khodorkovskiy with minor
editorialization by me. Not back-patched because the object TRUNCATE hook
was not.
Author: Yuli Khodorkovskiy
Reviewed-by: Joe Conway
Discussion: https://postgr.es/m/CAFL5wJcomybj1Xdw7qWmPJRpGuFukKgNrDb6uVBaCMgYS9dkaA%40mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/4f66c93f61439b4db866b21cc1ecd5bf815564ef
Modified Files
--------------
contrib/sepgsql/expected/truncate.out | 46 +++++++++++++++++++++++++++++++++++
contrib/sepgsql/hooks.c | 14 +++++++++++
contrib/sepgsql/relation.c | 40 ++++++++++++++++++++++++++++++
contrib/sepgsql/selinux.c | 3 +++
contrib/sepgsql/sepgsql-regtest.te | 8 ++++++
contrib/sepgsql/sepgsql.h | 2 ++
contrib/sepgsql/sql/truncate.sql | 24 ++++++++++++++++++
contrib/sepgsql/test_sepgsql | 16 +++++++++++-
8 files changed, 152 insertions(+), 1 deletion(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: mail@joeconway.com
Subject: Re: pgsql: Update sepgsql to add mandatory access control for TRUNCATE
In-Reply-To: <E1iYXdS-0000ik-Kv@gemulon.postgresql.org>
References: <E1iYXdS-0000ik-Kv@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox