From: Stephen Smalley <sds@tycho.nsa.gov>
To: Ted Toth <txtoth@gmail.com>
Cc: SELinux <selinux@tycho.nsa.gov>
Subject: Re: postgresql policy
Date: Thu, 28 May 2015 15:28:34 -0400 [thread overview]
Message-ID: <55676C62.2010309@tycho.nsa.gov> (raw)
In-Reply-To: <CAFPpqQGW=-pmSOfyppL1Q8uZLP=0ikpniQHRMUF-41dFXSdJiQ@mail.gmail.com>
On 05/28/2015 03:10 PM, Ted Toth wrote:
> Unfortunately it is the latter. Here's an example of what you can do:
>
> CREATE TABLE reports (
> id integer NOT NULL,
> report json,
> message_id integer NOT NULL,
> location geometry(Point),
> security_label text DEFAULT sepostgres_getpeercon()
> );
>
> CREATE POLICY
> check_report_insert_selinux ON reports FOR INSERT
> WITH CHECK (sepostgres_check_row_perm(reports.security_label,
> sepostgres_getpeercon(), 'insert'));
>
> CREATE POLICY
> check_report_delete_selinux ON reports FOR DELETE
> USING (sepostgres_check_row_perm(reports.security_label,
> sepostgres_getpeercon(), 'delete'));
>
> CREATE POLICY
> check_report_update_selinux ON reports FOR UPDATE
> USING (sepostgres_check_row_perm(reports.security_label,
> sepostgres_getpeercon(), 'update'))
> WITH CHECK (sepostgres_check_row_perm(reports.security_label,
> sepostgres_getpeercon(), 'update'));
>
> CREATE POLICY
> check_report_select_selinux ON reports FOR SELECT
> USING (sepostgres_check_row_perm(sepostgres_getpeercon(),
> reports.security_label, 'select'));
>
> I'm hoping that between DAC, postgresql DAC, selinux policy and RLS
> policy we can get something that's secure enough for our purposes.
Pardon my ignorance, but are the sepostgres_*() functions something you
have implemented or something in the existing sepgsl or postgres code?
next prev parent reply other threads:[~2015-05-28 19:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-28 16:52 postgresql policy Ted Toth
2015-05-28 18:54 ` Stephen Smalley
2015-05-28 19:09 ` Stephen Frost
2015-05-28 19:27 ` Stephen Smalley
2015-05-28 19:40 ` Ted Toth
2015-05-28 19:43 ` Stephen Frost
2015-05-28 19:50 ` Ted Toth
2015-05-28 19:10 ` Ted Toth
2015-05-28 19:28 ` Stephen Smalley [this message]
2015-05-28 19:34 ` Ted Toth
2015-05-28 19:41 ` Stephen Frost
2015-05-28 19:43 ` Ted Toth
2015-05-28 19:49 ` Stephen Frost
2015-05-29 14:48 ` Christopher J. PeBenito
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55676C62.2010309@tycho.nsa.gov \
--to=sds@tycho.nsa.gov \
--cc=selinux@tycho.nsa.gov \
--cc=txtoth@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.