
Proof, not promises: designing tamper-evident inspection evidence on Amazon S3
We are building a service that inspects property for owners who live far away. The product is not the photo, it is the proof the photo is real. Here is the storage design we arrived at on S3 — object lock, presigned uploads, and why client-supplied metadata can never be trusted.
am building StillYours, a service that checks on property for people who no longer live near it. A verified inspector visits your flat, your parents' house, your plot or your car on a schedule you choose, walks a 42-item room-by-room checklist, and you get a photo-and-video report within the hour.
We are live in Bengaluru, Pune, Hyderabad and Jaipur.
Here is the thing that took me a while to understand: we are not selling photographs. We are selling the belief that the photographs are real.
An owner in Dubai already has photos of their house. A cousin sent some. A caretaker sent some. They are useless, because there is no way to know when they were taken or where. That is the entire problem we exist to solve, and it makes storage an unusually interesting design question.
Start from the threat model, not the schema
Before choosing anything, I wrote down how someone would cheat us. Not hypothetically — these are the shortcuts a rushed or dishonest inspector actually takes:
- Never visit. Send photos from a previous visit to the same property.
- Visit, but photograph only the two rooms nearest the door, then reuse last month's images for the rest.
- Photograph something else entirely — their own home, a stock image.
- Visit properly, but write the report from memory three days later.
- Visit properly, then quietly replace an embarrassing photo afterwards.
Notice that every one of these is a provenance attack. Not one is solved by having a nice image pipeline. They are solved by being able to prove, later, that a specific file was produced at a specific place and time and has not changed since.
That reframes storage completely. The requirements stop being "cheap and fast" and become:
- Write once. Nobody, including us, can quietly modify an object after the fact. Especially us — "the company edited the evidence" is the accusation that would end this business.
- Capture context bound to the object, not sitting in a row somewhere that could drift out of sync.
- No client-side writes we have not authorised, scoped to one object.
- Cheap at rest for years, because an owner comparing this month to two years ago is the whole point.
Why the evidence does not go in Postgres
We already run Postgres for leads and scheduling. The tempting move is to put image references there and call it done.
But a database row is mutable by design. An
UPDATE leaves no trace an owner could audit. If our evidence lives anywhere a support engineer can change it with one statement, then it is not evidence, it is just data we are asking people to trust.So Postgres holds the record of a visit. S3 holds the evidence, and the evidence is immutable.
The S3 design
Object Lock in compliance mode. This is the piece that does the real work. With versioning and Object Lock enabled, an object under a compliance-mode retention period cannot be deleted or overwritten by anyone — not by an administrator, not by the root account, not by us. That is a strange thing to want until you remember we are the party the owner is being asked to trust. Object Lock has to be enabled when the bucket is created, so this is a decision you cannot defer.
Block Public Access on, always. Nothing in these buckets is ever public. Owners reach their reports through short-lived signed URLs, so access is always attributable to a logged-in owner.
A key scheme that encodes the claim:
properties/{property_id}/visits/{visit_id}/{room}/{sequence}-{sha256}.jpg
The visit ID is minted server-side when the inspector checks in at the gate. An object cannot exist under a visit that never happened, and the content hash in the key means the same bytes cannot be silently re-filed as a different room.
Presigned PUT URLs, one per photo, short expiry. The phone uploads straight to S3 rather than through our API — we are pushing video from Indian mobile networks and proxying that through a serverless function is slow and expensive for no benefit.
The mistake I nearly made
My first design had the app send capture metadata — GPS, timestamp, device — as
x-amz-meta-* headers on the upload.That is worthless, and it took me an embarrassingly long time to see why. Any metadata the client chooses is metadata the client can fake. An inspector willing to reuse last month's photos is certainly willing to send a GPS header saying they are at the gate.
The fix is to move the trust boundary. The metadata is decided server-side, at the moment the presigned URL is issued, and signed into it:
- The app requests permission to upload one photo for a specific visit and room.
- The server checks the inspector really is checked in, and that the check-in GPS matched the property.
- The server mints a presigned PUT, pinning key, content type, size limit, SHA-256 checksum and the metadata it decided.
- The upload either matches that signature exactly, or S3 rejects it.
The client never gets to assert where it was. It only gets a narrow, expiring permission to put one specific object in one specific place. Combined with conditional writes —
If-None-Match: * so an upload cannot overwrite an existing key — a photo that lands is a photo we can stand behind.This is also why gallery uploads are blocked at the app layer rather than the storage layer. Storage cannot tell you where a JPEG came from. Only the capture path can, so the capture path is where that control belongs.
Cost, over years
Same-angle comparison means evidence has to stay retrievable for a long time, but almost all of it is never looked at twice. Lifecycle rules handle that: Standard for 30 days while a report is fresh, Standard-IA to 90, then Glacier Instant Retrieval — still millisecond reads when an owner does scroll back, at a fraction of the cost.
Retention is set to outlive the dispute window, and because it is compliance mode, a lifecycle rule cannot quietly delete something still under lock.
Where this actually is
Honestly: the inspector app and this pipeline are in design and early build. The marketing site and the lead pipeline are live in production today, and I spent this morning fixing a far less glamorous bug there — both our forms were showing people a success screen while throwing their submissions away. That one is worth its own post.
I am publishing the storage design before it ships because the reasoning was the hard part, and because the mistake above — trusting client-supplied metadata — is one I suspect other people are making right now in systems where it matters more than it does in mine.
If you are building anything where a file has to mean something later, the question worth asking early is not "where do I put this" but "who could change this, and could I prove they didn't?"
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article