Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVrNZ-009BnY-2C for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Dec 2025 13:15:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vVrNY-00Cppj-0Z for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Dec 2025 13:15:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVrNX-00CppY-2i for pgsql-hackers@lists.postgresql.org; Wed, 17 Dec 2025 13:15:44 +0000 Received: from mail-yx1-xb12f.google.com ([2607:f8b0:4864:20::b12f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vVrNX-0019Lz-0i for pgsql-hackers@postgresql.org; Wed, 17 Dec 2025 13:15:43 +0000 Received: by mail-yx1-xb12f.google.com with SMTP id 956f58d0204a3-6420c0cf4abso5944439d50.1 for ; Wed, 17 Dec 2025 05:15:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=percona.com; s=google; t=1765977342; x=1766582142; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=jNLqp7MelB3vZN3Dlfpel85dMwOfN1jU6wLQe51XVdc=; b=Ao29BuEF+7hvr8b4oeA2NWHd8I7o5hcsFFYH4dR8XuzvoXO+p9uV4zMuDsN+PZg3K/ SfboB68DryFmNjdzq5h522TWdOKkqyfVV4Mp/muOkl2J7bgBlC6Xhj7ykQFS3dTxZ/cf e2jn0TFwNHKoDJec3t/SpnIncfBpym2xF44U4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765977342; x=1766582142; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jNLqp7MelB3vZN3Dlfpel85dMwOfN1jU6wLQe51XVdc=; b=xNJ+UITp2Tl5cjdrenYobfTIa5Cn63cmwBwNsgU5lkyRZ2BSz70mdcskZYaq69Gu4L vnUe0PEeDADH5VmQ/Xzk99OwD/W3cTrMqigSj5HUW0L6wnjLQ2mbAsrQ+INi1H2grkye GflU3ha0v3C1qiROv3///MYwHf+QSD+HUCr6bHFxmfmN8u1d+pM8T1eXv4ubRbjw+wLn rwQWMlT0nly3nYITlM1DP0EOBvwjP+B1t1ZP68mKyUMcaxoupFnYEuISLU0cquWaUhbT +9nbngwBfP0Y3nD1B+uHotaRJS3ARUlzRBe1AoFPMsVslcdbkAizbnUYFTfFqDDiZUjU 1sqw== X-Forwarded-Encrypted: i=1; AJvYcCUfy3IUH/K+OkhaEqV9p/0WXryVEf3anTI7NqpPGsi1Lmc3R/yrRIRwKNoZYZ/AwwFjEhBJBnUE1+UFFOF7@postgresql.org X-Gm-Message-State: AOJu0Yxj3Kyx1UWgWhAXGgSbmvJu5JSGXhLVBMCM6TnshC/zphNY8OcI XB2yHVJ1JsvC+FIz1HdQzCcQVHfnS3KruXN48crPY9ZvqPEJ5Q6i7jjajM1dj/1L3G67tmEkQ+T wq6cSnusmANP19c8IgC/DLPZtPZL3kYlwIhtUFh2bqhGdCPgfEV787KQEj8Mr64xFPQZv8ooLNs qJpM3g3tO+kWNaVMif4Sn5oVlaKS3oYsougubZ3+jlTwy511CgNa/l/GW26teTzy9NxMHliHBW+ jHTFfitEqK1tFxQpQ6G4S/puwe+KknANTp2RVPQ2HG2qrOSQ2s= X-Gm-Gg: AY/fxX6GZVOYKDLBbd0fnVLmsCwcN8ZfYeEpIetEpAztOKILsV/oYHVgOtd61gJBNGp 4nIPJe265ZJdwH5TencmM9flhr0dc/SMFz5jOhIpywwhoKZ66eh1+e8FigNPhA2047JpSEdcQh3 tuP1af5jOw56PalfRlbeenQEp4043ixXsgeFtkYxhDY+kW1bIYzQSvDCZ3jb8cl+VrA/i3rtQsD n38VYHVis/Ti4O93k+m+sTTWL3aJW2AZ1h5UZ8ikFBZk2w2FSnGJfKRdIiLVGa0aJMTn12XqOWP RPgNJeefYmBu/+P4bBE/GDLmSEBH6pG0Pb+76Cu2f606tNMvDNGbEupJ1stE8nhVS7k= X-Google-Smtp-Source: AGHT+IGOwaNuDJCHKwZE5vZYwk2aGmqEkhMZtFJZLQ4W7DtqaTFK8/r4ymgboTokkRzFCKtcYtzf13V3BCWdl3V+Zc4= X-Received: by 2002:a05:690e:130c:b0:644:4771:2d38 with SMTP id 956f58d0204a3-645555eb906mr13722425d50.27.1765977341589; Wed, 17 Dec 2025 05:15:41 -0800 (PST) MIME-Version: 1.0 References: <16a91d02795cb991963326a902afa764e4d721db.camel@gmail.com> <3D82D240-1CC5-4CE6-BE30-6065B693D40C@yesql.se> In-Reply-To: From: Zsolt Parragi Date: Wed, 17 Dec 2025 13:15:30 +0000 X-Gm-Features: AQt7F2rFkwZ6QYMsHb6QeHkw8xU9GPkKXfVAMpxLasjXLogo-8Wwu-NolVyflD8 Message-ID: Subject: Re: Make PGOAUTHCAFILE in libpq-oauth work out of debug mode To: Jacob Champion Cc: Daniel Gustafsson , "Jonathan Gonzalez V." , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" X-CLOUD-SEC-AV-Sent: true X-CLOUD-SEC-AV-Info: percona,google_mail,monitor X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > I don't disagree. But at this point in these conversations, the > question posed is typically "is the new risk/reward tradeoff any worse > than PGSSLROOTCERT or PGSSLMODE or PGSERVICEFILE (or LD_LIBRARY_PATH > or PATH)?" I'd say no, not enough to introduce a new way of > configuring things for this particular setting. Those are also bad, but there are also parameter alternatives for all of them. > 2) Do you want these settings to be part of a postgres:// URI? Not for debug settings, but if everyone agrees on splitting the CA into its own setting, it could behave the same way as sslrootcert/PGSSLROOTCERT. > Because it's not obviously spraying output all the time, you mean? We > could perhaps be noisier when any UNSAFE setting is in use. Yes, mainly that. And as you mentioned there's already existing behavior like that in the code, so it's nothing new. > Yeah, I'm not entirely happy about it either. Let me think about some > alternatives... I'll try these suggestions and see what they look like - and I'll start a separate thread with it so that this thread can focus on the CA variable. > Mmm... I'd say that application developers always have to be aware of > user environment changes in the context of any Linux programming, let > alone libpq client development. The user is generally in partial > control of the linker. Nearly every libpq setting is accessible via > the environment. (setuid programming is its own specialized skillset > for a reason.) My concern is not somebody developing libpq directly on Linux, but more complex situations. For example: 1. there is libpq 2. libpq is used by scripting language bindings for python/ruby/etc 3. language libraries are used in ORM frameworks, which have their own configuration interface 4. ORM frameworks are used in web frameworks / other libraries 5. those frameworks/libraries get used by somebody writing an actual webpage/application 6. And that webpage/application gets installed/maintained by an administrator/user, who might or might not be aware of this And we also have Windows/other platforms, where environment variables are less visible. > Now, if there's any appetite to make the situation better, continuing > to add security-critical settings into the environment makes things > worse for anyone who wants to propose an alternative This is also probably a separate discussion, but what do you think about introducing a parameter that disables environment variable fallbacks? Both for existing variables like PGSSLROOTCERT and new/debug variables like PGOAUTHCAFILE. (by default everything works as currently; when specified environment variables are ignored)