Skip to content

Commit 3b859f5

Browse files
authored
Compress audit logs (#64472)
audit logs should be compressed when rolling over due to size based triggering policy breaching 1GB. Files are not being deleted. closes #63843
1 parent 894dbc7 commit 3b859f5

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

docs/reference/migration/migrate_8_0/security.asciidoc

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,24 @@ xpack.security.authc.realms.kerberos.kerb1:
3333
remove_realm_name: false
3434
--------------------------------------------------
3535
====
36+
37+
[[audit-logs-are-rolled-over-and-archived-by-size]]
38+
.Audit logs are rolled-over and archived by size.
39+
[%collapsible]
40+
====
41+
*Details* +
42+
In addition to the existing daily rollover, the security audit logs are
43+
now rolled-over by disk size limit as well. Moreover, the rolled-over logs
44+
are also gzip compressed.
45+
46+
*Impact* +
47+
The names of rolled over audit logfiles (but not the name of the current log)
48+
have changed.
49+
If you've setup automated tools to consume these files, you must configure them
50+
to use the new names and to possibly account for gzip archives instead of plaintext.
51+
The Docker build of Elasticsearch is not affected since it logs on stdout where
52+
rollover is not performed.
53+
====
3654
// end::notable-breaking-changes[]
3755

3856
[[accept-default-password-removed]]
@@ -181,7 +199,7 @@ xpack.security.http.ssl.certificate_authorities: [ "corporate-ca.crt" ]
181199
<1> or `false`.
182200
====
183201

184-
.A `xpack.security.transport.ssl` certificate and key are now required to enable SSL for the transport interface.
202+
.A `xpack.security.transport.ssl` certificate and key are now required to enable SSL for the transport interface.
185203
[%collapsible]
186204
====
187205
*Details* +

docs/reference/migration/migrate_8_0/transport.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
=== Transport changes
44

55
//tag::notable-breaking-changes[]
6-
.Several `tranport` settings have been replaced.
6+
.Several `transport` settings have been replaced.
77
[%collapsible]
88
====
99
*Details* +
@@ -26,4 +26,4 @@ Specifying the removed settings in `elasticsearch.yml` will result in an error
2626
on startup.
2727
====
2828

29-
// end::notable-breaking-changes[]
29+
// end::notable-breaking-changes[]

x-pack/plugin/core/src/main/config/log4j2.properties

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,15 @@ appender.audit_rolling.layout.pattern = {\
7171
# "rule" name of the applied rule if the "origin.type" is "ip_filter"
7272
# "event.category" fixed value "elasticsearch-audit"
7373

74-
appender.audit_rolling.filePattern = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_audit-%d{yyyy-MM-dd}.json
74+
appender.audit_rolling.filePattern = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_audit-%d{yyyy-MM-dd}-%i.json.gz
7575
appender.audit_rolling.policies.type = Policies
7676
appender.audit_rolling.policies.time.type = TimeBasedTriggeringPolicy
7777
appender.audit_rolling.policies.time.interval = 1
7878
appender.audit_rolling.policies.time.modulate = true
79+
appender.audit_rolling.policies.size.type = SizeBasedTriggeringPolicy
80+
appender.audit_rolling.policies.size.size = 1GB
81+
appender.audit_rolling.strategy.type = DefaultRolloverStrategy
82+
appender.audit_rolling.strategy.fileIndex = nomax
7983

8084
logger.xpack_security_audit_logfile.name = org.elasticsearch.xpack.security.audit.logfile.LoggingAuditTrail
8185
logger.xpack_security_audit_logfile.level = info

0 commit comments

Comments
 (0)