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 1l71Zw-0001R3-BR for pgsql-general@arkaria.postgresql.org; Tue, 02 Feb 2021 19:43:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l71Zv-0006yr-B2 for pgsql-general@arkaria.postgresql.org; Tue, 02 Feb 2021 19:43:11 +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 1l71Zv-0006yk-1h for pgsql-general@lists.postgresql.org; Tue, 02 Feb 2021 19:43:11 +0000 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l71Zr-0002Bk-IX for pgsql-general@lists.postgresql.org; Tue, 02 Feb 2021 19:43:09 +0000 Received: by mail-pj1-x1036.google.com with SMTP id gx20so3081632pjb.1 for ; Tue, 02 Feb 2021 11:43:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version; bh=1YRulgx9L9OuCwyPdnrB71Kk3Bf/Y05Z6d8AVNOGNiU=; b=qoKY8+dqlQ5iA/IrPEFDMQ/VtZpFXDMziRDVmi9PWMYLe1AxYOSwR+Vp7yvuPy4IPI MTzz//m/kTzFqO5j4Y/DOPHu4wFK2R/hw75mITeIxKJ94/Kgo8xDIbHR7UVWPEmao+ru CqMR0uLFAjYcz5Ab28EsOTLe6jBYREX2viACfeTZ2tMvlelB5Xl3HTrM3uh5QUc1k8bI EtEp4qEtSBmmOv5kDbPHZimNJB6K8odyop5iiwhU9YefPP2vE2Kax1OK9Y0udRXWkXCP vxsSFBa30PhcLQ1N4FclbyUJUoCLQXg/tnw0976TsTyuUhucj5uomqHRX0ursS8wi7vj JY9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version; bh=1YRulgx9L9OuCwyPdnrB71Kk3Bf/Y05Z6d8AVNOGNiU=; b=SJ5hQZubaW7DRwT+RXKpOvDL/8Km7OAno3E1ZCoLXP7AgcmKwSJ/yJB9JpHg60HPi5 jXev751Nkbw2pgBnNJR9OfEVanijuHxw8jXGyTxPaBQlZ4TosVugUyDwv8O5BdIgdzuo QGSCxvc4+in+SRjwpC7Dwf9ZgUCXz1vFsWE0BcRu4ZupU7Qx4hhhve6Se6Ihq+b8J8+b AVT0sleTjtyymxV76cCutd3wl05YzG/dp1E3Sp9ouYlUrITlplh6GkTDRZry8g4TjyYS t1EooCDAMqBic43B3Vg/anbZBQ8gfzzq5uLE4iZjGnJ+hkqesO7PZ34FpRm7fzXOX780 rcRQ== X-Gm-Message-State: AOAM533W77zl3RiQN1xrWKwNehlrqfurA2e4G1GVFOkt/vhkgiFP64UC UHYktz2+inO2RYYt2MRqagDmODUEn0cJIw== X-Google-Smtp-Source: ABdhPJx7iSsTtDBtMAWppqmsv/toChLZxg4hiF5YJSojgLq14Qc2R2p/76yMa6UqXX1EEt7EVQOYaQ== X-Received: by 2002:a17:902:bd97:b029:de:abc4:fec7 with SMTP id q23-20020a170902bd97b02900deabc4fec7mr23767031pls.7.1612294985810; Tue, 02 Feb 2021 11:43:05 -0800 (PST) Received: from tim-desktop (220-235-5-208.dyn.iinet.net.au. [220.235.5.208]) by smtp.gmail.com with ESMTPSA id fv12sm3530014pjb.22.2021.02.02.11.43.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 11:43:05 -0800 (PST) References: User-agent: mu4e 1.5.8; emacs 27.1.91 From: Tim Cross To: pgsql-general@lists.postgresql.org Subject: Re: ransomware Date: Wed, 03 Feb 2021 06:14:01 +1100 In-reply-to: Message-ID: <87wnvq1cjf.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Marc Millas writes: > Hi, > > I know its quite general. It is as I dont know what approaches may exist. > > Requirement is extremely simple: Is there anyway, from a running postgres > standpoint, to be aware that a ransomware is currently crypting your data ? > > answer can be as simple as: when postgres do crash..... > > something else ? > > Marc MILLAS > Senior Architect > +33607850334 > www.mokadb.com > > > Ransomeware tends to work at the disk level rather than the application level. There is too much work/effort required to focus ransomeware at an application level because of the amount of variation in applications and versions, to be profitable. This means any form of detection you may try to implement really needs to be at the disk level, not the application level. While it could be possible to add some sort of monitoring for encryption/modification to underlying data files, by the time this occurs, it will likely be too late (and unless your monitoring is running on a different system, the binaries/scripts are likely also encrypted and won't run as well). The best protection from ransomeware is a reliable, regular and TESTED backup and restoration solution which runs frequently enough that any lost data is acceptable from a business continuity position and which keeps multiple backup versions in case your ransomeware infection occurs some time before it is actually triggered i.e. in case your most recent backups are already infected. Backups should be stored in multiple locations. For large data sets, this can often mean having the ability to take fast filesystem snapshots as more traditional 'copy' approaches are often too slow to perform backups frequently enough to meet business continuity requirements. Bar far, the most common failure in backup solutions is around failure to test the restoration component. I've seen way too many places where they thought they had adequate backups only to find when they needed to perform a restoration, key data was missing. This can greatly increase the time it takes to perform a restoration and in extreme cases can mean restoration is not possible. regular testing of restoration processes is critical to any reliable backup solution. As it is also a good idea to have some sort of testing/staging environment for testing code/configuration changes, new versions etc, it can make sense to use your backups as part of your staging/testing environment 'refresh' process. A regular refresh of your staging/testing environment from backups then provides you with assurances your backups are working and that your testing etc is being performed on systems with data most similar to your production systems. Tim