Home / Vault & Second Brain / The Log Is Written by the Thing It Audits

The Log Is Written by the Thing It Audits

A dark room with a glass drawer glowing from inside, a hand and a machine holding the same key

A receipt in a drawer you can unlock yourself

Last week I did something I had been putting off for months: I counted. Not estimated, not asked my own agent how it was doing — counted. There are 4,176 log files in my cron output directory. Over the past seven days, 489 of them are mode 600 and owned by john. So am I: the agent runs as john. Every single one of those files can be rewritten by the exact process it is supposed to be a record of.

That number had been sitting in my head as a vague discomfort. “My logging is fine.” It is not fine. It is convenient, which is a different thing, and I had been reading convenient as fine.


What I had already built, and what it did not cover

My verification gate is not a toy. Version 2.6.0, 76,575 bytes, and it landed within a day of me deciding it should exist. Every log line carries VERSIE= and NU=, so a claim can no longer be made in the name of a rule that has since changed. It names PRODUCENT=, so I know who produced the record. There is a normative rule that a detection step produces a trigger, never a verdict. A consistency script checks ten of these properties and returns 10/10.

Then I grepped the gate text for three words: writable, tamper, immutable. Zero hits. All three. The instrument that decides whether something counts as evidence has never once asked whether the evidence could have been edited afterwards, by the party that wrote it. The word owner appears eighteen times in that file — every one of them about the owner of an unresolved intermediate state, not the owner of the storage.

So the gate is complete on three axes: producer, version, authority. And blind on the one underneath them all.

Hash chains do not fix this, and that surprised me

My first instinct was the obvious one: chain the logs. Each record carries the hash of the previous one, and editing history becomes visible. So I counted how much of that I already have. Of 828 scripts, 189 compute a hash somewhere. Exactly one ties that hash to the preceding record. The other 188 produce a fingerprint with nothing to compare it against — the digital equivalent of a signature on a page nobody kept a copy of.

And even a perfect chain would only buy me one thing: nobody changed it after it was written. It says nothing about whether the claim was true when it was written. A hash chain protects a lie just as well as it protects the truth, as long as the lie was recorded first. There are five separate questions hiding inside the word “verified” — was the artifact altered, was the procedure valid, was the logic valid, was the observation real, and did the verdict actually change what happened next. A hash answers the first. I had been using it as if it answered all five.


The store I already had and never read

The part that made me laugh, in the way that is not really laughing: there is a record on this machine that my agent genuinely cannot rewrite. /var/log/journal is owned by root:systemd-journal, the journal files are -rw-r-----. Readable for me, writable by nobody in my uid. When I asked it for the last day of cron activity it handed me 5,038 lines.

In my whole gate, journalctl appears three times — all three as diagnosis. “Where is stderr”, “is the clock in UTC”, “a grep of seventeen hits says nothing about now”. Never once as a read path for a receipt. The external store was there the entire time. I had built a careful instrument and pointed it at the drawer I could open myself.

Today’s fix is small and I am not going to pretend it is more than that: the log line gets an EIGENAAR= field (owner of the storage), and the rule that if the owner’s uid equals the producer’s uid, the outcome can be at most accepted — never matched. Plus a CAVEAT= field: one sentence saying what the evidence still does not establish. That last one is the honest one. A receipt without a caveat gets read as “everything is fine” when it means “this one thing was fine”.

More than a hundred of my scheduled jobs have no read path at all — they produce output nobody, including me, ever reads back. That is a different kind of broken, and it is next.

The question I got wrong

I used to think verification was about the agent being honest. It is not. It is about the storage being outside the agent’s reach. Honesty is a property of a party; evidence is a property of a place. I had spent months improving the first and had never once checked the second.

So here is what I would like to know: where does your agent’s evidence actually live, and who can delete it? If the answer is “in a folder my own process can write to”, then what you have is a very well-formatted opinion. Tell me in the comments what your setup looks like — I am genuinely curious whether anyone has solved this without adding a second machine.

Wat vond je van dit bericht?

Leave a Reply

Your email address will not be published. Required fields are marked *