Explainstuff.mebeta
All concepts
Cloud Native Patternsintermediate6 min

Quarantine

Hold newly published third-party assets in an isolated staging area, scan them, and only promote the clean ones to where your system trusts them.

When you import food into a country, it doesn't go straight to supermarket shelves. It sits in a customs quarantine while inspectors check it for pests and contamination. Only after it clears does it enter the supply chain. Until then, it's treated as guilty until proven safe.

The Quarantine pattern applies the same discipline to digital assets you receive from outside — uploads from partners, packages from a third-party feed, container images from an external registry. Instead of trusting them the moment they arrive, you park them somewhere isolated, run your checks, and only then let the rest of your system touch them.

The problem

Assets that originate outside your control are a liability. A vendor publishes a data file with a corrupt schema. A user uploads a document carrying malware. An upstream image bundles a vulnerable library. If your system reads from a shared, trusted location the instant new content shows up, every one of these problems becomes your problem the moment it lands.

The core mistake is conflating "published" with "trusted." Just because a file exists in a bucket your services can read doesn't mean it's safe to consume. Without a deliberate gate, the first thing that ever validates the asset is your production code — and by then it's already too late.

Without quarantine — published is mistaken for trusted
no gate — bad asset reaches prod
External publisher
Trusted store
Production services
A third-party asset flows directly into the store production reads from, with no scan in between. One corrupt or malicious upload poisons production the instant it lands.

How it works

You introduce two distinct locations. New external assets are published only to a quarantine store — an isolated bucket, registry, or folder that no consumer reads from. Landing there triggers a validator: an automated process that runs whatever checks the asset type demands — virus scans, schema and format validation, signature verification, policy rules.

If every check passes, the validator promotes the asset by copying or moving it into the trusted store, where your real services finally read it. If anything fails, the asset stays put, gets quarantined or deleted, and an alert fires. The trusted store therefore only ever contains vetted content. The diagram below traces an asset from arrival, through scanning, to promotion into the location your system actually relies on.

Quarantine — vet external assets before you trust them
scan, then promote
External publisher
Quarantine store
Validator / scanner
Trusted store
A newly published asset lands in the isolated quarantine store, gets scanned by the validator, and is promoted to the trusted store only if it passes every check.
Tip

Make the trusted store unwriteable except by the promoter. The pattern only holds if there's no back door — if any process can write straight into the trusted location, the quarantine becomes theatre. Lock permissions so the validator is the only thing that can move an asset across the boundary.

When to use it

Quarantine earns its keep whenever you ingest assets you didn't author and can't fully trust: user uploads, partner data drops, third-party packages, externally built images. It complements a gatekeeper, which screens incoming requests, by doing the same job for incoming content. When the publisher is an external party, pairing it with federated identity lets you record exactly who submitted what, so a rejected asset is traceable back to its source.

The trade-off is latency and an extra moving part: assets aren't usable the instant they arrive, and you now run and monitor a validation pipeline. For content you generate yourself in a trusted pipeline, that overhead buys little. But for anything crossing your trust boundary from the outside, a quarantine zone is a cheap way to keep one bad upload from becoming a production incident.

Key takeaways

  • External assets land first in an isolated location that the rest of your system does not trust or read from.
  • An automated validator scans each asset — schema checks, malware scans, policy rules — before anything else can use it.
  • Only assets that pass every check are promoted to the trusted location; failures are rejected and flagged, never quietly used.
  • The quarantine zone contains the blast radius: a bad upload can't poison production because production never sees unvetted files.
  • It adds a delay and a moving part, so it pays off most when you ingest assets you didn't produce and can't fully trust.

Keep going