Security & supply chain¶
rstest ships a compiled Rust orchestrator binary plus a vendored pytest core
inside a Python wheel. That is a wider trust surface than a pure-Python package, so
this page states (in one place) how releases are built and signed, what the
runner does and does not do on your machine, and how the vendored pytest is
sourced and kept current. For the reporting process and the exact policy text,
SECURITY.md in
the repository remains authoritative; this page mirrors and expands it.
Reporting a vulnerability¶
Do not open a public issue for a security vulnerability. Report privately through GitHub's private vulnerability reporting on the repository. Kovant AB aims to acknowledge a report within a few business days and will coordinate a fix and disclosure timeline with you.
Include the rstest version (rstest --version), affected platform(s) and
Python version, a minimal reproduction, and the impact you observed. If the
issue originates in pytest itself, please also report it upstream to the
pytest project so all users benefit.
Supported versions¶
rstest is alpha (0.x). Security fixes land on the latest release only; there are no long-term-support branches yet. Upgrade to the newest version before reporting.
Release integrity¶
Every release is built and published by the release workflow, not from a maintainer's laptop. Two properties follow:
- Signed build provenance (SLSA). Each wheel is signed with GitHub artifact attestations (Sigstore-backed, keyless via OIDC) at build time and the attestation is stored in GitHub's attestation store. You can verify any downloaded wheel was built by this repository's workflow: see Verifying your install below.
- Trusted Publishing to PyPI. Wheels are published via PyPI Trusted Publishing (OIDC): no long-lived API tokens are stored in the repository or CI. The publisher is scoped to this repo and workflow.
Wheels are built as per-platform binaries (manylinux, musllinux, macOS arm64,
Windows x86_64/arm64): each contains the compiled standalone rstest
executable (not a Python extension module; maturin bindings = "bin"), so
they are not pure-Python and are not bit-for-bit reproducible; provenance is
established by attestation, not by reproducible builds. Each release also
ships a SHA256SUMS file.
Vendored pytest¶
rstest ships an unmodified, vendored copy of pytest (currently 9.2.0)
inside the rstest_worker._vendor package. It sits at pytest's usual
pytest / _pytest import paths so plugins keep class identity with the real
library. Provenance and the update procedure are documented in
python/VENDOR.md;
licensing is in License. Key points:
- The vendored tree is copied verbatim from the pytest 9.2.0 PyPI wheel. Local modifications inside the vendored directories are forbidden by policy: rstest replaces orchestration, not pytest semantics.
- There is one vendored core, tracked forward. Adopting rstest adopts pytest 9's behavior regardless of the pytest version installed elsewhere in your environment; there is no older-core build.
- The vendored core's own runtime dependencies must exist in the target
virtualenv:
pluggy>=1.5,iniconfig,packaging,pygments, plusexceptiongroupandtomlion Python 3.10 andcoloramaon Windows (pytest's own conditional dependencies). rstest depends on the real pluggy by design.
Handling pytest security fixes¶
When upstream pytest ships a security fix affecting the vendored code, an rstest release with the re-vendored core is expected within two weeks of the upstream release. Because the vendored tree is verbatim, re-vendoring is mechanical; the two-week budget covers rerunning the compatibility battery, not the patch itself.
How new pytest releases are detected. A scheduled workflow
(pytest-upgrade-watch.yml)
runs daily (07:00 UTC) and compares the version vendored under
python/rstest_worker/_vendor against the latest pytest on PyPI. When PyPI is
ahead, it opens a deduplicated tracking issue (label pytest-upgrade) that
links the verbatim re-extract procedure in
python/VENDOR.md
and requires the full e2e gate before merge. Because a pytest security fix
ships as a new PyPI release, it is surfaced by this watch within a day of
publication: the watch tracks releases, not an advisory feed directly, but
a security release is a release.
Re-vendor history¶
Why this table is short. It records changes to the vendored pytest, not rstest releases. pytest stayed on 9.1.1 from rstest 0.1.0 (2026-06-23) until pytest 9.2.0 shipped (2026-10-27): a short table here means the core has been stable, not that the docs are stale. For rstest's own release cadence and per-version changes, see the CHANGELOG.
Every vendored-pytest change, newest first, with the commit that re-extracted the tree and the rstest release it shipped in:
| Vendored pytest | Change | PR / commit | rstest release |
|---|---|---|---|
| 9.2.0 | 9.1.1 → 9.2.0 | dc3bcbf · #206 |
0.10.0 (2026-11-01) |
| 9.1.1 | 9.1.0 → 9.1.1 | 54ed39d · #30 |
0.1.0 (2026-06-23) |
| 9.1.0 | 9.0.3 → 9.1.0 | ab80f28 · #30 |
0.1.0 (2026-06-23) |
| 9.0.3 | initial vendored core | df7dcf1 |
0.0.1 (2026-06-10) |
Both post-initial bumps landed together in #30 and released in 0.1.0; see the CHANGELOG for the release notes. Keep this table updated whenever the pytest-upgrade-watch issue is actioned.
Verifying the vendored copy is unmodified¶
The vendored tree is covered by an integrity manifest,
rstest_worker/vendor.lock, which pins the pytest version, the upstream
wheel's PyPI sha256 (the trust anchor), and a sha256 of every file under
_vendor/. The manifest ships in the wheel, so any installed copy can verify
itself. Two levels of check:
-
Offline integrity: anyone, anytime.
rstest verify-vendorrehashes the installed_vendor/tree and compares it tovendor.lock, catching a modified, corrupted, or partial vendored copy. It runs without contacting the network and exits non-zero on any drift: -
Upstream provenance (CI). The
vendor.ymlworkflow runs the offline check on every change and, in a separate job, downloads the pinned pytest wheel, asserts its sha256 against the manifest's trust anchor, and diffs the extracted tree against_vendor/, proving the vendored copy is byte-identical to upstream pytest, not merely internally consistent. This also reruns weekly to catch drift. The same provenance check is part of the re-vendor procedure inpython/VENDOR.md.
The offline check answers "is my installed pytest core the one that shipped?"; the provenance check answers "is what shipped really upstream pytest?".
Dependency auditing¶
Rust dependencies are audited in CI with
cargo-deny, configured in
deny.toml:
- Advisories: RustSec vulnerabilities and yanked crates fail the check; the advisory database is fetched fresh each run.
- Licenses: an allow-list of permissive licenses (MIT, Apache-2.0, ISC, …); a dependency introducing a license outside the set fails.
- Sources: every crate must come from crates.io; an unknown registry or git source fails.
The Rust toolchain is pinned to stable via
rust-toolchain.toml
so local dev, pre-commit, and CI build with the same compiler.
Python dependencies are audited in CI with
pip-audit (the pip-audit job in
ci.yml):
the locked runtime dependency tree exported from uv.lock is checked against
the PyPI/OSV advisory feed on every push and pull request. Dev-only
dependencies are excluded: they are not part of the shipped artifact.
What rstest runs on your machine¶
rstest orchestrates test execution; it does not sandbox your code. The trust boundary is worth stating plainly:
- Your test code and conftest run with your privileges, in worker processes, exactly as under pytest. rstest schedules and isolates workers; it does not restrict what your tests can do.
- The vendored pytest is on the import path at
_pytest.*. Within a worker, imports of pytest internals resolve to the vendored copy: see Architecture for how the worker environment is assembled.
No telemetry; network only when you ask for a remote cache¶
rstest collects no telemetry and has no analytics SDK. By default it
opens no network connections: orchestrator and workers talk over
anonymous pipes created per worker (pipe() on Unix, CreatePipe on
Windows) carrying msgpack, never a socket and never a TCP/UDP connection to
a remote host.
The one exception is the shared cache, and only when you opt in with
--cache-remote (or RSTEST_CACHE_REMOTE):
--cache-remote value |
Network behavior |
|---|---|
unset, a directory path, or file://… |
none: plain filesystem reads and writes |
http(s)://… |
the orchestrator makes HTTP requests itself, via the ureq client compiled into the published wheels (Cargo feature http-cache, on by default); bearer token from RSTEST_CACHE_REMOTE_TOKEN. Use https://: over plain http:// the token is sent in cleartext on every request |
s3://… / gs://… |
rstest spawns the aws / gcloud (or gsutil) CLI already on the runner, which talks to the cloud with your environment's credentials |
See Caching: transports for the details.
If you need a binary with no HTTP client compiled in, build from source with
cargo build --no-default-features: http(s):// cache URLs are then
rejected with an error. (s3:// / gs:// still work in that build, because
they go through the external cloud CLIs; don't pass those URLs if the run
must stay offline.)
The network access rstest does not make is not the same as your run making none. Unchanged from pytest, the following still reach the network, because they are your code or your commands, not rstest's:
- Your tests, fixtures, conftest, and plugins run with your privileges and may do whatever I/O they always did.
- The CI recipes in the CI quickstart call
gh,aws s3, oractions/*to move cache segments: those are steps in your pipeline, not rstest reaching out. - Installing rstest (
pip/uv) or tracking a git revision fetches over the network like any package install; that is your package manager, not the runner at test time.
Shared cache is a trust boundary¶
A shared cache (--cache-remote, or the GitHub action's cache-backend)
feeds data from earlier runs into test selection, rerun policy, and shard
balancing. Whoever can push segments can make a later --changed run skip
tests or make --reruns-only-known-flaky or auto-quarantine (fed by the shared run
history) hide failures. Only trusted
default-branch runs should push; PR jobs (especially from forks) should pull
only. See Caching: trust boundary.
The credential is the real boundary, because your tests run with whatever the job holds:
- Tests can reach any credential the job holds. rstest keeps
RSTEST_CACHE_REMOTE_TOKENout of the environment it gives workers and the pytest baselinerstest tryruns, so the token doesn't show up in a test'sos.environ. The rstest process itself still holds it, though, and a test running as the same user can read another process's environment (/proc/<pid>/environon Linux,ps ewwon macOS). Treat that as defense in depth: a job that runs untrusted code must hold a read-only token or none. - Cloud CLI credentials are not stripped. For
s3:///gs://remotes, theaws/gcloudcredentials (AWS_*variables, an assumed OIDC role,gcloudconfig) are the job's own, and tests that talk to the cloud may need them. Give PR jobs a role or token that can only read the cache prefix. - The GitHub action writes the cache only from trusted runs. With
cache-push: auto(the default), theremotebackend pushes only onpush,scheduleandworkflow_dispatchruns ofwarm-from-branch, plusmerge_group. Theactions-cachebackend never saves onpull_request_target,issue_commentorworkflow_run, which write into the base branch's cache scope while possibly running PR code. The action also passes the token only to the rstest command, not to the rest of its run step.
Replay journals¶
A replay journal
records the run's arguments, and rstest replay passes them on to pytest
as they are. They can include -p <plugin>, -c <file>, -o <option> or
--rootdir, which load code or change configuration on your machine.
They can also point --basetemp at a directory (pytest deletes and
recreates it), or write files with --junitxml, --report-log or
--cov-report. rstest prints the recorded arguments, with control
characters escaped, before the tests start. Replay doesn't pause for
confirmation, so for a journal you didn't produce, look at its args
field first (python -m json.tool latest.json).
- Replay only journals from runs you trust. A journal downloaded from a fork's CI run (for example as a PR artifact) is written by that fork's workflow and can carry any arguments.
- Journals on public repositories are public. Anyone who can download
the workflow's artifacts can read the arguments, the test order and the
nodeids in the journal. The journal records the pytest arguments given
on the command line (the action's
argsinput, for example), notaddoptsorPYTEST_ADDOPTS, so keep secrets out of those command-line arguments. Shorten the artifact'sretention-daysif the order itself is sensitive. - Replaying a fork's failure runs the fork's code. Checking out the failing commit and installing its dependencies runs its conftest, plugins and install hooks on your machine, whatever the journal says. Do that in a container or a throwaway environment, not on a machine with credentials you care about.
GitHub action inputs¶
Pin v0.8.0 or later
Action tags before v0.8.0 paste some inputs straight into shell code
and have no warm-from-event input. Pin the action to the v0.8.0 tag
or a full commit SHA of that release or later.
The composite action passes every input to its scripts through env:
variables, never by pasting ${{ }} expressions into shell code, so an input
value can't inject commands. args is split with shell quoting rules but never
evaluated or glob-expanded. The exception is install, which is a shell
command by design: set it only to a command you wrote, never to
attacker-influenced context such as github.head_ref or a PR title.
With the artifact cache backend, the action warms only from a successful run
triggered by warm-from-event (default push) on warm-from-branch, so a
pull_request run, fork or not, can't seed the cache main reads. With the
remote and actions-cache backends, cache-push: auto (the default)
decides which events may write the cache: see
Shared cache is a trust boundary.
Verifying your install¶
Verify a downloaded wheel was built by this repository's release workflow:
For fully pinned, reproducible installs, install with hashes from your lockfile, e.g. pip:
or pin an exact version (pip install rstest==0.12.0). See
Installation
for the SHA256SUMS file and building from source.
SBOM¶
Each release ships two CycloneDX Software Bills of Materials, generated by the release workflow and attached as release assets:
sbom.python.cdx.json: the Python runtime dependencies a user installs alongside the wheel (inventoried from a clean install of the built wheel).sbom.rust.cdx.json: the Rust crate graph compiled into the orchestrator (viacargo cyclonedx).
Both are listed in the release's SHA256SUMS. One component is not
captured by either SBOM: the vendored pytest lives inside the wheel rather
than as a declared dependency, so tools don't see it. Its version (9.2.0) and
that core's own runtime deps are documented under
Vendored pytest and in
python/VENDOR.md.
Governance¶
rstest is maintained by Kovant AB under a dual Apache-2.0 / MIT license. It is alpha (0.x) software on a single vendored pytest core tracked forward; weigh that maturity against your risk tolerance for a dependency on the CI critical path.