Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 9EBC7632588 for ; Mon, 5 Apr 2010 17:30:23 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 56441-03 for ; Mon, 5 Apr 2010 20:30:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-bw0-f216.google.com (mail-bw0-f216.google.com [209.85.218.216]) by mail.postgresql.org (Postfix) with ESMTP id 8B6FA6324CD for ; Mon, 5 Apr 2010 17:30:12 -0300 (ADT) Received: by bwz8 with SMTP id 8so3259528bwz.3 for ; Mon, 05 Apr 2010 13:30:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=6fItRJ81gd6F2B0JF/pAv8sWfuophweiHKinrb1qIF0=; b=P4RNAllkevfs+UNsvlo1jeoqY2cFQqW4WTbJyksakCDha/nxO6GxfnCfWN8IB8Drsa 8qWjdsLe3JzGN6Ei1S9MP+LI/u6WOrUj9+Vn6xBdm2CeL1wprACLFFnAhAoeeLvfTv9F 5NUtqvBfz78cKS3sqyYLpYwJP80sDJIJnni1E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=olNKqNEQOqZayB7oe9IWlbii+AFkzjFANM5pRI+GP1peSMurPz0LRVzX0wGU3ugHe3 bBcnqH+iw0UBCv1c53qRUjTPE2/bY5zix26cGBKbhV00ofV5dHl9XYkyfWJQyy0SFlQ/ v1TY89pzKy5pJewrqc6O4TqsxtIi1/OHbgpWY= MIME-Version: 1.0 Received: by 10.204.101.6 with HTTP; Mon, 5 Apr 2010 13:30:10 -0700 (PDT) In-Reply-To: <4BB774D4.3070306@joeconway.com> References: <4BB774D4.3070306@joeconway.com> Date: Mon, 5 Apr 2010 23:30:10 +0300 Received: by 10.204.7.201 with SMTP id e9mr7471284bke.122.1270499410684; Mon, 05 Apr 2010 13:30:10 -0700 (PDT) Message-ID: Subject: Re: Database level encryption From: Timothy Madden To: Joe Conway Cc: pgsql-admin@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.716 tagged_above=-10 required=5 tests=AWL=-0.717, BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 201004/28 X-Sequence-Number: 34122 My scenario is how to protect the database if the machine is stolen (it is a mini-laptop), and I would like to encrypt the entire database, that is all columns of all tables, and if possible everything else found in the database. I would like all searching and sorting functions, just like with a normal database (that is, transparent encryption for the application level). The password will be entered by a human in order to start the application. The application exits after three unsuccessful attempts, but nothing prevents the user to start the application again; the number of failures is not counted. However if the database could count that I would not mind. I want a single password for data access to the entire database, there is only one database user involved anyway. I do not see the careful analysis required that you write about, I would say I am asking for SGBD support for database-level encryption. Thank you, Timothy Madden On Sat, Apr 3, 2010 at 8:03 PM, Joe Conway wrote: > On 04/03/2010 06:35 AM, Timothy Madden wrote: >> I can only see how PostgreSQL encrypts the password or the connection >> in the documentation, and for the database I can see application-level >> encryption with pgcrypto (and filesystem level encryption), How could >> I get database level encryption in PostgreSQL ? > > This is an extremely broad question, and you have barely begun to > provide enough information to answer it. For starters: > > 1. What is your threat scenario? > =A0 a) The physical machine is stolen > =A0 b) A database dump is stolen > =A0 c) Someone roots your system > =A0 d) Someone compromises your application, via SQL injection, etc > > 2. What data needs to be encrypted? > =A0 a) All columns of all tables > =A0 b) Selected columns of selected tables > > 3. Do you need to be able to search or sort on any of the encrypted > =A0 columns? > > 4. Is your password stored somewhere on the hardware, or is it entered > =A0 by a human every time the application starts? > > 5. Do you want a single password for all data access, or is the > =A0 encryption by user or some other segmentation? > > 6. Is brute-force cracking of the password a concern? Will your > =A0 application shut down repeated failed attempts? > > There is no magic bullet. This requires careful thought, analysis, and > trade-offs. > > Joe > >