-
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. Package Firewall records a log with the package, version, and reason. - Allow the installation if a policy condition matches with Warn. 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.
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 manager clients.
- Verify your setup.
https://factory.eu.endorlabs.com instead of https://factory.endorlabs.com.Create an API key for the Package Firewall
Create an API key dedicated to the Package Firewall so that Sonatype Nexus Repository 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.
Configure Nexus Repository for a NuGet proxy repository
Configure Nexus Repository for a NuGet proxy repository
- Sign in to Sonatype Nexus Repository.
- Select Settings > Repository > Repositories.
- Click Create repository.
- Select nuget (proxy) as the recipe.
- Enter the repository name, such as
endor-firewall-nuget. - In Protocol version, choose NuGet V3.
- In Remote Storage, enter
https://factory.endorlabs.com/v1/namespaces/<namespace>/firewall/nuget/v3/index.json. 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 manager clients
Update your package manager client to use the Nexus Repository proxy repository as its source, routing all package installations through Package Firewall instead of a 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
.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
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
.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
~/.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.NuGet
NuGet
nuget.config file to point NuGet at the proxy repository. If your proxy repository requires authentication, add the credentials as shown, otherwise skip the packageSourceCredentials block.Verify your setup
To verify your setup, install a package that Endor Labs has classified as malware. Package Firewall should block the installation and return anHTTP 404.
The following are examples of packages classified as malware by Endor Labs.
npm
npm
E404 error code and 404 Not Found response confirm that the firewall blocked the package.pip
pip
404 response confirms that the firewall blocked the package.Go
Go
404 response confirms that the firewall blocked the package.Maven
Maven
io.github.endorlabs:endor-java-webapp-demo:4.1 as a dependency in your pom.xml, then run the following command to test Package Firewall with Maven.Could not find artifact error.NuGet
NuGet
404 response confirming that the firewall blocked the package.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?
Why does a package stay blocked after I add an exception?
Why does a package stay blocked after I add an exception?
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 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.