Skip to content
Français
Sync not enabled: your progress stays in this browser My learning
Select theme
Français

Varnish Artifact Firewall: controlling dependency intake

By updated

Improve this page

Logo Orca

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 deny and hide rules, know when to use allow, 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:

DecisionEffectUse case
allowServes the artifactExplicit exception, trusted package
hideRemoves the version from "latest version" resolutionEvict a version without breaking an existing lockfile
denyRefuses with a 403 responseForbidden package, vulnerable version
quarantine (default_quarantine_days)Blocks any version published less than N days ago, whatever the rulesSafety 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:

Resolving a dependency: the npm or pip client queries the Orca virtual registry, the firewall decides allow, hide or deny; a refusal returns a 403 error to the client, otherwise the request reaches the Nexus group, which serves from its internal hosted repository or its proxy to npmjs.org and pypi.org.npm or pip clientOrca virtual registryFirewallallow, hide, deny403 responseNexus groupHosted repositoryinternal packagesPublic proxynpmjs, PyPI
Source · SVG
Esc to close, + and − to zoom, scroll to move around. 100 %

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_ORIGIN setting; Orca rewraps them in its /redirectz endpoint, and CONTENT_ORIGIN must 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, pip and jq (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.

  1. Declare Nexus and Orca

    docker-compose.yml
    services:
    nexus:
    image: sonatype/nexus3:3.96.4@sha256:5f48f9085096e96f4111ec07d79d57ca5a4a1da5a2003a3028a0b60c62bea7d1
    ports: ["8081:8081"]
    volumes: ["nexus-data:/nexus-data"]
    orca:
    image: varnish/orca:0.20.0@sha256:918e9839eaf13a5f7c2a3b3cbfaf0527f3344ab4dad1d891dd387b09a4d668b5
    depends_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:ro
    volumes:
    nexus-data:
  2. Start Nexus and prepare it

    Start Nexus alone and read the initial password of the admin account, which Nexus writes to /nexus-data/admin.password. On the 6 GB Debian 13 VM, two measured startups answered 200 on /service/rest/v1/status after 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 the 200, whatever the duration.

    Terminal window
    docker compose up -d nexus
    until [ "$(curl -s -o /dev/null -w '%{http_code}' http://localhost:8081/service/rest/v1/status)" = 200 ]; do sleep 10; done
    NEXUS_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 admin answers 403 with the message You must accept the End User License Agreement (EULA). The API accepts it with the body returned by GET, where "accepted" becomes true. The command uses jq, 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 body

    Then 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-all group aggregates npm-private-hosted then npm-public-proxy, and that is what the firewall will see. Each creation answers http=201.

    Terminal window
    NEXUS=http://localhost:8081/service/rest/v1
    st='"storage":{"blobStoreName":"default","strictContentTypeValidation":true'
    mk() { # $1 = format, $2 = repository type, $3 = JSON body
    curl -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.org
    mk $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\"]}}"
    done

    Orca 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 for is-number. Enable anonymous read access on this lab. In production, prefer dedicated credentials declared on the Orca side: caching an authenticated upstream belongs to the sup-auth add-on, which the firewall (the sup-firewall add-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"}'
  3. 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 in orca/rulesets/ before validating the configuration and starting Orca.

    orca/orca.yaml
    virtual_registry:
    registries:
    - name: npm-nexus
    default: true
    enable_firewall: true
    remotes:
    - url: http://nexus:8081/repository/npm-all/
    - name: pypi-nexus
    enable_firewall: true
    remotes:
    - url: http://nexus:8081/repository/pypi-all/
    firewall:
    default_action: allow # observe in a POC; deny in production
    default_quarantine_days: 2
    severity_deny_threshold: 9
    severity_allow_threshold: 4
    audit_log_output: stdout
    metrics_address: ":9090"
    rulesets:
    - path: /etc/orca/rulesets/npm-rules.yaml
    - path: /etc/orca/rulesets/pypi-rules.yaml

    The binary embeds a validator. Measured on Orca 0.20.0, it answers configuration is valid for this file, and refuses an unknown key (field champ_inconnu not found in type config.FirewallConfig) or a rulesets entry written as a plain string instead of a path: object (cannot unmarshal !!str ... into firewall.FirewallRulesetConfig). The image is multi-architecture: no --platform option 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
  4. Start Orca

    Orca answers on /healthz within a few seconds (measured: 200 after 4 s). A request sent within the second after startup returns 000, for lack of a response: the loop therefore waits for the 200.

    Terminal window
    docker compose up -d orca
    until [ "$(curl -s -o /dev/null -w '%{http_code}' http://localhost:8080/healthz)" = 200 ]; do sleep 1; done
    curl -s -o /dev/null -w '%{http_code}\n' http://localhost:8080/healthz
    # 200
  5. 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/simple
    trusted-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" under ports:, then docker compose up -d orca to recreate the container);
  • make nexus resolve to the local machine: --add-host nexus:127.0.0.1 for a container, a line 127.0.0.1 nexus in /etc/hosts otherwise.

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:

Terminal window
docker compose down -v
sudo sed -i '/^127\.0\.0\.1 nexus$/d' /etc/hosts

Writing 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.

orca/rulesets/npm-rules.yaml
id: npm-demo-rules
rules:
# 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.

orca/rulesets/pypi-rules.yaml
id: pypi-demo-rules
rules:
- 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.

orca/orca.yaml (firewall excerpt)
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 reload

The 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.

  1. Install an allowed dependency

    Terminal window
    npm install is-number # no rule matches: allow
  2. Try a blocked dependency

    Terminal window
    npm install left-pad # block-left-pad rule: deny, 403 response
  3. Read the audit log

    Terminal window
    docker compose logs orca | grep -i deny

    The 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).

  4. 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:

SolutionEffectRobustness
Cut direct egress to npmjs, pypi, Docker HubThe public registry has no route any moreHigh
Internal DNS: registry.npmjs.org resolved to the firewallEven a hard-coded public URL lands on the firewallHigh, with egress closed
Workstation without a direct Internet routeEverything goes through the internal proxyMaximum
Remote development environment (dev container, VDI)You control the environment's networkHigh
Managed configuration (.npmrc, pip.conf, GOPROXY)Steers the defaultLow 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.

StepComponentRole
Dependency intakeVarnish Artifact FirewallDecides before ingestion
CentralisationNexusCaches and exposes artifacts
InventorySBOMLists the shipped components
ExploitabilityVEXDocuments what is really exploitable
SigningCosignSigns and verifies the image
ProvenanceSLSAAttests 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.
  • report mode logs decisions without blocking anything: the right start to measure a policy.
  • -validate checks 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 nexus host 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

6 questions
6 min
70% to pass

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