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 1lEmum-0006qf-9q for pgsql-admin@arkaria.postgresql.org; Wed, 24 Feb 2021 05:40:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lEmuk-0007ty-UJ for pgsql-admin@arkaria.postgresql.org; Wed, 24 Feb 2021 05:40:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lEmuk-0007tr-Ge for pgsql-admin@lists.postgresql.org; Wed, 24 Feb 2021 05:40:46 +0000 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lEmue-0003Ao-3M for pgsql-admin@lists.postgresql.org; Wed, 24 Feb 2021 05:40:45 +0000 Received: by mail-ot1-x32b.google.com with SMTP id s3so1106770otg.5 for ; Tue, 23 Feb 2021 21:40:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=gnXaDs50BhaY24L5er8kwkdeaofdKFbizxZ46DRXaxA=; b=ZjFU5PJ7V8ddZymZpKpjn88PiaffHQrAbssfn3zMGSG9OtTFG9TM8NT/UZSlMfDDj5 F6T6XUisItlSGjol6S13oZ9dTxg39443exx1y6ePhcoARB+fldx/hU9GTL/vsLI+49KG J86yf1ikLzYT8hN1PKI8XC01XNYdaAAd+i2A4q0IylWlKR+ApdTc3QDa3Db9jAEe96AR 9VPtvC52+4ERKB35DO+k2qreNVnmQn+bpl5aKoXJ2K5fZAwrB4h+nG27D7N/8vbPvkgC a0xOEF3E/lHlNTugvIbva9RTKv6DHgAxsE9+e7X3LT7cSm6W/xcVSNdbyrq1C1YuJAHh 4TYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=gnXaDs50BhaY24L5er8kwkdeaofdKFbizxZ46DRXaxA=; b=saj8sh4aqZvatASdrvBf9jjFQvvwB6pp9BwL0gQ/9JfLiqAjmeBVQW5kbhddQEF/Js Y+5Oy1mcMCgj7ymf6yZ36D/XhKz/qbelyEUx6c2AqEhXxEO2bkte0ymbdzy+m/9OcGCj wUaVPQKS1fARHd8vV3SPwpBbIQcDxQysZ2hm0n/O6ZAaQr9GROo7oqPN5Pbcu5dzi384 ofYmBYojLjWKUjt/KsrUBeFhl9UgHDo8kx7E/dO3eja649p6I4CFLPTLNie+eCDbhqsv uOMeU11ygbZIOaHxmMyO5VGKTyDR5TLWYOJMJPwILVSI60/INxFBUYkMV02BSZ9SKYi0 6rkg== X-Gm-Message-State: AOAM532dIpSaT5ZHNt+GRARQ13a88lEjb3O608xG+4HCDfrhCRHegEzS Zv+OCkih7Al/yQDdUmC493nWxb+HAn+lpg== X-Google-Smtp-Source: ABdhPJz5hNsC2CIlvF2R5g5hhtuROACYkCzTHy6kX4cWqy5POcf3HCM39JbtdulY7cNczGjwNLwCzA== X-Received: by 2002:a9d:6308:: with SMTP id q8mr22108600otk.160.1614145239072; Tue, 23 Feb 2021 21:40:39 -0800 (PST) Received: from [192.168.88.10] (ip174-67-141-204.no.no.cox.net. [174.67.141.204]) by smtp.googlemail.com with ESMTPSA id g78sm194058otg.62.2021.02.23.21.40.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Feb 2021 21:40:38 -0800 (PST) Subject: Re: How to encrypt password in pgpass file To: pgsql-admin@lists.postgresql.org References: <87eeh6xnyy.fsf@gmail.com> <20210224044223.7cwkbced3ticu6bk@raf.org> From: Ron Message-ID: Date: Tue, 23 Feb 2021 23:40:37 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210224044223.7cwkbced3ticu6bk@raf.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2/23/21 10:42 PM, raf wrote: [snip] > Sometimes, the security requirements are for > encryption-at-rest, and it doesn't particularly matter > if encryption-at-rest is actually secure against likely > threats (sadly). > > For example, you could use file system encryption (e.g. > ecryptfs/LUKS/Linux, FileVault/macOS, > BitLocker/Windows). Then all of your files are > encrypted at rest, including .pgpass. > > But it's only secure when the computer is powered down > (i.e. if it is physically stolen, or the disk is > physically removed). It provides no security for a > computer that is up and running, and compromised. > > But that might satisfy the parties that make up the > requirements. It all depends on the threat model that > they need to address. I see the same thing when SQL Server systems are audited.  One of the check boxes is "encrypted database".  I say, "encrypt columns, and modify the application to decrypt the columns"; the customer laughs, and asks about TDE, which I implement. Of course, these systems are VMs and SQL Server is rarely turned off, so it serves no practical purpose other than to encrypt the backups.  Auditors don't understand that, hear "it's encrypted" and are happy when I show them AES-128 and that I rotate the key yearly. -- Angular momentum makes the world go 'round.