Repository navigation
scripts: verify-site — check served bytes and headers against the published tree - #902
Merged
Merged
Conversation
…d tree Fetches every file of the bento-site tree from bento.page (and optionally a second host) as a file:// deck would, with Origin: null. Fails on a body that differs from the tree, on any difference in status or client-relevant headers between the two hosts (CORS grant, Cache-Control, Content-Type, Location, and any security header one adds), and runs the update path: signed manifest, history and pack index verify against the kernel's release key, and the shell and packs hash to their pins, with every redirect hop needing a CORS grant. Offline rig with a throwaway key and mutants, in the shared CI slice.
Build size
Updated: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
scripts/verify-site.mjs, a read-only check of what a host actually serves.node scripts/verify-site.mjs --tree ../bento-sitefetches every published file from bento.page and fails if any body differs from the tree. This is the "verify what the CDN serves" check that release verification has been doing by hand.--candidate <url>also fetches everything from a second host and fails on any difference in status, body, or the headers a client acts on:Access-Control-Allow-Origin,Cache-Control,Content-Type,Location,Content-Disposition,X-Robots-Tag, and the security headers, so a host can't add one without anyone noticing. It also checks the URLs a static host answers on its own:/dir,/dir/, extensionless.html, directories without an index, and the 404 page.file://deck does: requests carryOrigin: null, every hop including redirects must carry a CORS grant, the manifest, history and pack index must verify againstPUBLIC_KEY_JWK(read fromkernel/src/update.tsso it can't drift), and the shell and every pack must match their signed sha256.--previewreports two differences as expected instead of failing: zone-onlyCache-Controlrewrites, and previewnoindex.--allow <regex>accepts one named difference.Measured: running it against bento.page and the current tree checks 100 URLs with no differences, and the slides manifest, history and 22 packs all verify.
Rig:
scripts/test-verify-site.mjs(27 checks, offline) is registered at the end ofvalidate-shared. It runs two local servers over a tree signed with a throwaway key. The identical candidate has to pass, and the rig asserts that the update path actually ran on both hosts. Each mutant has to fail: a.html→ extensionless redirect, a redirect hop with no CORS grant, a manifest with no grant, an addednosniff, a one-byte shell change, a cacheable 404, and a payload edited after signing.No changelog entry (tooling).