Skip to content

Commit 9039e34

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 ec98eac commit 9039e34

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

6652+
<note>
6653+
<para>
6654+
What you choose to log can have security implications; see
6655+
<xref linkend="logfile-maintenance"/>.
6656+
</para>
6657+
</note>
6658+
66526659
<variablelist>
66536660

66546661
<varlistentry id="guc-application-name" xreflabel="application_name">
@@ -7241,6 +7248,10 @@ log_line_prefix = '%m [%p] %q%u@%d/%a '
72417248
planning). Set <varname>log_min_error_statement</varname> to
72427249
<literal>ERROR</literal> (or lower) to log such statements.
72437250
</para>
7251+
<para>
7252+
Logged statements might reveal sensitive data and even contain
7253+
plaintext passwords.
7254+
</para>
72447255
</note>
72457256
</listitem>
72467257
</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)