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 1mvidN-0003fg-Qe for pgsql-admin@arkaria.postgresql.org; Fri, 10 Dec 2021 16:20:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mvidK-0003Gl-TT for pgsql-admin@arkaria.postgresql.org; Fri, 10 Dec 2021 16:20:30 +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 1mvidK-0003Gb-EC for pgsql-admin@lists.postgresql.org; Fri, 10 Dec 2021 16:20:30 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mvidC-0005rU-RK for pgsql-admin@lists.postgresql.org; Fri, 10 Dec 2021 16:20:29 +0000 Received: by mail-wm1-x335.google.com with SMTP id i12so7227437wmq.4 for ; Fri, 10 Dec 2021 08:20:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=+znSesChXXcDEGrDtQepKkrAkC548c6ZZVb5l+65FIg=; b=aUl5UhtuwdpWQTuboClIBPvwDEFEUdVxtO17pATvZwbnMy/BYRuOSV/lLscbs8pHLi 1CquYYZUEGe9SsrcvtufkvTErR8xLsutL+vUSjFm0GGrVywAMdDPm3Uh8oBuMNgapz3G /hv8h7P6ZqvuSiF/PQr+W3VCaPTQkuWgGKIa2imbSgBmxnBjDKNvnkSa2e6i7NelyU1B PSsYt2UUZy6PjMzuV274NbIB5RAMNtE2yk/zbRXUZMMTjBvFQXXb/P/KI6JeOM2EQzQ+ wMWSOMm5yVX5uvVJ7wLJ8+ify3iGyh0hlpii3/6bkpKo64HhyBNMN3xpaQaonzFNGmWL If4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=+znSesChXXcDEGrDtQepKkrAkC548c6ZZVb5l+65FIg=; b=ble9KqsvA+RnlKt2rRf1uLRZeZMDI0Q3Gfl/uyEn/sv5siLCNuJuIGugCwYHoDQuTa bjIPhI+Y62aOI54Ik/q9TGKd/AGtoirNqmBSRTHKsFRGusJoXBVcyyNehg2+B5gTINoa iTZZmLtSVfJ5p0hrnuMaS8ehufX0+C+8lvE8AW6DmrQTPTotoqiY6oIu9b9G/ftWLglJ D2zOSvVyh0cSFFm4SlK3xzj+DxSfYwXfbWQMu05cTquN1rb2uQ2WITh20A0pSnxeDC/+ d5cUI5yneevwMfabMuiKqNBwU57ZlaR/87T6TTahPAYgjBvzt5rji9ZpPDHhx1HrQxCy yF8g== X-Gm-Message-State: AOAM532KaYaBzqk1ZMnWCjVCuTfPElJ4ZXrI3orUXRziNLwPJ4F9GgFF HV5Qdza3q/Xtl2R4WxFL/OJHKA== X-Google-Smtp-Source: ABdhPJynOPcJzYKHB0LFr8reJszg1Xfubc/ScdOObtPR0zAAwwOMlWS0jG7RZBZRE9FZuAPlGwNQBg== X-Received: by 2002:a7b:c008:: with SMTP id c8mr17345881wmb.87.1639153220783; Fri, 10 Dec 2021 08:20:20 -0800 (PST) Received: from localhost.localdomain (dynamic-edcj58i4di7rusf95-pd01.res.v6.highway.a1.net. [2001:871:5e:9b3f:f541:ed11:253b:5639]) by smtp.gmail.com with ESMTPSA id d2sm3334151wmb.31.2021.12.10.08.20.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 08:20:20 -0800 (PST) Message-ID: Subject: Re: security issues From: Laurenz Albe To: Frank Eckes , pgsql-admin@lists.postgresql.org Date: Fri, 10 Dec 2021 17:20:19 +0100 In-Reply-To: <5235c46a-508e-f084-c8bc-738a6e99fd44@online.de> References: <5235c46a-508e-f084-c8bc-738a6e99fd44@online.de> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.4 (3.40.4-2.fc34) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2021-12-10 at 15:33 +0100, Frank Eckes wrote: > To access data in a PostgreSQL database I write queries which contains > the business rules > > how t access data. This is working fine and also the permission are > working fine. > > But I found out that a user can see the complete business rules in a > query or a procedure which is > > a big security issue. > > Is there e possibility that I can hide the definition and th user can > only see the data or can execute > > the procedure/function. No, there is no good way to do that. It is very unusual to put secret information into a view definition... > And even worse, if i define a foreign server (e.g ORACLE) everybody can > see the credentials in a user mapping > > which should not be allowed. This might be a show stopper of using > PostgreSQL in security environments. Then you use Oracle external authentication, for example with a secure key store on the PostgreSQL server. Then you don't need a password. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com