nextbuild.works

Concept · desired state

Configuration drift

The distance between what the code says a machine should be and what it is actually running, and what closing that distance found here.

Configuration drift is the gap between what a machine is declared to be and what it is actually running. The declaration is the desired state: the code, kept in version control, that says what every machine should hold. Drift is anything on the machine that the declaration does not account for, and anything in the declaration that never reached the machine.

Drift is easy to create and hard to see. A change made by hand, a change merged and never applied, a file written by a different version of the tooling: each leaves a machine that still works, and a declaration that no longer describes it.

None of this is new

In 2002, Steve Traugott and Lance Brown sorted every way of managing machines as divergent, convergent or congruent. The first is the one most places live with: “Divergence is characterized by the configuration of live hosts drifting away from any desired or assumed baseline disk content.”

The second pulls machines back: “Convergence is characterized by the configuration of live hosts moving towards an ideal baseline.” They credit the idea where it is due: “Convergence is a feature of Mark Burgess’ Computer Immunology principles”. The third, congruence, is “the practice of maintaining production hosts in complete compliance with a fully descriptive baseline”, and it has a particular answer to drift: “Congruent infrastructures rely on monitoring to detect deviations, and generally call for a rebuild when they have occurred.”

That sentence describes what we are building toward, twenty-four years later: a check that detects, and a rebuild from the declaration as the cure.

Why it matters more with an agent

An agent reads the declaration and believes it. It has no memory of the change someone made by hand last week, or of the merge nobody applied. A person who was there might remember that one machine is different. A fresh session sees only the code, and drift is exactly the part of the estate the code does not show.

A check only sees what it reads. When we retired an old key, the audit read every key file and reported clean, while the key was still registered in a database the audit never read. It stayed there for two weeks after being declared gone.

What finding it bought here

Where we fall short

We are convergent, not congruent. Between rebuilds a machine is only as current as the last time someone ran its code against it. Rebuilds happen in campaigns, not continuously.

The hourly check covers four parts of the code. Everything else is compared with the running estate only when someone runs it.

Detection is not correction. When the check finds drift, a person runs the fix. Nothing converges on its own, and merging a change still does not apply it.