pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <scott.marlowe@gmail.com>
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: pgsql-admin@postgresql.org, Josh <josh@saucetel.com>
Subject: Re: Securing a remotely accessible PostgreSQL server
Date: Wed, 22 Dec 2010 15:38:49 -0700
Message-ID: <AANLkTimGJ9fLSfEhNu26eoMjj+7_p94d2s0XOO-Lm2Yd@mail.gmail.com> (raw)
In-Reply-To: <4D1227A30200002500038A0C@gw.wicourts.gov>
References: <4D122D10.7090805@saucetel.com>
	<4D1227A30200002500038A0C@gw.wicourts.gov>

On Wed, Dec 22, 2010 at 3:30 PM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> Josh <josh@saucetel.com> wrote:
>
>> I am looking for suggestions on how best to secure a server that
>> is accessible via the internet. Even account creation for the
>> database is open to the world. Does anybody have any extra changes
>> they would make to postgresql.conf or OS changes they would
>> suggest? Perhaps some default permissions that would be best
>> revoked?
>>
>> The system setup is currently a Linux box running PostgreSQL 8.4
>> My pg_hba.conf already limits remote connections to one database
>> and one particular role.
>
> The role can create databases but not access them?  Odd.
>
> In no particular order, these come to mind:
>
> * Only allow SSL connections.
>
> * Use a non-standard port, to obscure what the service is.
>
> * Put the machine behind a firewall which only allows packets
> through to the desired port.
>
> * Make sure you *don't* run the database service as root.
>
> * Make sure that the user which does run the database server doesn't
> have access to anything more than it absolutely needs, directly or
> through group membership.  (In particular, sudo rights should be
> carefully limited or non-existent.)

In fact, I'd chroot / jail the postgres server in this instance.  If
they get in, you just copy back over the chrooted directory and you're
up and running in minutes.



view thread (4+ messages)  latest in thread

Message-ID: <AANLkTimGJ9fLSfEhNu26eoMjj+7_p94d2s0XOO-Lm2Yd@mail.gmail.com>
Permalink:  ../AANLkTimGJ9fLSfEhNu26eoMjj+7_p94d2s0XOO-Lm2Yd@mail.gmail.com/
Also on:    postgresql.org/message-id/AANLkTimGJ9fLSfEhNu26eoMjj+7_p94d2s0XOO-Lm2Yd@mail.gmail.com

 · 

reply

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-admin@postgresql.org
  Cc: scott.marlowe@gmail.com, Kevin.Grittner@wicourts.gov, josh@saucetel.com
  Subject: Re: Securing a remotely accessible PostgreSQL server
  In-Reply-To: <AANLkTimGJ9fLSfEhNu26eoMjj+7_p94d2s0XOO-Lm2Yd@mail.gmail.com>
  References: <4D122D10.7090805@saucetel.com> <4D1227A30200002500038A0C@gw.wicourts.gov> <AANLkTimGJ9fLSfEhNu26eoMjj+7_p94d2s0XOO-Lm2Yd@mail.gmail.com>

* 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