Use the firewall as an Artifactory upstream
Configure JFrog Artifactory remote repositories to fetch through the firewall, per ecosystem, including the settings that differ from Artifactory's defaults.
This guide sets up the firewall as the manager's upstream in JFrog Artifactory. Developers and CI keep using Artifactory, and each Artifactory remote repository fetches from a firewall instead of the public registry. Everything below was tested against Artifactory 7.178 with the client named in each section.
Most of the work is the same for every ecosystem. The differences are in fields that keep pointing at the public registry unless you change them, and in a few Artifactory behaviors that only show up per package type.
Before you start
- A firewall per ecosystem. Copy its namespace ID and firewall ID from the firewall's Setup tab.
- Your firewall's host. The URLs on this page use
eu-sov-1.bytesafecloud.euas an example; your namespace can be on another cluster or on a self-hosted installation. Copy the endpoint from the firewall's Setup tab and replace the host in every URL below. - A Service Access Token for Artifactory with access to those firewalls. Artifactory is a service, so use a service token rather than a personal one.
- Admin access to Artifactory to create remote repositories.
Settings for every remote repository
Create one remote repository per ecosystem (Administration, Repositories, Create a Repository, Remote) with these values:
| Field | Value |
|---|---|
| URL | the firewall endpoint for the ecosystem, listed per section below |
| User Name | any value; __token__ is a good convention. Containers are the exception, see Containers |
| Password / Access Token | the Service Access Token |
| Missed Retrieval Cache Period (Advanced tab) | 0 |
Missed Retrieval Cache Period is how long Artifactory remembers that an upstream answered "not found". A blocked package looks like "not found" to Artifactory, so with the default (1800 seconds for most package types) a package stays unavailable for up to 30 minutes after you relax a rule or grant an exception. Zapping the repository cache does not clear it. Set it to 0 so firewall decisions reach clients as soon as they propagate.
Artifactory clears the stored password whenever you change the URL of an existing remote repository. Paste the token again after editing the URL.
Test connection requests the URL itself. The firewall answers it only with a valid token and a firewall of the matching ecosystem, so a passing test confirms the URL, the firewall ID, and the token together.
npm
| Field | Value |
|---|---|
| Package type | npm |
| URL | https://eu-sov-1.bytesafecloud.eu/v1/<namespace-id>/npm/<firewall-id>/ |
Artifactory builds tarball URLs in the registry.npmjs.org layout (<package>/-/<package>-<version>.tgz) instead of using the URLs in the package metadata. The firewall serves that layout, so no extra setting is needed.
PyPI
| Field | Value |
|---|---|
| Package type | PyPI |
| URL | https://eu-sov-1.bytesafecloud.eu/v1/<namespace-id>/pypi/<firewall-id> |
| Registry URL (PyPI Settings) | the same value as URL |
| Registry Index Location URL Suffix | simple |
A PyPI remote repository has two URLs. Registry URL plus the suffix is where Artifactory reads the per-project index pages (<Registry URL>/simple/<project>/); URL is the base it resolves file downloads against. Registry URL defaults to https://pypi.org, so changing only URL leaves Artifactory reading the index from pypi.org.
Do not end URL with /simple/ here. The /simple/ endpoint on the PyPI page is for pip and uv pointing at the firewall directly; Artifactory adds the suffix itself.
With URL set to the firewall and Registry URL left at https://pypi.org, Artifactory reads the index from pypi.org, drops every file link because the links are not under URL, and serves empty project pages. It never contacts the firewall. uv reports "there are no versions of" the package.
pip, uv, and Artifactory's PyPI virtual repositories work against this remote.
Maven and Gradle
| Field | Value |
|---|---|
| Package type | Maven (Gradle clients use the same remote) |
| URL | https://eu-sov-1.bytesafecloud.eu/v1/<namespace-id>/maven/<firewall-id>/ |
Maven version ranges, Gradle dynamic versions (1.+, latest.release), Gradle module metadata, and plugin resolution all work through the remote. A blocked artifact is reported as "Could not find artifact".
NuGet
| Field | Value |
|---|---|
| Package type | NuGet |
| URL | https://eu-sov-1.bytesafecloud.eu/v1/<namespace-id>/nuget/<firewall-id>/ |
| NuGet v3 Feed URL | https://eu-sov-1.bytesafecloud.eu/v1/<namespace-id>/nuget/<firewall-id>/index.json |
Leave the v2 feed and download context paths at their defaults; the v3 feed does not use them.
The firewall implements the NuGet v3 API only. Point clients at Artifactory's v3 endpoint, https://<artifactory-host>/artifactory/api/nuget/v3/<repository-key>/index.json. A client on Artifactory's v2 endpoint (…/api/nuget/<repository-key>) makes Artifactory call the firewall's OData v2 API, which does not exist, and every restore fails with NU1301.
Go
| Field | Value |
|---|---|
| Package type | Go |
| URL | https://eu-sov-1.bytesafecloud.eu/v1/<namespace-id>/go/<firewall-id>/ |
| Git Provider | default |
Artifactory refuses to serve a Go remote repository on its own, with 400 "cannot be used without a virtual repository". Create a Go virtual repository that includes the remote, and point GOPROXY at the virtual repository.
The firewall does not proxy the Go checksum database. Artifactory forwards sumdb requests to the firewall and gets "not found", so the Go toolchain checks go.sum against sum.golang.org directly, as it does without Artifactory. Builders without access to sum.golang.org need GONOSUMDB or GOSUMDB=off; see the checksum database.
Cargo
| Field | Value |
|---|---|
| Package type | Cargo |
| URL | https://eu-sov-1.bytesafecloud.eu/v1/<namespace-id>/cargo/<firewall-id>/ |
| Registry URL (Cargo Settings) | the same value as URL |
| Enable sparse index support | on |
Registry URL defaults to https://index.crates.io/. Set it to the firewall as well, or the index comes from crates.io. Artifactory downloads .crate files through the firewall too, so a blocked version is refused at download time as well as hidden from the index.
RubyGems
| Field | Value |
|---|---|
| Package type | RubyGems |
| URL | https://eu-sov-1.bytesafecloud.eu/v1/<namespace-id>/rubygems/<firewall-id>/ |
Bundler and gem install work against the remote. A gem whose versions are all blocked is reported as "Could not find gem".
Composer
| Field | Value |
|---|---|
| Package type | Composer |
| URL | https://eu-sov-1.bytesafecloud.eu/v1/<namespace-id>/composer/<firewall-id>/ |
| Registry URL (Composer Settings) | https://eu-sov-1.bytesafecloud.eu/v1/<namespace-id>/composer/<firewall-id> |
| Git providers | Artifactory |
URL defaults to https://github.com/ and Registry URL to https://repo.packagist.org; set both.
Git providers decides which package archive URLs Artifactory rewrites to point at itself. Set it to Artifactory: the firewall publishes archive URLs in the shape an Artifactory repository uses, and Artifactory then downloads them through the firewall and caches them. With another provider, Artifactory hands the firewall's archive URLs to Composer unchanged, Composer downloads from the firewall with only its Artifactory credentials, and the install fails with HTTP 401.
Containers (OCI)
| Field | Value |
|---|---|
| Package type | Docker |
| URL | https://eu-sov-1.bytesafecloud.eu/ |
| User Name | <namespace-id>/<firewall-id> |
| Enable Token Authentication | on (default) |
A Docker remote's URL is a registry host with no room for a path, so the firewall is named in the username, as for container clients. Artifactory follows the firewall's token challenge with these credentials. Images without a namespace, such as alpine, resolve through the firewall's default repository prefix.
Conda
| Field | Value |
|---|---|
| Package type | Conda |
| URL | https://eu-sov-1.bytesafecloud.eu/v1/<namespace-id>/conda/<firewall-id>/ |
| Socket Timeout (MS) (Advanced tab) | 180000 for large channels such as conda-forge |
Test connection returns 404 for Conda remotes: the firewall does not answer the channel root yet. Create the repository anyway; clients do not request the root.
Set Socket Timeout to 180000 for large channels such as conda-forge. With the default (15000 ms), Artifactory reports repodata.json as not found and clients see an empty channel.
Prevent bypass
Remove remote repositories that still point at public registries for the same ecosystem, and remove them from virtual repositories. A virtual repository that includes both the firewall-backed remote and a direct public remote serves whatever the direct remote answers first, without firewall policy.
Verify
- Install a package through Artifactory with the ecosystem's usual client.
- Add a rule that blocks a test package with logging enabled, and install it through Artifactory. The install fails with the client's usual "not found" message.
- Check the firewall log for the blocked entry. Its user is the Service Access Token Artifactory uses.
bsfw logs --firewall <firewall-id> --all-usersThe firewall writes a log entry only when a rule with logging matches, so an install that matches no rule leaves no entry even when it went through the firewall.
Troubleshoot
A 401 means the token is missing, invalid, or has no access to the firewall; paste it again if you edited the URL. A 404 means the namespace ID or firewall ID in the URL is wrong, or, for Conda, that the root route has not shipped yet. A 400 means the firewall exists but belongs to another ecosystem. For containers, check that the username is <namespace-id>/<firewall-id>.
Registry URL is still https://pypi.org. Set it to the same firewall URL as URL, with the suffix simple, and remove /simple/ from the end of URL.
Artifactory is answering from its record of the earlier "not found". Set Missed Retrieval Cache Period to 0; otherwise the package becomes available when the period runs out.
The lock file or error names a firewall URL instead of an Artifactory URL, so Artifactory did not rewrite the archive URLs. Set Git providers to Artifactory. Package metadata Artifactory fetched before the change keeps the old URLs until its Metadata Retrieval Cache Period runs out (default 7200 seconds), or until you zap the repository cache.
The client uses Artifactory's v2 endpoint. Change the package source to …/api/nuget/v3/<repository-key>/index.json.
Create a Go virtual repository that includes the remote, and set GOPROXY to the virtual repository.
If the request takes about 15 seconds before failing, Artifactory's socket timeout expired. Raise Socket Timeout (MS) on the remote repository's Advanced tab.
Related
- How-to: Integrate with repository managers, Manage tokens, View logs
- Concept: Upstreams and caching, Deployment models
- Reference: Tokens, Client operations
- Ecosystems: npm, PyPI, Maven, NuGet, Go, Cargo, RubyGems, Composer, Containers, Conda
Integrate with repository managers
Deploy the firewall together with Artifactory, Nexus, GitLab, GitHub Packages, Azure Artifacts, or AWS CodeArtifact, between them and the public registries, between developers and them, or on both sides.
Connect a web proxy
Chain your company's web proxy, such as Zscaler or Squid, to a Bytesafe proxy so package installs are checked by your firewalls without changing developer machines.