> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/artifact-registry/3.0/concepts/dependency-firewall.md).

# Dependency Firewall

Understand how Dependency Firewall intercepts open-source artifacts and blocks unsafe dependencies before they enter your registry.

Dependency Firewall is a policy enforcement layer that sits in front of every upstream proxy registry, intercepting open-source package requests, evaluating them against your security policies, and blocking unsafe dependencies before they enter your registry.

## What is Dependency Firewall?

Dependency Firewall is a policy enforcement layer that sits in front of every upstream proxy registry. When a developer or pipeline requests a package from an upstream proxy, Dependency Firewall intercepts the request, evaluates the requested artifact against your configured security policies, and decides whether to cache it and allow it, or block it entirely.

A package that adheres to your policies is cached and made available. A package that fails is blocked before it reaches your registry.

{% hint style="info" %}
**Upstream proxies only**

Dependency Firewall applies to upstream proxy registries, which fetch artifacts from external sources. It does not evaluate artifacts you push directly to a local registry.
{% endhint %}

## How does Dependency Firewall evaluate a package?

When a pull request arrives at an upstream proxy with Dependency Firewall enabled:

1. Harness intercepts the request before caching the artifact.
2. The artifact version is evaluated against all configured policy sets.
3. Each policy in each policy set produces a result based on its configured fail action.
4. The artifact receives one of three verdicts:

| Verdict     | Meaning                                        | What happens                                           |
| ----------- | ---------------------------------------------- | ------------------------------------------------------ |
| **Passed**  | All policies satisfied                         | Artifact is cached and available                       |
| **Warning** | At least one "warn and continue" policy failed | Artifact is cached but flagged; optionally quarantined |
| **Blocked** | At least one "error and exit" policy failed    | Artifact is not cached; the pull request fails         |

A blocked artifact is never stored in your registry. Subsequent pull attempts for the same version will also fail until an exemption is granted.

## The five built-in policy templates

Harness provides five policy templates designed specifically for supply chain security. You can use them out of the box or customize the thresholds for your organization.

### CVSS threshold

Blocks or warns on packages with known vulnerabilities above a configurable severity score. A CVSS score of 7.0 or above is the most common enterprise threshold for mandatory blocking. Use this policy to prevent packages with critical or high-severity CVEs from entering your environment.

### License policy

Enforces license compliance by comparing each package's declared license against an approved list or a blocked list. Common use cases include blocking packages with GPL or Affero General Public License (AGPL) licenses in commercial products, or allowing only MIT, Apache 2.0, and BSD licenses.

### Package age

Newly published packages carry a statistically higher risk of containing malicious code. The Package Age policy quarantines packages that were published within a configurable window, such as any package published in the last 7 days. After the cooldown period passes, the package can be re-evaluated.

### Open-source software (OSS) risk level

Evaluates the health of the open-source project behind the package: Is it actively maintained? Has it reached end-of-life? Does it have a low aggregate health score based on contributor activity, issue response time, and other signals? Packages with poor health scores may introduce long-term maintenance risk even if they have no current CVEs.

### Malicious package

Compares each package against a threat intelligence database of packages that have been identified as intentionally malicious, including typosquatted packages, dependency confusion attacks, and known supply chain compromises. This database is refreshed automatically every 4 hours.

Go to [Built-in policy templates](https://developer.harness.io/artifact-registry/3.0/dependency-firewall/built-in-policy-templates.md) for thresholds, detection methodology, and recommended combinations.

## The first-pull vulnerability window

Dependency Firewall scanning is asynchronous. When a developer pulls a package that has never been cached before, the pull completes before scanning finishes. If the package turns out to be malicious or vulnerable, it has already been delivered before the verdict is available. Subsequent pulls of the same version are correctly blocked.

This first-pull window is a deliberate tradeoff: synchronous scanning on every first pull would add latency to every build. The practical risk is bounded. The package is evaluated and blocked within seconds of that first pull, and subsequent consumers are protected.

For environments where even a single delivery of an unscanned package is unacceptable, use the staging-registry pattern.

## The staging-registry pattern

Create two upstream proxies for each external registry you depend on: a staging proxy and a production proxy.

1. New packages are pulled through the staging proxy. Dependency Firewall evaluates them.
2. Monitor the Dependency Firewall dashboard for the verdict. Wait for **Passed**.
3. Promote the approved version to the production proxy using Copy Version.
4. Production pipelines pull only from the production proxy.

No unscanned package ever reaches production. The staging proxy absorbs the first-pull window; the production proxy receives only pre-approved artifacts.

To investigate blocked packages and their policy violations, go to [View and triage violations](https://developer.harness.io/artifact-registry/3.0/dependency-firewall/view-and-triage-violations.md).

## Use cases

### Blocking all packages with critical CVEs

Create a CVSS Threshold policy set with a blocking threshold of 7.0. Attach it to every upstream proxy in your account. Any package with a known CVE at High or Critical severity is blocked before it reaches a developer's machine or a CI build.

### Quarantining freshly published packages

A widely cited supply chain attack pattern involves registering a package with a name similar to a popular library and publishing it within hours of a real release. Configure a Package Age policy with a 7-day cooldown. Any package published in the last week is quarantined automatically, regardless of its vulnerability score. After 7 days without a security flag in the threat database, the package passes automatically.

### Enforcing permissive-only licenses

Your legal team has approved MIT, Apache 2.0, and BSD licenses for production use. Configure a License Policy that blocks any package with a General Public License (GPL), Affero General Public License (AGPL), or Lesser General Public License (LGPL). Every npm, pip, and Maven package fetched through your upstream proxies is evaluated before it is cached.

{% @harness-feedback/feedback %}
