> 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/enable-dependency-firewall.md).

# Enable Dependency Firewall on a registry

Enable Dependency Firewall for an upstream proxy registry, choose a firewall mode, and understand the effect on artifacts already cached.

Dependency Firewall is configured per upstream proxy. Set a firewall mode on each upstream proxy to control whether the artifacts it fetches are evaluated against your policies, and what happens when a policy fails.

## Before you begin

* Your role must include **Create/Edit** permission on the upstream proxy registry. Go to [RBAC and permissions](https://developer.harness.io/artifact-registry/3.0/reference/rbac-and-permissions.md) for details.
* At least one policy set with entity type **Upstream Proxy** is enforced at the scope of your registry. To create one, go to [Dependency Firewall overview](https://developer.harness.io/artifact-registry/3.0/dependency-firewall/overview.md#policies-and-policy-sets).
* Dependency Firewall applies to upstream proxy registries only. To create one, go to [Create an upstream proxy](https://developer.harness.io/artifact-registry/3.0/registries/create-an-upstream-proxy.md).

## Set the firewall mode

1. In the navigation menu, select **Registries**.
2. Select the upstream proxy registry you want to protect.
3. Select the **Configuration** tab.
4. In the **Dependency Firewall** section, select a mode:

   | Mode                | A policy violation | A policy warning |
   | ------------------- | ------------------ | ---------------- |
   | **Allow** (default) | Served             | Served           |
   | **Enabled**         | Blocked            | Served           |
   | **Quarantine**      | Blocked            | Quarantined      |
5. Save the setting.

To understand what counts as a violation or a warning for a pulled artifact, go to [Dependency Firewall overview](https://developer.harness.io/artifact-registry/3.0/dependency-firewall/overview.md#how-dependency-firewall-works).

{% hint style="info" %}
**Changing the mode re-evaluates cached artifacts**

Moving from **Allow** to **Enabled** or **Quarantine** triggers an asynchronous re-evaluation of every artifact already cached through this proxy against your current policies. Re-evaluation runs in the background and does not block the save. There is a brief window where a previously cached artifact can still be served before its re-evaluation completes.
{% endhint %}

## Set the firewall mode with the API

Set `firewallMode` on the upstream proxy's configuration:

```bash
curl -X PATCH \
  'https://app.harness.io/har/api/v3/registry/{registry_ref}' \
  -H 'x-api-key: <your-api-key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "config": {
      "type": "UPSTREAM",
      "firewallMode": "ENABLED"
    }
  }'
```

`firewallMode` accepts `ALLOW`, `ENABLED`, or `QUARANTINE`, the same three modes available in the UI.

## If the policy evaluation service is unreachable

Dependency Firewall fails closed. If Harness cannot reach the policy evaluation service, every pull through a proxy set to **Enabled** or **Quarantine** is blocked until the service is reachable again; Dependency Firewall never serves an artifact it could not evaluate. Monitor your account's policy evaluation health to avoid unplanned pull failures during an outage.

## Supported package types

To see which package types Dependency Firewall evaluates, go to [Supported formats](https://developer.harness.io/artifact-registry/3.0/dependency-firewall/overview.md#supported-formats). Package types outside that list are not affected by the firewall mode, regardless of what you set it to.

## Troubleshooting

<details>

<summary>I switched the mode but previously cached artifacts are still being served</summary>

Re-evaluation of cached artifacts runs asynchronously after you change the mode. Wait for it to complete, or go to [View and triage violations](https://developer.harness.io/artifact-registry/3.0/dependency-firewall/view-and-triage-violations.md) to check whether a specific artifact has been re-evaluated yet.

</details>

<details>

<summary>Pulls are failing with a 403 and no violation appears on the Violations tab</summary>

If the policy evaluation service was unreachable at pull time, the firewall blocks the pull without producing a violation record, because no evaluation ran. Confirm the policy evaluation service is healthy, then retry the pull.

</details>

<details>

<summary>The Dependency Firewall section does not appear in Configuration</summary>

The Dependency Firewall section is available only on upstream proxy registries. It does not appear on local or virtual registries. Go to [Create an upstream proxy](https://developer.harness.io/artifact-registry/3.0/registries/create-an-upstream-proxy.md) if the registry you are configuring is not already an upstream proxy.

</details>

## Next steps

* [Built-in policy templates](https://developer.harness.io/artifact-registry/3.0/dependency-firewall/built-in-policy-templates.md): attach policies to enforce
* [View and triage violations](https://developer.harness.io/artifact-registry/3.0/dependency-firewall/view-and-triage-violations.md): investigate what the firewall blocked or warned
* [Request an exception](https://developer.harness.io/artifact-registry/3.0/dependency-firewall/request-an-exception.md): get temporary access to a blocked or warned package

{% @harness-feedback/feedback %}
