Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfqwE-0005LR-MA for pgsql-sql@arkaria.postgresql.org; Thu, 10 Aug 2017 17:08:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dfqwE-0006HC-2w for pgsql-sql@arkaria.postgresql.org; Thu, 10 Aug 2017 17:08:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dfqvE-0004Wb-D0 for pgsql-sql@postgresql.org; Thu, 10 Aug 2017 17:07:00 +0000 Received: from mail-oi0-x22d.google.com ([2607:f8b0:4003:c06::22d]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dfqv7-0004dn-VH for pgsql-sql@postgresql.org; Thu, 10 Aug 2017 17:06:59 +0000 Received: by mail-oi0-x22d.google.com with SMTP id e124so12588331oig.2 for ; Thu, 10 Aug 2017 10:06:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=rYO7RBf+6jvuq+ZRD6LdBGPqYdv3If8kBdYEjn96WB0=; b=dOn2wwnTNkfNVDVbvrhwqoft6vVKe5MozIcaRlOEHKBOmuKWksCvbvoGk6Al41GRyd T0oI9HXz1TNI1orNWiDgCi/W3XgbHZg5qhONm9Pilp3m8U6GTG9O1pY4YE8oNTYrz1iB uyI9ya+ts00uasnTLMcLlIhxxD2HhOlLj5GMmFCpCmhiHcc4U+nmWq1l36JU2c8PFlEv kahqnvU+t1MtWeeEwl2h6IYfpuWB+6v0A8K/a5uoCYuGFbSTWSfQnOJNjBw7xcYL/75r yRW3s9c3i6DajzlJleJhbQ52GlR0rYqnFcNKeYxXNLBIF4l7JTaBpZ6K+wERY93HEBwn GH6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language; bh=rYO7RBf+6jvuq+ZRD6LdBGPqYdv3If8kBdYEjn96WB0=; b=THaocmdpPG2Uh1cVaQng0kwgNW75+yuzT1G35kc4eQG3VxQYSjSzSAhiKYkScGVr6r 4nyCyReG7W10aDtPVk1ogvjUe+2EATg1NAMcO4pm4QAU/0UXG9Fru4TIBF2WpEhITLil 6OUE0JjF2xw2xXF83wvmyv7GDG1vFyx59IOcZNMGBGlRjlYVSAn43kjkoLE7x0f7f924 AuzqdcpOQTROCuzBHNARq6kPKw23fxW95NXH0BfUBPddO8DySDj6gk2KlSTgRPcIKkji aX+rfn2YQ85T9UaPJBEe2haJE2XSGnrZhMffxViV0CQcUFTdOvgfSfximM45oZa44PYI DZnw== X-Gm-Message-State: AHYfb5g5gM86RMtTvd9qLTJs2FALe6DDD5kpcA/KNXvvICSuWYxYiYCZ 22oIcYcohPU1i8tn02g= X-Received: by 10.202.189.9 with SMTP id n9mr13367569oif.311.1502384811270; Thu, 10 Aug 2017 10:06:51 -0700 (PDT) Received: from [127.0.0.1] (mail.jonesborocwl.org. [64.233.145.118]) by smtp.gmail.com with ESMTPSA id w134sm7386310oif.32.2017.08.10.10.06.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Aug 2017 10:06:50 -0700 (PDT) To: pgsql-sql@postgresql.org From: Jason Aleski Subject: Replication and Field Level Encryption Message-ID: <482a34c7-d0dc-6b8b-0b92-cfef0ad6eadf@gmail.com> Date: Thu, 10 Aug 2017 12:04:41 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------5FA35D7AA90405EFF5B438AF" Content-Language: en-US List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org This is a multi-part message in MIME format. --------------5FA35D7AA90405EFF5B438AF Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit I really need some assistance to see if I'm heading in the right direction and get a second opinion. Also to see if there is anything I may need to reconsider. I'm building a database design and application from the ground up. The database is going to be synced in three locations using BDR.The local office will use the instance closest to them. Each location will also have an additional "BI/Reporting" instance with data being updated once a day. I need to be able to do field level encryption, with both 2-way encryption and 1-way hashing (ie: passwords, PII, PHI data). I believe I want to use PGCrypto and keep as much programming logic on the SQL server. Right now, there will be a desktop, mobile and web application; plus additional web services to support the applications. Even though the data will be encrypted and decrypted on the server, data transport security will rely upon SSL/TLS between the client and server. I'd like to keep the client applications as "dumb" as possible so if we decide to change encryption methods, keys, etc. We don't have to rollout entirely new applications just for key changes or if we have to re-hash/re-salt the database. The things I keep going back and forth on are: 1. Should the encryption and decryption be at the client or server? 1. Advantage to the client 1. Data is secured end-to-end 2. Disadvantage 1. Managing application changes during security key changes. 3. Advantage to the server 1. Consolidates programming logic and reduces the encryption process on the client 4. Disadvantage to the server 1. Data relies on communications SSL/TLS for encryption 2. Is BDR ready for multi-master in the production world? Or should I use a master/hot-standby at the main facility? I'm mainly the two of the locations are in rural areas and want to make sure if their internet connection goes down, they can still operate? Yes, I'm aware there are commercial packages out there. We are weighing those, but need to show that if we did it without the use of commercial software/support/services, there is risk/reward. Any thoughts or items I should also consider? -JA- --------------5FA35D7AA90405EFF5B438AF Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit I really need some assistance to see if I'm heading in the right direction and get a second opinion.  Also to see if there is anything I may need to reconsider.

I'm building a database design and application from the ground up.  The database is going to be synced in three locations using BDR.  The local office will use the instance closest to them.  Each location will also have an additional "BI/Reporting" instance with data being updated once a day.

I need to be able to do field level encryption, with both 2-way encryption and 1-way hashing (ie: passwords, PII, PHI data).  I believe I want to use PGCrypto and keep as much programming logic on the SQL server.  Right now, there will be a desktop, mobile and web application; plus additional web services to support the applications.  Even though the data will be encrypted and decrypted on the server, data transport security will rely upon SSL/TLS between the client and server.  I'd like to keep the client applications as "dumb" as possible so if we decide to change encryption methods, keys, etc.  We don't have to rollout entirely new applications just for key changes or if we have to re-hash/re-salt the database.

The things I keep going back and forth on are:
  1. Should the encryption and decryption be at the client or server? 
    1. Advantage to the client
      1. Data is secured end-to-end
    2. Disadvantage
      1. Managing application changes during security key changes.
    3. Advantage to the server
      1. Consolidates programming logic and reduces the encryption process on the client
    4. Disadvantage to the server
      1. Data relies on communications SSL/TLS for encryption
  2. Is BDR ready for multi-master in the production world?  Or should I use a master/hot-standby at the main facility?  I'm mainly the two of the locations are in rural areas and want to make sure if their internet connection goes down, they can still operate?  Yes, I'm aware there are commercial packages out there.  We are weighing those, but need to show that if we did it without the use of commercial software/support/services, there is risk/reward.

Any thoughts or items I should also consider?

-JA-



--------------5FA35D7AA90405EFF5B438AF--