Setting Separate Retention for Build Logs, Deploy Artifacts and Audit Records
For one deployment 20 days ago, developers want the compiler warnings, operations wants to redeploy the same file, and the business owner wants the approval trail. Start from those three questions to split retention for raw logs, artifacts and approval records, then test what you can still answer after expiry.
Three requests came in about a deployment from 20 days ago. The development team wants to see the warnings the compiler printed that day. Operations wants to put that exact version back on a test environment. The business owner wants to confirm who approved which file for production. All three cite the same deployment number, and each needs different material.
Build logs, deploy artifacts and approval/execution records answer different questions, so they get different retention periods. They share a deployment number, but one expiring must not take the others with it.
How do you split retention by record type?
Retention policy is easier to set when you start from those questions. The periods below are one team's operational example; a real retention schedule reflects the organization's contracts and records-management rules.
| Record | Question it answers | Example retention policy |
|---|---|---|
| Raw build log | Which step produced which warning or error? | Keep the original for 14 days. After expiry, show the run number, per-step results and the date the original expired |
| Deploy files, images and deployment definition | Can we redeploy the identical file used then? | 90 days for ordinary candidates. The current production version and the previous verified version are kept past that |
| Approval, execution and verification records | Who approved which target, and where was it actually applied? | One year, as an example. Linking the change request, approver and time, file digest, target environment and run result |
The difference between logs and artifacts shows up after expiry. If the file's SHA-256 digest survives, you can check whether a file you obtain later is the same one. A digest alone can't bring back a deleted file for deployment. A version designated for rollback must have its file and deployment definition actually retrievable. Separately, confirm that version still runs with today's configuration and database schema. Keeping approved builds versioned so you can pull them back out is covered in moving WAR files from rsync to an artifact repository.
What should audit records connect to?
Audit records should connect build provenance to the digest at approval time, the production target environment and the actual run result. Build provenance explains which build process produced a given artifact. Connect it to the digest at approval time, the environment designated as the production target and the actual run result, and you can confirm "is the file we approved the file we deployed?" SLSA's build provenance specification likewise links an artifact to the build definition that produced it.
How do you test a retention policy?
You test a retention policy by opening test data that already has expiry applied. For deployment #217 from 20 days ago, the raw compiler warnings show as retention expired. The operator can verify the retained file's digest and deploy it to a test environment. The business owner can use the same number to compare the approved target with what was actually deployed. Show how far each of the three requests can be answered, and when someone proposes longer retention it becomes clear which work the extra spend is for.
- #audit
- #traceability
- #supply-chain
- #compliance
- #cicd