Build notes

Privacy You Can Grep For: Auditing a Privacy Policy Against the Code

Batdorj Byambadorj · · 5 min read

Every sentence on a privacy page is a claim about code. "We keep logs for fourteen days" is a claim about a rotation config. "The website sets no cookies" is a claim you can run.

I rewrote my privacy page in October and checked it that way, line by line. Three weeks later I checked it again and found nineteen things wrong with it.

The October pass

Four statements, each traced to the place that makes it true:

  • An account my server does not recognise gets an answer and leaves no row behind. Proved at the lines that handle the lookup, not from memory of having written it that way.
  • Alert text is stored but never logged — the HTTP logger is switched off, at three separate call sites.
  • Disconnecting issues a delete, not a flag, and takes the pending code with it.
  • The fourteen day log promise rests on the access log being declared once at the top level, so the rotation rule covers both host blocks.

And cookies. A search found the session cookie only inside the API service, with zero matches anywhere in the site's own application. "The website sets no cookies" was true. I had checked.

The November pass

Then I built the scheduled and session alerts, and afterwards audited the page again. Three passes over the same text. Nineteen discrepancies. Each pass found new ones — the second and the third as well, which is the part I had not expected.

Six of them were not from that day's edits. They had been live since October: a sentence saying the EA sends "exactly two things" when it also calls three further endpoints; missing columns in a described table; wrong fields listed for the partner list; a claim that you return to three slots when the next check recreates the row; calling a DNS-only configuration "network security"; and a wrong frequency for one check.

None of those are dramatic. All of them were published as fact.

The worst one was the sentence I had proved

"The website sets no cookies."

By November the site was setting two, both with four hundred day lifetimes, for the Telegram connection flow. The sentence was true when I proved it and false three weeks later, and nothing in between re-checked it, because it had already been verified once and verification felt like a finished job.

That is the lesson I would keep if I could keep only one. A proof has a date. A grep is evidence about the code as it stood that afternoon. The page outlives the afternoon; the proof does not.

What actually changed is the ordering of my work, not my diligence. The audit is now a step that runs after code changes, not a step that runs before publishing text.

Promises before implementation

An older debt made the same point from the other direction.

The first version of the site published a ninety day deletion promise with nothing in the code behind it. It was a plan, not a lie, but it sat on a public page in the present tense and eventually had to be settled by hand.

So the order is now: build the retention sweep, audit it, then write the sentence. The second time round the sweep came first: six rules, a dry run reporting zeros, then a real run also reporting zeros against an unchanged database. The text came after, describing something that already existed.

A promise published ahead of its implementation is a debt, and it accrues quietly.

The analytics database nobody looked inside

My statistics come from server logs, which the page says are kept for a limited period — counting visitors from them has its own problems. The analyser's own persistent database was keeping 123 full IP addresses with no expiry at all.

The anonymisation setting was on. It did not apply to the keys the database uses to identify unique visitors, so addresses survived there in full — the published promise cancelled by a file I had never thought to open.

The fix is a masking step that zeroes the last octet before either tool sees an address. Searching the resulting output for 3,239 real addresses returns nothing.

It changed the unit as well as the data: a "visitor" now means a /24 network, and on one day the figure went from 17 to 7. Those are not the same measurement. Write that down beside the number rather than discover it later.

Collecting less is easier to prove

Several sentences on that page are easy to defend because there is nothing to defend.

Alerts live in a file on the trader's own disk; my server never sees which symbols they watch or where they drew their lines. An unrecognised account creates no record. The partner export is read for three columns — an account number, a platform and a server name — and the file is deleted once the import commits, because the rest of it is other people's names, emails and balances and none of it is mine to hold.

Proving "we do not store X" is much easier when the code has no column for X. Data minimisation is not only a privacy position. It is what makes the audit short.

If you are writing a privacy page

  • Treat every sentence as a claim about a specific place in the code, and cite it to yourself.
  • Re-run the audit after feature work, not before publishing. The stale sentence is the dangerous one.
  • Date your proofs. A grep is evidence about one afternoon.
  • Build the mechanism, audit it, then write the promise. Never the other way round.
  • Open the databases your own tools keep. A setting that looks global may not be.
  • When a privacy fix changes the unit, say so next to the number.
  • The fastest way to pass an audit is to have less to audit.

Batdorj Byambadorj

Batdorj Byambadorj has been trading forex for his own account since 2007, mostly gold. He is the sole developer of fx-alert and writes every article on this site himself.

About the author

← All articles