Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,11 @@ jobs:
# One blocking join owns the security-sensitive transition from candidates
# to public artifacts. Each target tuple contributes exactly three behavior-
# equivalent candidates (unstripped/debug-stripped/stripped); the selector may
# only choose within that tuple. A hard result on ANY sibling blocks
# the all-target release rather than selecting around a real detection.
# only choose within that tuple. A hard result on ANY sibling blocks the
# all-target release rather than selecting around a real detection - with
# ONE exception (policy cbm-vt-candidate-selection-v2, SECURITY.md): a single
# "isolated" candidate, flagged by one non-Microsoft engine that judged every
# sibling form clean on the same definitions, is never shipped and disclosed.
select-package:
needs: [build-unix, build-windows, build-windows-arm64, build-linux-portable]
runs-on: ubuntu-latest
Expand Down Expand Up @@ -345,8 +348,9 @@ jobs:
request_rate: 4

# The established gate tolerates only one Microsoft malicious label
# ending !ml and rejects every other malicious/suspicious combination.
# Every candidate still must complete with the minimum engine coverage.
# ending !ml and rejects every other malicious/suspicious combination,
# except the one isolated-sibling candidate this stage alone opts into
# (VT_ISOLATED_SIBLING_CANDIDATES; the archive surface scan stays strict).
- name: Wait for complete VirusTotal candidate results
if: ${{ inputs.scan_candidates }}
env:
Expand All @@ -355,6 +359,7 @@ jobs:
VT_EXPECTED_SCAN_SET: release-candidate-scan/scan-set.tsv
VT_ASSOCIATIONS: release-candidate-scan/associations.tsv
VT_RESULTS_PATH: release-candidate-scan/vt-results.tsv
VT_ISOLATED_SIBLING_CANDIDATES: release-candidate-scan/candidates.tsv
VT_POLL_TIMEOUT_SECONDS: 14400
MIN_ENGINES: 50
run: scripts/ci/check-virustotal.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ jobs:
gh release download "$VERSION" --repo "$GITHUB_REPOSITORY" --pattern 'release-selection.tsv' --output "$RUNNER_TEMP/release-selection.tsv"
python3 scripts/ci/verify-release-selection.py \
--selection "$RUNNER_TEMP/release-selection.tsv" \
--require-policy virustotal-v2 \
--require-policy virustotal-v3 \
--archive-dir "$ARCHIVE_DIR"
# 14 = 8 archives + 6 MCPB bundles; runtime 42 = 8×3 archive
# sidecars + 6×3 bundle members (manifest.json, LICENSE, notices).
Expand Down
84 changes: 52 additions & 32 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Releases are created as **drafts** (invisible to users) and only published after
2. **Sigstore cosign signing** — keyless digital signatures verifiable by anyone
3. **SBOM** — Software Bill of Materials (SPDX) listing all vendored dependencies
4. **SHA-256 checksums** — published with every release
5. **VirusTotal scanning** — three behaviourally identical executable candidates — unstripped, debug-stripped and stripped — are derived from one linker output for every release product and scanned before smoke/soak. Zero malicious and zero suspicious is preferred; the only tolerated result is exactly one Microsoft malicious label ending in `!ml`, which is disclosed. The selected executable is packaged without changing its SHA-256. After packaging, every distinct object extracted from the 14 shipped containers is scanned under the same policy — `install.sh`, `install.ps1`, `LICENSE`, `THIRD_PARTY_NOTICES.md`, the MCPB `manifest.json` and the unpacked UI assets — so the covered surface is everything we publish, not only the executables. Release notes link the verdict for the exact bytes shipped; the per-candidate results and the selection table are published as release assets for independent audit.
5. **VirusTotal scanning** — three behaviourally identical executable candidates — unstripped, debug-stripped and stripped — are derived from one linker output for every release product and scanned before smoke/soak. Zero malicious and zero suspicious is preferred; the only tolerated results are exactly one Microsoft malicious label ending in `!ml`, which is disclosed, and one "isolated" candidate per release (one other engine that judged every sibling form clean on the same definitions), which is never shipped and is named in the release notes. The selected executable is packaged without changing its SHA-256. After packaging, every distinct object extracted from the 14 shipped containers is scanned under the same policy — `install.sh`, `install.ps1`, `LICENSE`, `THIRD_PARTY_NOTICES.md`, the MCPB `manifest.json` and the unpacked UI assets — so the covered surface is everything we publish, not only the executables. Release notes link the verdict for the exact bytes shipped; the per-candidate results and the selection table are published as release assets for independent audit.
6. **OpenSSF Scorecard** — repository security health score
7. **Registry publishing without stored tokens** — npm and PyPI accept uploads only through OIDC trusted publishing from `release.yml` running in one of two GitHub environments, both restricted to `main`: `release`, which requires the maintainer's approval and publishes stable versions, and `rc`, which publishes release candidates (`vX.Y.Z-rc.N`) unattended to npm's `next` tag and as PyPI pre-releases. The environment follows the version's shape, checked three times before upload; no long-lived npm or PyPI token exists. The packages are built in a separate job that holds no publishing identity, from a toolchain (build backend included) installed by hash; the publishing job only uploads them. Release candidates pass every gate above, identically. A gate (VirusTotal, security, license, CodeQL, lint) is never retried, and a release that went green only on an automatic retry of a flaky test says so in its release notes.

