code wiki / _hdl_build / nx_apistack_audit.nx
nx_apistack_audit.nx
buildroot/runtime/_hdl_build/nx_apistack_audit.nx
about
nx_apistack_audit.nx -- CAP-API-AUDIT: the control-plane must-have -- a who/what/when trail for every privileged
/api action (deploy/rollback/reconcile/restart/upload). Append-only AND HASH-CHAINED: each record's chain hash
folds the PREVIOUS record's hash + this record's payload, so altering or deleting any past record breaks the chain
and au_verify detects it. Tamper-EVIDENT by construction (the sovereign exceed over a mutable log file). Pure
integer FNV-1a -> deterministic, reproducible. Record: "<hex16 chain>\t<action>\t<actor>\t<result>\n".
license_tier: ORIGINAL
dependencies 2 imports · 1 importers
imports: nx_syscalls.nxnx_site_lock_lib.nx
imported by: nx_apistack_audit_gate.nx
structs
| none |
consts
| 9 | const AU_MAGIC_1048576: i64 = 1048576 |
| 11 | const AU_FNV_OFF: i64 = 0 - 3750763034362895579 // 0xcbf29ce484222325 |
| 12 | const AU_FNV_PRIME: i64 = 1099511628211 |
functions
| 15 | func au_fnv_chain(prev: i64, payload: *u8, n: i64) -> i64 |
| 23 | func au_hex16(h: i64, out: *u8) -> i64 called by 1: au_append |
| 29 | func au_hexparse(s: *u8) -> i64 |
| 41 | func au_read_file(path: *u8, out: *u8, cap: i64) -> i64 |
| 54 | func au_last_chain(logpath: *u8) -> i64 |
| 70 | func au_append(logpath: *u8, payload: *u8, payload_n: i64) -> i64 |
| 82 | func au_verify(logpath: *u8) -> i64 |