vmware-tanzu / vmware-tanzu/tanzu-source-controller

Enable `HTTPS` for source artifact URL defined in `.status.artifact.url`

Open
#4 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
7
Forks
6
Avg merge
1d 4h
Merged PRs (30d)
4

Description

Enable TLS for source artifact download URL

The current implementation of source controller API ImageRepository and MavenArtifact expose the resulting source artifact at a HTTP URL defined in .status.artifact.url. The source artifact URL is not exposed externally and is only available to in-cluster consumers. This feature request requires TLS for the source artifact download endpoint.

Additional context
An accepted solution for this Proposal must include the requirements listed below.

  • Backward compatibility (i.e., deprecate HTTP URL and support existing clients during the deprecated period)
  • Support certificate signed by private CA
  • Able to consume certificate updates
  • In-cluster clients able to trust the certificate

Proposal

  • Add a fixed named secret that contains the TLS key and certificate
  • Source Controller manager deployment will use the secret in a mounted volume
  • Use cert-manager to issue a certificate and rotate expired certificates
  • Add a new type, SecureArtifact that has all the existing fields available in the existing Artifact type plus a new field called CABundle. The CABundle is a string field that contains the client certificate key/value pair
  • The URL field for SecureArtifact will contain the HTTPS download URL
  • Source Controller APIs Status will include SecureArtifact as well as existing Artifact and maintain backward compatibility

Here is a mock shape of the fixed name secret

apiVersion: v1
data:
  ca.crt: …
  tls.crt: …
  tls.key: …
kind: Secret
metadata:
  name: source-server-cert
  namespace: source-system
type: kubernetes.io/tls

Here is a mock of the proposed API status

status:
  artifact:                 # existing type `Artifact`
    ...
    url: "http://..."
  secureArtifact:           # New type `SecureArtifact` = `Artifact` + CABundle
    ...
    url: "https://..."
    caBundle: ""

Testing

  • Unit test coverage of the HTTPS feature
  • e2e integration test (CI)
  • Install with value TLS enabled
  • Create ImageRespository resource
  • Validate downloaded artifact from HTTPS endpoint
  • Create MavenArtifact resource
  • Validate downloaded maven artifact from HTTPS endpoint

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 with the source controller API types for ImageRepository and MavenArtifact and the Source Controller manager deployment described in the proposal. Review how status.artifact.url is produced and how the manager mounts configuration, then map the fixed TLS secret, SecureArtifact status, certificate rotation, and backward compatibility requirements. Done includes unit and e2e coverage for HTTPS downloads from both artifact types and the listed TLS installation and trust checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.