Skip to content
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

Merged
merged 2 commits into from
Mar 22, 2024

Conversation

peteski22
Copy link

@peteski22 peteski22 commented Mar 22, 2024

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

@peteski22 peteski22 added core/audit hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed labels Mar 22, 2024
@peteski22 peteski22 added this to the 1.16.1 milestone Mar 22, 2024
Copy link

github-actions bot commented Mar 22, 2024

CI Results:
All Go tests succeeded! ✅

@peteski22 peteski22 marked this pull request as ready for review March 22, 2024 10:33
Copy link

Build Results:
All builds succeeded! ✅

Copy link
Contributor

@VioletHynes VioletHynes left a 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).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Environmental storytelling ;P

Copy link
Contributor

@ccapurso ccapurso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core/audit hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants