go-audit
go-audit copied to clipboard
Fixed race conditions for log writing and minor bugs in parser.go
- [X] I've read and understood the Contributing guidelines and have done my best effort to follow them.
- [X] I've read and agree to the Code of Conduct.
- [X] I've been mindful about doing atomic commits, adding documentation to my changes, not refactoring too much.
- [X] I've a descriptive title and added any useful information for the reviewer. Where appropriate, I've attached a screenshot and/or screencast (gif preferrably).
- [X] I've written tests to cover the new code and functionality included in this PR.
- [X] I've read, agree to, and signed the Contributor License Agreement (CLA).
PR Summary
-
Added a mutex to AuditWriter in order to avoid a race condition.
-
Added a function
rotate
to use the mutex to rotate logs. -
Modified tests accordingly to the previous changes and used an atomic.LoadUint32 for n.seq.
-
Added the
syscall
JSON parameter in order for it to appear in AuditMessageGroup. -
Added 1305 to the
AddMessage
switch in order to not map the uid for that message.
Related Issues
None
Test strategy
Modified the tests in order to work with the mutex changes. Tested in a test environment to verify the 'syscall' parameter was appearing in the JSON struct.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.
:wave: @annab-stripe thanks for the PR. Can you do the CLA bit for us?
Hi, somebody from Stripe legal team signed one for me an year ago.