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 1noLMk-00066u-KB for pgsql-hackers@arkaria.postgresql.org; Tue, 10 May 2022 08:37:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1noLMj-0006q2-GR for pgsql-hackers@arkaria.postgresql.org; Tue, 10 May 2022 08:37:09 +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 1noLMj-0006pt-7B for pgsql-hackers@lists.postgresql.org; Tue, 10 May 2022 08:37:09 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1noLMe-00014U-Vf for pgsql-hackers@lists.postgresql.org; Tue, 10 May 2022 08:37:08 +0000 Received: by mail-ej1-x634.google.com with SMTP id m20so31432765ejj.10 for ; Tue, 10 May 2022 01:37:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:comments:mime-version :content-id:content-transfer-encoding:date:message-id; bh=3AAuzm6UoC0HyQ4PkcTpFGtNHdz6Y+7MYsM0qffQOB0=; b=pN1lHv054XQkOTjRwkeOtWasvRS5klsLK9uzH0fKmDKXt3LtJFO7EAwuAt3/vUXosi y2y2M0AntRNM84MmhCi/OB1g01wx8LLugi1XcmFkwF6Jr0ywdM8fefTjZW+vafmUPkWn TTY60qxzxzgF5KWUFwQ22eneKJSPx3bH56manoO+MmCSq0Tg6UkSUFKDLmaekyQ1iHzZ fEaVds5oh9TH88ntGyy3a8rzMMdNzDILMVirsaLoZUnXGS8MoevDkqsQbx5Sistc1bDn UjTh0pKK8o1XgyeFbB5Il8Eym+jfVSgdexInWv7QE4GE0F3IwJyCgLjie4mr9iJapTVO miWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :comments:mime-version:content-id:content-transfer-encoding:date :message-id; bh=3AAuzm6UoC0HyQ4PkcTpFGtNHdz6Y+7MYsM0qffQOB0=; b=Ojv9MS1EC/NJlA7e3iKTuJuEUyfhXL+iWICqF/QVHkpk9px2/RP1Nv9sLTMofJg/me 8sus0j5cIHCt9i2xglQVJBdKxF+kxc0KFI5vSIdBezPwMGp0zMH3TTkXkkRDPtpwv0Hf w3SbnSj7UDJqStXSWckTpDXAoJWIXoWXA0hHoi5S5/AU7Iehk2K7uCU2Cm5N/BaAiuzw heJX0r+/QSvB+RJFjMXvu3hbxMmz/JMcWEFnnl5jbK8zk3RKKAJeW/VZZPcLIshK+C9R Z3jGm5nBdE/yuztKUh1/5TPU11boq+PwXgeyxBnbW9n0dkrJp3xgRea8Ku+8DZ4eXrqM GDLQ== X-Gm-Message-State: AOAM531uamcqIk3iQeq/yAZhIMkLq2zl4sbO+3LFiPsgoi1FlUVA+F8k w41jJkDgKh7ipYnwhsb/Hsfp2A== X-Google-Smtp-Source: ABdhPJxLY2HBiDE7ONuk76gKwmz3by390oxladc15SogEZJ7uV/edLULKrdrhKXY265Kufo9Y+3EzQ== X-Received: by 2002:a17:907:8a20:b0:6f4:bb5d:9e19 with SMTP id sc32-20020a1709078a2000b006f4bb5d9e19mr17768310ejc.190.1652171823217; Tue, 10 May 2022 01:37:03 -0700 (PDT) Received: from antos (85-207-121-76.static.bluetone.cz. [85.207.121.76]) by smtp.gmail.com with ESMTPSA id a27-20020a170906245b00b006f3ef214db2sm5840524ejb.24.2022.05.10.01.37.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 May 2022 01:37:02 -0700 (PDT) From: Antonin Houska To: Amit Kapila cc: Euler Taveira , PostgreSQL Hackers Subject: Re: Privileges on PUBLICATION In-reply-to: References: <20330.1652105397@antos> <8a00e0e1-dc4e-422c-9dcf-664b16b18625@www.fastmail.com> Comments: In-reply-to Amit Kapila message dated "Tue, 10 May 2022 09:19:48 +0530." X-Mailer: MH-E 8.6+git; nmh 1.7+dev; GNU Emacs 27.2.50 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2809.1652171844.1@antos> Content-Transfer-Encoding: quoted-printable Date: Tue, 10 May 2022 10:37:24 +0200 Message-ID: <2810.1652171844@antos> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Amit Kapila wrote: > On Tue, May 10, 2022 at 12:16 AM Euler Taveira wrote= : > > > > On Mon, May 9, 2022, at 11:09 AM, Antonin Houska wrote: > > > > Now that the user can specify rows and columns to be omitted from the = logical > > replication [1], I suppose hiding rows and columns from the subscriber= is an > > important use case. However, since the subscription connection user (i= .e. the > > user specified in the CREATE SUBSCRIPTION ... CONNECTION ... command) = needs > > SELECT permission on the replicated table (on the publication side), h= e can > > just use another publication (which has different filters or no filter= s at > > all) to get the supposedly-hidden data replicated. > > > > The required privileges were not relaxed on publisher after the row fi= lter and > > column list features. It is not just to "create another publication". = Create > > publications require CREATE privilege on databases (that is *not* gran= ted to > > PUBLIC).If you have an untrusted user that could bypass your rules abo= ut hidden > > data, it is better to review your user privileges. > > > = > Also, to create a subscription (which combines multiple publications > to bypass rules), a user must be a superuser. So, isn't that a > sufficient guarantee that users shouldn't be able to bypass such > rules? My understanding is that the rows/columns filtering is a way for the *publisher* to control which data is available to particular replica. From this point of view, the publication privileges would just make the control complete. -- = Antonin Houska Web: https://www.cybertec-postgresql.com