Skip to content

feat: corporate CA trust for pipeline git-clone from internal hosts#142

Merged
sabre1041 merged 7 commits into
validatedpatterns:mainfrom
minmzzhang:pipeline-corp-ca-trust
Jun 16, 2026
Merged

feat: corporate CA trust for pipeline git-clone from internal hosts#142
sabre1041 merged 7 commits into
validatedpatterns:mainfrom
minmzzhang:pipeline-corp-ca-trust

Conversation

@minmzzhang

Copy link
Copy Markdown
Collaborator

Add support for the git-clone task to trust corporate/internal CA certificates when cloning from private Git servers (e.g. GitLab behind a corporate CA).

Supply-chain chart:

  • Add conditional ssl-ca-directory workspace to pipeline and pipelinerun templates (gated by git.sslCABundle.enabled)
  • Add git.sslCABundle values (enabled, configMapName) defaulting to the ztvp-trusted-ca ConfigMap
  • Set CRT_FILENAME param so git-clone finds the CA bundle file

ztvp-certificates chart:

  • Auto-detect internal Git hosts via customCA.remoteHosts: the extraction Job connects to the host on port 443, extracts the full CA chain from the TLS handshake, and merges it into the bundle
  • Distribute ztvp-trusted-ca to the pipeline namespace via the targetNamespaces list

Generator (gen-feature-variants.py):

  • Auto-enable git.sslCABundle and customCA.remoteHosts when --git-repo points to a non-public host (not github.com/gitlab.com/bitbucket.org)
  • Add git.sslCABundle.enabled to the protected-repos feature fragment and to the commented-out overrides in the base values-hub.yaml

values-hub.yaml:

  • Replace hand-edited file with gen-feature-variants output for consistent indentation and complete feature composition

Documentation:

  • Add "Corporate CA trust for internal Git hosts" section to docs/supply-chain.md covering enablement, auto-extraction, and manual CA provisioning alternatives

@minmzzhang minmzzhang force-pushed the pipeline-corp-ca-trust branch from ae0f678 to 2f1c9b8 Compare June 5, 2026 15:22

@mlorenzofr mlorenzofr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and working correctly. Just a couple of minor changes
LGTM

Comment thread charts/supply-chain/templates/pipeline-qtodo.yaml Outdated
Comment thread scripts/gen-feature-variants.py
Comment thread scripts/gen-feature-variants.py
Comment thread charts/supply-chain/templates/pipeline-qtodo.yaml Outdated
Comment thread charts/supply-chain/templates/pipeline-qtodo.yaml Outdated
Comment thread charts/supply-chain/templates/pipelinerun-qtodo.yaml Outdated
minmzzhang and others added 3 commits June 12, 2026 10:25
Add support for the git-clone task to trust corporate/internal CA
certificates when cloning from private Git servers (e.g. GitLab behind
a corporate CA).

Supply-chain chart:
- Add conditional ssl-ca-directory workspace to pipeline and
  pipelinerun templates (gated by git.sslCABundle.enabled)
- Add git.sslCABundle values (enabled, configMapName) defaulting to
  the ztvp-trusted-ca ConfigMap
- Set CRT_FILENAME param so git-clone finds the CA bundle file

ztvp-certificates chart:
- Auto-detect internal Git hosts via customCA.remoteHosts: the
  extraction Job connects to the host on port 443, extracts the full
  CA chain from the TLS handshake, and merges it into the bundle
- Distribute ztvp-trusted-ca to the pipeline namespace via the
  targetNamespaces list

Generator (gen-feature-variants.py):
- Auto-enable git.sslCABundle and customCA.remoteHosts when --git-repo
  points to a non-public host (not github.com/gitlab.com/bitbucket.org)
- Add git.sslCABundle.enabled to the protected-repos feature fragment
  and to the commented-out overrides in the base values-hub.yaml

values-hub.yaml:
- Replace hand-edited file with gen-feature-variants output for
  consistent indentation and complete feature composition

Documentation:
- Add "Corporate CA trust for internal Git hosts" section to
  docs/supply-chain.md covering enablement, auto-extraction, and
  manual CA provisioning alternatives

Signed-off-by: Min Zhang <minzhang@redhat.com>
Signed-off-by: Manuel Lorenzo <mlorenzofr@redhat.com>
- Skip SSL CA bundle workspace/params when authType is SSH (not needed
  for SSH connections to git)
- Add hostname validation in _parse_git_repo_url() to fail early on
  malformed URLs

Signed-off-by: Min Zhang <minzhang@redhat.com>
@minmzzhang minmzzhang force-pushed the pipeline-corp-ca-trust branch from 2565a0e to 7ad9fc4 Compare June 12, 2026 14:31
The External Secrets Operator no longer serves v1beta1; only v1 is
available on the cluster, causing supply-chain sync failures.

Signed-off-by: Min Zhang <minzhang@redhat.com>
@minmzzhang

Copy link
Copy Markdown
Collaborator Author

Rebased to latest main and ready for review.

The supply-chain doc lists values-hub.yaml sections to uncomment but
did not mention overrides/values-vault-jwt.yaml. Without the rhtpa and
supply-chain JWT roles, RHTPA and the pipeline SA cannot authenticate
to Vault via SPIFFE.

Signed-off-by: Min Zhang <minzhang@redhat.com>
When a custom CA is added after the pattern is already deployed, the
ArgoCD repo-server init container will not re-run to pick up the
updated trusted-ca-bundle.  Document the rollout restart workaround
and broaden the x509 troubleshooting entry to cover Gitea and other
self-hosted Git servers beyond GitLab.

Signed-off-by: Min Zhang <minzhang@redhat.com>
The corporate CA trust configuration was nested as step 4 under
"Protected Repositories", implying it only applies to private repos.
In reality these are orthogonal concerns -- a public repo on an
internal Git server behind a corporate CA also needs CA trust without
any git credentials.

Promote "Corporate CA Trust for Internal Git Hosts" to its own
top-level section, split the combined "How it works" block, and add
bidirectional cross-references. Also fix the duplicate SSH mode
PipelineRun YAML and add ssl-ca-directory guidance to the Web Console
instructions.

Signed-off-by: Min Zhang <minzhang@redhat.com>

@sabre1041 sabre1041 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Great work @minmzzhang !

@sabre1041 sabre1041 merged commit d5c7a48 into validatedpatterns:main Jun 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants