Skip to content

Vulnerability Proxy Endpoints ​

BatleHub proxies ecosystem-native vulnerability database protocols in addition to package downloads. This lets govulncheck, npm audit, dotnet list package --vulnerable, and composer audit work without direct internet access when BatleHub is your only outbound registry.

These endpoints are distinct from BatleHub's own SBOM vulnerability scanning ([vulnerability_scan]), which scans the contents of cached artifacts against OSV. See Adding a Vulnerability Scanner Source for that feature.

1. Go — govulncheck / Go Vulnerability Database ​

The Go Vulnerability Database (govulndb) is a separate protocol from the Go module proxy and requires its own set of endpoints. BatleHub proxies all three:

EndpointMethodDescription
/proxy/{registry}/v1/index.jsonGETVulnerability index (list of all known IDs)
/proxy/{registry}/v1/ID/{id}.jsonGETFull OSV record for a single vulnerability
/proxy/{registry}/v1/queryPOSTBatch query — returns matching records for a set of modules

{id} must contain only alphanumeric characters, hyphens, and dots (e.g. GO-2023-1234, CVE-2024-12345). Any other character returns 400.

Configuration ​

The vuln DB upstream is controlled per-registry by the optional vuln_db_url field.

toml
[[registries]]
type = "goproxy"
name = "go"

# Optional. Defaults to https://vuln.go.dev.
# Set to "" to disable the /v1/ endpoints for this registry.
# vuln_db_url = "https://vuln.go.dev"
vuln_db_url valueBehaviour
absent / nullProxies to https://vuln.go.dev (default)
"https://…"Proxies to the given URL
"" (empty string)Disables the /v1/ endpoints; returns 404

Client setup ​

Point GONOSUMCHECK and GOVULNDB at BatleHub:

sh
export GOPROXY="https://batlehub.example.com/proxy/go,direct"
export GONOSUMCHECK="*"
export GONOSUMDB="*"
export GOVULNDB="https://batlehub.example.com/proxy/go"

With authentication:

sh
# Put the token in NETRC so govulncheck picks it up automatically.
echo "machine batlehub.example.com login user password <token>" >> ~/.netrc
chmod 600 ~/.netrc
export GOVULNDB="https://batlehub.example.com/proxy/go"

Or run govulncheck directly:

sh
GOVULNDB="https://batlehub.example.com/proxy/go" govulncheck ./...

2. npm — npm audit ​

BatleHub proxies both npm audit modes:

EndpointMethodDescription
/proxy/{registry}/-/npm/v1/security/advisories/bulkPOSTBulk advisories — what npm audit sends by default
/proxy/{registry}/-/npm/v1/security/audits/quickPOSTQuick audit, for the lockfile-only scan

Both forward the request body to the configured upstream and relay the response as-is. You do not need to configure either path: they are the paths the npm CLI already uses, so npm audit finds them by pointing at the registry.

Two older paths are still answered, and should not be used

/-/npm/v1/audit/quick and /-/npm/v1/audit/bulk are deprecated aliases. They were never paths the npm CLI sends — earlier releases served only those, so npm audit against BatleHub received a 404 and reported nothing. They remain routed for any script that hard-coded them, and will be removed in a later release.

Audit answers are cached. A repeated audit is answered from the cache, and when the upstream advisory database is unreachable BatleHub serves the last answer it has rather than failing — so a CI pipeline running npm audit does not stop because npmjs.org is having an outage. The response carries X-BatleHub-Cache: hit | miss | stale, and stale means exactly that fallback happened. Set serve_stale = false on the registry if a stale advisory answer is worse for you than none.

The request body is part of the cache key, so two projects auditing different dependency sets never receive each other's answers.

Configuration ​

