SV-261868r1000609_rule
V-261868
SRG-APP-000097-DB-000041
CD16-00-001200
CAT II
10
$ sudo su - postgres
$ vi ${PGDATA?}/postgresql.conf
Extra parameters can be added to the setting log_line_prefix to log application related information:
# %a = application name
# %u = user name
# %d = database name
# %r = remote host and port
# %p = process ID
# %m = timestamp with milliseconds
# %i = command tag
# %s = session startup
# %e = SQL state
For example:
log_line_prefix = '< %m %a %u %d %r %p %i %e %s>'
As the system administrator, reload the server with the new configuration:
$ sudo systemctl reload postgresql-${PGVER?}
As the database administrator (shown here as "postgres"), check the current log_line_prefix setting by running the following SQL:
$ sudo su - postgres
$ psql -c "SHOW log_line_prefix"
If log_line_prefix does not contain "%m %u %d %s", this is a finding.
V-261868
False
CD16-00-001200
As the database administrator (shown here as "postgres"), check the current log_line_prefix setting by running the following SQL:
$ sudo su - postgres
$ psql -c "SHOW log_line_prefix"
If log_line_prefix does not contain "%m %u %d %s", this is a finding.
M
5598