Learn

Architecture & pattern guides

Read the idea, build it on a Grid, prove it in a challenge. Short, practical guides — illustrated with RodGrid's own nodes — on system design, design patterns, flow modeling, and how to get the most out of the app.

All articles

Quarantine

Hold a third-party package, a partner's file or an upload where nothing can use it while checks run, then promote exactly the bytes that passed to the trusted area, or reject them with a reason.

Scanned overnight, pulled at once

A scan that runs after the build has pulled the package protects nothing that build did. A logistics company's platform team ran its internal mirror of public npm packages and container images that way: builds fetched new versions through the mirror at once, and a nightly job scanned whatever had arrived that day. A malicious dependency could run its install script on a build machine hours before anyone looked at it.

The fix changes where a new artifact waits. In the Quarantine pattern, an artifact from outside, here a package version or an image the mirror has not seen before, lands in an area that consumers cannot read. Checks run there. Then the artifact is promoted to the trusted area, by moving it or by tagging it as approved, or it is rejected with a reason. Until one of the two happens nothing can use it, which limits the damage a defective or malicious artifact can do.

Nothing pulls from quarantine

Build machines can read only the trusted repository, and the checker is the only writer to it.

Unreadable means unreadable

The isolation has to be enforced by permissions, not by convention. If the quarantine is a folder that builds are merely asked to avoid, the first build that resolves a version by name will find it there. So the build machines' credentials grant read on the trusted repository and nothing on the quarantine, and the checker is the only identity allowed to write to the trusted side. A request for a version still being checked gets an answer that says so, rather than an error that tempts someone to point the build straight at the public registry.

What the checker asks

  • Is it what it claims to be? Where the ecosystem offers one, verify the publisher's signature or a provenance attestation, a signed record of the source and build that produced the artifact (Software supply chain: signing, provenance & scanning covers producing and verifying both). Many packages carry neither, and the policy decides whether that alone is a reason to reject.
  • Does it contain anything known to be bad? Scan for malware and for known vulnerabilities in the artifact and what it bundles, against the scanner's current databases.
  • Is it the shape we expect? For data, validate the schema and the content: the columns the contract names, values in range, the row count the sender announced.

Some checks have to run the artifact or open it: executing an install script to watch what it does, or parsing an archive or a PDF. The code doing that is now the target, so these checks run isolated (Sandboxing untrusted code: isolation, limits & egress), with no credentials and no network they do not need.

Promote the bytes you checked

Promotion has one trap. Suppose the checker scans the image tagged base:22, then copies whatever base:22 points to at that moment. A tag can be moved, so if someone pushes a new image under it between the scan and the copy, the trusted side receives bytes nobody checked. The same goes for a file name in a drop folder that can be overwritten. So the checker identifies the artifact by its content digest, checks that digest and promotes that digest: the record says sha256:… passed, not that a name did. Content-addressed storage & deduplication explains why a digest names exactly one set of bytes. Names in the trusted repository then only ever point at approved digests.

Rejected, kept, overridden

A rejection is recorded against the digest with a reason someone can act on: which check failed, what it found, and which scanner version found it. The team that asked for the package sees that reason, instead of a build that fails to resolve a dependency and says nothing more. Rejected bytes stay unreadable until they have been investigated and are then deleted; the verdict is kept longer, so the same digest is recognised if it comes back.

Sometimes a flagged artifact is needed anyway: the only release that fixes a critical bug also carries a low-severity finding with no fix yet. An override is a decision about one digest, made by someone other than the requester, usually the security team, with a reason and an expiry, and recorded next to the verdict. When it expires, the trusted repository stops serving new pulls of that digest; copies already pulled are not recalled. An override that switches checking off for a whole repository is not an override; it turns the pattern off.

When the checker is down

Sooner or later the scanner is slow or unavailable, and the tempting fix is a timeout that promotes whatever it could not check. That turns an outage of the checker into an open door. Fail closed: the artifact waits, a new version arrives late, and builds that use versions already promoted keep working. A vulnerability scan also answers only against what is known on the day it runs; a library promoted in March can match a vulnerability published in May, so promoted artifacts are rescanned as the databases update. Quarantine decides what gets in, not whether it stays safe.

Watch outPromoting an artifact out of quarantine before its scan or validation actually completes, or counting a check that timed out or crashed as a pass, defeats the isolation the pattern exists to provide.

The same shape for files

A partner's nightly file drop lands in an inbound bucket only the validator reads; a file that fails its schema check goes back to the partner with the failing line, and yesterday's data stays in place. A user upload is scanned for malware in a quarantine bucket before clean files move to the bucket that serves them, the path Large file upload walks through.

Dead Letter Channel and Invalid Message Channel collect messages that failed delivery or processing, or could not be parsed, after the fact; quarantine holds every new artifact before anything trusts it. Gatekeeper validates each request at request time in front of the hosts it shields; quarantine checks an artifact before it becomes available, and keeps the verdict.

Build it into a registry

In the Container & Package Registry Challenge, route pushed and mirrored images through a quarantine repository that deploys cannot pull from, and label the promote edge with what it carries: a digest, not a tag.

Practice this