Quarantine
Quarantine holds each new release until enough time has passed for malware to be reported. You set the window for every registry, and can give one package its own.
How quarantine works
Most malicious releases are found and removed within hours or days of publication. While a release is younger than its quarantine window, Pratique holds it. Clients get the newest cleared version instead, and a client that asks for the held version directly gets an error that says when it clears.
The default window is 7 days. A held version clears on its own when its window ends, unless it is reported first. Known malware is refused whatever the window.
Private packages that you publish to Pratique skip quarantine, because your team made them.
Set the window for a registry
Admins set a window for each registry under Settings, in Quarantine by registry. There is one row each for npm, Python, Composer and Go.
Enter the window
In the registry's row, enter a number under Hold new releases for and choose Days or Hours as the Unit.
Preview it
Select Preview to see what the window would have done to the last 30 days of downloads. Nothing changes yet. See preview a change.
Save it
Select Save in the same row. Each row saves on its own.
Under each registry's name, a line says where its window comes from: the server default, the person who changed it and when, or the config file. A changed row shows Not saved yet until you save it, and the browser warns you if you leave the page with unsaved changes.
Longer windows give more time for malware to be reported. Shorter windows get fixes to developers sooner. Only admins can change these settings. A setting from the config file shows In code and can't be changed in the UI.
Set the window for one package
Give a package its own window to let a package you trust through sooner, or to hold a risky one for longer. Open the package's page and select Set quarantine, or open its Policy tab. Enter the window under Hold new releases for and select Save.
To remove it, select Use the npm setting instead (or the name of the package's registry). The Packages page lists every package with its own window under Packages with their own quarantine. See Package pages.
Which window applies
The most specific window wins. Pratique looks for a window in this order and uses the first it finds:
- A window for that package, from the config file, then from the UI.
- The team's window, if the client's token belongs to a team that sets one. See Teams.
- A window for its registry, from the config file, then from the UI.
- The server default:
quarantine.defaultin the config file, orPRATIQUE_QUARANTINE. The environment variable wins over the file. Without either, the default is 168 hours, which is 7 days.
A team's window replaces the registry window and the default, but never a window set for one package. A team made in the UI can't change a registry window that the config file sets.
Turn quarantine off
A window of 0 turns quarantine off for that scope. Releases then clear as soon as they pass every other check. Known malware, blocking rules and a person's decisions still apply. The longest window you can set is 365 days.
How the publish time is decided
Quarantine counts from a release's publish time. A registry or an attacker can give a false date, so Pratique doesn't always take the registry's date as it is.
- npm uses the publish time in the registry's listing. Python uses each file's upload time.
- No date means no install. A release whose registry gives no publish time is refused, because its age can't be verified.
- Backdated releases. Once Pratique has read a package's listing, a new release that appears with a date more than an hour older than that listing has its clock started when Pratique first sees it. An incident opens, titled "A new release claims to be older than it is". The first time Pratique sees a package, it has no history, so it accepts the registry's dates.
- Composer. Packagist's dates can come from Git, which an author can backdate. So a new release's clock starts when Pratique first sees it. The first time Pratique sees a whole package, it accepts the upstream dates. Request your important Composer packages early.
- Go. A release's date comes from its commit, which its author controls. Once Pratique has seen a module, a new tag dated before the last listing has its clock started when it is first seen. So tagging an old commit doesn't skip quarantine. The first time Pratique sees a module, and for pseudo-versions, the date is taken as given.
The Published date on a package's versions table, and in a version's explanation, is the date Pratique uses.
Preview a change
Preview next to a registry's window shows what that window would have done to the last 30 days of real downloads, without changing anything. It judges each download by how old the release was when it was pulled.
The preview shows:
- Versions it would hold, Downloads affected, and People and systems affected.
- A table of the affected versions, with the reason, the number of downloads, who pulled them and when. It lists the 200 with the most downloads.
- For a longer window, the number of pulled versions it would have held that were later reported as malware.
Use it before you shorten or lengthen a window, to see who would notice.
Fast-track security fixes
A quarantine also delays the fix for a vulnerability you are exposed to. Fast-track security fixes lets such a fix through without waiting. It is off by default.
Turn it on under Settings, in Quarantine by registry. Set Action to Fast-track, choose a Minimum severity of Low, Moderate, High or Critical, and select Save. The default severity is High. It applies to npm, Python and Composer.
A held release then skips the rest of its quarantine only if all of these are true:
- It is named as the fix. A vulnerability report at or above the minimum severity names this exact version as the version that fixes it.
- You are exposed. You already use a version that the report affects: a client received it through Pratique, or a project's lockfile lists it. A file that is only stored doesn't count.
- Nothing suggests an account takeover. The release has none of these warnings: New publisher, Install script newly added, Provenance dropped, Sudden release after silence, Remote dependencies, Manifest mismatch, Provenance doesn't verify, or Built from another repository. A warning only counts while its rule isn't off.
Fast-track only shortens quarantine. Malware reports, risk rules set to block, and a person's decisions still apply, because Pratique checks them before quarantine. A fast-tracked version shows the rule Fast-tracked fix in its package's versions table, and its explanation and Activity name the report it fixes.
A report could name a malicious version as the fix. Fast-track trusts your vulnerability data, so don't feed it from a source you don't trust. Vulnerability reports come from OSV, so with OSV turned off there is nothing to fast-track.
Metadata cache
Pratique reuses a package's list of releases for 5 minutes before asking the registry again. Change this under Settings, in Metadata cache. Enter a number under Reuse for, choose Minutes or Hours, and select Save. The value can be from 1 minute up to 24 hours, and it applies to all registries.
A longer cache makes requests faster and sends fewer of them upstream, especially for large packages. In exchange, new releases and removals show up later. It doesn't weaken policy. Quarantine, rules, exceptions and threat data are checked on every request, downloads are still verified against their hash, and threat data has its own schedule.
A release that first appears while the list is cached is judged by when the list was fetched. So it isn't mistaken for a backdated release.
Set it in the config file
Every quarantine setting can live in pratique.yaml. Anything set there shows In code in
the UI, which refuses to change it. Use a number of days such as 7d, a duration such as
36h, or 0 for none.
# How long a package's list of releases is reused, from 1m up to 24h.
metadata_cache: 30m
quarantine:
default: 7d
npm: 7d
python: 3d
composer: 7d
go: 7d
packages:
- { registry: npm, name: typescript, hold: 1d }
- { registry: python, name: some-risky-package, hold: 30d }
rules:
# off or fast-track: a named fix skips quarantine
security-fast-track: { action: fast-track, severity: high }
Changes to the file need a restart. See Configuration for the rest of the file.