> 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/dependency-firewall/built-in-policy-templates.md).

# Built-in policy templates

Reference for the five built-in Harness Dependency Firewall policy templates, covering detection methodology, recommended configuration, and combination.

Harness provides five policy templates in the Policy Library that are purpose-built for Dependency Firewall. Each template targets a specific supply-chain risk category and works out of the box without custom Rego. You can use any template as-is, customize it, or write your own policies from scratch.

All templates use the **Upstream Proxy** entity type. They run automatically every time an artifact is fetched through an upstream proxy registry that has Dependency Firewall enabled.

## Malicious Package

Detects packages that have been intentionally designed to attack your software supply chain, powered by a proprietary threat intelligence database that is **refreshed every 4 hours**.

**What it detects**: Packages flagged as intentionally harmful. This is fundamentally different from vulnerability detection; malicious packages are purpose-built attacks, not accidental flaws in legitimate code.

**When to use**: Always. This template should be active on every upstream proxy with Dependency Firewall enabled. There is no valid use case for allowing a known malicious package into your supply chain.

**Detection coverage**:

| Category          | Examples                                                                                               |
| ----------------- | ------------------------------------------------------------------------------------------------------ |
| **History**       | Prior malicious advisory, security yanks, repeat offenders                                             |
| **Integrity**     | Obfuscated source, install-time network calls, suspicious install scripts, source mismatches           |
| **Takeover**      | Expired maintainer domains, new maintainer publishing immediately after ownership change, disabled 2FA |
| **Confusion**     | Dependency confusion (private package name collision with a public namespace)                          |
| **Typosquatting** | Package names mimicking popular dependencies to trick developers into installing malicious code        |

**Key difference from CVSS Threshold**:

|                  | CVSS Threshold                     | Malicious Package                          |
| ---------------- | ---------------------------------- | ------------------------------------------ |
| Nature of threat | Accidental flaw in legitimate code | Intentionally harmful package              |
| Detection basis  | CVE databases and CVSS scores      | Threat intelligence and behavioral signals |
| Resolution       | Patch available in a newer version | No fix; the package itself is the attack   |
| Classification   | Can change as patches are released | Permanent once flagged                     |

**Recommended configuration**:

| Environment      | Fail action    |
| ---------------- | -------------- |
| All environments | Error and exit |

{% hint style="danger" %}
Set Malicious Package to **Error and exit** with no exceptions. Unlike license or age violations where a warning may be acceptable, a malicious package represents an active attack and should be blocked unconditionally.
{% endhint %}

***

## CVSS Threshold

Evaluates artifacts against Common Vulnerability Scoring System (CVSS) scores from CVE databases.

**What it detects**: Packages with known vulnerabilities whose CVSS base score exceeds your configured threshold. CVSS scores range from 0.0 (no risk) to 10.0 (critical).

**When to use**: Block or warn on packages with known CVEs above your organization's risk tolerance. CVSS Threshold is the most widely adopted first policy in a Dependency Firewall setup.

**How it works**: At pull time, Dependency Firewall checks the artifact against CVE databases. If any vulnerability on the artifact exceeds your configured threshold, the policy fails. The **Evaluation Details** sidebar shows the full breakdown by severity (Critical, High, Medium, Low).

**Recommended configuration**:

| Use case                | Threshold | Fail action     |
| ----------------------- | --------- | --------------- |
| Strict security posture | 7.0       | Error and exit  |
| Block critical only     | 9.0       | Error and exit  |
| Warn on high severity   | 7.0       | Warn & continue |
| Visibility only         | 4.0       | Warn & continue |

{% hint style="info" %}
CVSS Threshold and Package Age complement each other. New packages may not yet have CVE entries in public databases, so Package Age provides a safety net during the window before vulnerabilities are indexed.
{% endhint %}

***

## OSS Risk Level

Evaluates artifacts based on a composite open-source risk score that aggregates multiple supply-chain health signals.

**What it detects**: Packages that exceed a configured risk threshold based on overall project health. The risk score (0 to 100, higher means greater risk) is derived from four weighted dimensions:

| Dimension     | Weight | What it measures                                                       |
| ------------- | ------ | ---------------------------------------------------------------------- |
| Vulnerability | 40%    | Known CVE count and severity distribution                              |
| Risk          | 30%    | Supply-chain risk signals (malicious flags, end-of-life, unmaintained) |
| License       | 20%    | License compliance and restrictiveness                                 |
| Quality       | 10%    | Maintenance activity, release cadence, community health                |

**When to use**: Catch dependencies that may not have critical CVEs today but show signs of becoming risky over time: unmaintained projects, end-of-life packages, or projects with poor security hygiene. The composite score surfaces risk that individual policy templates (CVSS, License) might miss in isolation.

**Key findings surfaced in Evaluation Details**:

* **End of Life**: the project has been officially deprecated or archived
* **Unmaintained**: no commits or releases in an extended period
* **Outdated**: the version is significantly behind the latest release
* **Malicious**: the package has been flagged in threat intelligence
* **Unpatched critical CVE**: a critical vulnerability exists with no available fix

