Re: pgaudit - an auditing extension for PostgreSQL

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Neil Tiffin <neilt(at)neiltiffin(dot)com>, Yeb Havinga <yebhavinga(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Abhijit Menon-Sen <ams(at)2ndquadrant(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, MauMau <maumau307(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <bruce(at)momjian(dot)us>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Ian Barwick <ian(at)2ndquadrant(dot)com>
Subject: Re: pgaudit - an auditing extension for PostgreSQL
Date: 2015-02-17 19:04:06
Message-ID: 54E390A6.1050002@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2/17/15 12:50 PM, Stephen Frost wrote:
> Jim,
>
> * Jim Nasby (Jim(dot)Nasby(at)BlueTreble(dot)com) wrote:
>> We may need to bite the bullet and allow changing the user that the
>> postgres process runs under so it doesn't match who owns the files.
>> Maybe there's a way to allow that other than having the process
>> start as root.
>
> That's an interesting thought but it doesn't seem too likely to work out
> for us. The process still has to be able to read and write the files,
> create new files in the PGDATA directories, etc.

Right, but if we don't allow things like loading C functions from
wherever you please then it's a lot less likely that a DB SU could
disable auditing.

>> Or maybe there's some other way we could restrict what a DB
>> superuser can do in the shell.
>
> This could be done with SELinux and similar tools, but at the end of the
> day the answer, in my view really, is to have fewer superusers and for
> those superusers to be understood to have OS-level shell access. We
> don't want to deal with all of the security implications of trying to
> provide a "trusted" superuser when that user can create functions in
> untrusted languages, modify the catalog directly, etc, it really just
> doesn't make sense.

The part I don't like about that is then you still have this highly
trusted account that can also run SQL. The big issue with that is that
no OS-level auditing is going to catch what happens inside the database
itself (well, I guess short of a key logger...)

What I'd prefer to see is a way to decouple the OS account from any DB
account. Clearly that doesn't protect us from the OS user doing
something bad, but at least then there's no way for them to just
silently run SQL commands.
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2015-02-17 19:10:43 Re: pgaudit - an auditing extension for PostgreSQL
Previous Message Stephen Frost 2015-02-17 18:50:59 Re: pgaudit - an auditing extension for PostgreSQL