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 1mo5D5-0003ZU-Mn for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Nov 2021 14:49:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mo5D2-0001Ii-Re for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Nov 2021 14:49:48 +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 1mo5D2-0001IZ-7h for pgsql-hackers@lists.postgresql.org; Fri, 19 Nov 2021 14:49:48 +0000 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mo5Cv-0001dB-70 for pgsql-hackers@postgresql.org; Fri, 19 Nov 2021 14:49:46 +0000 Received: by mail-wr1-x42b.google.com with SMTP id d24so18644050wra.0 for ; Fri, 19 Nov 2021 06:49:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=migops.com; s=google; h=to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=CjJz4rlaN4DeubEfQnMI3/07Bmow3aDAn5Hrz5xYsWY=; b=PWHPs6SIB8OFK4KsM7qiJOLFZ2gqHu0VIQIJeicZDMPapD1UwEVXCbWcwNnVHVveZ5 sauyIA9J1xAKXif0FEwXvoUDPOs61lTB/fn+Y6Fmw/0mNSlcyHdIa8dj4wkWltA0i/qn +FPvT1zDfs/Wx+SMiRG1wuvTJ/eGockm9epKLPD5t3DxrGLnJU3dBnPjjnv4VnDUxyxw rPpJqa24RILY/5FHDw6gL+RQcx+/t8HT7NrZAZ3hHH+gffRCDCXzD1q/gy7kx33aWRxc Feacr8L3wup1mjYC2stiDN/sk55SEQiA/gOm/49ryEkx3yOAIpA3EUDuySeF43nINC8A 4TAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language; bh=CjJz4rlaN4DeubEfQnMI3/07Bmow3aDAn5Hrz5xYsWY=; b=e7ywpxLm851sB4Z5ff3p9K+M4wyGd1XlSKTZyYFVMjnDkN9iS0ppu7er++JzaJB2Vk jr+c1wNU4u9ikD2Gs5n22G+e70p1c8F1En7NB9l0WCAzT0ZP/Aq0eX8iCdl8N31ob6IL 975YhsI8XxE1NI8s0nHq0LrfAg5UxZux0nAdR9i9/HuQpX05ePtx+bwVpbSvc5hUOw3D 0NisVBTrlfwaHGNJh9X9r0uuOw6eDo8fwB8s0kWq8/wwFWCwZBQTUAVTYIkQKJpbLnfA HwnLPqI/jRv3g5uYHHLVMM2V6OTuo7Sf+Bm29Qo7Il0ZA/SeLd/WnynBhlcJH6G87JFj CQwA== X-Gm-Message-State: AOAM532fIwzhXm7i+iIjFu/C1uqy4/sKuoJ7XSOLhZdFZB0s2lxfgsKx Q7cK49xEE5uThtIl9gsCFIqg7RRgOl1QEA== X-Google-Smtp-Source: ABdhPJxLsfrj/92ANohd3TgU+jl9IqhDSPaspSPZEc6aawqpBW94eLxJNE/EFisF2alG+mhoJ4Zm0Q== X-Received: by 2002:adf:f551:: with SMTP id j17mr8107969wrp.392.1637333378633; Fri, 19 Nov 2021 06:49:38 -0800 (PST) Received: from ?IPv6:2a01:cb14:51d:5100:11d4:49ba:48dc:8256? ([2a01:cb14:51d:5100:11d4:49ba:48dc:8256]) by smtp.gmail.com with ESMTPSA id 10sm4255754wrb.75.2021.11.19.06.49.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Nov 2021 06:49:38 -0800 (PST) To: PostgreSQL Hackers From: Gilles Darold Subject: Pasword expiration warning Message-ID: <129bcfbf-47a6-e58a-190a-62fc21a17d03@migops.com> Date: Fri, 19 Nov 2021 15:49:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------015BB07E5F45D545C024CB81" Content-Language: fr List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------015BB07E5F45D545C024CB81 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi all, Now that the security policy is getting stronger, it is not uncommon to create users with a password expiration date (VALID UNTIL). The problem is that the user is only aware that his password has expired when he can no longer log in unless the application with which he is connecting notifies him beforehand. I'm wondering if we might be interested in having this feature in psql? For example for a user whose password expires in 3 days: gilles=# CREATE ROLE foo LOGIN PASSWORD 'foo' VALID UNTIL '2021-11-22'; CREATE ROLE gilles=# \c - foo Password for user foo: psql (15devel, server 14.1 (Ubuntu 14.1-2.pgdg20.04+1)) ** Warning: your password expires in 3 days ** You are now connected to database "gilles" as user "foo". My idea is to add a psql variable that can be defined in psqlrc to specify the number of days before the user password expires to start printing a warning. The warning message is only diplayed in interactive mode Example: $ cat /etc/postgresql-common/psqlrc \set PASSWORD_EXPIRE_WARNING 7 Default value is 0 like today no warning at all. Of course any other client application have to write his own beforehand expiration notice but with psql we don't have it for the moment. If there is interest for this psql feature I can post the patch. -- Gilles Darold --------------015BB07E5F45D545C024CB81 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

Hi all,


Now that the security policy is getting stronger, it is not uncommon to create users with a password expiration date (VALID UNTIL). The problem is that the user is only aware that his password has expired when he can no longer log in unless the application with which he is connecting notifies him beforehand.


I'm wondering if we might be interested in having this feature in psql? For example for a user whose password expires in 3 days:


gilles=# CREATE ROLE foo LOGIN PASSWORD 'foo' VALID UNTIL '2021-11-22';
CREATE ROLE
gilles=# \c - foo
Password for user foo:
psql (15devel, server 14.1 (Ubuntu 14.1-2.pgdg20.04+1))
** Warning: your password expires in 3 days **
You are now connected to database "gilles" as user "foo".


My idea is to add a psql variable that can be defined in psqlrc to specify the number of days before the user password expires to start printing a warning. The warning message is only diplayed in interactive mode Example:

$ cat /etc/postgresql-common/psqlrc
\set PASSWORD_EXPIRE_WARNING 7

Default value is 0 like today no warning at all.


Of course any other client application have to write his own beforehand expiration notice but with psql we don't have it for the moment. If there is interest for this psql feature I can post the patch.


-- 
Gilles Darold
--------------015BB07E5F45D545C024CB81--