What happened

I was asked to "document the details of our production sites from a security perspective." The starting point was an existing inventory spreadsheet: nine columns per site — name, URL, category, service, hosting, tech stack, language version, management type, and owner.

My first thought was "I'll just clean up the spreadsheet." That lasted exactly one site. The inventory said "WordPress / AWS" — but the response headers showed it was a static site on S3. If I had trusted the ledger and transcribed it, we'd have kept managing WordPress vulnerabilities for a WordPress that didn't exist.

So I changed the approach: treat the inventory as a claim, measure every site for real, and report the diff. The ledger turned out to disagree with reality in seven places.

Why — an inventory starts rotting the day it's written

I split the measurements into three layers, matching the access I had.

1. External observation (no privileges needed). DNS, certificates, and HTTP headers are visible to anyone:

dig +short example-site.jp A echo | openssl s_client -connect example-site.jp:443 2>/dev/null \ | openssl x509 -noout -issuer -enddate curl -sI https://example-site.jp | head -20 

For "is this WordPress?", I checked both the /feed/ response and the meta name="generator" tag. Either one alone can be stripped by a theme or plugin, so my rule was: only record a value when two independent pieces of evidence agree.

2. Cloud APIs (read-only credentials). AWS Lightsail can enumerate assets from the CLI:

aws lightsail get-instances --query 'instances[].{name:name,ip:publicIpAddress,state:state.name}' aws lightsail get-instance-port-states --instance-name <name> aws lightsail get-relational-databases \ --query 'relationalDatabases[].{name:name,public:publiclyAccessible}' 

3. SSH (only where I had access). php -v, httpd -v, SELECT VERSION(); on the DB. Change history filled in from yum history info output — not from anyone's memory.

Cross-checking the three layers against the ledger surfaced discrepancies one after another. The highlights:

  • Ledger: "WordPress / AWS" → reality: static S3 site (a completely different attack surface)
  • A site whose hosting had been migrated to an external provider (GoDaddy) — but the old instance was still running: an orphan server nobody patches
  • A domain that no longer resolves (NXDOMAIN) while the server behind it is still up — nothing left but billing and attack surface
  • An instance not in the ledger at all, running a 2023 build of WordPress
  • The management database with publiclyAccessible: true

And one of the seven was my own measurement error. Trying to check the PHP version of a migrated site's old server, I ran curl -L against the IP with a Host header — and the -L followed a redirect to the new hosting, whose response I then recorded as the old server's value. It only came to light later, when I was asked to "double-check the language versions" and re-measured. Dropping -L, or looking at the redirect target, would have prevented it. The person doing the measuring is part of the error budget too.

The fix — make "how to verify" and "where to verify" into columns

The final spreadsheet ended up designed like this:

  • Keep the original nine columns untouched. The diff between the ledger's claim and the measured value is the report — don't overwrite the claim
  • Add measured columns to the right: real IP / TLS expiry / issuer / HSTS / running state / last-verified date / notes, with a different background color so "this was measured" is visible at a glance
  • Add a "where to verify unconfirmed items" column. Anything I couldn't see with my own access gets not a blank cell, but a pointer: the GoDaddy console, Lightsail's browser SSH and php -v, the console of another account
  • Closed sites stay as grayed-out rows marked "closed" — deleting them makes it impossible to tell "removed from the ledger" from "never existed"
  • Sheets: internal / external / change history (only entries verified via yum history) / cloud assets / diffs-from-ledger / legend

The "where to verify" column is the important one. Any real inventory includes servers you may look at but must not touch — managed by another team, read-only investigation allowed. Leave them out and your asset picture has holes; include them with empty measurement cells and it looks like negligence. Write "verifiable in console X (admin access required)" and the blank turns into the next person's TODO.

Takeaways

  • An inventory starts going stale the day it's written. Keep its values as claims, put measured values beside them, and report the diff
  • Measure in three layers matched to your access: external observation / cloud API / SSH. Accept a version only when two independent pieces of evidence agree
  • The measurer makes mistakes too. If you use curl -L, ask yourself whose response you're actually reading
  • Scarier than any single mismatch were the assets nobody was looking at: a dead domain with a live server, and a running server that wasn't in the ledger at all

I've come to think the value of an inventory isn't that its values are correct — it's that it can be re-measured. If "how to verify" and "where to verify" survive as columns, the next person can redo it when the values rot. And figuring out how to document the assets you're only allowed to read — that's half of what a security inventory is.