A Version Control System (VCS) based on the unit of "audits". Audits in the sense of actions modifying a database table(s), file(s), or some other unit of state. These actions have names and data which allow the action to be recreated without copying the files/rows/etc. Think of these audits kind of like migrations.
Audit VCS is based on the idea of having the most recent audit be the audit which gets the final say in audit decisions. Therefore Audit VCS is time based. In the case that two audits come in from the same time (nearly impossible), then they will be sorted based on their audit ID.
auditcmd.pyis the command line interface for Audit VCS. It is licensed under theMITlicenseauditvcs/**is the library/api for Audit VCS and is licensed underMPL 2.0.
Audits are stored in files containing the following information:
[ HEADER -- 24 bytes ]
[ audit-id -- uuid ]
[ audit-time -- unix timestamp (64bit) ]
[ previous_hash: u64 ]
[ audit-type -- [size: u32, text: u8[]] ]
[ audit-data [size: u64, json_text: u8[]]] # json for simplicity in extending the api
[ audit-back-data: [size: u64, json_text: u8[]]] # data used to reverse this audit
The history file is a contiguous block of AUDIT_DESCRIPTOR_SIZE sized elements. History is streamed in as necessary in order to avoid using large amounts of memory. History[0] is the latest audit. ``History[1]` is the next latest audit. Use negative index to index from the bottom of the history.