SoarJsonAuditingFormatter
This gem provides the formatting of audit entries for auditing purposes.
Installation
Add this line to your auditor Gemfile:
gem 'soar_json_auditing_format'
And then execute:
$ bundle
Or install it yourself as:
$ gem install soar_json_auditing_format
Testing
Run the rspec test tests using docker compose:
export UID
docker-compose build --force-rm --no-cache
docker-compose down
docker-compose run --rm soar-json-auditing-format
docker-compose down
Usage
When formatting an auditing entry call the formatter as follow:
SoarJsonAuditingFormatter::Formatter.format(:error,SecureRandom.hex(32),Time.now,{'message' => 'bla'})
Detailed example
require 'soar_json_auditing_format'
require 'byebug'
require 'securerandom'
class Main
def test_sanity
SoarJsonAuditingFormatter::Formatter.format(:error,SecureRandom.hex(32),Time.now,{'message' => 'bla'})
end
end
main = Main.new
main.test_sanity
The formatted output of the example above will be something like this:
error,9241cee6f0368942202d4d0e22ac09cde6c88446137c8c48e4eb053a703855f8,2016-05-27T08:40:27.087Z,[somekey:somevalue] message
Contributing
Bug reports and feature requests are welcome by email to barney dot de dot villiers at hetzner dot co dot za. This gem is sponsored by Hetzner (Pty) Ltd (http://hetzner.co.za)
Notes
Though out of scope for the provider, auditors should take into account encoding, serialization, and other NFRs.
License
The gem is available as open source under the terms of the MIT License.