X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id DAD7C8B9B8F for ; Tue, 22 Feb 2005 14:32:35 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 81493-06 for ; Tue, 22 Feb 2005 14:32:30 +0000 (GMT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 88DDA8B9B16 for ; Tue, 22 Feb 2005 14:32:33 +0000 (GMT) Received: (qmail 28292 invoked by uid 500); 22 Feb 2005 14:47:51 -0000 Date: Tue, 22 Feb 2005 08:47:51 -0600 From: Bruno Wolff III To: Dick Davies Cc: PostgreSQL Admin Subject: Re: pg_hba.conf Message-ID: <20050222144751.GD22550@wolff.to> Mail-Followup-To: Dick Davies , PostgreSQL Admin References: <20050222115641.GR66519@eris.tenfour> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050222115641.GR66519@eris.tenfour> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/218 X-Sequence-Number: 16386 On Tue, Feb 22, 2005 at 11:56:41 +0000, Dick Davies wrote: > > Just needed clarification on how pg_hba.conf operates. > Does a specific host take precedence over a more general network setting? No. The first line that matches the triple connection type, database name and user name is the one that is used. Typically you can get what you want by using the narrower rule first. > The local socket is only accessible to a certain group, but I don't want > the overhead of SSL for loopback connections. If I connect to the server > from the local machine, the connections show up as (eg) 10.2.3.4, the NIC > ip. > > I was hoping the more specific 'host' entry would take entry over the universal > 'hostssl' entry, but it does'nt seem to... The host entry is the one that applies. But the host entry will allow either ssl or nonssl, so it doesn't do what you want without cooperation from the connecting client. You can use hostnossl to match without allowing ssl. You will also want to use a hostssl line with 'reject' authentication to keep the later rule from matching. I am not sure if all of the normal clients will fallback after trying ssl to not using ssl. That should be pretty easy to test though. > > I have this: > > root@eris:postgresql80-server$ cat /opt/pgsql/data/pg_hba.conf > # TYPE DATABASE USER IP-ADDRESS METHOD > local all all trust > host all all 10.2.3.4/32 md5 > hostssl all all 0.0.0.0/0 md5 > > Is there a way to say 'all IP traffic should be encrypted except one IP' that > I'm missing? > > I know I could just add the local process into the dba group, but the app doesn't > reconnect if the socket goes away on a db restart, so that's not ideal... > > > -- > 'That question was less stupid; though you asked it in a profoundly stupid way.' > -- Prof. Farnsworth > Rasputin :: Jack of All Trades - Master of Nuns > > ---------------------------(end of broadcast)--------------------------- > TIP 7: don't forget to increase your free space map settings