Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fxgIB-0005tE-38 for pgsql-admin@arkaria.postgresql.org; Wed, 05 Sep 2018 22:28:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fxgI8-0004um-3u for pgsql-admin@arkaria.postgresql.org; Wed, 05 Sep 2018 22:28:52 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fxgI7-0004ue-MU for pgsql-admin@lists.postgresql.org; Wed, 05 Sep 2018 22:28:51 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fxgI0-0007Sc-G3 for pgsql-admin@postgresql.org; Wed, 05 Sep 2018 22:28:50 +0000 Received: by mail-pg1-x541.google.com with SMTP id 2-v6so4130732pgo.4 for ; Wed, 05 Sep 2018 15:28:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=nwEz5IO5KXVMbHjgElCsWVT3pN/JUeTwwYxnLdSVlKQ=; b=g/gf2lxLPDXuU/eYCHcahtlDpVpPUo9bWlzvu/2XedsXmHZzYVHIzKHntev+bpvV08 13MVBX6CNaQPYxBQWQemEaB35DgxdS+NGgIOOLLIYr8qrUObtdRZjH3S0B8VkMviixpv gULeWqrfw2oyQQ5ervW1hagghxpdEmUZTZR32ReI1vFWXvU1bhJxCKQIfy69U3qXSl5K cTZDvaIdV5208ndUBNyYrgMUYO2FsahHwBJtIa7uOJvQNELmN+UxWR/FI5bka1p1zbdx uQmM76CK2wKJcMFGrnNm/k8eiVLu7n85BGkmnm9cc5whVnjDRZQ1jOGl+F39S9Z8Atpl 4WvA== 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:cc:subject :in-reply-to:date:message-id:mime-version; bh=nwEz5IO5KXVMbHjgElCsWVT3pN/JUeTwwYxnLdSVlKQ=; b=oQtsX9CT5TIA6BYIG9HyVUoa/nIvhMWr9r2kp8w2tbM7sHV1AHHdTVUYk8nA9YK3kS 7S6AqeXtYMUedCH43BhBKSiAVPeRxG6B+soMtGbz0NJ4rx//lVuvuV2U1obvm1FIl01y y5GQzkzW6qucITlmFw4euI3Xo0niwdkW6FaTJkaV61aaqMmPwdgB3v2zxHIUlG/DwD8O r6b64S8YZ08a9V7qKFuv4MTDBj7Qa1UP9wU+JuTj+nGWn3HjA7ozxu9zOfhxhbHZCWOn JDn/Y4Tk2Cv48NmDP1UjDCpdYTECoyH48CB4A9Yy9sVH0V4Xf32Nq3Zg9xLvIovf4CJ4 sUCQ== X-Gm-Message-State: APzg51Bos/j1iDQxvNoAQYHQn5znOXWLVVv/xi/9A19iy43A+L3j/vbf f4tw7dgd+ebDU0gUqKS8cP7CjVK9mpU= X-Google-Smtp-Source: ANB0VdYDFWKuptEGkc2xx4QN1h5D3MHqxlTBoL9dMBS2KOkCPdPMrIt7j3vEC/Cbr/H4G10Psncjrw== X-Received: by 2002:a63:4606:: with SMTP id t6-v6mr38233915pga.271.1536186523294; Wed, 05 Sep 2018 15:28:43 -0700 (PDT) Received: from tim-desktop (2001-44b8-31f2-bb00-b51f-7d8d-6cfb-da17.static.ipv6.internode.on.net. [2001:44b8:31f2:bb00:b51f:7d8d:6cfb:da17]) by smtp.gmail.com with ESMTPSA id 16-v6sm5739319pfo.164.2018.09.05.15.28.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Sep 2018 15:28:42 -0700 (PDT) References: <30655.1536069964@sss.pgh.pa.us> <20180905174832.GO4184@tamriel.snowman.net> <87va7j61g2.fsf@gmail.com> User-agent: mu4e 0.9.18; emacs 26.1 From: Tim Cross To: Craig James Cc: Stephen Frost , Tom Lane , Praneel Devisetty , pgsql-admin@postgresql.org Subject: Re: User to get locked after three wrong login attempts. In-reply-to: Date: Thu, 06 Sep 2018 08:28:38 +1000 Message-ID: <87r2i760kp.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 Craig James writes: > On Wed, Sep 5, 2018 at 3:09 PM, Tim Cross wrote: > >> >> Stephen Frost writes: >> >> > Greetings, >> > >> > * Tom Lane (tgl@sss.pgh.pa.us) wrote: >> >> Praneel Devisetty writes: >> >> > We have a requirement , where we require a user to get locked after >> three >> >> > wrong login attempts. >> >> >> >> The usual recommendation is to configure Postgres to use PAM >> >> authentication; then you can set up any weird requirements like >> >> this one in the PAM configuration. >> > >> > Unfortunately, it's a pain to set up PAM and there's a lot of things in >> > the PAM stack which can't be used because PostgreSQL doesn't run as >> > root. We should really have a better solution to this pretty commonly >> > asked for capability; I'm hoping to find time soon to hack on that. >> > >> > Thanks! >> > >> > Stephen >> >> These days, I think the better solution is to have this functionality in >> a central system. Putting aside that it is an 'outdated' auditor >> requirement ... > > > To elaborate, you should explain to the auditor that this introduces a huge > denial-of-service vulnerability into your system. Anyone can start > hammering on everyone else's accounts, and with a fairly trivial script, > lock the entire company out of all accounts. This is a terrible idea. > Unfortunately, that is a reflection of the poor standard of most auditors. They are rarely technical people and just follow a rule book. Most of their rules are outdated and many are wrong. For example, many still require 'complex' passwords consisting of mixed case, punctuation/special characters etc. This is despite the fact the person who originally proposed such a scheme has actually come out and apologised and said he had it wrong (plus this 'standard' was removed from NIST standards over 2 years ago) and ignores the changes in technologies which has changed the threat (i.e. rainbow tables etc now mean length is far more important than complexity). The 'trick' with auditors is to only answer what they ask and answer in such a way that what you say is true, but perhaps open to favourable interpretation. e.g. Auditor: do your accounts get locked after X failed login attempts Answer: We use Active directory for our Windows domain, which has the failed login policy enabled. Auditor: Ah yes, I know about that - good, I will mark you as compliant. rather than Answer: Well sort of. We have AD for our windows accounts which has the failed login policy enabled, but some of our systems, like Postgres, don't use that service. Auditor: So do you get locked if you try to login to postgres and fail X times Answer: No Auditor: Oh dear, I will have to mark you as non-compliant. -- Tim Cross