openshift / openshift/console

Backend should enforce HTTPS requirement when basicAuthConfig is used for Helm repositories

Open
#15,755 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

lifecycle/frozen
Dominant language
TypeScript
Stars
460
Forks
756
Avg merge
4d 2h
Merged PRs (30d)
88

Description

Background

While adding basic authentication support for Helm repositories in PR #15624, frontend validation was implemented to require HTTPS when basicAuthConfig is present (see comment thread).

However, the backend does not currently enforce this security requirement, allowing users to bypass the frontend validation by directly creating or modifying repository resources via the API.

Current State

  • Frontend validation: Correctly requires HTTPS when basicAuthConfig is present (frontend/packages/helm-plugin/src/components/forms/HelmChartRepository/helmchartrepository-validation-utils.ts)
  • Backend validation: Missing in pkg/helm/chartproxy/repos.go (lines 169-246) where basicAuthConfig is extracted and applied without URL scheme validation
  • Test files confirm backend accepts HTTP URLs with basicAuthConfig

Required Action

Add server-side validation in pkg/helm/chartproxy/repos.go to reject repository create/update requests when:

  • basicAuthConfig is provided, AND
  • Repository URL does not use HTTPS scheme

The validation should return a clear HTTP 400 error when this constraint is violated.

Additional Context

Requested by: @webbnh
Tracked from: https://github.com/openshift/console/pull/15624#discussion_r2547581524

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/helm/chartproxy/repos.go, especially the lines where basicAuthConfig is extracted and applied, and compare them with the HTTPS rule in frontend/packages/helm-plugin/src/components/forms/HelmChartRepository/helmchartrepository-validation-utils.ts. Review the existing backend tests that accept HTTP URLs with basicAuthConfig, then verify create and update requests reject that combination with a clear HTTP 400 response.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, helm
Domain
api, backend, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.