pipe-cd / pipe-cd/pipecd

Kubernetes Helm provider exposes credentials in argv

Open
#6,993 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
1.4k
Forks
364
Avg merge
1d 4h
Merged PRs (30d)
84

Description

What happened:

The single-cluster Kubernetes Helm provider passes registry and chart repository passwords on the Helm command line. LoginToOCIRegistry builds helm registry login -u <user> -p <password> ..., and AddRepository builds helm repo add ... --username <user> --password <password>. That exposes credentials through process inspection tools because the secret is present in argv.

What you expected to happen:

Passwords should be provided through stdin or another non-argv channel, consistent with the safer implementation already used by the multicluster Kubernetes provider.

How to reproduce it:

  1. Open pkg/app/pipedv1/plugin/kubernetes/provider/helm.go.
  2. Inspect LoginToOCIRegistry and note that it appends -p and the raw password to the Helm args.
  3. Inspect AddRepository and note that it appends --password and the raw password to the Helm args.
  4. Compare that with pkg/app/pipedv1/plugin/kubernetes_multicluster/provider/helm.go, which already uses --password-stdin and sets cmd.Stdin.
  5. Run a focused regression test with a fake Helm executable that records argv; the password currently appears in the recorded arguments.

Environment:

  • piped version: current master checkout as of 2026-07-08
  • control-plane version: Not applicable
  • Others: Local code inspection of the Kubernetes and Kubernetes multicluster Helm providers

Summary

The single-cluster Kubernetes Helm provider leaks registry and repository credentials via process arguments.

Affected Area

pkg/app/pipedv1/plugin/kubernetes/provider/helm.go

Steps to Reproduce

  1. Read LoginToOCIRegistry in pkg/app/pipedv1/plugin/kubernetes/provider/helm.go.
  2. Read AddRepository in the same file.
  3. Observe that passwords are appended directly into Helm argv.
  4. Compare with pkg/app/pipedv1/plugin/kubernetes_multicluster/provider/helm.go.

Expected Behaviour

Passwords are passed via stdin and never appear in process arguments.

Actual Behaviour

Passwords are appended directly to Helm command arguments in the single-cluster provider.

Technical Evidence

  • pkg/app/pipedv1/plugin/kubernetes/provider/helm.go currently uses -p <password> for OCI login and --password <password> for helm repo add.
  • pkg/app/pipedv1/plugin/kubernetes_multicluster/provider/helm.go already uses --password-stdin and cmd.Stdin = strings.NewReader(...).

Suspected Root Cause

The single-cluster provider still uses older Helm argument handling while the multicluster provider has already moved to stdin-based credential passing.

Proposed Direction

Port the single-cluster provider to the same --password-stdin pattern and add regression tests that fail if a secret appears in recorded command arguments.

Acceptance Criteria

  • No Helm password is passed as a command-line argument in the Kubernetes single-cluster provider.
  • OCI registry login uses a non-argv secret channel.
  • Helm repository add uses a non-argv secret channel.
  • Regression tests fail if a password appears in recorded argv.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in pkg/app/pipedv1/plugin/kubernetes/provider/helm.go by reading LoginToOCIRegistry and AddRepository, then compare them with the multicluster provider's helm.go implementation. Run focused regression tests using a fake Helm executable that records argv. Done means registry and repository passwords use a non-argv channel and never appear in recorded arguments.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, helm, kubernetes
Domain
devops, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.