#44 - Kosli with Mike Long. From compliance to answering questions about the production environment
Production history connects running binaries to commits, scans and approvals when an incident needs explaining.
15 min read
We are excited about the new breed of tools coming to the market. We often had to put together tools to find out what was in production and what broke it. Your monitoring tools go as far as only telling you that something isn’t working as expected but not why it is so, and then you have to scramble to figure out what versions of services are in production, were there any recent deploys, etc. So you can understand what has changed to narrow down possible causes. Our good friend Mike and his team are building the tool to answer exactly such questions, so we thought you might be interested in hearing him out.
Your monitoring tells you it broke, not what changed
Something stops working in production. The alert fires, the dashboard turns red, and that is where most of the tooling stops. It tells you a service isn’t behaving. What it won’t tell you is which build of that service is running, whether anybody deployed in the last 24 hours, or whether the deploy that ran actually landed everywhere it was supposed to land. Monitoring is set up for the operations team, and it’s good at what operators need: memory going haywire, a database that isn’t keeping up. When the failure is developer-shaped, there’s often no instrumentation pointed at it at all.
So the scramble starts. You open the CI/CD UI and hunt for the right repo and the right pipeline. A container digest doesn’t say which Git commit made it, so that’s another few minutes. You ask the one person with kubectl access on production to check the pods for you. Then you go looking for an audit log that would show a manual change, and either you can’t read it or nobody kept one. Almost none of that is diagnosis. It’s reconstruction: rebuilding the record of what happened to production out of four systems that each hold a quarter of it, at a bad hour, with people waiting.
Mike Long is co-founder and CEO of Kosli in Oslo, which he describes as a DevOps database with version control semantics. He spent ten years in oil and gas building steerable drilling tools and marine seismic arrays, deep in kernel and device driver work, then five years consulting on DevOps in the places where it’s hardest: regulated finance, automotive, safety-critical systems. We know him from consulting for the same company, him in Norway, us in Sweden. The problem he has pointed his company at is the unglamorous one: inventory. Knowing what’s in production, and how it got there.
What you think is running isn’t what’s running
Start with the assumption underneath the scramble, because it’s the one that fails first.
What goes wrong most often when you’re debugging an environment?
You’re debugging the wrong thing. The version you’re reasoning about isn’t the version that’s live.
A rollout half landed. A pod is stuck on ImagePullBackOff and the old replica is still serving traffic. A node got skipped. None of that raises an incident of its own, so you spend the evening reading code that isn’t executing.
One company he came across had done the responsible thing. Blue-green deployments, with the whole infrastructure regenerated every three weeks precisely so environments couldn’t drift. They brought up the new environment, started shifting traffic, watched it fail, and went back to the old one. An engineer burned an entire evening on it. What he had forgotten was a manual change he made to the other environment two or three weeks earlier, which never went into Git and so was never reproduced by the rebuild.
Some of this your deploy step can catch, if you let it block. kubectl rollout status deployment/myapp --timeout=300s waits for the rollout to finish and tells you whether it did, instead of returning the moment the apply is accepted. Pass that --timeout yourself: the command reference defines the flag as the length of time to wait before ending watch, with zero meaning never, and an omitted flag leaves the watch with no deadline, so a rollout that stalls holds the job open instead of failing it. argocd app wait wants the same treatment. It waits for an application to reach a synced and healthy state, and the 2.4 command reference documents --timeout in seconds and lists no default for it, so write argocd app wait myapp --timeout 300 and an application that never goes healthy fails the job after five minutes instead of leaving it waiting. That covers the minutes of a deploy. It covers nothing about the weeks after one, which is where that manual change lived.
Regenerating from scratch on a schedule stops drift from accumulating. It doesn’t tell you what drifted. For that you want the two commands you already use on code, pointed at environments instead: diff and log.
Thirty services, three consoles, and no record that joins them
Pointed at one system, those two commands do exist.
Why is it so hard to diff staging and production?
Deployment histories are scattered across tools, and they don’t necessarily capture what’s actually running.
Argo CD gets closest. argocd app history shows an application’s deployment history, and argocd app diff compares live state against target state, or against a particular revision with --revision. Inside its own scope that is the log and the diff we’re asking for. Outside it, you’re back to one kubectl command here, another there, image digests compared by eye, and the Lambda functions, buckets and hand-made changes that Argo CD never managed in the first place.
The cost grows with the estate. With 30 microservices, working out which pipelines ran means walking 30 repos and 30 pipelines. Then you’re still only looking at what the pipelines did, not at what reached production, whether the rollout finished, or what somebody changed by hand afterwards.
When the diff does come back, the difference is often credentials. The code is identical, the secret it reads isn’t, or the role it assumes isn’t. Those failures produce the worst error messages in the stack, because the system is being deliberately vague for security reasons. You get a numeric code and some incomprehensible words, not “your credentials are wrong”. Someone who has seen it before knows instantly. A new joiner has no chance, and how to request that access usually isn’t written down anywhere either, so the next step is a ticket and a week of waiting.
What’s missing is one record of production that spans all of it and joins to the build evidence: successive snapshots of a namespace, a Lambda function or a bucket, what changed between them, when deployments happened and when scaling events fired, each tied back to the commit and the build job that produced the artifact.
GitOps describes the world you intended
That record is close to what GitOps promised, and the distance between the two is the whole point.
Doesn’t GitOps already give you the history of production?
It gives you the history of what you asked for, which is a different document.
We sorted out the GitOps idea back in episode 2, and the direction it belongs to has been consistent for twenty years: put more things into version control. Build configuration went in, then pipelines as code, then infrastructure and configuration so environments could be reproduced, then tests, then security policy.
This isn’t an argument against the pattern. “I’m the biggest fan of GitOps in the world. We have everything as code in our system,” as Mike Long puts it. The gap is that a static description can’t answer a question about a dynamic system. When did that commit get applied? Did it apply cleanly? Is it still applied now?
Branch-per-environment makes the comparison easy, and plenty of teams run it: diff the staging branch against the production branch, or two directories inside one branch. You’re still comparing two intentions rather than two environments. We’ve all watched a change land in dev, get called done, never get promoted, and sit there for months while everyone assumes it shipped.
Have a process, follow it, prove it
The teams that hit this gap first are the ones who have to answer for it in writing.
What do the audit standards actually ask for?
Three things. That you have a written process, that you follow it, and that you can produce the evidence afterwards.
Kosli started life as ComplianceDB, aimed at banks that wanted a provable audit trail for change management and also wanted to do DevOps. The idea came from a consulting engagement at a bank in Australia, where getting a release out of the door took a round of ceremony assembled almost entirely from information the DevOps tools already held: which commits were in the release, how they had been tested, which security scans ran, who approved what. All of it was re-entered by hand into other systems and SharePoint pages so the release could go.
ISO 27001 covers information security, ISO 9001 covers management processes, ISO 26262 covers automotive, and there is a stack more for medical devices. Add SOC 2, PCI DSS, HIPAA’s rules on who accessed what and when, and GDPR on how personal data is stored and moved. Zoom out far enough and the technical demand underneath is the same: “You have to have a process, you have to follow the process, and you need the proof."
A pipeline is good at the middle one, because it does the same thing every time. What’s usually thin is the written process at one end and the evidence at the other. Kosli’s team published a starting point for the written half, a forkable static site at devopsctl.com covering artifact binary provenance, testing and security verification, which you clone and edit to match what you actually do.
There’s an obvious shortcut for the evidence half, and it doesn’t hold. The first version of the product stored everything in Git: a provable Merkle tree, an append-only journal as long as you forbid rewrites, audit guarantees for free. It worked until the data grew. Reading the history of one file in Git means walking the entire commit history, and doing that a thousand times to render one page gives you unhappy customers. The data layer was rebuilt on a document database with the append-only journal inside it, the two ran side by side under contract testing, and customers noticed nothing except pages getting faster. The verdict: “I wouldn’t recommend Git as a database.”
Binary provenance is the floor
Evidence only means something when it’s attached to the exact thing that shipped.
What is binary provenance?
The story of where your binary came from, bound to the binary rather than to a build number somebody typed.
In practice it’s a pipeline step that reports the artifact: this commit produced this binary, in this build job, under this name or tag, plus whatever else is worth keeping, a software bill of materials included. What makes it evidence rather than a note is that it’s keyed to the SHA of the binary. Change the binary afterwards and the SHA changes, so the old evidence stops applying. Same trick Git plays on your source.
The digest pins a record to one artifact. It says nothing about who wrote the record, which is where SLSA’s provenance requirements go further. From level 2 up, the provenance has to come from the build service rather than whoever reports it, and the consumer has to be able to verify its authenticity and integrity. The spec recommends, rather than requires, a digital signature from a key only the build service can reach. Kosli’s estimate for that first step, adding the artifact report to a pipeline you already have, is 15 minutes.
The other half is polling. Something runs on a schedule, in CI or inside the cluster, and lists what’s really there: the pods, the images, the digests, the deployed functions and bucket contents, fingerprinted. Then you match fingerprints against builds. The two kinds of mismatch mean different things. A fingerprint with no matching build record doesn’t say where that artifact came from, only that your records don’t cover it: a manual deployment, an image built outside the pipeline, or something nobody knew was running. An artifact that matches a build record can still be the wrong one for that environment, which is what a failed rollout leaves behind. The poller speaks only for what it fingerprints. An edited ConfigMap or a namespace nobody pointed it at needs a check of its own.
Approvals ride the same rail. A manual gate in CI that certain people press becomes another piece of evidence the deploy job can assert on: deploy only if the security scan passed and a named person approved this binary for this environment. For the hotfix someone pushed straight to production at 2am, the honest mechanism is an allow list. Record that this version of Istio is approved, by name, and carry on. Making the exception visible is the whole job.
Knight Capital and the server that missed the deploy
If this all sounds like bookkeeping, the bill for skipping it is on public record.
What made the Knight Capital loss so expensive?
Three ordinary mistakes stacked up, and then a deployment that only mostly worked.
On 1 August 2012, Knight Capital’s automated equity router sent millions of orders in 45 minutes and the firm lost more than $460 million. The SEC’s order describes the setup: code called Power Peg that Knight had stopped using in 2003 and never deleted from the router, a flag that used to switch Power Peg on and had been repurposed for new code written ahead of a new NYSE program, and that new code rolled out in stages across eight servers. In 2005 Knight had moved the function that counted cumulative shares out of Power Peg, and did not retest the dormant code afterwards. A technician didn’t copy the new code to one of the eight servers. The seven that received it processed orders correctly. The eighth read the repurposed flag, woke the old code, and started buying high and selling low with nothing left in that code path to stop it when the parent orders filled. Knight settled with the SEC in October 2013 for $12 million, and the order faults the firm’s controls over code deployment and testing.
That last part is the one every team has. Nobody reviewed the deployment to check that all eight servers had the new code, and the order notes that Knight had no written procedure requiring anyone to, so the people debugging it were reasoning about the version they had shipped rather than the version running. Ten years on: “there’s no new problems in software. We just keep discovering the same problems over and over again.”
What this means for teams
You don’t need to buy anything to start. You need to stop taking the pipeline’s word for what’s in production, because a pipeline that never looks at the running system only knows what it attempted.
- Pick one service and answer, from a terminal, which commit is running in production right now. Time yourself. That number is what every incident costs you before diagnosis even begins.
- Record the SHA of every artifact your pipeline builds, next to the commit and the build job that produced it. Even in a flat file, it beats a build number. Hang whatever software bill of materials your tooling already emits on the same record; several formats are in use, SPDX among them, and as far as we could tell the industry hasn’t picked one.
- Make the deploy step wait for the rollout to converge, with
kubectl rollout status deployment/myapp --timeout=300sorargocd app wait myapp --timeout 300, so a rollout that hasn’t converged inside the deadline fails the job rather than holding it open. Then put a scheduled job somewhere that lists the images and digests actually running and alerts when they disagree with the artifact approved for that environment. Compare against the last green build instead and every deliberate rollback looks like an incident. - Write your process down, badly if necessary, then make the pipeline the thing that follows it. Fork someone else’s outline rather than starting from a blank page.
Common questions, answered
How do I prove to an auditor that what’s in production came from my pipeline?
Record provenance for every binary your pipeline builds, keyed to that binary’s digest, then fingerprint what’s running and match the digests. The match shows the running artifact is the one the record describes, not who wrote the record. SLSA covers that from level 2 up: the provenance has to come from the build service, and the consumer has to be able to verify it. Hang the commit, the build job, the test results, the security scan and the approval on that same digest. Auditors want a written process, proof you followed it, and the evidence; collected in the pipeline, that evidence is a by-product of deploying.
What do I do about a hotfix someone pushed straight to production?
Record it as a named exception rather than leaving a hole in the record. An allow list is the usual mechanism: this version, approved by this named person, raises no alarm when it shows up in production. People will keep doing emergency deploys, and a record that only describes the happy path looks complete while it isn’t.
How do I stop a failed deployment from silently leaving old code in production?
Make the deploy wait for the rollout to converge, with kubectl rollout status deployment/myapp --timeout=300s or argocd app wait myapp --timeout 300, so the job fails when the rollout fails and when it never finishes either. Both deadlines are yours to supply: kubectl treats a missing --timeout as a watch that never ends, Argo CD 2.4 documents it in seconds and lists no default, and a command left waiting is a hung job, not a failed one. Then compare running images and digests against the artifact approved for that environment, on a schedule, which catches the ImagePullBackOff that left an old replica serving.
Related episodes
- Episode 2, GitOps: what the pattern actually changes about who holds credentials to your cluster, and where your pipeline stops.
- Episode 16, Do you need a staging environment?: how many environments earn their keep, and what a shared staging costs you.
- Episode 20, Monitoring done wrong: the gap between an alert firing and knowing why, which is where this one starts.
- Episode 30, Three pillars of observability: logs, metrics and traces, and which one to build first.
- Episode 38, Platform teams with Henrik: when an internal platform is worth building, and when it becomes a wall between developers and production.
Resources
- Kosli: the product behind the argument, a DevOps database with version control semantics.
- Mike Long on LinkedIn: his background in safety-critical systems and regulated DevOps consulting.
- DevOpsCTL Framework, archived May 2022: the forkable written SDLC published at devopsctl.com, with sections for artifact binary provenance, deployment approvals and change records.
- SLSA v0.1 requirements: the level definitions, what provenance has to satisfy to count, and the alpha warning printed on them.
- SPDX: the SBOM format that became ISO/IEC 5962:2021, which settles the “is it a real standard” question for that one format.
- Sigstore: signing and verification without long-lived keys, the piece with momentum across trust boundaries.
kubectl rollout statusreference: what--timeoutdoes, and why a rollout watch without one has no deadline.- SEC order against Knight Capital, October 2013: the official account of the August 2012 loss, the dormant code and the deployment controls that failed.
Since we recorded
Sigstore reached general availability on 25 October 2022, and SLSA published its first stable 1.0 in April 2023, reorganized into tracks that start with build, so the level numbers in this piece no longer map onto the current ones. We came back to the supply chain question in episode 46 and again, with a reference framework for the attacks themselves, in episode 53.
