Tamper-evident audit log

Every audit line carries a chain value: a keyed hash (HMAC-SHA256, key derived from the installation’s master key) over the line and the chain value of the line before it. Changing a line, inserting one or removing one from the middle breaks the chain from that point, and nobody can repair it without the key. Settings → Audit log shows whether the log is intact and has a Check now button; Netlens also checks every six hours, raises a critical event (it breaks through quiet hours) and a “needs attention” entry when the check fails, and never reports the same failure twice.

What it does not do, plainly: somebody who can write to the database and holds the key can rebuild the whole chain, and a line removed from the very end leaves a valid chain. Hence the anchors: once an hour, if there is anything new, Netlens writes an audit line Audit chain anchor: row N, chain … holding the newest chain value. Log forwarding (Small business and Enterprise) sends audit lines to your SIEM like all others, so the SIEM keeps a copy that Netlens cannot reach; compare it with the check result when it matters. Retention keeps the chain: when old lines are pruned, the chain value of the last one removed is kept so the rest can still be verified. Lines from before this existed are counted and reported as such. The chain is for every edition. GET /api/audit/integrity (?run=true to check now) is for administrators.