Join our Newsletter — 33% off our NHI Course
Home› Guides› Tamper-Evident Logging Guide: Hash Chains, WORM Storage and…
Guide SOC & Detection Engineering

Tamper-Evident Logging Guide: Hash Chains, WORM Storage and Proving Log Integrity

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 15 min read
On this page

A log you cannot prove is unaltered is a weak piece of evidence, because the first thing a capable intruder does after gaining administrative access is edit or delete the records of what they did. Tamper-evident logging means designing the pipeline so that any change, deletion or gap is detectable, and so that you can show an investigator, auditor or court how you know. This guide covers the techniques (hash chains, Merkle trees, digital signatures, forward-secure sealing and WORM storage), how to control the human and machine identities that can touch logs, and how to verify integrity and keep a chain of custody. It is written for log platform engineers, SOC teams and compliance owners. For collection, retention periods and storage tiers in general, see the Log Management and Retention Guide; this page goes deeper on integrity only.

Key takeaways

  • Tamper-evident is not tamper-proof. Cryptography makes changes detectable; only storage controls and separation of duties make them hard. You need both.
  • Integrity starts at the source. Anything an attacker can alter before the log is hashed, signed or shipped is unprotected, so forward events off the host quickly and seal local stores.
  • Keys and anchors decide the outcome. A hash chain or signature is only as trustworthy as the key that signed it or the copy of the latest hash held somewhere the attacker cannot reach.
  • The log pipeline runs on non-human identities. Shipper agents, collectors and storage roles hold write and sometimes delete rights; scope them to append only and watch them like privileged accounts.
  • Verification has to be routine. Integrity checks that only run during an incident are often discovered to be broken during the incident; schedule them, alert on failure and record the result.

Why log integrity matters

Logs serve three purposes that all depend on integrity: detection (the SOC trusts that what it sees happened), investigation (responders rebuild a timeline) and evidence (auditors, regulators and courts accept the records). NIST SP 800-53 Rev 5 treats this as its own control, AU-9 Protection of Audit Information, with enhancements that map directly onto the techniques in this guide: AU-9(2) store on separate physical systems or components, AU-9(3) cryptographic protection, AU-9(4) access by a subset of privileged users and AU-9(6) read-only access. AU-10 Non-repudiation adds the requirement to prove who performed an action.

Regulatory drivers, at headline level: several regimes require logs or records to be retained in a form that resists alteration. The US SEC's Rule 17a-4(f), as amended in 2022 (effective 3 January 2023, compliance date 3 May 2023), lets broker-dealers keep electronic records either in non-rewriteable, non-erasable (WORM) form or in a system with an audit trail that allows the original record to be recreated if it is modified or deleted, including time stamps and the identity of the person responsible. PCI DSS Requirement 10, US federal logging maturity requirements and the EU AI Act's record-keeping article all have log protection or retention expectations; see the PCI DSS Requirement 10 Guide, the OMB M-21-31 Logging Maturity Guide and the Log Retention Requirements Map for the specific periods.

Threats to logs

MITRE ATT&CK v20 places log tampering in two tactics. Under Stealth, T1070 Indicator Removal covers deleting or altering artefacts to hide activity. Under Defense Impairment, T1685 Disable or Modify Tools covers turning logging off or clearing it.

ThreatATT&CK techniqueIntegrity control that exposes or blocks it
Deleting or editing local logs and artefactsT1070 Indicator Removal (including T1070.004 File Deletion, T1070.006 Timestomp)Rapid forwarding to a remote store (ATT&CK mitigation M1029 Remote Data Storage); hash chain gaps
Clearing Windows event logsT1685.005 Clear Windows Event LogsForwarded copy; alert on Security event 1102 (audit log cleared) and System event 104
Disabling or reconfiguring Windows event loggingT1685.001 Disable or Modify Windows Event LogSequence numbers and heartbeat gaps; configuration monitoring
Disabling the Linux audit systemT1685.004 Disable or Modify Linux Audit System LogImmutable audit configuration; collector alerts on silence
Clearing Linux or macOS system logsT1685.006 Clear Linux or Mac System LogsSealed journal; forwarded copy; signed syslog
Stopping or altering cloud audit trailsT1685.002 Disable or Modify Cloud LogOrganisation-level trails the account cannot change; provider digest validation; WORM bucket
Altering stored records to misleadT1565.001 Stored Data ManipulationHash chain or Merkle verification against an external anchor

Insiders matter as much as intruders. A log administrator who can both change records and run the verification job can hide their own actions, which is why separation of duties appears below as a control in its own right. For the cloud side specifically, see How to detect attackers disabling cloud audit logging.

Hash chains and signed logs

The cryptographic techniques differ in what they prove, what they cost and what they depend on.

