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 1l6xO7-0000D7-JS for pgsql-general@arkaria.postgresql.org; Tue, 02 Feb 2021 15:14:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l6xO6-0005uL-HI for pgsql-general@arkaria.postgresql.org; Tue, 02 Feb 2021 15:14:42 +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 1l6xO6-0005uE-9X for pgsql-general@lists.postgresql.org; Tue, 02 Feb 2021 15:14:42 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6xNz-00005w-Qs for pgsql-general@lists.postgresql.org; Tue, 02 Feb 2021 15:14:40 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id 151E043C1; Tue, 2 Feb 2021 16:14:33 +0100 (CET) Date: Tue, 2 Feb 2021 16:14:33 +0100 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: ransomware Message-ID: <20210202151433.GA1814@hjp.at> Mail-Followup-To: pgsql-general@lists.postgresql.org References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="J/dobhs11T7y2rNN" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --J/dobhs11T7y2rNN Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2021-02-02 15:44:31 +0100, Marc Millas wrote: > I know its quite general. It is as I dont=A0know what approaches may exis= t. >=20 > Requirement is extremely simple: Is there anyway, from a running postgres > standpoint, to be aware that a ransomware is currently crypting your data= ? PostgreSQL can be set up to store a checksum with every page (I think that's even the default in recent releases). If an external process encrypts a data file used by PostgreSQL it is unlikely to get the checksums correct (unless it was written explicitely with PostgreSQL in mind). So the next time PostgreSQL reads some data from that file it will notice that the data is corrupted. Of course is would notice that anyway since all the other structures it expects aren't there either. > answer can be as simple as: when postgres do crash..... Yep. That's what I would expect to happen pretty quickly on a busy database. The question is: Does that help you? At that point the data is already gone (at least partially), and you can only restore it from backup. hp --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --J/dobhs11T7y2rNN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmAZbFMACgkQ8g5IURL+ KF213A/+JPSV7UjFMZNPgG1ZYhe85UOT3iM/d+FcVWOg6uKZdEATGrsaxCwpWCa0 j9bYKsVIdFdPZ60qFA4FKPVjEPZB1QUVaJnnxOdSITWoZV/BjDZ8ZQhdciN94WuX KMoqb+fJ6dL10FVIvUyeClXVm44mZTHFG2JYKlw0gAxwqehbz5sZh4S+xEnGaO2h nLjZcFzgoOSYGckuC8tbsDTP8QfHXooW8+8Tkgz0t19t3cjM5UqlseRympCHsoau 0ttVP2f7dvskJpOXMJkliL2uh6dNhMNQRICForSOGUTPVRevGj/tDdOBuHKTDRhM cl7tW2nS6rqwOlGk5EHCPWSIcHDVo+okU/pNe+NtOqtE6vNlWvmo13HQiDQB/c2x 0RM3qLnBgtYG1v2Shi+xswSDT1Ll4hkCIJGDugbs8wpPKK5035byhMywXQgAbnG2 7k0FDbirWRW6eYLlJrU/k5/5g8MWYuKdFrzCigJXdbwmBOnXrXxN1r4buEoXBFcS L9zR6/Azh6bPJcbOP0V5vI+kCPLdA9H0GNn14GuuZdcluMAWzwxrqwxN7lTm2jD3 LDKJs+ekzgxUpGYpeRaKMVVWyGzDrfizvNFdG4XUQR4QuQl/ZOAX8Myt10BkOJy+ uyGeoYssvUCuL+mvNTqaUggDV2/ZsC9+s15pEokpkYsUzoj1WPA= =S5f9 -----END PGP SIGNATURE----- --J/dobhs11T7y2rNN--