Retention and sending to a SIEM#
The audit grows with each access and each query, so Empowerment Center purges by itself whatever is past its retention period. This page explains how long things are kept and how to change it, how to stop logging queries if your organization decides so, and how to send the audit to a syslog or a SIEM.
Before you start#
Everything on this page is configured on the server, with the ecenter.audit.* properties or their environment variables (see Configuration), and applies when the backend restarts. The line below the title of the Audit screen shows what is in force.
How long it is kept#
| Category | Property | Default |
|---|---|---|
| Queries | ecenter.audit.retention.categories.query |
90d |
| Jobs | ecenter.audit.retention.categories.job |
90d |
| The others | ecenter.audit.retention.others |
365d |
Any category can have its own period with its code in lower case: access, query, data, workbook, job, scheduling, distribution, metadata or administration. For example, to keep access entries for two years and queries for six months:
Every hour (ecenter.audit.purge-interval), ECenter deletes what is past its period, in batches of 10,000 entries. With several instances there is no need to share it out: deleting what is already deleted does nothing.
Important
Lengthening a period does not bring back what has already been purged. If your organization must keep the audit longer than is convenient to have in the own database, export it periodically or send it to a SIEM (below).
How much space it takes#
Queries take the most space: each one stores its SQL and its values, and in PostgreSQL the text search has an index on the SQL. As a guide, in PostgreSQL, a million entries, nine out of ten of them queries with about 400 characters of SQL, take about 590 MB of table and about 270 MB of text indexes. Watch the size of the own database with your engine's tools (PostgreSQL or Oracle) and, if it grows too much, shorten the period for queries.
Stop logging queries#
By default, each query to a client database is recorded with its SQL and the values of its parameters (ecenter.audit.record-queries: true). To stop recording them:
With that:
- Query entries are not recorded. The screen says so below the title: “Queries are not recorded.”.
- Query denied entries (those that name what the user does not see), which show probing, are still recorded, and so is everything else.
The log lines#
Each audit entry also goes out as a line in the server log, in the ecenter.audit.<category> logger (ecenter.audit.access, ecenter.audit.query…):
action=LOGIN_FAILED outcome=FAILED user=ana connection= address=10.0.0.7 channel=SESSION channel_ref= target="" summary="Intento fallido de iniciar sesión: Usuario o contraseña incorrectos" job=
| Field | What it is |
|---|---|
action |
The action code (see What is recorded) |
outcome |
OK or FAILED |
user |
The login |
connection |
The connection identifier (not its name) |
address |
The IP address |
channel, channel_ref |
The channel and its reference |
target |
The object, in quotes |
summary |
The description, in quotes (in Spanish, as the server writes it) |
job |
The job identifier, at the end |
Control characters are replaced with spaces and the double quotes in the texts with single ones, so that nobody can forge a line with a login that contains a line break. The SQL and its values do not go in the line: they are in the entry.
By default access, data changes, workbooks, scheduling, distribution, metadata and administration go out (level info). Queries and jobs do not (warn), because there is one line for each one. To send them as well:
Operational alerts have their own lines in ecenter.operations.alert (see Operational alerts).
Sending them to a syslog or a SIEM#
ECenter has no syslog configuration of its own: the lines are sent with the log configuration. There are two ways.
From the container log#
The backend writes to standard output, and each line carries the name of its logger. Configure the Docker logging driver (or your organization's collector: Fluent Bit, Vector, the SIEM agent) to collect the output of the backend service and keep the lines whose logger starts with ecenter.audit or is ecenter.operations.alert. In deploy/compose.yaml, the driver is changed in the x-logging anchor.
With a syslog appender#
To send only the audit to a syslog, mount a Logback configuration file in the backend and point to it with LOGGING_CONFIG:
<!-- config/logback-spring.xml -->
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
<appender name="SIEM" class="ch.qos.logback.classic.net.SyslogAppender">
<syslogHost>siem.example.org</syslogHost>
<port>514</port>
<facility>AUTH</facility>
<suffixPattern>ecenter %logger %msg</suffixPattern>
</appender>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
</root>
<logger name="ecenter.audit">
<appender-ref ref="SIEM"/>
</logger>
<logger name="ecenter.operations.alert">
<appender-ref ref="SIEM"/>
</logger>
</configuration>
# deploy/compose.yaml, backend service
volumes:
- ./config/logback-spring.xml:/opt/ecenter/config/logback-spring.xml:ro
environment:
LOGGING_CONFIG: /opt/ecenter/config/logback-spring.xml
The Logback syslog appender sends over UDP. If your SIEM requires TCP or TLS, use the first way or a local syslog relay.
The audit lines replace the syslog of Empowerment Center 7 (EC7), whose mask, host and port were configured in the product itself: now they are configured in the log.
Configuration#
| Property | Default | What it is |
|---|---|---|
ecenter.audit.record-queries |
true |
Record each query with its SQL and its values |
ecenter.audit.retention.others |
365d |
How long a category without its own period is kept |
ecenter.audit.retention.categories.<category> |
query: 90d, job: 90d |
The period of a category |
ecenter.audit.purge-interval |
1h |
How often it is purged |
ecenter.audit.export-max-rows |
100000 |
Maximum entries in an export |
ecenter.audit.export-timeout |
30m |
How long the download of an export may last |
ecenter.audit.contains-timeout |
10s |
How long a search with Contains without a From may take before it is cut off |