Helm
Kubernetes
Private Repository
Secure Access
DevOps

Secure access to a private helm repository

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

Introduction

Secure access to a private Helm repository is mostly an authentication and secret-distribution problem, not a Helm templating problem. The right design depends on where the charts are stored, how clients authenticate, and how CI or clusters obtain credentials without exposing them in shell history or repository files.

Start with the Repository Type

A "private Helm repository" can mean different backends:

  • classic HTTP Helm repository with index.yaml
  • ChartMuseum
  • cloud object storage fronted by auth
  • OCI registry used by Helm

The security approach depends on that backend.

For example, modern Helm supports OCI registries directly, and that often gives a cleaner auth story than older chart-repo patterns.

Basic Auth for a Traditional Repository

For a private HTTP-based chart repository, Helm can authenticate with a username and password.

bash
helm repo add private-repo https://charts.example.com \
  --username "$HELM_USER" \
  --password "$HELM_PASSWORD"

This works, but do not hardcode credentials in scripts or commit them into config files.

Better sources for those values include:

  • CI secret stores
  • environment variables injected securely
  • cloud secret managers

The command is fine. Credential handling is where the real security decision lives.

Prefer OCI Registry Login When Available

If your charts live in an OCI registry, use Helm's registry login flow.

bash
helm registry login registry.example.com \
  --username "$HELM_USER" \
  --password "$HELM_PASSWORD"

Then pull or install charts with OCI references:

bash
helm pull oci://registry.example.com/charts/my-app --version 1.2.3

OCI-based distribution is often easier to secure and integrate with existing container-registry auth policies.

Use TLS and Verify Certificates

Private does not mean secure if transport is weak. Use HTTPS and valid certificates.

For custom CA environments, configure trust properly instead of disabling verification casually.

If Helm cannot trust the certificate chain, fix the trust chain rather than turning off verification unless you are in a very controlled temporary test environment.

The secure default is:

  • HTTPS transport
  • valid server certificate
  • no credential leakage in plain text

CI/CD Credential Handling

In CI, do not write passwords inline in the pipeline definition. Use the platform's secret mechanism and pass values at runtime.

Example:

bash
1helm repo add private-repo https://charts.example.com \
2  --username "$HELM_USER" \
3  --password "$HELM_PASSWORD"
4
5helm upgrade --install my-app private-repo/my-app

This is acceptable if:

  • the variables come from secret storage
  • logs do not print them
  • the runner environment is trusted appropriately

Avoid storing auth tokens in:

  • repository files
  • checked-in shell scripts
  • developer wiki pages

Kubernetes Pulling Versus Helm Fetching

Do not confuse chart-repository access with container-image pulling.

Two separate concerns often exist:

  • Helm needs credentials to fetch the chart
  • Kubernetes may need image pull secrets to fetch the container image

Securing one does not automatically secure the other. Private chart storage and private container registries are related but distinct layers.

Principle of Least Privilege

Use credentials that can only read the necessary chart namespace or repository area. Do not hand out broad admin credentials to every developer workstation or pipeline.

That matters because Helm repository credentials can become a lateral movement path into your release infrastructure if they are overscoped.

Good practice:

  • read-only tokens for consumers
  • separate publish credentials for chart release jobs
  • short-lived credentials where the platform supports them

Rotate and Audit

A secure repository setup includes:

  • secret rotation
  • access revocation
  • audit logs
  • review of who can read which charts

This matters especially for internal platform charts that may encode sensitive operational assumptions even if the chart files themselves are not secret in the cryptographic sense.

Treat private chart access as part of your software supply chain.

Common Pitfalls

  • Hardcoding repository credentials in scripts or repository files.
  • Using basic auth over weak transport or misconfigured TLS.
  • Confusing chart repository access with Kubernetes image pull authentication.
  • Giving broad publish credentials to consumers who only need read access.
  • Choosing an older repository pattern when OCI registry auth would integrate more cleanly with existing tooling.

Summary

  • Secure Helm repository access starts with the repository backend and auth model.
  • Use helm repo add with credentials for classic repositories, or helm registry login for OCI registries.
  • Keep credentials in secret stores, not in source control or plain-text scripts.
  • Use TLS properly and prefer least-privilege read access for consumers.
  • Treat private chart access as part of release and supply-chain security, not just as a convenience setting.

Related reading
Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

All Rights Reserved.