Skip to content

Commit a4a24fe

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 d1303bc commit a4a24fe

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
@@ -6501,6 +6501,13 @@ local0.* /var/log/postgresql
65016501
<sect2 id="runtime-config-logging-what">
65026502
<title>What to Log</title>
65036503

6504+
<note>
6505+
<para>
6506+
What you choose to log can have security implications; see
6507+
<xref linkend="logfile-maintenance"/>.
6508+
</para>
6509+
</note>
6510+
65046511
<variablelist>
65056512

65066513
<varlistentry id="guc-application-name" xreflabel="application_name">
@@ -7017,6 +7024,10 @@ log_line_prefix = '%m [%p] %q%u@%d/%a '
70177024
planning). Set <varname>log_min_error_statement</varname> to
70187025
<literal>ERROR</literal> (or lower) to log such statements.
70197026
</para>
7027+
<para>
7028+
Logged statements might reveal sensitive data and even contain
7029+
plaintext passwords.
7030+
</para>
70207031
</note>
70217032
</listitem>
70227033
</varlistentry>

doc/src/sgml/maintenance.sgml

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

0 commit comments

Comments
 (0)