Package Firewall Tips
Package Firewall sits between your developers and public registries like npm and PyPI. It checks each package against your policies before it reaches a lockfile or a build. These tips help you switch it on without breaking anyone's day. For why this matters right now, see the Supply Chain hub.
Everything below comes from the Veracode docs. The pages are listed at the end.
Before you start
- Region: Package Firewall needs a Veracode account in the Commercial region. It doesn't support accounts in the United States Federal region yet.
- Roles: to create a firewall or manage its policies, you need the Policy Administrator or Security Lead role. To add exceptions, you need Mitigation Approver or Security Lead.
- Access token: every setup option needs a firewall access token. Go to Policies > Firewall, open your firewall, select GET TOKEN and copy it from the pop-up. Don't save your token into your shell history. Tokens don't expire by default. To get a new token, create a new firewall.
Tip 1: Start in warn-only, then turn on blocking
A new firewall blocks from day one. A default set of policies applies to every new firewall, and the docs say a demo package install should fail because the firewall blocks it by default. You can see the default policies on the firewall's Policy tab.
The docs note that during onboarding, organizations often set policies to warn instead of block. Here's a rollout that does that:
- Create the firewall. Go to Policies > Firewall, select NEW FIREWALL, add a name, then select ADD FIREWALL.
- Test it with a demo package. Veracode publishes demo packages, marked as malicious on purpose, for Ruby, Cargo, Go, Python, Maven and npm. The install should fail. Never test with a real malicious package.
- Switch your policies to warn. Open the firewall, go to the Policy tab, and for each policy you turn on, select the Warn-only policy checkbox. Package Firewall then warns about a package but doesn't block it. Install the demo package again, and you should get a warning instead of a failure. Custom policies have the Warn-only option too.
- Connect a pilot team. Point one team's package manager or repository proxy at the firewall (see Tip 2).
- Review what would have been blocked. On the firewall's Downloads tab you can see each download and whether the firewall blocked or warned about it.
- Add exceptions for what you really need (see Tip 5).
- Turn on blocking. When the warnings look right, clear Warn-only policy on the policies you want to enforce.
One thing to know before you rely on warn-only: by default, Package Firewall treats packages that haven't been analyzed yet as failures, so code that hasn't been checked doesn't run. Those packages are queued for analysis. You can wait for it to finish or add an exception. The Block incomplete toggle controls whether packages that haven't finished analysis are blocked. It works separately from your policies, so setting them to Warn-only doesn't change it.
Tip 2: Pick where to connect it
You have three options. The docs recommend the first.
- Artifact repository: add the firewall as a remote or proxy repository in JFrog Artifactory, Sonatype Nexus Repository or Azure Artifacts. You get one place to control and monitor packages for the whole organization. Azure Artifacts works with npm only.
- Package managers: point each developer's or pipeline's package manager at the Veracode registry URL. One firewall can serve several package managers.
- Developer machines: if you don't use a repository manager, push the package manager configuration command to developer machines with your Mobile Device Management (MDM) or endpoint management system.
Artifactory: create a remote repository with user name Veracode, the firewall access token as the password, and the Veracode registry URL for your ecosystem. Under Advanced, select Lenient Host Authentication so redirects work. Then add the new remote to your virtual repository in place of the old one.
Nexus: create a proxy repository with the registry URL as Remote storage, and turn on username authentication with Veracode and your token. Lower Maximum metadata age and Not found cache TTL. With the default of 1440 minutes, a policy change can take up to an extra day to show up.
Tip 3: Setup notes for each ecosystem
| Ecosystem | Veracode registry URL | How packages get analyzed |
|---|---|---|
| Cargo | https://cargo.firewall.veracode.com/ |
Proactively monitored |
| Golang | https://golang.firewall.veracode.com/ |
On demand only |
| Maven | https://maven.firewall.veracode.com/ |
On demand only |
| npm | https://npm.firewall.veracode.com/ |
Proactively monitored |
| NuGet | https://nuget.firewall.veracode.com/ |
Proactively monitored |
| Python | https://pypi.firewall.veracode.com/ |
Proactively monitored |
| RubyGems | https://rubygems.firewall.veracode.com/ |
Proactively monitored |
Proactively monitored means Veracode submits newly published packages for analysis automatically. On demand only means packages are submitted for analysis based on Package Firewall usage.
The commands below are copied from the docs. Replace <FIREWALL_TOKEN> with your access token, and keep the token out of your shell history.
npm and pnpm
npm config set replace-registry-host never npm config set registry https://:<FIREWALL_TOKEN>@npm.firewall.veracode.com/
Yarn
yarn config set -H npmRegistryServer "https://npm.firewall.veracode.com/" yarn config set -H npmAuthIdent "-:<FIREWALL_TOKEN>" yarn config set -H npmAlwaysAuth true
pip (for one install, then as the default)
pip install --index-url https://:<FIREWALL_TOKEN>@pypi.firewall.veracode.com/simple/ <requirement specifier> pip config set global.index-url https://:<FIREWALL_TOKEN>@pypi.firewall.veracode.com/simple/
Poetry
poetry source add --priority primary veracode https://pypi.firewall.veracode.com/simple/ poetry config http-basic.veracode "veracode" "<FIREWALL_TOKEN>"
.NET (dotnet). On systems other than Windows, the docs also add --store-password-in-clear-text.
dotnet nuget disable source nuget.org dotnet nuget add source https://nuget.firewall.veracode.com/v3/index.json --protocol-version 3 --name Veracode --valid-authentication-types basic --username veracode --password <FIREWALL_TOKEN>
Go
export GOPROXY="https://:<FIREWALL_TOKEN>@golang.firewall.veracode.com"
Bundler
bundle config set --global mirror.https://rubygems.org https://rubygems.firewall.veracode.com bundle config set --global mirror.https://rubygems.org.fallback_timeout 9999 bundle config set --global rubygems.firewall.veracode.com veracode:<FIREWALL_TOKEN>
Maven, Gradle and Cargo are set up in a config file rather than with one command:
- Maven: base64-encode
-:<FIREWALL_TOKEN>, then add a server and a mirror (mirror ofcentral) forhttps://maven.firewall.veracode.comto~/.m2/settings.xml. - Gradle: add an
allprojectsblock to~/.gradle/init.gradlethat removes other repositories and adds the Veracode Maven URL with user nameveracodeand your token. - Cargo: add a
veracoderegistry with indexsparse+https://cargo.firewall.veracode.com/, replacecrates-iowith it, and set a base64-encoded token.
Copy the exact file contents from Integrate with package managers.
Tip 4: Know what a block looks like
Tell developers what they'll see, so a block doesn't turn into a support ticket:
- npm fails with error code
E403and the message "Blocked by package firewall." - When every version of a package is blocked, the response is HTTP 424 with "failed Veracode analysis".
- Version ranges help. If your manifest accepts a range, the package manager automatically tries a version that passes your policy.
Package Firewall checks twice. When a package manager asks which versions exist, the firewall keeps risky versions out of your lockfile, and you can see this on the Activity tab. When it downloads a version, the firewall checks again, and that shows on the Downloads tab.
Tip 5: Use exceptions, not workarounds
When a team needs a package your policy blocks, add an exception instead of pointing them back at the public registry. Go to Policies > Firewall, open the firewall and select Exceptions. There are two kinds:
- GRANT EXCEPTION: allow a specific package that violates a policy.
- ALLOW INCOMPLETE: allow packages whose analysis isn't finished. Choose Allow all or Specific package version.
Tip 6: Start from the pre-built policies
There are 21 pre-built policies, and you turn each one on or off with its toggle. Some to look at first:
- Confirmed Malicious
- Typosquat and Dependency Confusion
- Install Code Execution and Install Code Execution (Suspicious)
- Data Exfiltration and Obfuscated Code
- Software Vulnerability – Critical or Software Vulnerability – Critical/High
- Copyleft License and AGPL Licenses, if license risk matters to you
If none fits, write a custom policy in OPA and Rego and upload it with UPLOAD POLICY. A custom policy is available to all your firewalls. You can only remove one when it isn't active in any firewall. Firewall policies are separate from Veracode security policies.
Docs pages used
- Veracode Package Firewall (last updated Aug 26, 2026)
- Create and test a firewall (Sep 8, 2026)
- Manage firewall policies (Sep 2, 2026)
- Add firewall exceptions (Sep 2, 2026)
- Copy an access token (Sep 2, 2026)
- Integrate Package Firewall (Jul 29, 2026)
- Integrate with package managers (Sep 11, 2026)
- Integrate with artifact repositories (Sep 8, 2026)
- Integrate with developer endpoints (Jul 29, 2026)
- Review firewall activity (Sep 2, 2026)
Questions or a rollout story to share? Post it in the Community and tag it Package Firewall.
.png)