Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5ee0408

Browse files
committed
doc: warn about security issues around log files
Reported-by: Simon Riggs Discussion: https://postgr.es/m/CANP8+jJESuuXYq9Djvf-+tx2vY2OFLmfEuu+UvwHNJ1RT7iJCQ@mail.gmail.com Author: Simon Riggs Backpatch-through: 10
1 parent ca53f67 commit 5ee0408

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

doc/src/sgml/config.sgml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5123,6 +5123,13 @@ local0.* /var/log/postgresql
51235123
<sect2 id="runtime-config-logging-what">
51245124
<title>What To Log</title>
51255125

5126+
<note>
5127+
<para>
5128+
What you choose to log can have security implications; see
5129+
<xref linkend="logfile-maintenance">.
5130+
</para>
5131+
</note>
5132+
51265133
<variablelist>
51275134

51285135
<varlistentry id="guc-application-name" xreflabel="application_name">
@@ -5565,6 +5572,10 @@ log_line_prefix = '%m [%p] %q%u@%d/%a '
55655572
planning). Set <varname>log_min_error_statement</> to
55665573
<literal>ERROR</> (or lower) to log such statements.
55675574
</para>
5575+
<para>
5576+
Logged statements might reveal sensitive data and even contain
5577+
plaintext passwords.
5578+
</para>
55685579
</note>
55695580
</listitem>
55705581
</varlistentry>

doc/src/sgml/maintenance.sgml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,25 @@ analyze threshold = analyze base threshold + analyze scale factor * number of tu
947947
It is a good idea to save the database server's log output
948948
somewhere, rather than just discarding it via <filename>/dev/null</>.
949949
The log output is invaluable when diagnosing
950-
problems. However, the log output tends to be voluminous
950+
problems.
951+
</para>
952+
953+
<note>
954+
<para>
955+
The server log can contain sensitive information and needs to be protected,
956+
no matter how or where it is stored, or the destination to which it is routed.
957+
For example, some DDL statements might contain plaintext passwords or other
958+
authentication details. Logged statements at the <literal>ERROR</literal>
959+
level might show the SQL source code for applications
960+
and might also contain some parts of data rows. Recording data, events and
961+
related information is the intended function of this facility, so this is
962+
not a leakage or a bug. Please ensure the server logs are visible only to
963+
appropriately authorized people.
964+
</para>
965+
</note>
966+
967+
<para>
968+
Log output tends to be voluminous
951969
(especially at higher debug levels) so you won't want to save it
952970
indefinitely. You need to <emphasis>rotate</> the log files so that
953971
new log files are started and old ones removed after a reasonable

0 commit comments

Comments
 (0)