Helpful first: What a container boundary does not stop · Who can write and who can ship
Thirty days to Halcyon · Case 12: The long list · Episode 5 of 5
Thursday. Kael Cho, Staff Infrastructure Engineer, fixed the node role on Monday and uplink- on Wednesday, both by hand. "Hand fixes come undone," he says. "Templates don't forget."
Sloane Sterling, Head of Compliance, chairs the board at 10:00 tomorrow. She will sign on evidence, not on promises.
At 16:10 a message arrives from Dax Mercer, Software Engineer: "Quick fix in the console. The uplink alarms were flapping." Is the account still what the templates say?
By the end you can
- Tell a preventive policy check on a template from a detective posture check on a live account
- Explain how drift happens and how it is caught
- Place a policy check in the pipeline so a risky change fails before it is applied
A template is a change you can read first
Infrastructure as code (IaC) means describing cloud resources in files that a tool applies. Kael writes templates for the ground- cluster, the node role, the halcyon- bucket, and the uplink- deployment and its load balancer. They live in Git, so every change has an author, a reviewer, and a time. That history is the provenance of the account's settings.
Before it changes anything, the tool writes a plan. A plan lists every resource it would create, change, or delete, and how. So a risky setting can be read, and refused, before it exists.
A check on the plan is a preventive control. It stops a change from happening. A posture tool is a detective control. It reads the live account and reports what already exists.
Meridian needs both. The plan check sees only changes that go through the pipeline. The posture tool sees everything in the account, but only after a change is live.
SORT IT OUT
Kael lists five checks for the ground-telemetry account. Which act before a change exists, and which find it afterwards?
Show the answers
- Preventive, before the change exists. It reads the plan, so the role is never created.
- Detective, after it exists. The bucket is already public when the tool sees it.
- Preventive, before the change exists. The pod is refused before it starts, even though the check sits outside the pipeline.
- Detective, after it exists. It finds a change that has already happened.
- Preventive, before the change exists. A review of the plan happens before the account changes.
Policy as code fails the plan
A policy check is a rule written as code and run on every plan. It has three parts: the rule, the input, and the result.
Meridian's rules are short. No pod may set privileged or hostNetwork. No role may allow a wildcard action. The input is the plan, exported as JSON with terraform show -. A policy engine reads that JSON. Open Policy Agent (OPA), with rules written in a language called Rego, is one such engine. Others do the same job, and none of them is a standard.
The result is pass or fail, with a reason a person can read. A failure stops the pipeline before apply. A pass goes to a reviewer, and only then to apply.
After apply, one more check keeps running. A scheduled job plans against the live account to catch changes made around the pipeline. The next section is about those.
WORKED EXAMPLE
One pull request, two failures
- 09:40, the commit. Kael builds his first templates from the files already in Git, with import blocks for the live resources. Nobody had copied Monday's or Wednesday's hand fixes into those files.
- 09:42, the plan. The plan would change the live account back.
ingest-would allowreadonly s3:*on every bucket again, anduplink-would run privileged on the host network.status - 09:43, the check. Two failures: a wildcard action in
ingest-, and a pod rule broken byreadonly uplink-. The pipeline stops, and nothing is applied.status - The fix. Kael copies the hand fixes into the templates: the narrowed policy, the pod without either setting, and the pod's own identity.
- 11:05 and 11:12. The new plan passes. Dax reviews it and approves the merge at 11:05. The pipeline applies it at 11:12.
Result: Both hand fixes are now in code. A later deploy cannot quietly undo them, because the check would fail it first.
PUT IT IN ORDER
Put one template change in order, from the commit to the check that keeps watching afterwards.
- The pipeline writes a plan.
- An engineer commits the template change.
- The pipeline applies the change.
- A scheduled drift check compares the account with the code.
- A second engineer reviews the plan.
- The policy check reads the plan.
Show the answer
- An engineer commits the template change.
- The pipeline writes a plan.
- The policy check reads the plan.
- A second engineer reviews the plan.
- The pipeline applies the change.
- A scheduled drift check compares the account with the code.
The plan has to exist before anything can check it. The machine check runs before the human review, so the reviewer reads a plan that already passes. Apply comes last in the pipeline, and the drift check watches what happens after.
Drift is a change the code never saw
Drift is any difference between the live account and its code. It comes from changes made around the pipeline: a console edit, a command typed during an incident, another tool. Kael's hand fixes on Monday and Wednesday were drift too, in the safe direction.
At 16:10 Dax raises the health check threshold on the uplink- load balancer, in the console. Its alarms had been flapping during passes. The change is sound. Nothing in the pipeline saw it.
A scheduled job runs terraform plan against the account every 15 minutes. At 16:25 it reports that the load balancer has changed outside Terraform. The next apply would put the old threshold back.
Drift detection has limits. It checks only the resources the code manages, and only the settings the tool can read. AWS CloudFormation, for example, marks resource types it cannot check as not checked.
YOUR CALL
The 16:10 fix
The 16:25 drift report names Dax's change to the uplink-status load balancer. Dax says the alarms are quiet now and asks you to leave it alone.
What happens to the console change tonight?
When does the change go into the templates?
Strong calls keep a sound emergency change, write down why it was made, and bring it into the code quickly, so the next apply does not undo it.
Show the strong calls
- Keep it live, and record who changed what, and why. The alarms stay quiet through the evening pass. The drift report now has a name and a reason beside it.
- Within a day, through a pull request that passes the check. Dax opens it that evening. The next apply keeps his threshold instead of reverting it.
What a template check cannot see
A plan check reads what someone intends to build. It cannot see what a workload does at runtime, what data lands in a bucket, or who reads it.
It also misses anything made outside the code. A bucket created by hand never appears in a plan, so no plan check ever judges it. That is why the posture tool keeps running on the live account after the templates exist.
The tool's own records need care too. Terraform keeps a state file that maps the code to real resources. HashiCorp's documentation says state is stored in plain text and can hold secret values from the configuration. The JSON form of a plan can show them as well. Treat both as secrets: encrypted storage, narrow access.
So the pipeline check, the drift check, and the posture tool each cover a gap the others leave. None of them is enough alone.
CHECK YOUR JUDGMENT
Friday, 09:30. Sloane asks you what evidence shows the path will stay closed after the board signs at 10:00. Which answer gives her that?
CASE FILE · CASE 12 · ENTRY 5 OF 5
Answer the closing question correctly to add this entry to your case file.
Fixed in code, held by checks
The path was closed in templates; a pipeline check fails any privileged pod or wildcard action, and a drift check finds console changes the code never saw.
Review sheet: exam notes and quick reference
Control A process, configuration, or technology meant to reduce a named risk or detect a named failure.
Provenance The recorded origin, collection method, transformations, and completeness limits of a piece of evidence.
Incident An event or set of events that actually or potentially causes a security loss requiring coordinated handling.
Infrastructure as code Describing cloud and server resources in versioned files that a tool applies, so each change can be read, reviewed, and checked before it happens.