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 1jhjFD-0003R3-Er for pgsql-general@arkaria.postgresql.org; Sun, 07 Jun 2020 00:32:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jhjFA-0005pE-GP for pgsql-general@arkaria.postgresql.org; Sun, 07 Jun 2020 00:32:56 +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 1jhjFA-0005p6-5g for pgsql-general@lists.postgresql.org; Sun, 07 Jun 2020 00:32:56 +0000 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jhjF1-0004RL-Hc for pgsql-general@lists.postgresql.org; Sun, 07 Jun 2020 00:32:53 +0000 Received: by mail-pj1-x102f.google.com with SMTP id i4so386050pjd.0 for ; Sat, 06 Jun 2020 17:32:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:message-id :date:mime-version; bh=k0Wr7ixYfnAUpw35UKuFpe7pfN5pHHu2ay55bbYFrLI=; b=EbDQO4wl3ZBoqYFmRO+nOH77NQ8HLv37USeodipkzDmD/t4HaiqFCXsh2dzRSvSFV2 4/h++ZfnixeTwiOYGjrBNQ+xAS5bNG5/6ifZtU2MKBgWUScV021x2YJyS9Ma4r31SJ54 7/cayN1/I7ubYv9Sb4o6C3kIljZ4gCagEAPRkir9ikHaqRWIPACdCyf8OedUt02XroHB EI3RrWK8BphUrm6kOps4r9bl4yAuNT/NerZBjpdqea2Z8x2VTlgo0AtWwTjO+DTlVIEL geNJGs4Q26j1UHDc70kmeasDaKUMJdM7AnQDzxKoYAHuOLMTC5YQY3zSuUpaAJPzJ526 bFuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:message-id:date:mime-version; bh=k0Wr7ixYfnAUpw35UKuFpe7pfN5pHHu2ay55bbYFrLI=; b=bzVCXapScIgVIdMSBqsLxyA81gxfvBRp9Mmmq26gr1cD9iar6+KwMEOf1h1BeEDudp J6llhMJlO+9OIezKss8sBqnnLbZvrIOk6KjDEL7kR6qK4gfbi7kJev13CRyB3GGstRSp Ae8LIIKreaUmq2/ejHCBG1QptNP/OOEbeoRzE7PRhSIXWsQQn8Og30skb+LkjXWndEo/ Kcdexs/36fXH9bgTOTxu0WUFrl6ZlR9uYc+SWZzWczh34v20XnK6qeMjtkVHa32UjrgK YOqIK0bpISN9thgh9Jr8f/vj94Hn+Bpu5Fz9PyEET416KlHznVMGJ9wL2K8lDC1orEbV Yjaw== X-Gm-Message-State: AOAM531LPB6TKpdYJATN9Ryxmsi668RyM1HRJaSBGthchMan4MFs00fn 3K4Yo6oMTU1zbuUQxCfuUILefIT94oM= X-Google-Smtp-Source: ABdhPJwQeuJYU669IQpBjFN3P5Nm9iGA4831OQ+Gr5mQMGEWlQNNKjrfZDhvdJ4c4lbo/K4ekVP89Q== X-Received: by 2002:a17:902:b092:: with SMTP id p18mr7194418plr.205.1591489964688; Sat, 06 Jun 2020 17:32:44 -0700 (PDT) Received: from tim-desktop (203-173-29-109.dyn.iinet.net.au. [203.173.29.109]) by smtp.gmail.com with ESMTPSA id n9sm11578236pjj.23.2020.06.06.17.32.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jun 2020 17:32:43 -0700 (PDT) References: User-agent: mu4e 1.5.1; emacs 27.0.91 From: Tim Cross To: Michel Pelletier Cc: pgsql-general@lists.postgresql.org Subject: Re: Should I enforce ssl/local socket use? In-reply-to: Message-ID: <874krn1zrt.fsf@gmail.com> Date: Sun, 07 Jun 2020 10:32:39 +1000 MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michel Pelletier writes: > Hello, > > I'm the author of the pgsodium cryptography library. I have a question > about a best practice I'm thinking of enforcing. Several functions in > pgsodium generate secrets, I want to check the Proc info to enforce that > those functions can only be called using a local domain socket or an ssl > connection. If the connection isn't secure by that definition, secret > generating functions will fail. > > If someone really wants to point the gun at their foot, they can connect > with an unsecured proxy. My goal would be to make bypassing the check > annoying. > > Any thoughts? Is this an insufferably rude attitude? Are there scenarios > where one can foresee needing to generate secrets not over ssl or a domain > socket? > I'm never very fond of enforcing a particular behaviour as it assumes we understand all environments and use cases. Far better to make this the default behaviour, but allow users to disable it if they want and clearly document that option as insecure. I also suspect that without the ability to somehow disable the checks, people will find elaborate ways to work around them which are almost certainly going to be even worse from a security perspective. -- Tim Cross