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 1jPL1x-000321-Ke for pgsql-docs@arkaria.postgresql.org; Fri, 17 Apr 2020 07:03:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jPL1w-00058G-I2 for pgsql-docs@arkaria.postgresql.org; Fri, 17 Apr 2020 07:03:16 +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 1jPL1t-0002iG-CY for pgsql-docs@lists.postgresql.org; Fri, 17 Apr 2020 07:03:13 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jPKzz-00060y-OX for pgsql-docs@lists.postgresql.org; Fri, 17 Apr 2020 07:01:16 +0000 Received: by mail-wr1-x441.google.com with SMTP id a25so1815571wrd.0 for ; Fri, 17 Apr 2020 00:01:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=kYgJWUtaHcahYbIXAP3d8cOdwy3uMS5tlO/SBchiTY8=; b=LtslfuQcZoMk2oM4A4tOl3fTP+MzGucV0Ub7XvmlitDyaV01+IIwFbsERrn63A6TRd BZybsWRtibmvc4Ml6dmSgsndggxDerYMZzVYWSNY797+jnceHjD2PwGBv9GX24XKe80U U/j/lCI5LSqtdvGuRUawUOrsmXpIaGMiAeWCe+6FI0XKi7BicMJ+hksS4u1GSyI315+I xmYiEj39wuhVtypo08bYcDYhkZ6qO4iBlORcP3Q/2noUgExj7jFPz5xIONddEfUJS5fZ MqZJI59Oz1iypuxAGBExetB5spWvP0dodjXchSNWPCmIpT1btWczSQr+EGeoieOK1fd4 d5LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=kYgJWUtaHcahYbIXAP3d8cOdwy3uMS5tlO/SBchiTY8=; b=FcTOEyAZ5oSLOahInQiWEe6PoUiFggU7Gy7GS3u49z3DEeqVcp0JtLWdi6rshP2JaP O0OiyPCvJhMSwEVms+ILMQIhJQVaYXBPmUZ5hnHuv3LhpWu03MWS7vtuxiDaFPnVkKMU H6zRg4d27puAr+pB5stGIs3duYY3BgduEdvI15D3iqNLgqAK0LLXf2kic2lYfyDii89n zb4s5lw0G7K1escuqDImKWcqcaVUab/LrMMQ/kEE4ezBbx/yjuZD80U3FEGzTYC4wzIl L5GzfT6+xfqaanwJhwukfqO3XjxBgB19G1qiOB2gV0QCdRI+rrAVy4p1GBhv3TQynhYO NPnw== X-Gm-Message-State: AGi0PuZ3LMKUPfUv4D9Qru8BY6u+enpnS+cqC0TvB0ldfP8FMpCg4c2R RVablWiAvqHrJZaJ4F3ZYgseqw== X-Google-Smtp-Source: APiQypIG+51d7RUejTGuw3ctsc/d2gN63Wua/mJ9e2e4wXoGqpwO47QM8cc8pfXGlF1e5qNgrhNBxQ== X-Received: by 2002:a5d:5085:: with SMTP id a5mr2480888wrt.394.1587106874101; Fri, 17 Apr 2020 00:01:14 -0700 (PDT) Received: from dynamic-enps4ysyol859bmr0-pd01.res.v6.highway.a1.net (dynamic-enps4ysyol859bmr0-pd01.res.v6.highway.a1.net. [2001:871:60:809f:3db3:6bd5:7c47:e4ec]) by smtp.gmail.com with ESMTPSA id o7sm938835wmh.46.2020.04.17.00.01.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Apr 2020 00:01:13 -0700 (PDT) Message-ID: Subject: Re: pg_stat_statements showing passwords while create or alter users. From: Laurenz Albe To: chandu_munnu@yahoo.com, pgsql-docs@lists.postgresql.org Date: Fri, 17 Apr 2020 09:01:12 +0200 In-Reply-To: <158708887722.25694.11400369619365749891@wrigleys.postgresql.org> References: <158708887722.25694.11400369619365749891@wrigleys.postgresql.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, 2020-04-17 at 02:01 +0000, PG Doc comments form wrote: > pg_stat_statements is recording passwords also, is there any way to avoid > the logging of passwords without droping extension package. > testdb=> create user test1 with password 'test123'; > CREATE ROLE > testdb=> create user test2 with encrypted password 'test123'; > CREATE ROLE > test=> select query from pg_stat_statements where query like '%test%'; > query > ----------------------------------------------------------- > create user test1 with encrypted password 'test123' > create user test2 with password 'test123' There is no way to obfuscate such passwords. Note that these statements will also show up in the server log if you set "log_statement = 'ddl'". For these reasons it is recommended to never set your password like this, but always hash it on the client side first. Most interactive clients have a way to do that, like psql`s "\password". Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com