An artifact firewall is a proxy that makes a policy decision (allow, hide,
refuse) in front of every npm install or pip install, before the package
enters your software factory. A cache such as Nexus serves whatever it is
asked for; the firewall decides what has the right to come in. This lesson
is for security and platform teams who already run an artifact manager and want
to move from caching to control.
The example is Varnish Artifact Firewall, the Premium (licensed) component
of Varnish Orca, placed in front of Nexus. The lab was replayed on 4 November
2026 on Orca 0.20.0 (firewall 0.8.0). The Pulp trial and rule severity are not
covered by that replay: the lesson says so wherever they come up. The lesson's
configuration passes the validator, but the public image carries no licence
add-on (its startup log shows addons=[]): the firewall enforces nothing
without a trial licence. The lesson reminds you of this wherever it changes
what you can observe.
What you will learn
- Distinguish cache, artifact firewall, SCA analysis and admission control.
- Write
denyandhiderules, know when to useallow, and tune the quarantine of recent publications. - Set up an Orca and Nexus lab, and know what it shows without a licence.
- Block a vulnerable version and a spoofed internal name.
- Close bypasses, on CI runners as on workstations.
- Produce the evidence for SOCLE-INT-GEN-3 (in French), OSS consumption through a controlled internal proxy, without unfiltered direct pulls.
Why a cache is not enough
Your developers run dozens of npm install and pip install every day. Each
one downloads third-party code, often hundreds of transitive packages, and
runs it on workstations and CI runners (the machines that run your
pipelines). In September 2025, the Shai-Hulud worm compromised more than 500
npm packages, according to the CISA alert of 23 September
2025
(accessed 2026-11-04): its postinstall script collected the tokens and
credentials present in the environment, then republished itself with the npm
tokens it found.
An artifact manager such as Nexus or a cache such as Varnish Orca solves two real problems: speed and resilience against an outage of the public registry. But it serves whatever it is asked for. If a developer installs a vulnerable version, a version published two hours ago by a compromised account, or a package whose name spoofs one of your internal packages (that is dependency confusion: an attacker publishes on the public registry a package carrying the name of one of your private packages, see Securing your dependencies), the cache downloads it, stores it and redistributes it to the whole team.
What is an artifact firewall?
An artifact firewall sits between your clients (npm, pip, CI runners) and your repositories, and evaluates every resolution (every package request) against a set of rules. At Varnish, a rule leads to one of three actions, and a global quarantine comes on top, according to the firewall configuration documentation:
| Decision | Effect | Use case |
|---|---|---|
allow | Serves the artifact | Explicit exception, trusted package |
hide | Removes the version from "latest version" resolution | Evict a version without breaking an existing lockfile |
deny | Refuses with a 403 response | Forbidden package, vulnerable version |
quarantine (default_quarantine_days) | Blocks any version published less than N days ago, whatever the rules | Safety window on fresh publications |
Quarantine is therefore not a rule action: it is a global setting, which directly answers the framework's requirement of a delay before adoption (cooldown), SOCLE-INT-OSS-1 (in French). A booby-trapped version published this morning, like those of Shai-Hulud, is held back while the community spots it.
Quarantine is disabled by default: varnish-supervisor -defaults prints
default_quarantine_days: 0 in the firewall section. The lab sets it to 2
days.
The benefit over a scanner is the moment of the decision: before ingestion, that is, before the package enters your cache. A refused dependency never enters the cache or the build. Where a scanned SBOM tells you after the fact "you installed a vulnerable component", the firewall stops the component from arriving.
Architecture of the study lab
The lab chains three components: the client (npm or pip), Orca with its
firewall, then Nexus. Clients target a virtual registry of Orca, that is,
an address specific to Orca that the proxy links to an upstream repository,
here a Nexus group. The firewall is transparent: enable_firewall: true
routes that registry through the firewall internally, without changing the
address the client sees. The diagram follows a resolution:
Nexus's role is to centralise: a proxy repository to the public registry, a hosted repository for your internal packages, and a group that exposes a single URL. The order of the group members (hosted before proxy) already forms a first barrier against dependency confusion; the firewall adds the per-rule decision on top.
In front of Nexus, but also in front of Pulp
The firewall is not tied to Nexus. The Varnish documentation describes Orca as
an agnostic virtual registry manager: each virtual registry has a
remotes.url backend, and Orca forwards the client path as is to that
backend. Nothing therefore prevents pointing that backend at another manager,
such as Pulp, the open source artifact
manager.
A trial of this setup with Pulp, run before this lesson and not rechecked on Orca 0.20.0, showed that the virtual registry loads, and that both the PyPI index and the download of artifacts go through Orca. Two points are worth knowing:
- The most direct setup targets the container registry: Pulp exposes its
OCI API (the standard format for container images) on
/v2/at the root, like the public registry Orca already knows how to cache. - For PyPI, Pulp emits absolute download links through its
CONTENT_ORIGINsetting; Orca rewraps them in its/redirectzendpoint, andCONTENT_ORIGINmust match the URL exposed by Orca.
Putting Orca in front of Pulp is interesting because Pulp has no native quarantine: the firewall brings the missing decision layer, on entirely open source storage.
Lab prerequisites
The lab was replayed on 4 November 2026 on a disposable Debian 13 virtual machine with 6 GB of RAM, with Docker Engine 29.9.2 and Docker Compose 5.6.1 installed from Docker's official repository, and npm 11. You need:
- Docker Engine and Docker Compose (the versions above are the ones measured);
- memory for Nexus, whose JVM reserves about 2 GB according to the page installing Nexus with Docker Compose; the image default was not measured here;
npm,pipandjq(absent from Debian 13 in the test installation);- ports 8080, 8081, 9090 and 80 free on the machine;
sudo, to add a line to/etc/hosts.
If the Nexus wait loop never ends, read docker compose logs nexus: a
container that stops for lack of memory leaves its trace there.
Setting up the lab
The lab fits in a docker-compose.yml that starts Nexus and Orca, plus a few
configuration files. Images are pinned by digest: the tag names the
version, the sha256 designates the exact image. Versions are those of 4
November 2026.
-
Declare Nexus and Orca
docker-compose.yml services:nexus:image: sonatype/nexus3:3.96.4@sha256:5f48f9085096e96f4111ec07d79d57ca5a4a1da5a2003a3028a0b60c62bea7d1ports: ["8081:8081"]volumes: ["nexus-data:/nexus-data"]orca:image: varnish/orca:0.20.0@sha256:918e9839eaf13a5f7c2a3b3cbfaf0527f3344ab4dad1d891dd387b09a4d668b5depends_on: [nexus]ports:- "8080:80" # virtual registries (client endpoint)- "9090:9090" # firewall metrics (Premium)volumes:- ./orca/orca.yaml:/etc/varnish-supervisor/default.yaml:ro- ./orca/rulesets:/etc/orca/rulesets:rovolumes:nexus-data: -
Start Nexus and prepare it
Start Nexus alone and read the initial password of the
adminaccount, which Nexus writes to/nexus-data/admin.password. On the 6 GB Debian 13 VM, two measured startups answered200on/service/rest/v1/statusafter 30 s, then after 61 s. The first launch can take longer: the page installing Nexus announces 1 to 3 minutes. The loop waits for the200, whatever the duration.Terminal window docker compose up -d nexusuntil [ "$(curl -s -o /dev/null -w '%{http_code}' http://localhost:8081/service/rest/v1/status)" = 200 ]; do sleep 10; doneNEXUS_PASSWORD=$(docker compose exec -T nexus cat /nexus-data/admin.password)Nexus Community Edition requires you to accept its EULA (the licence agreement) before it serves artifacts. Measured on 3.96.4, as long as it is not accepted, a download authenticated as
adminanswers403with the messageYou must accept the End User License Agreement (EULA). The API accepts it with the body returned byGET, where"accepted"becomestrue. The command usesjq, which is absent from Debian 13 in the test installation:sudo apt-get install -y jq.Terminal window curl -s -u "admin:$NEXUS_PASSWORD" http://localhost:8081/service/rest/v1/system/eula \| jq '.accepted = true' \| curl -s -u "admin:$NEXUS_PASSWORD" -H 'Content-Type: application/json' \-X POST http://localhost:8081/service/rest/v1/system/eula -d @-# 204 response, no bodyThen create the npm and PyPI repositories through the REST API: a proxy to the public registry, a hosted repository for your internal packages, and a group that aggregates the two. The
npm-allgroup aggregatesnpm-private-hostedthennpm-public-proxy, and that is what the firewall will see. Each creation answershttp=201.Terminal window NEXUS=http://localhost:8081/service/rest/v1st='"storage":{"blobStoreName":"default","strictContentTypeValidation":true'mk() { # $1 = format, $2 = repository type, $3 = JSON bodycurl -s -w "$1/$2 http=%{http_code}\n" -u "admin:$NEXUS_PASSWORD" \-H 'Content-Type: application/json' -X POST "$NEXUS/repositories/$1/$2" -d "$3"}for t in npm pypi; do[ $t = npm ] && url=https://registry.npmjs.org || url=https://pypi.orgmk $t proxy "{\"name\":\"$t-public-proxy\",\"online\":true,$st},\"proxy\":{\"remoteUrl\":\"$url\",\"contentMaxAge\":1440,\"metadataMaxAge\":1440},\"negativeCache\":{\"enabled\":true,\"timeToLive\":1440},\"httpClient\":{\"blocked\":false,\"autoBlock\":true}}"mk $t hosted "{\"name\":\"$t-private-hosted\",\"online\":true,$st,\"writePolicy\":\"allow_once\"}}"mk $t group "{\"name\":\"$t-all\",\"online\":true,$st},\"group\":{\"memberNames\":[\"$t-private-hosted\",\"$t-public-proxy\"]}}"doneOrca sends no credentials to Nexus. Yet Nexus disables anonymous access by default: measured on 3.96.4, every access through Orca then answers
401, including foris-number. Enable anonymous read access on this lab. In production, prefer dedicated credentials declared on the Orca side: caching an authenticated upstream belongs to thesup-authadd-on, which the firewall (thesup-firewalladd-on) also requires, according to the Varnish Orca page. That case was not measured here.Terminal window curl -s -u "admin:$NEXUS_PASSWORD" -H 'Content-Type: application/json' \-X PUT http://localhost:8081/service/rest/v1/security/anonymous \-d '{"enabled":true,"userId":"anonymous","realmName":"NexusAuthorizingRealm"}' -
Configure the Orca firewall
This file declares two virtual registries that go through the firewall, then the firewall settings: the action taken when no rule matches (
default_action), the 2-day quarantine, two severity thresholds (explained below), the audit log output and the metrics port. It cites two rule files, given in the "Writing rules" section: create them inorca/rulesets/before validating the configuration and starting Orca.orca/orca.yaml virtual_registry:registries:- name: npm-nexusdefault: trueenable_firewall: trueremotes:- url: http://nexus:8081/repository/npm-all/- name: pypi-nexusenable_firewall: trueremotes:- url: http://nexus:8081/repository/pypi-all/firewall:default_action: allow # observe in a POC; deny in productiondefault_quarantine_days: 2severity_deny_threshold: 9severity_allow_threshold: 4audit_log_output: stdoutmetrics_address: ":9090"rulesets:- path: /etc/orca/rulesets/npm-rules.yaml- path: /etc/orca/rulesets/pypi-rules.yamlThe binary embeds a validator. Measured on Orca 0.20.0, it answers
configuration is validfor this file, and refuses an unknown key (field champ_inconnu not found in type config.FirewallConfig) or arulesetsentry written as a plain string instead of apath:object (cannot unmarshal !!str ... into firewall.FirewallRulesetConfig). The image is multi-architecture: no--platformoption is needed.Terminal window docker run --rm \-v "$PWD/orca/orca.yaml":/c.yaml:ro -v "$PWD/orca/rulesets":/etc/orca/rulesets:ro \varnish/orca:0.20.0@sha256:918e9839eaf13a5f7c2a3b3cbfaf0527f3344ab4dad1d891dd387b09a4d668b5 \varnish-supervisor -validate -config /c.yaml# configuration is valid -
Start Orca
Orca answers on
/healthzwithin a few seconds (measured:200after 4 s). A request sent within the second after startup returns000, for lack of a response: the loop therefore waits for the200.Terminal window docker compose up -d orcauntil [ "$(curl -s -o /dev/null -w '%{http_code}' http://localhost:8080/healthz)" = 200 ]; do sleep 1; donecurl -s -o /dev/null -w '%{http_code}\n' http://localhost:8080/healthz# 200 -
Point the clients at the firewall
Orca forwards the client path as is: include the Nexus group path. For npm, one more setting is needed before the first
npm install: see the section that follows the steps..npmrc registry=http://npm-nexus.localhost:8080/repository/npm-all/pip.conf [global]index-url = http://pypi-nexus.localhost:8080/repository/pypi-all/simpletrusted-host = pypi-nexus.localhost
Why does npm install fail behind Orca without a setting?
Measured with Nexus 3.96.4 and npm 11, everything seems in place and yet
npm install stops on ENOTFOUND nexus. The metadata request does go through
Orca and answers 200. But Nexus writes the address of the archives there with
the host name that Orca passes to it, namely
http://nexus/repository/npm-all/left-pad/-/left-pad-1.3.0.tgz, and the
client cannot resolve that host name. Setting the Base URL capability of
Nexus to http://npm-nexus.localhost:8080 changes nothing.
The measured workaround comes down to two settings:
- also publish Orca's port 80 (
- "80:80"underports:, thendocker compose up -d orcato recreate the container); - make
nexusresolve to the local machine:--add-host nexus:127.0.0.1for a container, a line127.0.0.1 nexusin/etc/hostsotherwise.
npm install is-number left-pad lodash@4.17.20 then succeeds. The workaround
holds because the archive request carries Host: nexus, a name that no Orca
registry declares: it falls on the registry marked default: true (here
npm-nexus), as the Varnish Orca page
describes, and the archive therefore goes through the firewall too. Port 80
must be free on the machine. On the Python side, pip is not affected: the
PyPI index of Nexus uses relative links.
To undo the lab, remove the containers and the nexus-data volume, then the
line added to /etc/hosts:
docker compose down -vsudo sed -i '/^127\.0\.0\.1 nexus$/d' /etc/hostsWriting rules
A rule describes what to recognise (match) and what to decide
(action). Rules are grouped in a file identified by an id, and sorted by
priority. This demonstration npm rule set uses deny and hide. The allow
action does not appear in it: in the lab, default_action: allow serves
whatever no rule forbids. An allow rule declares an explicit exception,
useful mostly when the default action switches to deny in production.
id: npm-demo-rulesrules: # Hard block of a specific package. - id: block-left-pad priority: 100 action: deny severity: 9.5 reason: "Package bloqué pour la démonstration." match: - type: npm name: left-pad
# Anti dependency confusion: an internal scope never comes from the public registry. - id: block-internal-scope priority: 90 action: deny reason: "Le scope @company ne doit pas être résolu depuis le registre public." match: - type: npm name: "@company/*"
# Hide old versions without breaking an existing lockfile. - id: hide-lodash-old priority: 50 action: hide reason: "Les versions de lodash < 4.17.21 ne sont pas proposées." match: - type: npm name: lodash version: "vers:npm/<4.17.21"On the Python side, the same grammar blocks a vulnerable version. The
version range uses the VERS notation (vers:pypi/<2.32.0), a standardised
format for version ranges per ecosystem.
id: pypi-demo-rulesrules: - id: block-old-requests priority: 100 action: deny severity: 9.0 reason: "Les versions de requests < 2.32.0 sont interdites." match: - type: pypi name: requests version: "vers:pypi/<2.32.0"How severity interacts with the thresholds
A rule can carry a severity score, which overrides its action. According
to the Varnish documentation, which this lab does not verify, a rule whose
severity is at or above severity_deny_threshold (9 by default) leads to
deny, a rule at or below severity_allow_threshold (4 by default) leads
to allow, and in between, the rule's action applies. In the npm example,
block-left-pad (9.5) would be refused even if its action were hide.
This mechanism lets you plug in community rules, for instance the rule sets
derived from OSV data (the open vulnerability database), and steer their effect
with two thresholds, without rewriting each rule. It also carries a trap: a
deny rule of severity 3 is allowed.
Dynamic rules from a git repository
Loading rules from local files (path:) requires restarting Orca to take
them into account. Dynamic mode goes through a git source, which the
firewall refreshes at a regular interval, without a restart. The following
excerpt passes the 0.20.0 validator.
firewall: mode: report # decisions logged, nothing is blocked rulesets: - git: name: npm-osv-rules url: https://github.com/varnish/osv-rules.git sub_path: rulesets/npm/all.yaml ref: main # followed branch: rules change without local review interval: 30m # refresh frequency webhook: url: http://collector.interne/reloaded # notified after each reloadThe varnish/osv-rules repository exists and publishes
rulesets/npm/all.yaml. Following its main branch is a deliberate
choice: rules update on their own, at the price of trusting the publisher.
For your own rules, an internal repository, versioned and reviewed through code
review, gives a real GitOps approach.
report mode is the right starting point: every decision is brought down
to allow, but stays written in the audit log. You thus measure the effect of
a policy before enabling it.
Studying the firewall in practice
With a trial licence mounted, the firewall enforces its decisions. The most telling scenario compares an allowed installation and a blocked one. The following steps were not replayed for this lesson, for lack of a licence: they describe the documented behaviour.
-
Install an allowed dependency
Terminal window npm install is-number # no rule matches: allow -
Try a blocked dependency
Terminal window npm install left-pad # block-left-pad rule: deny, 403 response -
Read the audit log
Terminal window docker compose logs orca | grep -i denyThe log carries the decision, the package and the rule's reason (
reason). That is what you will route in production to a SIEM (the platform that centralises security logs). -
Change a rule and replay
Remove
block-left-pad, restart Orca, run the installation again: it goes through. The policy drives the decision.
What the firewall does not protect
An artifact firewall closes one door: the ungoverned intake of dependencies. Presenting it as global protection would be a mistake, and three limits show it.
- It does not read the code of an allowed package: a dependency that is sound today can be compromised by an update, hence the quarantine.
- It protects neither a compromised CI runner, nor secret exfiltration, nor an image already built and unsigned.
- It produces neither an SBOM nor provenance: those are other components of this module.
Above all, the registry configuration encourages going through the
firewall but does not enforce it: a developer or a job can always write
npm config set registry https://registry.npmjs.org. Closing this bypass is a
topic in its own right.
Preventing bypass (CI and developer workstations)
A firewall only protects what goes through it. As long as clients can
reach registry.npmjs.org or pypi.org directly, anyone can short-circuit it
with a single command. The rule fits in one sentence: configuration
encourages, the network enforces.
On CI runners: lock down egress
On the CI side, the bypass closes cleanly because you control the
environment. Put the runners in a network with no outbound route to the
Internet (that is egress, the traffic leaving your network): only the
artifact firewall is reachable. An attempt to run
npm config set registry https://registry.npmjs.org then fails for lack of a
route. On Kubernetes, an egress NetworkPolicy that only allows the firewall
service has the same effect, and ephemeral runners prevent any persistent local
configuration.
On developer workstations: the hard case
The developer's workstation is harder to constrain: the developer often has
administrator rights on it, so no application configuration is
tamper-proof. Pushing an .npmrc, a pip.conf or a GOPROXY through MDM
(centralised workstation management) or a configuration management tool
reduces friction, but can still be bypassed with a --registry. The robust
control is, once again, the network:
| Solution | Effect | Robustness |
|---|---|---|
| Cut direct egress to npmjs, pypi, Docker Hub | The public registry has no route any more | High |
Internal DNS: registry.npmjs.org resolved to the firewall | Even a hard-coded public URL lands on the firewall | High, with egress closed |
| Workstation without a direct Internet route | Everything goes through the internal proxy | Maximum |
| Remote development environment (dev container, VDI) | You control the environment's network | High |
Managed configuration (.npmrc, pip.conf, GOPROXY) | Steers the default | Low on its own |
No single row is enough on a machine where the developer is an administrator. The combination that holds: no direct route to public registries, plus a DNS that brings public names back to the firewall. Managed configuration adds comfort, not security.
Catching and detecting
The network closes the door; detection checks that it stays closed. Add a
CI check on lockfiles: a resolved entry (npm) or an index URL pointing
anywhere other than the firewall fails the build.
OSV-Scanner (in French) spots on
its side the poisoned dependencies that bypassed the firewall, and the
network proxy logs flag any attempt at direct access to public registries.
These bypasses extend the techniques described in
Attacks through package managers.
A closed network and detection complete the configuration of the internal
proxy (here orca.yaml and its rules): together, they form the evidence that
SOCLE-INT-GEN-3 (in French)
asks for, OSS consumption through a controlled proxy, with no unfiltered
direct pulls.
Where should it sit in your chain?
The firewall is not a substitute for the module's other controls: it holds the furthest upstream position. A mature chain combines them, each answering a different question.
| Step | Component | Role |
|---|---|---|
| Dependency intake | Varnish Artifact Firewall | Decides before ingestion |
| Centralisation | Nexus | Caches and exposes artifacts |
| Inventory | SBOM | Lists the shipped components |
| Exploitability | VEX | Documents what is really exploitable |
| Signing | Cosign | Signs and verifies the image |
| Provenance | SLSA | Attests the origin of the build |
The firewall reduces the noise downstream: fewer dubious components come in, fewer vulnerabilities to sort afterwards. It does not replace defence in depth, it starts it.
Key points
- A cache speeds things up and withstands outages; an artifact
firewall decides what has the right to come in, through three rule
actions (
allow,hide,deny) and a global quarantine (default_quarantine_days), disabled by default. - Severity overrides the action: above the deny threshold,
deny; below the allow threshold,allow. reportmode logs decisions without blocking anything: the right start to measure a policy.-validatechecks the configuration's structure, not the content of the rules.- Without a network egress rule, the registry configuration can be bypassed.
- In the lab, two settings are indispensable: anonymous read access on
Nexus, because Orca sends no credentials, and resolution of the
nexushost name on the npm client side. - At Varnish, the firewall is Premium: the public 0.20.0 image starts with
addons=[]and filters nothing. - The evidence expected by SOCLE-INT-GEN-3 is the internal proxy configuration and proof of the absence of unfiltered direct pulls.
Knowledge check
Check that the essentials of this lesson are understood. The questions only cover what has just been explained here.
Knowledge check
Check what you have learned with this interactive quiz
How it works
- The timer starts when you click Start
- Multiple choice, true/false and short answer questions
- You can move between questions
- Detailed results are shown at the end
Starts the quiz and the timer
Review
(0/0)Result saved on this device. It will be sent to your account at the next sync. Sync now
Score by domain
A domain groups several guides and gets several questions, so its score is more reliable than a per-topic score, which often rests on a single question.
Summary
Strengths
No topic passed at 80% on at least two questions yet.
Weak areas
No topic below the pass mark.
Recommended next
Hints before you try again?
Continue the course: TPRM for technical teams: assessing the security of your suppliers
Continue the course: GitLab registries: build and publish images and packages
A new full quiz with random questions
Work again only on the questions you missed