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.
| Threat | ATT&CK technique | Integrity control that exposes or blocks it |
|---|---|---|
| Deleting or editing local logs and artefacts | T1070 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 logs | T1685.005 Clear Windows Event Logs | Forwarded copy; alert on Security event 1102 (audit log cleared) and System event 104 |
| Disabling or reconfiguring Windows event logging | T1685.001 Disable or Modify Windows Event Log | Sequence numbers and heartbeat gaps; configuration monitoring |
| Disabling the Linux audit system | T1685.004 Disable or Modify Linux Audit System Log | Immutable audit configuration; collector alerts on silence |
| Clearing Linux or macOS system logs | T1685.006 Clear Linux or Mac System Logs | Sealed journal; forwarded copy; signed syslog |
| Stopping or altering cloud audit trails | T1685.002 Disable or Modify Cloud Log | Organisation-level trails the account cannot change; provider digest validation; WORM bucket |
| Altering stored records to mislead | T1565.001 Stored Data Manipulation | Hash 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.
| Technique | How it works | What it proves | Weak point | Best fit |
|---|---|---|---|---|
| Hash chain | Each record (or block) includes the hash of the previous one, so changing any record breaks every later link | Order and integrity of everything after a trusted point | An attacker with write access can recompute the whole chain unless the latest hash is anchored elsewhere | Application audit trails, database audit tables, append-only files |
| Merkle tree | Records 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 one | Presence of a given record and append-only growth, with compact proofs | Needs someone to keep and compare signed roots; more complex to build | High-volume logs, shared or multi-party logs, transparency logs |
| Digital signatures | A signer hashes records or batches and signs with a private key; verifiers use the public key | Origin and integrity; with sequence numbers, also gaps and replays | Key compromise allows forgery; key loss stops verification | Syslog from network devices and servers, signed digest files, export bundles |
| Forward-secure sealing | The sealing key evolves at a fixed interval and old keys are discarded, so an attacker who takes the current key cannot reseal past entries | That entries before the compromise have not been altered | Entries after compromise are unprotected; verification key must be kept off host | Host-local journals on Linux |
| WORM storage | Storage refuses overwrite or delete until a retention date passes | Nothing cryptographically; it prevents change rather than detecting it | Administrative modes that allow bypass; data altered before it was written | Archive 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.
| Identity | Needs | Must not have |
|---|---|---|
| Shipper or agent on each host (NHI) | Append to its own stream or topic | Read other streams, delete, change retention |
| Collector or pipeline service (NHI) | Read from queues, write to storage, use signing key | Export signing key, delete objects, change bucket policy |
| Storage role for archive (NHI) | Write new objects under lock | Bypass retention, remove legal holds |
| Log platform administrators | Operate pipeline, parsers, dashboards | Delete archives, alter verification results, hold verification key |
| Verification job and its owner | Read archives and anchors, read public keys | Write to the logs it verifies |
| SOC analysts | Search and read | Modify stored events |
| Break-glass account | Emergency change under dual control | Routine 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.
- Define the trust anchor: document where anchors (latest hashes, signed roots, digest files) and verification keys live and who controls them.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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 area | NIST SP 800-53 Rev 5 | NIST CSF 2.0 | ATT&CK mitigation |
|---|---|---|---|
| Protect stored logs | AU-9, AU-9(2), AU-9(6) | PR.DS-01 | M1029 Remote Data Storage |
| Cryptographic integrity | AU-9(3), SC-13, AU-10 | PR.DS-01 | M1041 Encrypt Sensitive Information |
| Restrict log administrators | AU-9(4), AC-5, AC-6 | PR.AA-05 | M1022 Restrict File and Directory Permissions |
| Generate and retain records | AU-12, AU-11 | PR.PS-04 | Not applicable |
| Review and investigate | AU-6 | DE.AE-03, RS.AN-03 | Not 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
- NIST: SP 800-92 Guide to Computer Security Log Management
- NIST: SP 800-53 Rev 5 Security and Privacy Controls (AU-9 Protection of Audit Information)
- IETF: RFC 5848 Signed Syslog Messages
- IETF: RFC 9162 Certificate Transparency Version 2.0
- MITRE ATT&CK: T1070 Indicator Removal
- MITRE ATT&CK: T1685 Disable or Modify Tools
- systemd: journalctl manual (Forward Secure Sealing)
- US SEC: Electronic Recordkeeping Requirements for Broker-Dealers (Rule 17a-4 amendments, Federal Register)
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