-
Notifications
You must be signed in to change notification settings - Fork 25k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Structured audit logging #31931
Structured audit logging #31931
Conversation
Pinging @elastic/es-security |
...security/src/main/java/org/elasticsearch/xpack/security/audit/logfile/LoggingAuditTrail.java
Show resolved
Hide resolved
@albertzaharovits Do you seen an issue that Filebeat would still do some potential transformations on the event during ingest time? We do similar things when we fetch metrics and prefix it with the service to prevent conflicts. It would not make sense in an Elasticsearch API to prefix everything and I think the same is true for a log. |
Alrighty, based on the feedback from @ruflin I have:
Yep, they're handcrafted. They will definitely be in the documentation (there is already documentation for it, but it is stale).
No, I don't take any issue with this.
I think all top level fields which are not part of ECS have to/should be prepended during ingest with the appropriate namespace. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left two minor comments. Otherwise LGTM!
@@ -1554,7 +1566,7 @@ public void testIndicesFilter() throws Exception { | |||
} | |||
|
|||
private <T> List<T> randomListFromLengthBetween(List<T> l, int min, int max) { | |||
assert (min >= 0) && (min <= max) && (max <= l.size()); | |||
assert min >= 0 && min <= max && max <= l.size(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep the parentheses?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I though I can spot when Eclipse does these check while validating the commit diff, but it looks like I can't. I have removed the check. I have long entertained the idea of using vim and things like this are only stoking it...
...security/src/main/java/org/elasticsearch/xpack/security/audit/logfile/LoggingAuditTrail.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for iterations, LGTM.
@ruflin I am going to merge this. There are no outstanding moot points, I have addressed them all. |
* master: (24 commits) Only notify ready global checkpoint listeners (elastic#33690) Don't count hits via the collector if the hit count can be computed from index stats. (elastic#33701) Expose retries for CCR fetch failures (elastic#33694) Test fix - Graph vertices could appear in different orders based on map insertion sequence (elastic#33709) Structured audit logging (elastic#31931) Core: Add DateFormatter interface for java time parsing (elastic#33467) [CCR] Check whether the rejected execution exception has the shutdown flag set (elastic#33703) Mute ClusterDisruptionIT#testSendingShardFailure Revert "Mute FullClusterRestartSettingsUpgradeIT" Adjust BWC version on settings upgrade test (elastic#33650) [ML] Allow overrides for some file structure detection decisions (elastic#33630) Adapt skip version for doc_values format deprecation [TEST] wait for no initializing shards [Docs] Minor fix in `has_child` javadoc comment (elastic#33674) Mute FullClusterRestartSettingsUpgradeIT [Kerberos] Add realm name & UPN to user metadata (elastic#33338) [TESTS] Disable specific locales for RestrictedTrustManagerTest (elastic#33299) SQL: Return functions in JDBC driver metadata (elastic#33672) SCRIPTING: Move terms_set Context to its Own Class (elastic#33602) AwaitsFix testRestoreMinmal ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM. I think we will figure out the small nitty gritty details as soon as we try to add it to the Filebeat module.
@ycombinator FYI
Documents the new structured logfile format for auditing that was introduced by #31931. Most changes herein are for 6.x . In 7.0 the deprecated format is gone and a follow-up PR is in order.
Documents the new structured logfile format for auditing that was introduced by #31931. Most changes herein are for 6.x . In 7.0 the deprecated format is gone and a follow-up PR is in order.
Documents the new structured logfile format for auditing that was introduced by #31931. Most changes herein are for 6.x . In 7.0 the deprecated format is gone and a follow-up PR is in order.
Documents the new structured logfile format for auditing that was introduced by #31931. Most changes herein are for 6.x . In 7.0 the deprecated format is gone and a follow-up PR is in order.
As it now stands logfile security auditing is almost structured. Most fields are of the form
key=[value]
and there is no text in between the entries (besides the comma and space delimiters). If all values where of the formkey=[value]
then such entries would count as'structured'
. Examples of such values, which are not prepended by the field name, are:date
,host name
,node name
,layer: rest or transport
.This PR builds the log event as a Map, and lets log4j's internals (precisely the
layout
assigned to theappender
) to handle the actual printing format. This is better because we could have many appenders for the same log each with a particular layout from: JSON, XML or syslog (all structured) to custom ones to get the desired human friendly templated format. Even better: we could changeappenders
andlayouts
at runtime, without touching the code, from the log4j conf file.It is WIP because tests still need fixing.Closes: #31046