Expand All @@ -138,10 +138,11 @@ not mean the source code is vulnerability-free or that maintainers cannot change
source. Consumers should verify the signer workflow, not only repository
ownership.

If a scanned executable candidate has any result outside the one narrowly reviewed
Microsoft `!ml` tolerance, the release stays as a draft and is not published.
There is no manual bypass around that release gate; its sole machine-enforced
tolerance and selection table are specified in [Our release policy](#our-release-policy).
If a scanned executable candidate has any result outside the two narrowly reviewed
rules (the Microsoft `!ml` tolerance and the isolated-sibling rule), the release
stays as a draft and is not published. There is no manual bypass around that
release gate; its machine-enforced rules and selection order are specified in
[Our release policy](#our-release-policy).

### Code-Level Defenses

Expand Down Expand Up @@ -257,44 +258,63 @@ Every release ships the material needed to check our artifacts independently.
Use the commands in [Verification](#verification) above: SLSA Build Level 3
provenance ties the archive to the workflow run that produced it, Sigstore cosign
verifies the signature, and `checksums.txt` pins the bytes. The release notes
carry a durable VirusTotal link for every executable candidate, including any
tolerated detection — we publish those results whether or not they are clean.
link the VirusTotal report for every shipped executable, including any tolerated
detection, and name any isolated candidate that was not shipped; the verdicts of
every candidate are published as release assets, whether or not they are clean.

You can also rebuild from source and compare: `scripts/build.sh --with-ui`
produces the shipped composition.

### Our release policy

A release may ship with **at most one** detection, and only when the engine is
Microsoft and the label ends in `!ml`. Two or more engines, any signature-based
label, any other vendor, or any "suspicious" verdict blocks the release. That
rule is enforced in `scripts/ci/check-virustotal.sh` and pinned by
`tests/test_vt_gate_policy_contract.sh`.

Before smoke and soak testing, each of the eight supported platform/link-mode
products is built in two conventional forms from the same linked executable:
stripped and unstripped. Both candidates are scanned, and selection is confined
to that product tuple; for example, a portable static Linux build can never be
substituted for the ordinary dynamically linked Linux build.

The selection policy is deterministic:

| Stripped candidate | Unstripped candidate | Selected candidate |
|---|---|---|
| Clean | Clean | Stripped |
| Clean | One tolerated Microsoft `!ml` | Stripped |
| One tolerated Microsoft `!ml` | Clean | Unstripped |
| One tolerated Microsoft `!ml` | One tolerated Microsoft `!ml` | Stripped |

Any other verdict, an incomplete scan, a missing sibling, or a provenance/hash
mismatch blocks the complete release. The selected bytes are then packaged
products is built in three conventional forms from the same linked executable:
stripped, debug-stripped and unstripped. All forms are hashed and submitted to
VirusTotal once, before any result is known; nothing is rebuilt, re-stripped or
re-submitted in response to a verdict. Selection is confined to that product:
for example, a portable static Linux build can never be substituted for the
ordinary dynamically linked Linux build.

Each candidate is classified as:

- **clean**: no detection;
- **microsoft-ml**: exactly one detection, by Microsoft, with a label ending in `!ml`;
- **isolated**: exactly one detection, by one engine other than Microsoft, as
malicious, while every sibling form of the same product is clean and the same
engine, on the same engine version and definitions, returned a non-detection
for each of them;
- **blocking**: anything else, including two or more engines, a signature-based
Microsoft label, any "suspicious" verdict, a single-engine detection whose
engine did not answer for every sibling or answered on other definitions, and
a detection beside a sibling that is not clean.

One blocking candidate, or more than one isolated candidate, blocks the complete
release, and so do an incomplete scan, a missing sibling and a provenance/hash
mismatch. An isolated candidate is never shipped. Among the rest, the first
clean form in the order stripped, debug-stripped, unstripped is shipped; only if
every form is microsoft-ml is the stripped form shipped, with that verdict
disclosed.

The forms contain identical code, and two of them identical symbols, so a
detection that the same engine does not repeat on any sibling form describes
that file image, not the program. We do not ship that image, and the release
notes name it with its SHA-256, engine, label and definitions date. The scan of
everything extracted from the shipped containers after packaging has no
isolated class: there, every detection other than the single Microsoft `!ml`
blocks.

These rules are enforced in `scripts/ci/check-virustotal.sh` and
`scripts/ci/select-release-candidates.py`, re-derived independently by
`scripts/ci/verify-release-selection.py`, and pinned by
`tests/test_vt_gate_policy_contract.sh` and
`tests/test_vt_candidate_selection_contract.sh`. The selected bytes are then packaged
without stripping, signing, relinking, or any other content mutation, and the
resulting archives—not rejected candidates—are what smoke and soak testing execute.
After packaging, every archive and MCPB executable is extracted and its SHA-256
must still equal the selected candidate. This identity check makes a second
VirusTotal submission of the same bytes unnecessary.

This is not obfuscation: stripping is a standard release transformation, both
This is not obfuscation: stripping is a standard release transformation, all
forms and their SHA-256 provenance are recorded, and no binary is modified in
response to an engine result. If the unstripped form is selected, it is larger
and can expose compiler symbol names and build-time path metadata (but not source
Expand All @@ -306,8 +326,8 @@ outputs of one linker result, and the actually selected form—not its sibling
subjected to the full smoke/soak gate. That trade-off is visible in the
published selection evidence.

Policy identifier: `cbm-vt-candidate-selection-v1`. It is reviewed at least
every 90 days; last review: 2026-08-13, next review due: 2026-11-11.
Policy identifier: `cbm-vt-candidate-selection-v2`. It is reviewed at least
every 90 days; last review: 2026-12-06, next review due: 2027-03-06.

### If you find something real

Expand Down
4 changes: 2 additions & 2 deletions scripts/ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ CI and the local infrastructure — both of which the venue-parity contract
| `verify-shard-union.sh` | Prove sharded test legs lost nothing: shard count agreement, indices 1..n, identical suite lists, union of slices == full list (was inline YAML). No manifests is green only when the lane selection holds no test leg. | `_test.yml` shard-completeness |
| `prepare-release-candidates.sh` | Copy one linker output into stripped/unstripped candidates, finalize signatures, composition-check them without execution, and record their hashes. | `_build.yml`, local artifact smoke |
| `stage-release-candidates.py` | Admit exactly eight candidate artifacts / sixteen byte-distinct binaries into the content-addressed VirusTotal scan set. | `_build.yml` |
| `select-release-candidates.py` | Apply the reviewed tuple-local VT truth table, or the explicit dry-run stripped default, and atomically copy one content-bound binary per target. | `_build.yml` |
| `select-release-candidates.py` | Apply the reviewed tuple-local selection order (policy `cbm-vt-candidate-selection-v2`: first clean form, never the release's one isolated candidate, whose sibling proof it re-checks), or the explicit dry-run stripped default, and atomically copy one content-bound binary per target. | `_build.yml` |
| `verify-release-selection.py` | Recompute the selection policy and prove every executable member in all 14 public containers equals its selected SHA-256. | `_build.yml`, `release.yml` final draft verification |
| `check-virustotal.sh` | Poll and validate the exact candidate scan set, enforce engine coverage and the narrow documented Microsoft `!ml` policy, and emit content-bound results evidence. | `_build.yml` |
| `check-virustotal.sh` | Poll and validate the exact scan set, record engine coverage (never gated), apply policy `cbm-vt-candidate-selection-v2` (the narrow Microsoft `!ml` tolerance and, at the candidate stage only, the isolated-sibling rule), and emit content-bound results evidence naming every detecting engine. | `_build.yml`, `release.yml` surface scan |
Loading
Loading