Re: proper pg_hba config to require ssl from non-local/private ips

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Frank Gard <frank(dot)von(dot)postgresql(dot)org(at)familie-gard(dot)de>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: proper pg_hba config to require ssl from non-local/private ips
Date: 2022-10-19 16:36:55
Message-ID: CAMkU=1yxyL4-T87egrxaLHkGRCKAeAzcF4NP31VH8awj-QE1fQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Wed, Oct 19, 2022 at 12:26 PM Frank Gard <
frank(dot)von(dot)postgresql(dot)org(at)familie-gard(dot)de> wrote:

> Hi Jeff,
> Am 19.10.22 um 17:47 schrieb Jeff Janes:
>
> On Wed, Oct 19, 2022 at 8:50 AM Matthew Lenz <mlenz(at)nocturnal(dot)org> wrote:
>
>> This is what I've got currently but it's still allowing non-ssl
>> connections from remote (non-local/private) hosts. Any thoughts?
>>
>
> Did you reload the server configurations after changing the file? What is
> the address of that non-local host, as seen by the server? (you can check
> the first with `select * from pg_hba_file_rules`,
>
> unfortunately that's not true, at least up to Pg v14 (I don't know if
> they've changed this IMHO "unexpected" behaviour in the meantime). The
> pg_hba_file_rules seems to be just an SQL frontend to the hba-file's
> content and does not(!) reflect the currently active configuration. So you
> can see your changes before the are activated, e.g. by calling
> pg_reload_conf().
>

Yes, thanks for the correction. I'd mistaken using it for checking that
the file you changed was the correct one for use by the connected server
(people often edit the wrong pg_hba.conf file), for checking that it had
actually been put into use via a reload, which as you note it doesn't do.

Cheers,

Jeff

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Ribe 2022-10-19 16:41:41 Re: proper pg_hba config to require ssl from non-local/private ips
Previous Message Matthew Lenz 2022-10-19 16:29:26 Re: proper pg_hba config to require ssl from non-local/private ips