TechniqueHow it worksWhat it provesWeak pointBest fit
Hash chainEach record (or block) includes the hash of the previous one, so changing any record breaks every later linkOrder and integrity of everything after a trusted pointAn attacker with write access can recompute the whole chain unless the latest hash is anchored elsewhereApplication audit trails, database audit tables, append-only files
Merkle treeRecords are leaves; a signed root hash summarises the tree. Inclusion proofs show a record is present; consistency proofs show a newer tree only appended to an older onePresence of a given record and append-only growth, with compact proofsNeeds someone to keep and compare signed roots; more complex to buildHigh-volume logs, shared or multi-party logs, transparency logs
Digital signaturesA signer hashes records or batches and signs with a private key; verifiers use the public keyOrigin and integrity; with sequence numbers, also gaps and replaysKey compromise allows forgery; key loss stops verificationSyslog from network devices and servers, signed digest files, export bundles
Forward-secure sealingThe sealing key evolves at a fixed interval and old keys are discarded, so an attacker who takes the current key cannot reseal past entriesThat entries before the compromise have not been alteredEntries after compromise are unprotected; verification key must be kept off hostHost-local journals on Linux
WORM storageStorage refuses overwrite or delete until a retention date passesNothing cryptographically; it prevents change rather than detecting itAdministrative modes that allow bypass; data altered before it was writtenArchive copies, regulated records, evidence stores

Signed syslog (RFC 5848): this IETF Proposed Standard (May 2010) adds signature blocks to syslog that carry hashes of a batch of earlier messages, a reboot session ID and a message counter, signed by the sender. That gives origin authentication, integrity, replay resistance and detection of missing messages. It does not encrypt, so pair it with TLS transport. It mandates SHA-1 support and recommends SHA-256; configure SHA-256 where your implementation allows. Support varies, so check your devices and collectors before relying on it.

Merkle trees in practice: Certificate Transparency (RFC 9162, Experimental, which obsoletes RFC 6962) is the best-known design: an append-only Merkle tree, signed tree heads with a timestamp, tree size and root hash, and inclusion and consistency proofs. The same pattern suits enterprise logs. RFC 9162 also notes the limit: a log could show different views to different clients, so signed roots must be compared or published somewhere independent.

Forward-secure sealing on Linux: systemd-journald supports it. journalctl --setup-keys creates a sealing key that stays on the host and a verification key you store elsewhere; the sealing key changes every 15 minutes by default (set with --interval=), and shorter intervals narrow the window in which changes could go undetected. journalctl --verify --verify-key= checks authenticity. See the Linux Logging and auditd for Defenders Guide.

Anchoring: every hash-based scheme needs the latest hash or signed root copied somewhere the log administrators cannot write: a separate account, a WORM bucket, a ticket, or a periodic signed export to a second team. Without an anchor, a privileged attacker simply rebuilds the chain.

Key management: keep signing keys in an HSM or managed key service, give the signing service use rights only (no export), rotate on a schedule, and retain old public keys for as long as the logs they verify. See the Cryptographic Key Management Guide.

WORM and immutable storage

WORM storage prevents change rather than detecting it, and is the simplest way to stop an administrator deleting an archive early. Most cloud object stores and many backup and archive appliances offer it; the concepts are similar across products.

  • Retention modes: object stores typically offer a flexible mode, where principals with a special bypass permission can shorten or remove retention, and a strict compliance mode, where no user, including the account's root user, can delete the object or shorten retention before it expires. Use the flexible mode only to test; use the strict mode for evidence and regulated logs.
  • Legal hold: a hold with no expiry that keeps data until it is explicitly removed, independent of the retention period. Restrict the permission to place and remove holds to the legal or investigations function.
  • What WORM does not cover: versioned stores can still accept new versions or delete markers, the data may have been altered before it was written, and a strict lock is irreversible, so set retention deliberately to avoid storing data, including personal data, longer than intended.
  • Regulatory assessment: some providers publish third-party assessments of their WORM features against SEC 17a-4, CFTC and FINRA rules. An assessment says the feature can support compliance; your configuration still has to meet the rule.
  • Separate failure domain: put the WORM archive in a different account or tenancy from the systems that generate logs, so compromising production does not give access to delete or re-key the archive. The Backup Security and Immutable Backup Guide covers the same pattern for backups.

Decision guidance: a small organisation can get most of the value from forwarding to a managed log service plus a strict-mode WORM copy, with the provider's own digest validation switched on for cloud audit trails. A large organisation, or one with regulated records, should add signing or hash chaining at the collector, an independent anchor, and scheduled verification by a team separate from log operations. Merkle-based designs are worth their complexity when logs are shared across organisations or volumes make per-record signatures expensive.

Separation of duties and access control

Cryptography fails if the same people and machines that generate, store and verify logs can also change them. Separation of duties (AC-5) and least privilege (AC-6) do the remaining work.

IdentityNeedsMust not have
Shipper or agent on each host (NHI)Append to its own stream or topicRead other streams, delete, change retention
Collector or pipeline service (NHI)Read from queues, write to storage, use signing keyExport signing key, delete objects, change bucket policy
Storage role for archive (NHI)Write new objects under lockBypass retention, remove legal holds
Log platform administratorsOperate pipeline, parsers, dashboardsDelete archives, alter verification results, hold verification key
Verification job and its ownerRead archives and anchors, read public keysWrite to the logs it verifies
SOC analystsSearch and readModify stored events
Break-glass accountEmergency change under dual controlRoutine use; every use is itself logged and reviewed
  • Pipeline NHIs: prefer workload identity or short-lived credentials over long-lived keys for shippers and collectors, inventory them with an owner, and alert when one is used from an unexpected host. See the Non-Human Identity (NHI) Guide.
  • Admin access: put log platform administration behind privileged access controls, with just-in-time elevation and session recording, and require two people for retention or policy changes on the archive.
  • Logging the loggers: send the audit trail of the log platform itself (policy changes, deletions, key use) to a destination its own administrators cannot change.

