-
Block the installation if the package is found in the Endor Labs malware database, or if a policy condition matches with Block. Nexus Repository returns
HTTP 404response. The Package Firewall records a log with the package, version, and reason. - Allow the installation if a policy condition matches with Warn. The Package Firewall records a warning log with the package, version, and reason.
- Allow the installation if the package passes all checks. No log is recorded.
HTTP 404 response when it blocks a request without surfacing the specific reason. To see why a package was blocked, review the Package Firewall logs.
Sonatype Nexus Repository requirementYou must have a Sonatype Nexus Repository instance with permission to create proxy repositories and configure credentials.
Configure the Package Firewall
Complete the following steps to integrate Sonatype Nexus Repository with the Endor Labs Package Firewall:- Create an API key for the Package Firewall.
- Configure Sonatype Nexus Repository.
- Set up local package managers.
- Verify your setup.
Create an API key for the Package Firewall
Create an API key dedicated to the Package Firewall so that can authenticate to it. You can create it through one of the following methods:- Using the Endor Labs user interface, with the Package Firewall User role. See API keys to learn more.
- Using endorctl, with the
SYSTEM_ROLE_PACKAGE_FIREWALLrole. Make sure to install and configure endorctl before you create the key.
<namespace>with your namespace.<API key name>with the name of the API key for the Package Firewall use case.<YYYY-MM-DDTHH:MM:SSZ>with the API key expiration in ISO 8601 UTC format, for example2026-12-31T23:59:59Z.
- API key:
spec.key - API secret:
spec.secret
Configure Sonatype Nexus Repository
Configure a proxy repository in Nexus Repository for each package type you want to route through the Package Firewall. A proxy repository fetches artifacts from an upstream source, so you set the Package Firewall URL as the remote storage. The remaining repository settings, such as blob store and cleanup policies, are specific to Nexus Repository. Configure them based on your requirements.Configure Nexus Repository for an npm proxy repository
Configure Nexus Repository for an npm proxy repository
- Sign in to Sonatype Nexus Repository.
- Select Settings > Repository > Repositories.
- Click Create repository.
- Select npm (proxy) as the recipe.
- Enter the repository name, such as
endor-firewall-npm. - In Remote Storage, enter
https://factory.endorlabs.com/v1/namespaces/<namespace>/firewall/npm/. Replace<namespace>with your Endor Labs namespace. - Select Authentication under HTTP Authentication.
- In Authentication type, choose Username.
- Enter the API key as the Username and the API secret as the Password.
- Click Create repository.
Configure Nexus Repository for a PyPI proxy repository
Configure Nexus Repository for a PyPI proxy repository
- Sign in to Sonatype Nexus Repository.
- Select Settings > Repository > Repositories.
- Click Create repository.
- Select pypi (proxy) as the recipe.
- Enter the repository name, such as
endor-firewall-pypi. - In Remote Storage, enter
https://factory.endorlabs.com/v1/namespaces/<namespace>/firewall/pypi/. Replace<namespace>with your Endor Labs namespace. - Select Authentication under HTTP Authentication.
- In Authentication type, choose Username.
- Enter the API key as the Username and the API secret as the Password.
- Click Create repository.
Configure Nexus Repository for a Go proxy repository
Configure Nexus Repository for a Go proxy repository
- Sign in to Sonatype Nexus Repository.
- Select Settings > Repository > Repositories.
- Click Create repository.
- Select go (proxy) as the recipe.
- Enter the repository name, such as
endor-firewall-go. - In Remote Storage, enter
https://factory.endorlabs.com/v1/namespaces/<namespace>/firewall/go/. Replace<namespace>with your Endor Labs namespace. - Select Authentication under HTTP Authentication.
- In Authentication type, choose Username.
- Enter the API key as the Username and the API secret as the Password.
- Click Create repository.
endor-firewall-go as a member. For more information, refer to Repository types.Configure Nexus Repository for a Maven proxy repository
Configure Nexus Repository for a Maven proxy repository
- Sign in to Sonatype Nexus Repository.
- Select Settings > Repository > Repositories.
- Click Create repository.
- Select maven2 (proxy) as the recipe.
- Enter the repository name, such as
endor-firewall-maven. - In Remote Storage, enter
https://factory.endorlabs.com/v1/namespaces/<namespace>/firewall/maven/. Replace<namespace>with your Endor Labs namespace. - Select Authentication under HTTP Authentication.
- In Authentication type, choose Username.
- Enter the API key as the Username and the API secret as the Password.
- Click Create repository.
Set up local package managers
Update your package manager to use the Nexus Repository proxy repository as its source, routing all package installations through the Package Firewall instead of the public registry. Nexus Repository serves each repository athttps://<nexus-host>/repository/<repository-name>/. Replace <nexus-host> with your Nexus Repository host, and the port if your instance uses one, such as nexus.example.com:8081. Replace <repository-name> with the repository you created.
Each example includes the credentials to add when your proxy repository requires authentication. Omit them if your proxy repository allows anonymous read access. Replace <nexus-username> and <nexus-password> with your Nexus Repository credentials, not the Endor Labs API key and secret stored on the proxy repository.
npm
npm
Run the following command to point npm at the proxy repository.If your proxy repository requires authentication, encode your credentials as a Base64 string.Add the following lines to your Run
.npmrc file at the project level, or in the user-level file at ~/.npmrc. Replace <base64-credentials> with the string you generated.npm config get registry to confirm the registry matches the repository URL.For more information, refer to npm registry documentation.pip
pip
Add the following lines to your If your proxy repository requires authentication, include your credentials in the index URL.Run
pip.conf file.pip3 config list | grep index-url to confirm the index URL matches the repository URL.For more information, refer to Configure PyPI with Nexus.Go
Go
Run the following command to point the Go module proxy at the repository.If your proxy repository requires authentication, Go reads your credentials from a
.netrc file rather than from the proxy URL.Run go env GOPROXY to confirm the proxy matches the repository URL.For more information, refer to Configure Go with Nexus.Maven
Maven
Add a mirror to your Run
~/.m2/settings.xml file that points at the proxy repository. If your proxy repository requires authentication, add a server with the same <id> as the mirror.mvn dependency:resolve to confirm Maven resolves through the mirror.For more information, refer to Maven repository documentation.Verify your setup
To verify your setup, install a package that Endor Labs has classified as malware. The Package Firewall should block the installation and return anHTTP 404.
The following are examples of packages classified as malware by Endor Labs.
npm
npm
Run the following command to test the Package Firewall with npm.When the Package Firewall blocks the package, the output looks similar to the following. The
E404 error code and 404 Not Found response confirm that the firewall blocked the package.pip
pip
Run the following command to test the Package Firewall with pip.When the Package Firewall blocks the package, the output looks similar to the following. The
404 response confirms that the firewall blocked the package.Go
Go
Run the following command to test the Package Firewall with Go.When the Package Firewall blocks the package, the output looks similar to the following. The
404 response confirms that the firewall blocked the package.Maven
Maven
Add When the Package Firewall blocks the package, the output looks similar to the following. Nexus Repository doesn’t serve the artifact, so resolution fails with a missing POM warning and a
io.github.endorlabs:endor-java-webapp-demo:4.1 as a dependency in your pom.xml, then run the following command to test the Package Firewall with Maven.Could not find artifact error.Troubleshooting and FAQ
What if Nexus Repository has already cached a package that is declared malicious later?
What if Nexus Repository has already cached a package that is declared malicious later?
If Endor Labs flags a package as malware after Nexus Repository cached it, Nexus Repository continues to serve it until the cache expires. Reduce the component and metadata maximum age on the proxy repository to shorten that window.
Why does a package stay blocked after I add an exception?
Why does a package stay blocked after I add an exception?
Nexus Repository caches negative responses in its not found cache. After the Package Firewall starts allowing a package, Nexus Repository can keep returning
HTTP 404 until that entry expires. Invalidate the cache on the proxy repository to pick up the change immediately.How do I troubleshoot connection issues?
How do I troubleshoot connection issues?
- Verify that the Package Firewall URL in the proxy repository remote storage is correct.
- Ensure network connectivity from Nexus Repository to the Package Firewall.
- Ensure your network firewall rules allow outbound connections from Nexus Repository.
How do I troubleshoot authentication issues?
How do I troubleshoot authentication issues?
- Verify the API key and secret are correct and that the key has the Package Firewall User role.
- Confirm that Authentication is selected on the proxy repository and that the credentials are saved.
- Check the Nexus Repository logs for authentication errors.