-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Audit: Timestamps on sink entries should match the creation time of the audit event #26088
Conversation
CI Results: |
Build Results: |
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.
This looks great! I love the implementation. Very clean and easy to understand.
// to provide a formatted time. | ||
type testTimeProvider struct{} | ||
|
||
// formattedTime always returns the same value for 22nd March 2024 at 10:00:05 (and 10 nanos). |
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.
Environmental storytelling ;P
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.
Looks great!
Previously when entries for audit were written to configured sinks (file, socket, syslog) the time associated with each entry was related to the exact time the sink tried to write it, and not the time the audit entry itself was created.
This PR changes this so that the time the entry (audit event) is created is the time which appears in the sink logs, this will help Operators to coordinate entries across multiple audit device sinks.
Addresses #8466