**Cap rules**: When critical signals are detected (malicious component, unpatched critical CVE, or end-of-life status), the score is clamped to 100 regardless of the weighted calculation. Packages with severe risk indicators always exceed standard thresholds.

**Recommended configuration**:

| Use case                     | Threshold | Fail action     |
| ---------------------------- | --------- | --------------- |
| Block high-risk dependencies | 70        | Error and exit  |
| Warn on moderate risk        | 50        | Warn & continue |
| Strict supply-chain hygiene  | 40        | Error and exit  |

***

## License Policy

Checks artifact licenses against your organization's approved or blocked license list.

**What it detects**: Packages whose detected license is not in your allowed list, or is explicitly in your blocked list. This prevents non-compliant open-source licenses from entering your supply chain without review.

**When to use**: Enforce license compliance requirements. Common scenarios: blocking copyleft licenses (GPL, AGPL) in proprietary products, or restricting to a pre-approved set of permissive licenses (MIT, Apache-2.0, BSD-2-Clause).

**How it works**: At pull time, Dependency Firewall reads the license metadata from the package. The policy compares the detected license against your configured allowed or blocked list. If the license is on the blocked list, or is not in the allowed list when one is configured, the policy fails.

**Recommended configuration**:

| Use case                | Approach                                 | Fail action     |
| ----------------------- | ---------------------------------------- | --------------- |
| Strict compliance       | Allowed list only (MIT, Apache-2.0, BSD) | Error and exit  |
| Block specific licenses | Blocked list (GPL-3.0, AGPL-3.0)         | Error and exit  |
| Audit mode              | Blocked list                             | Warn & continue |

***

## Package Age

Evaluates artifacts based on their release date to enforce a cooldown window on newly published versions.

**What it detects**: Package versions whose release date is more recent than your configured age threshold (in days). Newly published packages are more likely to contain undiscovered bugs or supply-chain attacks. A cooldown period gives the community time to identify issues before the version enters your supply chain.

**How it works**: At pull time, Dependency Firewall checks the version's release date against the current date. If the version was released fewer days ago than your threshold, the policy fails. This is especially useful for transitive dependencies that update frequently.

**Recommended configuration**:

| Use case                      | Threshold | Fail action     |
| ----------------------------- | --------- | --------------- |
| High-security environments    | 30 days   | Error and exit  |
| Moderate cooldown             | 7 days    | Warn & continue |
| Audit newly released packages | 3 days    | Warn & continue |

***

## Combine templates in a policy set

Add multiple templates to a single policy set and assign a different fail action to each. This lets you layer enforcement levels within one evaluation pass.

A common configuration for production environments:

| Policy               | Fail action     | Rationale                        |
| -------------------- | --------------- | -------------------------------- |
| Malicious Package    | Error and exit  | Zero tolerance for known attacks |
| CVSS Threshold (9.0) | Error and exit  | Block critical vulnerabilities   |
| CVSS Threshold (7.0) | Warn & continue | Surface high-severity issues     |
| License Policy       | Error and exit  | Compliance requirement           |
| OSS Risk Level (70)  | Warn & continue | Awareness of risky dependencies  |
| Package Age (7 days) | Warn & continue | Flag newly published versions    |

To create a policy set with these templates, go to **Account Settings > Policies**, create a new policy set, set the entity type to **Upstream Proxy**, add each policy with its fail action, and set the **Enforced** toggle to ON.

***

## Custom policies

If the built-in templates do not cover your use case, write custom policies in Rego. Ensure your policies use the **Upstream Proxy** entity type; policies with any other entity type do not appear when creating Dependency Firewall policy sets.

For Rego language fundamentals, go to the [OPA Policy Authoring documentation](https://www.openpolicyagent.org/docs/latest/policy-language/).

***

## Troubleshooting

<details>

<summary>A custom policy does not appear in the Policy Library when creating a Dependency Firewall policy set</summary>

Confirm the policy's Entity Type is set to **Upstream Proxy**. Policies with any other entity type are filtered out when creating policy sets for upstream proxy registries.

</details>

<details>

<summary>OSS Risk Level never triggers even with a low threshold</summary>

Confirm that the upstream proxy registry has Dependency Firewall enabled and that the policy set is set to Enforced. Risk scores are only evaluated for artifacts fetched through upstream proxies with an active, enforced policy set. Risk score data may also not be available for all package ecosystems.

</details>

## Next steps

* To assign policy templates to a registry, go to [Configure policy sets](https://developer.harness.io/artifact-registry/3.0/dependency-firewall/configure-policy-sets.md).
* To enable Dependency Firewall for an upstream proxy, go to [Enable Dependency Firewall](https://developer.harness.io/artifact-registry/3.0/dependency-firewall/enable-dependency-firewall.md).

{% @harness-feedback/feedback %}
