Hash cache bodies and File System backing files - #316
Merged
Conversation
Records a SHA-256 for each cached response body and each File System API backing file, so an artifact recovered from a profile can be matched against a copy found anywhere else. A cache body is only hashed when the bytes on disk are the resource. ccl returns the still-compressed bytes when it cannot decode a content-encoding, and hashing those gives the digest of a gzip stream, which matches nothing and is indistinguishable in the output from a digest of the resource. Empty files are left unhashed for the same reason: the digest of no bytes identifies nothing, and a constant repeated through the output reads as a finding. Adds Body SHA256 to the Timeline sheet and File SHA256 to the Storage sheet, with matching sqlite columns. The Storage autofilter stopped a column short of File Type, so the last column could not be filtered on at all; it now covers every column.
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.
Records a SHA-256 for each cached response body and each File System API backing file, so an artifact recovered from a profile can be matched against a copy found anywhere else.
A cache body is only hashed when the bytes on disk are actually the resource. ccl returns the still-compressed bytes when it cannot decode a content-encoding, and hashing those gives the digest of a gzip stream, which matches nothing and looks identical in the output to a digest of the real thing. Empty files are skipped for the same reason: the digest of no bytes identifies nothing, and a constant repeated down a column reads as a finding.
Output gains Body SHA256 on the Timeline sheet, File SHA256 on the Storage sheet, and the matching sqlite columns. The Storage autofilter stopped a column short of File Type, so the last column could not be filtered on at all; it now covers every column.
Adds tests/test_hashing.py, covering that the digests land under the right headers, that the neighbouring columns did not shift, and that every column falls inside the autofilter. Full suite passes including the corpus parse tests.