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.94.2) (envelope-from ) id 1sWfhB-00GcLe-EK for pgsql-admin@arkaria.postgresql.org; Wed, 24 Jul 2024 17:22:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sWfh9-006qBd-B8 for pgsql-admin@arkaria.postgresql.org; Wed, 24 Jul 2024 17:22:31 +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.94.2) (envelope-from ) id 1sWfh8-006qBU-SU for pgsql-admin@lists.postgresql.org; Wed, 24 Jul 2024 17:22:30 +0000 Received: from fhigh6-smtp.messagingengine.com ([103.168.172.157]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sWfh5-001Emu-Nb for pgsql-admin@lists.postgresql.org; Wed, 24 Jul 2024 17:22:29 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.nyi.internal (Postfix) with ESMTP id E48D811400BD; Wed, 24 Jul 2024 13:22:25 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 24 Jul 2024 13:22:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1721841745; x= 1721928145; bh=f5GUQlgPQYYIvbh/RfhqsRSfPXgbw7GGD5dJsAO1pWA=; b=G K1t4sY8fMz3xYwfoRn9FY/+sRerTm9GAROvWQnlNIVpNxmschcpijU4DUdekPKbM Na6ewSFXyq280fXBtLZ9qHDQoRlO7xQCa0kGH7NQpwjTamr5MhRWam4xV7BLxe5y YSeidR1/6mkgEXsYd9IdsOiEwBxNgdmSQXSKX9XetYhuMardddGot3U8F/33HOI3 zVvm02e5CE7eY9DUSrEZbXEWDtw1BRn6n71RYF+vj8aXbhLl0JclTNbQm7h0OUaW SOlOcTqUSqA5v0Qk9oxYbA2EkoJG9BtB8fAl+G7McZfIeeoWR+BYQQAqey1L2Guh 8kpzmktehI2Uh1p/Qnc/Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddriedugdduuddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepvdektdffudfftdffffehfffhjeejhffgieeuueekjeek fffgudffhfduffffueevnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhv hhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgpdhnsggprhgtphhtthhopedt X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 24 Jul 2024 13:22:25 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1721841743; bh=KCf3bT6wO0IrsfE/WYhWtqbwM/7Z3sOCbCnpuyZJRnk=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Svlbxdy5xEJ1mx/rNLGXreZ9BKS8ymoTanlMnXr1/WEs6SA34yN1MJfudK+qCn4+0 nBpFnulre+2EOlVfygxGJ4Y/J0sxJC0Z5+kZ7hp6tTX0f7MVPVeUjbtIuKt9bFnOS6 wYlMBwOiYThJCy3JFYr4uUtcD/ZGfEyrMdaIH6lN6kXi/4/9kCQfzpvAbdxsoYIpth Rj8GrhR1xu394Tw3FIP74Br2K8lV8G2YB4HF0QnF2gwhKbXromwkGpjM0nAJxUOsUI IC5vH/4czTktcBXGRAcFD3g39LI8D0CgO3IT6Xh6yAZbS+ScsXcMzazVnMoNxRjgjg uzl7miUSfL5uA== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 7B367A2; Wed, 24 Jul 2024 19:22:23 +0200 (CEST) Date: Wed, 24 Jul 2024 19:22:23 +0200 From: Alvaro Herrera To: "Wetmore, Matthew (CTR)" Cc: "David G. Johnston" , Siraj G , sagar jadhav , Wasim Devale , Kashif Zeeshan , Muhammad Imtiaz , Pgsql-admin Subject: Re: [EXTERNAL] Re: Detect who ran DROP schema Message-ID: <202407241722.yigc7p4tnajc@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024-Jul-24, Wetmore, Matthew (CTR) wrote: > This is a major issue in the DBA world as enterprise management lawyers get more popular. > > At a large company I was at, there was only one elevated user, (which several people had user/pass) and then our personal accounts cannot do much due to modern corporate governance. This is how it was set up. > > As the DBA I couldn’t even log into the linux box where postgres was installed. > > I couldn’t even change any logging without a two day ticket to do the work. > > Not specifically this issue, but this is more the norm now-a-days then not. Yeah. This is an important if there are any potential attackers at all, which given today's Internet, you can be pretty sure is always the case. A database where people are allowed to connect as superuser is a sure way to get in trouble sooner rather than later. Having layered security is one of the first things you should be thinking about. FWIW I think even that one elevated user to which several people have user/pass is a bad idea; forensics would require to know who used the password when. It's better to have one elevated user _without login privs_, to which people can SET ROLE when they require it. This leaves a better trail. If you add something like pgAudit to the mix and direct its logs (or all Postgres logs) to a remote server where they can't easily be tampered with by attackers, you'll have a better trail of who did what, when, with what credentials. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "I can't go to a restaurant and order food because I keep looking at the fonts on the menu. Five minutes later I realize that it's also talking about food" (Donald Knuth)