No extra config is needed. Audit requests are forwarded to the same upstream as package downloads (default https://registry.npmjs.org).

toml
[[registries]]
type = "npm"
name = "npm"
# upstreams = ["https://registry.npmjs.org"]  # default

Client setup ​

Configure npm to use the BatleHub registry:

sh
npm config set registry https://batlehub.example.com/proxy/npm/
npm config set //batlehub.example.com/proxy/npm/:_authToken "<token>"

npm audit will then automatically route through BatleHub.


3. NuGet — dotnet list package --vulnerable ​

BatleHub exposes a VulnerabilitiesUrl/6.7.0 resource in the NuGet v3 service index and proxies the pages it references:

EndpointMethodDescription
/proxy/{registry}/nuget/v3/vulnerabilities/index.jsonGETVulnerability catalogue index
/proxy/{registry}/nuget/v3/vulnerabilities/page/{page}GETIndividual catalogue page

The service index (GET /proxy/{registry}/nuget/v3/index.json) includes:

json
{
  "@id": "https://batlehub.example.com/proxy/<registry>/nuget/v3/vulnerabilities/",
  "@type": "VulnerabilitiesUrl/6.7.0",
  "comment": "NuGet vulnerability database"
}

The dotnet CLI discovers this URL automatically from the service index.

Configuration ​

No extra config is needed. Vulnerability data is fetched from the NuGet upstream configured for the registry (default https://api.nuget.org). Since NuGet vulnerability data always originates from the NuGet gallery, the default covers all public NuGet feeds.

toml
[[registries]]
type = "nuget"
name = "nuget"
# upstreams = ["https://api.nuget.org"]  # default

Client setup ​

Point your NuGet source at BatleHub in nuget.config:

xml
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="batlehub" value="https://batlehub.example.com/proxy/nuget/nuget/v3/index.json" />
  </packageSources>
  <packageSourceCredentials>
    <batlehub>
      <add key="Username" value="user" />
      <add key="ClearTextPassword" value="<token>" />
    </batlehub>
  </packageSourceCredentials>
</configuration>

Then run:

sh
dotnet list package --vulnerable

4. Composer — composer audit ​

BatleHub proxies the Packagist security advisory API used by composer audit:

EndpointMethodDescription
/proxy/{registry}/api/security-advisories/GETQuery advisories for a set of packages

The full query string (e.g. ?packages[]=vendor/pkg&packages[]=other/lib) is forwarded to the upstream Packagist unchanged.

Configuration ​

No extra config is needed. Requests are forwarded to the upstream configured for the registry (default https://packagist.org).

toml
[[registries]]
type = "composer"
name = "packagist"
# upstreams = ["https://packagist.org"]  # default

For a private Packagist mirror or Satis instance that exposes its own advisory endpoint:

toml
[[registries]]
type = "composer"
name = "internal"
upstreams = ["https://satis.internal.example.com"]

Client setup ​

Add BatleHub as your Composer repository:

json
{
  "repositories": [
    {
      "type": "composer",
      "url": "https://batlehub.example.com/proxy/packagist/"
    }
  ],
  "config": {
    "bearer": {
      "batlehub.example.com": "<token>"
    }
  }
}

Then run:

sh
composer audit

5. Ecosystems Without a Proxy-able Vuln API ​

Some ecosystems reach their vulnerability data out-of-band and do not require BatleHub to proxy anything:

EcosystemToolHow it reaches vuln dataBatleHub action needed
Cargo / Rustcargo auditClones rustsec/advisory-db from GitHub as a git repoNone — cargo audit bypasses the crate registry entirely
RubyGemsbundler-auditClones rubysec/advisory-database from GitHubNone — bundler-audit bypasses the gem server
PyPIpip-auditQueries https://api.osv.dev directly via the OSV APINone — configure pip-audit --index-url for packages; vuln data is separate
MavenDepends on pluginMost Maven security plugins query NVD or OSV directlyNone — Dependency-Track can take every feed through BatleHub, see below

For Cargo and RubyGems in fully air-gapped environments you would need to mirror the advisory git repositories separately (e.g. via a local Gitea instance) and point the tools at that mirror — this is outside BatleHub's scope.

Maven — Dependency-Track ​

Dependency-Track can run with BatleHub as its only egress for Java projects. It fetches two kinds of data, and both go through BatleHub:

What Dependency-Track fetchesIts requestsBatleHub registry
Repository metadata (the outdated flag)…/maven-metadata.xml, HTTP Basic when authentication is onmaven
OSV advisories for the Maven ecosystem (GHSA records, with their CVE aliases){base}Maven/all.zip, then Maven/modified_id.csv and Maven/<id>.json; {base}ecosystems.txt for the list the settings page offersgeneric
NVD CVE feeds (feeds mode, the default){feeds}/json/cve/2.0/nvdcve-2.0-<year>.json.gz and .meta, …-modified.*generic
EPSS scores{feeds}/epss_scores-current.csv.gzgeneric

All three feeds are plain GETs of files that are republished in place, so each generic registry lists them in revalidate: every read asks upstream again, and the cached copy is served if upstream is down (Caching § Revalidated paths). Dependency-Track sends no credential to its vulnerability sources, so those three registries must allow anonymous reads. They only relay public data, and path_allow keeps each one to the files Dependency-Track asks for.

BatleHub side ​

toml
# The repository analyzer: Maven Central, read with a token.
[[registries]]
type = "maven"
name = "maven-central"
mode = "proxy"
upstreams = ["https://repo1.maven.org/maven2/"]

# OSV, Maven ecosystem only. Add one glob per extra ecosystem (`npm/*`, `PyPI/*`, …).
[[registries]]
type = "generic"
name = "osv"
mode = "proxy"
upstreams = ["https://osv-vulnerabilities.storage.googleapis.com"]
path_allow = ["ecosystems.txt", "Maven/*"]
revalidate = ["ecosystems.txt", "Maven/*"]

[registries.rbac]
anonymous = ["releases:read", "source:read"]

# Admit every year: Dependency-Track retries a 403 on an NVD feed six times,
# backing off to 32 s, so a narrower path_allow stalls the mirror for hours.
[[registries]]
type = "generic"
name = "nvd"
mode = "proxy"
upstreams = ["https://nvd.nist.gov/feeds"]
path_allow = ["json/cve/2.0/*"]
revalidate = ["json/cve/2.0/*"]

[registries.rbac]
anonymous = ["releases:read", "source:read"]

# epss.cyentia.com now answers 301 to this host: point at it directly.
[[registries]]
type = "generic"
name = "epss"
mode = "proxy"
upstreams = ["https://epss.empiricalsecurity.com"]
path_allow = ["epss_scores-current.csv.gz"]
revalidate = ["epss_scores-current.csv.gz"]

[registries.rbac]
anonymous = ["releases:read", "source:read"]

Dependency-Track side ​

The source URLs are configuration properties. Set them with an API key holding SYSTEM_CONFIGURATION, or in Administration → Vulnerability Sources:

sh
DT=https://dtrack.example.com
BH=https://batlehub.example.com/proxy
curl -X POST "$DT/api/v1/configProperty/aggregate" \
  -H "X-Api-Key: $DT_API_KEY" -H "Content-Type: application/json" -d '[
  {"groupName":"vuln-source","propertyName":"google.osv.base.url","propertyValue":"'"$BH"'/osv/generic/"},
  {"groupName":"vuln-source","propertyName":"google.osv.enabled","propertyValue":"Maven"},
  {"groupName":"vuln-source","propertyName":"nvd.feeds.url","propertyValue":"'"$BH"'/nvd/generic"},
  {"groupName":"vuln-source","propertyName":"epss.feeds.url","propertyValue":"'"$BH"'/epss/generic"},
  {"groupName":"scanner","propertyName":"ossindex.enabled","propertyValue":"false"},
  {"groupName":"telemetry","propertyName":"submission.enabled","propertyValue":"false"}
]'

The OSV base URL keeps its trailing / (Dependency-Track appends the ecosystem to it); the NVD and EPSS URLs do not (it appends /json/… and /epss_…). The last two lines turn off what BatleHub cannot relay: OSS Index is a POST API, and telemetry would leave on its own. GitHub Advisories (a GraphQL POST), the NVD REST API, Snyk, Trivy and VulnDB are off by default; leave them off. The OSV records already carry GitHub's advisories.

Then, in Administration → Repositories → Maven, disable the five default repositories (central, atlassian-public, jboss-releases, clojars, google-android) and add:

FieldValue
URLhttps://batlehub.example.com/proxy/maven-central/maven2/
Authentication requiredon: any username, a BatleHub token as the password

The other ecosystems' default repositories (npm, PyPI, …) still point at the internet: disable them, or replace each with its BatleHub registry.

The latest version Dependency-Track reports is the newest version this registry serves: a blocked version, or one a [security] registry has denied, is removed from maven-metadata.xml (see Maven § Blocked versions).

BatleHub's own CVE verdict for a Maven artifact ​

A registry behind [security] scans each version against OSV, refuses a vulnerable one to mvn (403, X-BatleHub-Verdict: denied, X-BatleHub-Reason: VULNERABILITY), and exposes what it found. Dependency-Track does not read this API itself; query it from a script, or use batlehub-cli why:

sh
curl -H "Authorization: Bearer $BATLEHUB_TOKEN" \
  "https://batlehub.example.com/api/v1/verdicts/<registry>/org.apache.logging.log4j:log4j-core/2.14.1"

Each entry in findings carries the advisory in reference (e.g. GHSA-jfh8-c2jp-5v3q) and its CVE ids in raw.aliases (CVE-2021-44228). findings is filled only for a token holding findings:read; otherwise findings_withheld is true.

The repository read and the verdict are both exercised by the CVE axis of tests/heavy/maven.sh (a real mvn, Maven Central, a recorded OSV answer). tests/heavy/dependency_track.sh runs a real Dependency-Track 4.14 through the setup above, with its direct egress closed: it mirrors OSV, NVD and EPSS through BatleHub and finds Log4Shell in a Java SBOM. Dependency-Track 5.x is a different architecture and is not covered.

Released under the Apache 2.0 License. Made with care and too much coffee.