Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kDnw6-0007lF-RF for pgsql-general@arkaria.postgresql.org; Thu, 03 Sep 2020 12:01:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kDnw3-0005QN-2I for pgsql-general@arkaria.postgresql.org; Thu, 03 Sep 2020 12:01:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kDnw2-0005QF-AC for pgsql-general@lists.postgresql.org; Thu, 03 Sep 2020 12:01:46 +0000 Received: from sonic301-31.consmr.mail.ne1.yahoo.com ([66.163.184.200]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kDnvx-0006Lv-Gd for pgsql-general@postgresql.org; Thu, 03 Sep 2020 12:01:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verizon.net; s=a2048; t=1599134499; bh=6RpXGUP83096v2gKiYsFhisQ0eCpwCyhBSzZwVj7h3w=; h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject; b=GBxUQWTEVHBsY7FDrXlZ6RG8m+XstauGZtEQXOEX1kMcaafp0hS25CdzHxKcKTLxh1pmmWZ7K+iaqC8L1L6um+/9nYhBqwbeBsedUe2avsip+c+M2iLArHb90zOHEwgVJuwKTf/fG5FMpaScd8ZxyS3xnL/cDHgffL34GJxkOyvwTkgJroej7++ot+qdl8vwjiPnAGkt494q33+bLJwaqTsF7N/+iNMSnWXFICaEwVrN5plPfyv1RycVf/TqI1pQ2PGB3Ys+trG3QlFugN9/IzxTESV0walsKT+CO2D8TgpiX2NZ23a8diL4iSxe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8_7YNpyJIHZJA8turyPF5C.GO2kD n1gJQpA.WmynteSPqRLZpK4ZcP.6_tLMlHIT1rsOU.bpcvPl3WSIIEQmNglkvcuAC1vqQAw4Seoh oaLrr_JLfJwB0U_Y3AIYRny84yzzfxhiJBEhpbsMO6jtlieyLloYqX2ibVkOKe9C20Dk4Wq_qisa ooIHElzt2FbapJpNPmD_BiL_SvQYAm7q0XEMwNxZzWojZUwv9f7uWS2VzjR6E74J.vyyuPEc18tx AclFGr7aDvp4XNqoyd15mBVOS.b6SzOAImssGJo26wfCMgH5xr_oskc8xGH7P98AUYIpiFFM_Qv1 j.OxIx2ytf_arMmuIOm3z0POhFDp8TnkqInoM_voZGwIrRZX2k5Aw_SyvX.niMQHRyScUyN9Ko4V A3fGyvnZyKoEqnDTWYtMQozxjsfxU8xnMdLLWkDHetBZX4iE5klHGoWRfIWI0AA-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.ne1.yahoo.com with HTTP; Thu, 3 Sep 2020 12:01:39 +0000 Date: Thu, 3 Sep 2020 12:01:34 +0000 (UTC) From: Susan Joseph Reply-To: Susan Joseph To: "wim.bertels@ucll.be" , "peter.eisentraut@2ndquadrant.com" , "pgsql-general@postgresql.org" Message-ID: <420332079.2644491.1599134494072@mail.yahoo.com> In-Reply-To: <9A729A27-75BE-4EB3-A484-2736C162692C@ucll.be> References: <976526972.6642745.1598278223530.ref@mail.yahoo.com> <976526972.6642745.1598278223530@mail.yahoo.com> <347470685.8377276.1598525839866@mail.yahoo.com> <845624022.192753.1599130476553@mail.yahoo.com> <9A729A27-75BE-4EB3-A484-2736C162692C@ucll.be> Subject: Re: SSL between Primary and Seconday PostgreSQL DBs MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2644490_1233404042.1599134494069" X-Mailer: WebService/1.1.16565 aolwebmail Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0 Content-Length: 20518 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_2644490_1233404042.1599134494069 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Unfortunately I am not allowed to use wireshark in my environment.=C2=A0 Go= od idea though =20 =20 Susan Joseph sandajoseph@verizon.net =20 =20 -----Original Message----- From: Wim Bertels To: Susan Joseph ; peter.eisentraut@2ndquadrant.co= m ; pgsql-general@postgresql.org Sent: Thu, Sep 3, 2020 7:44 am Subject: Re: SSL between Primary and Seconday PostgreSQL DBs First thougt: A general solution that you could use is wireshark. For example : Search for wireshark ssl traffic Susan Joseph schreef op September 3, 2020 10:54:3= 6 AM UTC: OK, I understand I was just hoping someone could confirm that my settings a= re correct.=C2=A0=20 I didn't come across an error so everything seems to be working I just can'= t verify that SSL is working.=C2=A0=20 Are there any commands you can run to verify that SSL is up and operational= ?=20 Testing from a client to the database doesn't prove that database to datab= ase is working.=C2=A0 =20 =20 Susan Joseph sandajoseph@verizon.net =20 =20 -----Original Message----- From: Peter Eisentraut To: Susan Joseph ; pgsql-general@postgresql.org Sent: Thu, Sep 3, 2020 1:01 am Subject: Re: SSL between Primary and Seconday PostgreSQL DBs On 2020-08-27 12:57, Susan Joseph wrote: > So has no one done this before? I'm sure people have done this.=C2=A0 But I suggest that if you ask a=20 question on this mailing list, you ask something more concrete, like, I=20 tried to do this, and got stuck here, and tried this and got this error.=20 =C2=A0 People can help with that sort of thing.=C2=A0 What we have here is = a=20 complex security setup and you are asking people to do an open-ended=20 review.=C2=A0 No one wants to do that. > -----Original Message----- > From: Susan Joseph > To: pgsql-general@postgresql.org > Sent: Mon, Aug 24, 2020 10:10 am > Subject: SSL between Primary and Seconday PostgreSQL DBs >=20 > I have setup a Primary and Secondary PostgreSQL DBs.=C2=A0 They were setu= p up=20 > with basic replication then I went back and modified them to use SSL.=C2= =A0 I=20 > am just not sure if I did it correctly.=C2=A0 Everything is working but I= =20 > want to make sure I have the settings correctly.=C2=A0 I am using Postgre= SQL=20 > 11.2. >=20 >=C2=A0 * I have a PKI that I stood up so I issued 2 server certificates on= e >=C2=A0 =C2=A0 for each database from my CA. >=C2=A0 * Primary server certificate - Primary Database >=C2=A0 =C2=A0 =C2=A0 o The FQDN and IP address are set in the SAN field. >=C2=A0 =C2=A0 =C2=A0 o FQDN is also the CN in the DN >=C2=A0 =C2=A0 =C2=A0 o Key Usage is set to Digital Signature and Key encip= herment >=C2=A0 =C2=A0 =C2=A0 o EKU is set to Server Authentication and Client Auth= entication >=C2=A0 * Rep_user certificate - Secondary Database >=C2=A0 =C2=A0 =C2=A0 o CN is set to the rep_user account name >=C2=A0 =C2=A0 =C2=A0 o Key Usage is set to digital signature and key encip= herment >=C2=A0 =C2=A0 =C2=A0 o EKU is set to client authentication >=C2=A0 * Each certificate file contains the certificate and the subCA >=C2=A0 =C2=A0 certificate who issued the certificate and put in a file cal= led >=C2=A0 =C2=A0 server.crt for the Primary and client.crt for the secondary. >=C2=A0 * The key for each certificate is stored in a separate file >=C2=A0 =C2=A0 unencrypted (I have questions about this later on) in a file= called >=C2=A0 =C2=A0 server.key and client.key >=C2=A0 * The server.crt, server.key, and root.crt are put onto the primary >=C2=A0 =C2=A0 database server in the /data/pgsql/data location, the owner = and >=C2=A0 =C2=A0 group of these files is set to postgres >=C2=A0 * The client.crt, client.key, and root.crt are put onto the primary >=C2=A0 =C2=A0 database server in the /data/pgsql/data location, the owner = and >=C2=A0 =C2=A0 group of these files is set to postgres >=C2=A0 * On the Primary in postgresql.conf I set: >=C2=A0 =C2=A0 =C2=A0 o ssl=3Don >=C2=A0 =C2=A0 =C2=A0 o ssl_ca_file=3D'root.crt' >=C2=A0 =C2=A0 =C2=A0 o ssl_cert_file=3D'server.crt' >=C2=A0 =C2=A0 =C2=A0 o ssl_key_file=3D'server.key' >=C2=A0 =C2=A0 =C2=A0 o ssl_ciphers=3D'HIGH:MEDIUM:+3DES:!aNULL' >=C2=A0 * On the Primary in pg_hba.conf I add a replication line: >=C2=A0 =C2=A0 =C2=A0 o hostssl=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 replication=C2=A0 =C2=A0 =C2=A0 =C2=A0=20 >=C2=A0 =C2=A0 =C2=A0 =C2=A0 rep_user=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 cert >=C2=A0 * On the Secondary I set the following information in the >=C2=A0 =C2=A0 postgresql.conf to:=C2=A0 (DO I NEED TO DO THIS??) >=C2=A0 =C2=A0 =C2=A0 o ssl=3Don >=C2=A0 =C2=A0 =C2=A0 o ssl_ca_file=3D'root.crt' >=C2=A0 =C2=A0 =C2=A0 o ssl_cert_file=3D'client.crt' >=C2=A0 =C2=A0 =C2=A0 o ssl_cert_fkey=3D'client.key' >=C2=A0 =C2=A0 =C2=A0 o ssl_ciphers=3D'HIGH:MEDIUM:+3DES:!aNULL' >=C2=A0 * On the Secondary I edit the recovery.conf file to the following: >=C2=A0 =C2=A0 =C2=A0 o primary_conninfo =3D 'user=3Drep_user passfile=3D''= /data/.pgpass'' >=C2=A0 =C2=A0 =C2=A0 =C2=A0 host=3D port=3D5432 sslmode=3Dv= erify-ca >=C2=A0 =C2=A0 =C2=A0 =C2=A0 sslcert=3Dclient.crt sslkey=3Dclient.key sslco= mpression=3D0 >=C2=A0 =C2=A0 =C2=A0 =C2=A0 target_session_attrs=3Dany' >=C2=A0 * On the Secondary I edit the pg_hba.conf file and change the rep_u= ser >=C2=A0 =C2=A0 line to: >=C2=A0 =C2=A0 =C2=A0 o hostssl=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 replication=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 re= p_user=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 IP>/32=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 cert clie= ntcert=3D1 >=C2=A0 * On the Secondary I move the root.crt to /data/pgsql/data/.postgre= sql >=C2=A0 * Then I restart the databases >=20 >=20 > My questions are: >=20 >=C2=A0 * Do I need to set the information in the Secondary postgresql.conf= ?=20 >=C2=A0 =C2=A0 Originally I did not set this and everything worked but I sa= w errors >=C2=A0 =C2=A0 in my log files that said to do SSL these needed to be set s= o I went >=C2=A0 =C2=A0 back and set them.=C2=A0 Are there pgsql commands I can run = to test that >=C2=A0 =C2=A0 my SSL is working in both directions? >=C2=A0 * Are my pg_hba.conf files set correctly?=C2=A0 Is that how you get= SSL >=C2=A0 =C2=A0 "turned on" for communications between the primary and the r= ep_user >=C2=A0 =C2=A0 account? >=C2=A0 * If I leave my key file encrypted then every time my databases hav= e >=C2=A0 =C2=A0 to be started have to enter the password.=C2=A0 So you can e= ither leave >=C2=A0 =C2=A0 the passwords unencrypted and set the permissions on the fil= e to >=C2=A0 =C2=A0 0600 accessible only by postgres or you can enter the key pa= ssword >=C2=A0 =C2=A0 each time the database is started up.=C2=A0 As someone in th= e security >=C2=A0 =C2=A0 field I have a tough time leaving the key unencrypted but as= some >=C2=A0 =C2=A0 setting up a production system that is located on a network = that you >=C2=A0 =C2=A0 can't get to without directly accessing the server I feel th= at is >=C2=A0 =C2=A0 enough security that I can leave them unencrypted.=C2=A0 Tho= ughts? >=C2=A0 * Am I missing anything?=C2=A0 There are no videos out there that s= how how >=C2=A0 =C2=A0 to stand up a 2 way SSL communication channel between the pr= imary >=C2=A0 =C2=A0 and secondary, or does anyone have one that they can share? >=20 >=20 > Thanks, >=C2=A0 =C2=A0 Susan >=20 >=20 >=20 --=20 Verstuurd vanaf mijn Android apparaat met K-9 Mail. Excuseer mijn beknopthe= id. ------=_Part_2644490_1233404042.1599134494069 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Unfortunately= I am not allowed to use wireshark in my environment.  Good idea thoug= h


Susan Joseph
sandajoseph@verizon.net


-----= Original Message-----
From: Wim Bertels <wim.bertels@ucll.be>
To: Susan Joseph <sandajoseph@verizon.net>; peter.eisentraut@2ndquadr= ant.com <peter.eisentraut@2ndquadrant.com>; pgsql-general@postgresql.= org <pgsql-general@postgresql.org>
Sent: Thu, Sep 3, 2020 7:44 am
Subject: Re: SSL between Primary and Seconday PostgreSQL DBs

First thougt: A general solution that you could use is wireshark.

For example : Search for wireshark ssl tra= ffic


Susan Joseph <sandajoseph@verizo= n.net> schreef op September 3, 2020 10:54:36 AM UTC:
OK, I understand I was just hoping someone could conf= irm that my settings are correct. 
I didn't come across an error so everything seems to = be working I just can't verify that SSL is working. 
Are there any commands you can run to verify that SSL= is up and operational?
Testing from a client to the database doesn't prove = that database to database is working. 


Susan Joseph
sandajoseph@verizon.net


---= --Original Message-----
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Susan Joseph <sandajoseph@verizon.net>; pgsql-general@postgresql.= org <pgsql-general@postgresql.org>
Sent: Thu, Sep 3, 2020 1:01 am
Subject: Re: SSL between Primary and Seconday PostgreSQL DBs

On 2020-08-27 12:57, Susan Joseph wrote:
> So has no one done this before?

= I'm sure people have done this.  But I suggest that if you ask a
question on this mailing list, you ask something more concret= e, like, I
tried to do this, and got stuck here, and tri= ed this and got this error.
  People can help with = that sort of thing.  What we have here is a
complex= security setup and you are asking people to do an open-ended
review.  No one wants to do that.

> -----Original Message-----
> From: Susan J= oseph <sand= ajoseph@verizon.net>
> To: pgsql-general@postgresql= .org <pgsql-general@postgresql.org>
> Sent: = Mon, Aug 24, 2020 10:10 am
> Subject: SSL between Prim= ary and Seconday PostgreSQL DBs
>
&= gt; I have setup a Primary and Secondary PostgreSQL DBs.  They were se= tup up
> with basic replication then I went back and = modified them to use SSL.  I
> am just not sure = if I did it correctly.  Everything is working but I
> want to make sure I have the settings correctly.  I am using Pos= tgreSQL
> 11.2.
>
>  * I have a PKI that I stood up so I issued 2 server certif= icates one
>    for each database from my C= A.
>  * Primary server certificate - Primary Dat= abase
>      o The FQDN and IP address= are set in the SAN field.
>      o FQ= DN is also the CN in the DN
>      o K= ey Usage is set to Digital Signature and Key encipherment
>      o EKU is set to Server Authentication and Client= Authentication
>  * Rep_user certificate - Seco= ndary Database
>      o CN is set to t= he rep_user account name
>      o Key = Usage is set to digital signature and key encipherment
&g= t;      o EKU is set to client authentication
>  * Each certificate file contains the certificate and the s= ubCA
>    certificate who issued the certif= icate and put in a file called
>    server.= crt for the Primary and client.crt for the secondary.
>= ;  * The key for each certificate is stored in a separate file
>    unencrypted (I have questions about this lat= er on) in a file called
>    server.key and= client.key
>  * The server.crt, server.key, and= root.crt are put onto the primary
>    dat= abase server in the /data/pgsql/data location, the owner and
>    group of these files is set to postgres
>  * The client.crt, client.key, and root.crt are put onto t= he primary
>    database server in the /dat= a/pgsql/data location, the owner and
>    g= roup of these files is set to postgres
>  * On t= he Primary in postgresql.conf I set:
>    &n= bsp; o ssl=3Don
>      o ssl_ca_file= =3D'root.crt'
>      o ssl_cert_file= =3D'server.crt'
>      o ssl_key_file= =3D'server.key'
>      o ssl_ciphers= =3D'HIGH:MEDIUM:+3DES:!aNULL'
>  * On the Primar= y in pg_hba.conf I add a replication line:
>  &nb= sp;   o hostssl         =             &nb= sp;  replication       
>&n= bsp;       rep_user      &nbs= p;           cert
>  * On the Secondary I set the following information i= n the
>    postgresql.conf to:  (DO I = NEED TO DO THIS??)
>      o ssl=3Don>      o ssl_ca_file=3D'root.crt'
>      o ssl_cert_file=3D'client.crt'
>      o ssl_cert_fkey=3D'client.key'
>      o ssl_ciphers=3D'HIGH:MEDIUM:+3DES:!= aNULL'
>  * On the Secondary I edit the recovery= .conf file to the following:
>      o = primary_conninfo =3D 'user=3Drep_user passfile=3D''/data/.pgpass''
>        host=3D<Primary DB IP&= gt; port=3D5432 sslmode=3Dverify-ca
>    &nb= sp;   sslcert=3Dclient.crt sslkey=3Dclient.key sslcompression=3D0
>        target_session_attrs=3Dany'=
>  * On the Secondary I edit the pg_hba.conf fi= le and change the rep_user
>    line to:>      o hostssl    =       replication     &nb= sp;   rep_user        &nb= sp;  <primary
>        IP= >/32      cert clientcert=3D1
>  * On the Secondary I move the root.crt to /data/pgsql/data/.po= stgresql
>  * Then I restart the databases
>
>
> My questi= ons are:
>
>  * Do I need = to set the information in the Secondary postgresql.conf?
>    Originally I did not set this and everything worked but= I saw errors
>    in my log files that sai= d to do SSL these needed to be set so I went
>  &= nbsp; back and set them.  Are there pgsql commands I can run to test = that
>    my SSL is working in both directi= ons?
>  * Are my pg_hba.conf files set correctly= ?  Is that how you get SSL
>    "turne= d on" for communications between the primary and the rep_user
>    account?
>  * If I leave= my key file encrypted then every time my databases have
= >    to be started have to enter the password.  So you c= an either leave
>    the passwords unencryp= ted and set the permissions on the file to
>  &nb= sp; 0600 accessible only by postgres or you can enter the key password
>    each time the database is started up.&nbs= p; As someone in the security
>    field I = have a tough time leaving the key unencrypted but as some
>    setting up a production system that is located on a net= work that you
>    can't get to without dir= ectly accessing the server I feel that is
>  &nbs= p; enough security that I can leave them unencrypted.  Thoughts?
>  * Am I missing anything?  There are no video= s out there that show how
>    to stand up = a 2 way SSL communication channel between the primary
>= ;    and secondary, or does anyone have one that they can share?=
>
>
> Tha= nks,
>    Susan

>
>
>

--
Verstuurd vanaf mijn Android appar= aat met K-9 Mail. Excuseer mijn beknoptheid.
------=_Part_2644490_1233404042.1599134494069--