Protect dependency installations on developer machines, AI agents, and CI runners with GitHub package firewall.
Note
This feature is currently in public preview and is subject to change.
The GitHub package firewall sits between your endpoints and package registries. It evaluates package downloads against policies such as minimum package age and malware advisories, and blocks downloads that do not meet those policies. You can use it to protect dependency installations in CI builds, AI agent sessions, and local development.
To use the firewall, configure your enterprise's policy controls, then configure your endpoints to request packages through the firewall instead of directly from a public registry. You can also grant access to manage the policy through a custom role.
Enterprise security managers and enterprise administrators can configure policy controls.
When enabled, this control checks the GitHub Advisory Database for active malware advisories and blocks packages with a matching advisory. This control defaults to On.
This control checks the GitHub Advisory Database for vulnerabilities that affect the requested package version. Select the minimum advisory severity that blocks an installation: Critical only, High or higher, Medium or higher, or Any severity. This control defaults to Critical only.
This control compares attestations for the requested package version with those of earlier versions. If the package previously had SLSA attestations but the requested version does not, the firewall blocks the download. Missing attestations can indicate a compromised publishing process. For more information about attestations, see Artifact attestations. This control defaults to On.
This control checks whether the package recently added scripts that run during installation, such as preinstall or postinstall scripts. These scripts can run arbitrary commands on your system and can be used to steal credentials. This control defaults to On.
This control sets a cooldown period for newly published package versions. The firewall blocks versions that are newer than the configured minimum age, allowing time for threats to be discovered before you install them.
Set the minimum age to a value between 1 and 365 days, or set it to 0 to disable the control. The default is 1 day.
Configure your package manager to fetch packages from the firewall's URL instead of the default public registry.
The registry URL is specific to your enterprise. Each request must include an authentication token associated with a user or bot account that is a member of the enterprise. The token does not need any elevated permission beyond Read-only access to public repositories. For more information, see Managing your personal access tokens.
Use your user-level .npmrc file to configure npm. In the examples, replace ENTERPRISE with your enterprise slug. Set the GITHUB_TOKEN environment variable to a GitHub token with access to your enterprise. Store the token securely, such as in a CI secret, and do not commit it to a repository.
Add the following configuration to your user-level .npmrc file:
registry=https://package-firewall.githubapp.com/npm/enterprises/ENTERPRISE
//package-firewall.githubapp.com/npm/enterprises/ENTERPRISE/:_authToken=${GITHUB_TOKEN}
Alternatively, configure the same settings from the command line:
npm config set registry \
https://package-firewall.githubapp.com/npm/enterprises/ENTERPRISE
npm config set \
'//package-firewall.githubapp.com/npm/enterprises/ENTERPRISE/:_authToken=${GITHUB_TOKEN}'
You can configure JFrog Artifactory to retrieve packages through the firewall. Your endpoints continue to use Artifactory, which lets you combine public and private packages while applying firewall policies to packages retrieved through the firewall.
You must have administrator privileges in your Artifactory instance.
Note
Artifactory support is experimental. To share suggestions or concerns about Artifactory support, see the community discussion.
gh-package-firewall.https://package-firewall.githubapp.com/npm/enterprises/ENTERPRISE, replacing ENTERPRISE with your enterprise slug.**/* to include all package paths.By default, enterprise administrators and enterprise security managers can modify the firewall policy. To grant other users access to view and change the policy, add the "Edit enterprise-level package firewall policy" fine-grained permission to a custom role, then assign that role to a team or individual.
If the firewall blocks a package you need, you can request an exception to the policy. For example, a new package version that includes a security fix could be blocked by the minimum package age policy.
When the firewall blocks a package, the npm output or CI/CD log includes a URL for requesting an exception. For example:
npm notice testcontainers: 1 version blocked by package-firewall due to security policies (version cooldown). Request an override: https://github.com/enterprises/octocats/security/bypass-requests/package-firewall/new?ecosystem=npm&package=testcontainers
Open the URL in your browser.
Review the prefilled fields and provide any missing information:
@scope prefix if applicableSubmit the request.
Enterprise administrators and enterprise security managers can review exception requests.
*. This broadens the exception beyond the requested version.For example, you might allow all versions of an enterprise-owned package rather than require a separate exception each time the minimum package age policy blocks a new version.
Approved bypass requests are added to the firewall policy. Enterprise administrators and enterprise security managers can review and remove outdated or unwanted exceptions, including exceptions added manually.