Skip to content

disk cache: verify CAS digests fetched from a proxy backend - #922

Open
martinpitt wants to merge 1 commit into
buchgr:masterfrom
martinpitt:verify-proxy-cas-digests
Open

martinpitt wants to merge 1 commit into
buchgr:masterfrom
martinpitt:verify-proxy-cas-digests

Conversation

@martinpitt

Copy link
Copy Markdown

Previously, blobs fetched from a proxy backend were committed after only a size comparison. A backend answering with same-length wrong bytes got them stored under the digest they were asked for, and served to every client after that.

Verify proxy reads by -hashing their blobs and comparing before committing. A hash mismatch is logged, dropped and reported as a cache miss, similar to a size mismatch.

Client uploads already are verified that way, so this closes the verification gap for proxy mode.


I'm trying to set up two bazel-remote instances chained over the HTTP protocol, as in #524: a developer-side instance with
--http_proxy.url pointing at a shared one, --num_uploaders 0 so it never writes back. The shared instance is published read-only by a reverse proxy restricted to GET and HEAD (which makes it read-only). A mistake there lets anyone PUT, and with no digest check on the fetch side nothing downstream would notice.

Related:

Previously, blobs fetched from a proxy backend were committed after only
a size comparison. A backend answering with same-length wrong bytes got
them stored under the digest they were asked for, and served to every
client after that.

Verify proxy reads by -hashing their blobs and comparing before
committing. A hash mismatch is logged, dropped and reported as a cache
miss, similar to a size mismatch.

Client uploads already *are* verified that way, so this closes the
verification gap for proxy mode.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant