A tamper-resistant log archive is one where the systems that generate the records have no ability to change them afterwards. The property an auditor is buying is not that your logs are complete — everyone’s logs look complete — but that they could not quietly have been made to look complete. That is an architecture question about account boundaries and key policies, and it is answered before any log is written.
It is also a claim people overstate. “Immutable audit logs” appears on a lot of slides in front of a lot of designs where an administrator can delete the bucket. This post is about building the real thing, and about being precise regarding where the real thing stops.
The three properties, and what each one is worth
#| Property | The mechanism | What it stops | What it does not stop |
|---|---|---|---|
| Separation | The archive lives in its own account; source accounts can deliver, not read or delete | Every path from a compromised workload account to the evidence about it | A highly privileged principal inside the archive account |
| Detection | Hourly digest files hashing each log and chaining to the previous digest | A quiet edit or deletion; the chain breaks and verification fails | The deletion itself, which is detected rather than prevented |
| Prevention | An organization policy denying the calls that stop or delete the trail | A local administrator switching logging off before acting | Someone with control of the organization management account |
Read the right-hand column carefully, because that is the honest part. Each mechanism has a residual risk, and the residual risks are different, which is exactly why you want all three. What none of them does is make deletion physically impossible. That requires write-once storage, and it is a deliberate, separate decision with consequences of its own.
Separation is the control that does the most work
#Put the archive in an account that exists only for that purpose. In a multi-account landing zone it is usually called audit, and it holds the log archive and the configuration aggregation and nothing else. No workloads, no build agents, no shared tooling.
The delivery path is deliberately one-way. The trail is configured by the organization, not by the accounts it covers, and CloudTrail writes into the archive bucket as a service principal. Members of the source accounts have no read permission, no delete permission and no route to the objects. The bucket policy denies anything the delivery does not require, and the encryption key is a customer-managed KMS key whose policy is at least as restrictive as the bucket policy — because a bucket policy alone is only half the door when the objects are encrypted.
This is the part that makes an incident survivable. If an attacker owns your production account entirely, they can do a great deal of damage, and the one thing they cannot do is edit the record of it. That property comes from the account boundary being enforced by the provider above everything in either account — the same reason the account boundary is the first real security control.
What log file validation actually proves
#Enable log file validation on the trail and CloudTrail starts writing digest files, one per hour, into their own prefix. Each digest contains the SHA-256 hash of every log file delivered in that hour, and a reference to the previous hour’s digest. The digest is signed with a private key whose public counterpart AWS publishes, so anyone holding the files can verify the signature without trusting you.
That structure produces two useful guarantees. If a log file is altered, its hash no longer matches the digest that recorded it. If a log file or an entire hour is removed, the chain of references has a hole in it. Both are verifiable with the standard tooling — aws cloudtrail validate-logs over a date range — which means the verification can be performed by an auditor, by an incident responder, or by you on a schedule.
Two caveats worth stating before someone else states them. Validation is detection, not prevention: it tells you the record was altered, it does not stop the alteration. And it only proves anything if someone runs it. A validation that has never been executed is a feature, not a control. Run it quarterly at minimum, and run it during any incident before you start drawing conclusions from the logs.
The policy that keeps the trail running
#The weakest point in most logging designs is not the storage. It is that logging is a setting in an account, and account administrators can change settings in their account. An attacker with administrative access does not need to edit the logs if they can stop them being written.
A service control policy closes that. It is evaluated above the account, so it constrains every principal in that account — including administrators, including the root user — and denies the calls outright: stopping logging, updating the trail, deleting the trail, stopping the configuration recorder, deleting the delivery channel. The calls fail with an explicit denial that no local permission can override. Only the organization management account can change the policy, and the management account should be empty, with access to it exceptional and alarmed.
This is the step that converts a claim into a property. “Logging is enabled in all accounts” is a statement about the current state, and current states drift. “Logging cannot be disabled in any account” is a statement about the rules, and an auditor can test it in ten seconds by trying it.
Retention, lifecycle and the cost conversation
#Retention is where compliance and finance meet, and it goes better when the two are discussed in that order rather than the reverse.
Start with the obligation. A Type II report tests controls over an observation window, so the logs must cover the whole window plus the audit itself. Contracts may require more. Incident response usually wants at least a year, because the gap between a breach and its discovery is routinely measured in months. Pick the period from those constraints, and only then make it cheap.
Making it cheap is a lifecycle policy. Audit logs have a distinctive access pattern: heavily queried for days, occasionally queried for months, and then almost never read but required to exist. Storage classes map onto that almost exactly — standard storage for the recent window, infrequent access for the middle, archival storage for the tail. The archived tail costs a fraction of standard storage and takes minutes to hours to retrieve, which is acceptable for a request from an auditor and not acceptable for an incident, so the boundary between the tiers should sit outside your realistic incident window.
The AWS Enterprise Baseline’s default is a 365-day retention with lifecycle transitions to infrequent access and then archival storage. That is a starting point rather than a rule: an organization with a longer contractual obligation should set the longer period deliberately and price it, rather than discovering the limit during an audit.
What we deliberately do not claim
#This is the section that usually gets left out, so it gets its own heading.
There is no S3 Object Lock in what ships, and no write-once retention. That means the honest description of the archive is: the accounts that produce the records cannot touch them, disabling the trail is denied organization-wide, and any alteration or gap is detectable through a signed chain — but a sufficiently privileged principal inside the archive account could still delete objects, and you would find out rather than be prevented.
If your obligations require true write-once storage, add Object Lock, and go in with open eyes. In compliance mode, objects cannot be deleted or overwritten by anyone, including the root user, until the retention period expires. That is precisely the point, and it is also the risk: a misconfigured retention period is not correctable, and you are committing to pay for that storage for the full term. It is the right choice for some organizations and an expensive mistake for others, which is why it should be a decision rather than a default.
Two other things worth being equally direct about, because they appear on competitor feature lists and are not part of this design: there is no cross-region replication of the archive, and no separate backup product is layered on top of the bucket’s own durability. If your threat model includes losing an entire region’s copy of the evidence, that is a gap to close explicitly, and closing it is a small piece of work — far smaller than discovering the gap during an audit.
What an auditor will actually ask
#Four questions, and they are the same four every time:
- Is logging enabled everywhere, including accounts created during the period? Answer with the organization trail, and with the fact that new accounts are covered automatically.
- Could someone have turned it off? Answer with the service control policy, and let them test it.
- Could someone have edited what was collected? Answer with the separate account, the key policy and the validated digest chain — and show them a validation run.
- Is it still there? Answer with the retention period and the lifecycle configuration.
Notice that all four are configuration questions, not screenshot questions. That is the difference between an audit that is a query and an audit that is a two-week screenshot scramble.
Where this sits in the foundation
#In the AWS Enterprise Baseline — the AWS edition of the BuiltForProd Baseline — the audit account holds the log archive and the AWS Config aggregator and nothing else. The organization trail is multi-region, encrypted with a customer-managed key that rotates annually, and has log file validation on. One of the four service control policies exists specifically to protect the audit path: no account can stop or delete the trail or the configuration recorder. Retention is 365 days with lifecycle transitions, and the detection services that consume the same telemetry are administered separately, from the security account — which is the subject of nine security services, one account.
Those specifics describe the AWS edition. The property they deliver — evidence stored where the systems it describes cannot reach it — belongs to the BuiltForProd Standard, and readiness is the claim we make about it. Certification remains your auditor’s decision.
Where to start this week
#- Find out which account your logs are in. If the answer is “the same account as the workloads”, that is the first thing to change.
- Check whether log file validation is enabled on your trail. If it is not, enabling it is a single setting and it starts working immediately — for future logs only, which is the argument for doing it today.
- Run a validation over last quarter. If the tooling reports gaps, you have learned something important about your archive before an auditor does.
- Try to stop the trail from a member account with an administrator role. If it succeeds, your logging is a setting rather than a control.
If those four take longer than a day because nobody is certain where the logs go, that uncertainty is the real finding. The BuiltForProd Assessment measures an existing estate against the Standard, and the compliance page sets out which evidence sources a foundation should generate on its own.