How to Manage Repositories and Upstream Mirrors

Beginner 15 minutes DevOps / Platform Engineers Getting Started Updated

Enable and disable repositories, configure anonymous access, browse cached packages, view per-repository traffic, and set up client connection guides.

Video: Add and inspect a repository | Chainsaw tutorial 11.1

Overview

Repositories in Chainsaw represent upstream package registries that the proxy mirrors. Each repository is a pull-through cache for a specific ecosystem — when a package is requested, Chainsaw fetches it from upstream, caches it locally, and serves it to the client. This tutorial covers managing these repositories.

Prerequisites

  • Admin or Owner role in Chainsaw
  • Understanding of which package ecosystems your organization uses

Step 1: View All Repositories

Navigate to Settings → Repositories. The Repository catalog lists every configured repository; filter it by ecosystem or search by name.

Repository catalog
The repository catalog: format, enabled and anonymous-access switches, upstream and cache TTL
ColumnDescription
NameRepository identifier (e.g., npmjs, pypi)
FormatPackage ecosystem (npm, pip, maven, etc.)
Repository enabledSwitch: whether the repository serves requests
Anonymous accessSwitch: whether requests without credentials are accepted
RemoteThe upstream registry URL
Cache TTLHow long cached metadata is reused before Chainsaw re-checks upstream

Click a row to open the repository’s management sheet, with Overview, Packages, Config and Traffic tabs.

Step 2: Enable or Disable Repositories

Turn repositories on or off with the Repository enabled switch in the catalog row. Disabled repositories reject all requests.

Repository enabled switches
Turn repositories on or off from the catalog; disabled repos reject all requests
Disable repositories your organization doesn’t use to reduce attack surface. If nobody uses Cargo, there’s no reason to leave the crates-io mirror active.

Step 3: Configure Anonymous Access

By default, repositories require client credentials. To accept requests without credentials for a specific repository (e.g., for open development environments), turn on its Anonymous access switch in the catalog.

Anonymous access switches
Anonymous access is set per repository from the catalog
Anonymous access bypasses client identification. You lose the ability to trace requests to specific teams or apply client-scoped policies. Use sparingly.

Step 4: Browse Cached Packages

Open a repository and switch to the Packages tab. It lists each cached package with its versions and how many of them are vulnerable; click a package for its versions. Until clients have pulled something through the repository, the tab says “No packages cached yet”.

Packages tab of a repository
The Packages tab lists what the repository has cached

The Overview tab summarises the repository: format, status, anonymous access, remote, proxy path, cache TTL, total packages and repository size.

Step 5: View Per-Repository Traffic

The Traffic tab shows a rolling window of requests for that repository, with Requests, Block rate and Cache hit ratio.

To compare repositories over time, use Intelligence → Activity: one row per repository and one dot per day, filled for blocked requests and hollow for monitor-mode flags.

Per-repository activity
Intelligence → Activity shows each repository's enforcement activity day by day

This helps you understand:

  • Which repositories see blocks, and how often
  • When a repository flipped between monitor and block
  • How effective the cache is per registry (Traffic tab)

Step 6: Check Repository Config and Client Setup

The Config tab shows the repository’s remote URL and request headers. They are read-only in the portal: change the remote with PATCH /api/proxies/{name}, and set request headers as remote.headers when creating the repository with POST /api/proxies (chainsaw repo create has no header option).

Repository Config tab
The Config tab: remote URL and request headers, managed from the CLI and API

Copy-paste client setup for each package manager is in How to Configure Your Package Manager to Use Chainsaw, and a new client credential’s setup snippet is shown when you create it under Settings → Client Credentials. Share those with your development teams to simplify onboarding.

Step 7: Understand Negative Caching

Chainsaw uses negative caching to prevent repeated 404 requests to upstream registries. When an upstream returns a 404:

  1. Chainsaw caches the negative result
  2. Subsequent requests for the same package return 404 immediately
  3. The cache expires after a configurable time

This reduces load on upstream registries and improves response times for packages that don’t exist.

Negative caching concept
Negative caching prevents repeated upstream requests for non-existent packages

Step 8: Format-Aware URL Rewriting

For some ecosystems (PyPI, Composer), upstream responses contain absolute URLs that point back to the original registry. Chainsaw automatically rewrites these URLs to point through the proxy, ensuring all subsequent requests stay on the Chainsaw path.

This rewriting is transparent to the client. Package managers work normally without any special configuration beyond pointing at the Chainsaw repository URL.

Supported Repository Formats

FormatUpstream DefaultRepository Path
npmregistry.npmjs.org/repository/@default/npmjs/
PyPIpypi.org/repository/@default/pypi/simple/
Mavenrepo1.maven.org/repository/@default/maven-central/
NuGetapi.nuget.org/repository/@default/nuget-official/v3/index.json
Cargocrates.io/repository/@default/crates-io/
Composerpackagist.org/repository/@default/packagist/
Goproxy.golang.org/repository/@default/gomod/
Dockerregistry-1.docker.io/repository/@default/docker-hub/
RubyGemsrubygems.org/repository/@default/rubygems-official/
APTvaries/repository/@default/apt-main/
Yum/DNFvaries/repository/@default/yum-baseos/
Hugging Facehuggingface.co/repository/@default/huggingface/
Homebrewformulae.brew.sh (API) + ghcr.io (bottles)/repository/@default/homebrew/

Next Steps