Skip to content

Commit 4cf9579

Browse files
committed
docs(ci): state the real reason the VT verdict binds to bytes, not to an id
The previous commit framed accepting VirusTotal's own analysis id as giving up freshness. That was the wrong way round. VirusTotal recognising our bytes is desirable: the evidence this pipeline publishes is the hash-keyed file report — append-vt-notes.sh asserts the URL is exactly .../gui/file/<sha256>/detection — so the report we gate on is the same one a reader gets by looking that SHA-256 up themselves. Requiring a freshly minted analysis id would have contradicted the evidence we publish next to it, and made our verdict unreproducible by anyone outside the release job. Comment-only; no behaviour change. The build+VT dry-run on 094929f exercises identical logic. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 094929f commit 4cf9579

1 file changed

Lines changed: 17 additions & 15 deletions

File tree

‎scripts/ci/check-virustotal.sh‎

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -428,23 +428,25 @@ def parse_completed(document: object, submission: Submission) -> Tuple[str, Opti
428428
raise GateError(f"VirusTotal response has an invalid analysis id: {submission.expected.scan_path}")
429429
# The id is recorded as evidence, NOT required to equal the submitted one.
430430
#
431-
# VirusTotal is content-addressed: for bytes it already holds it may answer
432-
# with its own canonical analysis rather than the one this upload created,
433-
# and the id then differs legitimately. Requiring equality blocked a real
434-
# release dry-run on the 282 MB linux-arm64 candidate — precisely the kind
435-
# of large, previously-seen artifact where this happens, so it would have
436-
# recurred on most releases.
431+
# VirusTotal is content-addressed, and it recognising our bytes is the
432+
# behaviour we WANT, not a problem to defend against. The evidence this
433+
# pipeline publishes is the hash-keyed file report — append-vt-notes.sh
434+
# asserts the URL is exactly .../gui/file/<sha256>/detection — so what we
435+
# gate on and what a reader sees when they look that SHA-256 up themselves
436+
# are the same report. Demanding a freshly minted analysis id would have
437+
# contradicted the evidence we publish alongside it.
437438
#
438-
# What must hold is that the verdict describes THESE bytes, and the
439-
# completed branch below enforces exactly that against file_info.sha256 and
440-
# size. That is also what keeps a tuple's two candidates apart: stripped and
441-
# unstripped have different hashes by construction, so neither can be read
442-
# as the other regardless of what ids VirusTotal hands out (the wrong-hash
443-
# and wrong-size contract cases pin this).
439+
# It also does not work in practice: requiring equality blocked a real
440+
# dry-run on the 282 MB linux-arm64 candidate, exactly the kind of large,
441+
# previously seen artifact VirusTotal answers for from its own record, so it
442+
# would have recurred on most releases.
444443
#
445-
# The property given up is freshness: an older cached analysis of identical
446-
# bytes is accepted. For identical bytes that is the same content risk, and
447-
# it is the trade this gate deliberately takes to stay deterministic.
444+
# What must hold is that the verdict describes THESE bytes, and the
445+
# completed branch below enforces that against file_info.sha256 and size —
446+
# a strictly stronger binding than an id. It is also what keeps a tuple's
447+
# two candidates apart: stripped and unstripped differ in hash by
448+
# construction, so neither can be read as the other whatever ids VirusTotal
449+
# hands out (the wrong-hash and wrong-size contract cases pin this).
448450
attributes = data.get("attributes")
449451
if not isinstance(attributes, dict):
450452
raise GateError("VirusTotal response has no analysis attributes")

0 commit comments

Comments
 (0)