-
Notifications
You must be signed in to change notification settings - Fork 4.4k
fix(audit): timestamp field to first in log #31437
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
base: main
Are you sure you want to change the base?
Conversation
@saipranav is attempting to deploy a commit to the HashiCorp Team on Vercel. A member of the Team first needs to authorize it. |
changelog/31437.txt
Outdated
@@ -0,0 +1,3 @@ | |||
```release-note:bug | |||
audit: Log entry has time as first field. Useful for log parsers, forwarders for accurate timestamps of events. |
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.
audit: Log entry has time as first field. Useful for log parsers, forwarders for accurate timestamps of events. | |
audit: Log entry fields are reorganized so time is the first field, which is useful for log parsers and forwarders for accurate timestamps of events. |
changelog/31437.txt
Outdated
@@ -0,0 +1,3 @@ | |||
```release-note:bug |
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.
```release-note:bug | |
```release-note:improvement |
Is it better to say it is an improvement?
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 think this would need to be called out as a change
, since this might have breaking impact for some customers
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.
That's a good point!
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 am actually wondering how other customers and even enterprise customers are not affected before by this audit log change?
Most of customers should have been using default settings in log parsers, this change was probably introduced in 1.16.x for audit logging refactor.
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 assume, change
can be merged even for minor releases and not just for major releases. Is my assumption correct?
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.
If we did want to merge this (I'm not yet sure if we do, due to breakage considerations), then this would have to be a major release. We don't release breaking changes in minor releases
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.
Understood. It is just that we need this badly for upgrading our enterprise servers and we prefer to do it quickly.
Nice idea : if feasible if you can ask enterprise customers if they are affected by the previous change and log parse of event timestamps.
I would call this one a fix or improvement, but I will leave it to you as you all know the system better.
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.
Left a minor suggestion, but looks good otherwise
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 was advised that this can break things for others so we need to consult more people.
adding @peteski22 for additional review, since he has refactored the file and for sure knows the system better than me |
@VioletHynes @aslamovamir |
Apologies @saipranav for the delay in replying, I completely missed being tagged in this. The JSON spec (both 2014 and 2017 versions) specifies that keys (fields) in the object (struct) are unordered: 2014: https://www.rfc-editor.org/rfc/rfc7159.html#section-1 2017: https://datatracker.ietf.org/doc/html/rfc8259#section-1
The Go library encoding/json follows the 2014 spec, with encoding/json/v2 following the 2017 spec. However, as described by the intention of the PR:
Whilst the Go v1 JSON encoder (which is being used in Vault) does ensure that the order of the fields is maintained when serialized, any JSON consuming services should be written against the spec, not a Go (or similar) specific implementation. I'd question that this is actually a 'bug' in Vault (I think @VioletHynes already mentioned changing this), as despite the changes around I'm not a Splunk admin/operator so I'm not 100% on this, but could the issue be resolved by configuring Splunk props.conf - Structured Data Header Extraction and configuration to handle JSON and the timestamp field (
This is something I'd look into as a solution for any customers that are reporting this issue as it may resolve it, or at least be a workaround until a newer version of Vault containing this PR is released and can be deployed in the customer's environments. Whilst I'm no longer at HashiCorp, I don't really see a problem with the intent of the change 'as-is'. I don't think I'd consider it a breaking change for existing users, as all it is doing is allowing Splunk customers to handle the audit log entries, any consumer of the log files that actually follows the JSON spec is not impacted. I'd recommend for HashiCorp reviewers to 'request changes' to the current PR however, to address the following:
Hope this helps. 😄 |
Description
PR modifies the struct of entry in audit log event and makes time as first field so after encoding / marshalling into json, time still stays as first field.
PR fixes #31435
TODO only if you're a HashiCorp employee
backport/
label that matches the desired release branch. Note that in the CE repo, the latest release branch will look likebackport/x.x.x
, but older release branches will bebackport/ent/x.x.x+ent
.of a public function, even if that change is in a CE file, double check that
applying the patch for this PR to the ENT repo and running tests doesn't
break any tests. Sometimes ENT only tests rely on public functions in CE
files.
in the PR description, commit message, or branch name.
description. Also, make sure the changelog is in this PR, not in your ENT PR.
PCI review checklist
Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.