Proving integrity: verification and chain of custody

An integrity scheme proves nothing until someone verifies it and records the result. Build verification in from the start.

  1. Define the trust anchor: document where anchors (latest hashes, signed roots, digest files) and verification keys live and who controls them.
  2. Turn on built-in validation: enable cloud provider log file validation or digest features where they exist, and journald sealing on Linux hosts that keep local journals.
  3. Sign or chain at the collector: for sources without native integrity, hash-chain or sign batches as they arrive, and write the anchor to the WORM store.
  4. Pilot and test tampering: in a test environment, delete a record, edit a record and remove a whole file, then confirm verification fails and alerts in each case. Repeat after major pipeline changes.
  5. Schedule verification: run checks daily for high-value sources and at least weekly for the rest, from a job owned by a team separate from log operations; alert on any failure, gap in sequence numbers or missing digest.
  6. Prepare evidence exports: for an investigation, export the records with their hashes, signatures, anchors and public keys, record who exported them and when, and hash the export bundle. Use the Chain of Custody Form Template and see the Evidence Handling and Chain of Custody Guide.
  7. Roll back safely: introduce signing or chaining alongside the existing pipeline, keep the unsigned path until verification has run cleanly for a full cycle, and never apply a strict WORM lock to production buckets until retention values are agreed, because it cannot be undone.

Accurate time underpins all of this: inconsistent clocks make a genuine sequence look tampered with and a tampered one look plausible. Synchronise sources to a common time service and record time zone handling.

Metrics:

  • Percentage of in-scope log sources covered by signing, chaining, sealing or provider validation.
  • Verification runs completed on schedule, and time to investigate each failure.
  • Count of sequence gaps or missing digests per month, by source.
  • Percentage of archive storage under strict-mode retention.
  • Number of identities with delete or retention bypass rights on log stores (should trend towards zero outside break-glass).
  • Mean time from a log-clearing event (for example event 1102) to SOC triage.

Framework mapping

Control areaNIST SP 800-53 Rev 5NIST CSF 2.0ATT&CK mitigation
Protect stored logsAU-9, AU-9(2), AU-9(6)PR.DS-01M1029 Remote Data Storage
Cryptographic integrityAU-9(3), SC-13, AU-10PR.DS-01M1041 Encrypt Sensitive Information
Restrict log administratorsAU-9(4), AC-5, AC-6PR.AA-05M1022 Restrict File and Directory Permissions
Generate and retain recordsAU-12, AU-11PR.PS-04Not applicable
Review and investigateAU-6DE.AE-03, RS.AN-03Not applicable

CIS Controls v8.1 Control 8 Audit Log Management covers collection, storage and retention; see the CIS Control 8 Audit Log Management Guide. In ISO/IEC 27001:2022 the Annex A logging control asks for logs to be protected, which this guide's techniques implement.

Common failure patterns

  • Unanchored hash chain: records are chained, but the latest hash lives in the same database, so an administrator or intruder with write access rebuilds the chain and verification still passes.
  • Bypassable retention: archives use the flexible retention mode, and the pipeline role or an admin group holds the bypass permission, so "immutable" logs can be deleted.
  • Signing key on the same host: the signing key or verification key sits beside the logs it protects, so one compromise defeats both.
  • Verification never run: digest or seal checks are enabled but nobody runs them, and the first run during an incident reveals months of missing digests.
  • Over-privileged shipper credentials: a long-lived agent key with delete rights is copied across hosts; one stolen key lets an attacker erase the central store.
  • Integrity without completeness: logs are sealed perfectly but logging was disabled on the key host for hours, and no alert fired on the silence.

Practitioner checklist

  • Forward logs off hosts in near real time over TLS, and seal or sign any local store that must be kept.
  • Turn on provider log validation or digest features for every cloud audit trail.
  • Choose hash chaining, Merkle trees or signatures per source, and anchor the latest hash or root outside the log administrators' control.
  • Keep signing keys in an HSM or managed key service with use-only rights, and retain old public keys.
  • Store an archive copy in strict-mode WORM storage in a separate account, with legal hold restricted.
  • Scope pipeline NHIs to append-only, remove delete and bypass rights, and inventory them with owners.
  • Split duties: log operations, archive retention and verification belong to different people.
  • Schedule verification, alert on failures, sequence gaps and source silence, and test with deliberate tampering in a lab.
  • Prepare an evidence export procedure with hashes, keys and a chain of custody record.

Standards and references

Related NHI Mgmt Group resources: Log Management and Retention Guide · NIST SP 800-92 Log Management Guide · Evidence Handling and Chain of Custody Guide · Secrets Access Logging and Detection

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.