Skip to content

feat: support protected repositories with Tekton Chains provenance#136

Open
minmzzhang wants to merge 4 commits into
validatedpatterns:mainfrom
minmzzhang:tekton-protected-repos
Open

feat: support protected repositories with Tekton Chains provenance#136
minmzzhang wants to merge 4 commits into
validatedpatterns:mainfrom
minmzzhang:tekton-protected-repos

Conversation

@minmzzhang
Copy link
Copy Markdown
Collaborator

Add support for cloning source code from protected (private) Git repositories in the Tekton supply-chain pipeline. Credentials are stored in Vault and delivered to the pipeline via an ExternalSecret that generates .git-credentials and .gitconfig files for the git-clone task's basic-auth workspace.

Supply-chain chart changes:

  • Add init task (skopeo pre-flight image check, skip rebuild)
  • Add optional git-auth workspace and Chains provenance results (CHAINS-GIT_URL, CHAINS-GIT_COMMIT, IMAGE_URL, IMAGE_DIGEST)
  • Add ExternalSecret for git credentials (Opaque with .git-credentials)
  • Conditionally attach git-credentials secret to pipeline SA
  • Add skopeo image to tasks.images for the init task
  • Migrate all Tekton resources from v1beta1 to v1 API

Generator and feature fragments:

  • Add protected-repos feature fragment with git.credentials overrides and qtodo.repository placeholder
  • Add --git-repo CLI argument to gen-feature-variants.py (required when protected-repos feature is enabled)
  • Add ignoreDifferences for Tekton Task/Pipeline defaulted fields to the supply-chain feature fragment

Default values-hub.yaml:

  • Extend hub-supply-chain-jwt-secret Vault policy to cover secret/data/hub/supply-chain/*
  • Add commented-out Tekton ignoreDifferences, git.credentials overrides, and qtodo.repository override

Documentation:

  • Update docs/supply-chain.md with protected repos setup, generator --git-repo usage, and git-auth workspace selection
  • Update scripts/gen-feature-variants.md with --git-repo examples
  • Add git-credentials entry to values-secret.yaml.template

Copy link
Copy Markdown
Collaborator

@sabre1041 sabre1041 left a comment

Choose a reason for hiding this comment

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

This is good and works as described. A few items/questions

  1. See the note regarding hardcoded git host value in the features Python script
  2. Has there been a thought supporting SSH based auth? Currently, based on this feature, only basic auth is supported. However, given that the VP framework supports SSH, we should also include support as well

Comment thread scripts/features/protected-repos.yaml Outdated
Add support for cloning source code from protected (private) Git
repositories in the Tekton supply-chain pipeline. Credentials are
stored in Vault and delivered to the pipeline via an ExternalSecret
that generates .git-credentials and .gitconfig files for the
git-clone task's basic-auth workspace.

Supply-chain chart changes:
- Add init task (skopeo pre-flight image check, skip rebuild)
- Add optional git-auth workspace and Chains provenance results
  (CHAINS-GIT_URL, CHAINS-GIT_COMMIT, IMAGE_URL, IMAGE_DIGEST)
- Add ExternalSecret for git credentials (Opaque with .git-credentials)
- Conditionally attach git-credentials secret to pipeline SA
- Add skopeo image to tasks.images for the init task
- Migrate all Tekton resources from v1beta1 to v1 API

Generator and feature fragments:
- Add protected-repos feature fragment with git.credentials overrides
  and qtodo.repository placeholder
- Add --git-repo CLI argument to gen-feature-variants.py (required
  when protected-repos feature is enabled)
- Add ignoreDifferences for Tekton Task/Pipeline defaulted fields
  to the supply-chain feature fragment

Default values-hub.yaml:
- Extend hub-supply-chain-jwt-secret Vault policy to cover
  secret/data/hub/supply-chain/*
- Add commented-out Tekton ignoreDifferences, git.credentials
  overrides, and qtodo.repository override

Documentation:
- Update docs/supply-chain.md with protected repos setup,
  generator --git-repo usage, and git-auth workspace selection
- Update scripts/gen-feature-variants.md with --git-repo examples
- Add git-credentials entry to values-secret.yaml.template

Signed-off-by: Min Zhang <minzhang@redhat.com>
- Support SSH auth for protected repositories
- Fix ESO SSH template with index syntax for hyphenated keys
- Add Vault NetworkPolicy rules for registry-token-refresher
- Update gen-feature-variants with protected-repos feature
- Clarify that git credentials use SA injection (no git-auth
  workspace binding needed)

Signed-off-by: Min Zhang <minzhang@redhat.com>
@minmzzhang minmzzhang force-pushed the tekton-protected-repos branch from b9ed384 to e8c14b9 Compare May 27, 2026 21:57
@minmzzhang
Copy link
Copy Markdown
Collaborator Author

This is good and works as described. A few items/questions

  1. See the note regarding hardcoded git host value in the features Python script
  2. Has there been a thought supporting SSH based auth? Currently, based on this feature, only basic auth is supported. However, given that the VP framework supports SSH, we should also include support as well

ssh-auth is added into the PR.

@minmzzhang minmzzhang requested review from mlorenzofr and p-rog May 28, 2026 03:03
HTTPS mode requires explicitly binding the git-auth workspace to the
qtodo-git-credentials secret, while SSH mode must leave it unbound
due to the git-clone ClusterTask's prepare.sh chmod failing on
read-only projected volume symlinks.

Signed-off-by: Min Zhang <minzhang@redhat.com>
@minmzzhang minmzzhang force-pushed the tekton-protected-repos branch from 486b5d2 to b1c6793 Compare May 28, 2026 03:08
Copy link
Copy Markdown
Collaborator

@mlorenzofr mlorenzofr left a comment

Choose a reason for hiding this comment

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

Good work 👍

I have a few suggestions and the gen-feature-variants.py part needs fixing, but otherwise it works correctly (https and ssh methods).

Comment thread scripts/gen-feature-variants.py
Comment thread values-secret.yaml.template Outdated
Comment thread docs/supply-chain.md Outdated
Comment thread charts/supply-chain/templates/secrets/qtodo-git-credentials.yaml Outdated
Comment thread docs/supply-chain.md Outdated
Comment thread values-secret.yaml.template Outdated
Comment thread docs/supply-chain.md
minmzzhang added a commit to minmzzhang/layered-zero-trust that referenced this pull request May 28, 2026
…orenzofr)

- Restore PR validatedpatterns#139 dedup logic (named list upsert, duplicate override
  validation) that was inadvertently removed
- Use file-based path instead of inline value for HTTPS git credentials
  to avoid plaintext password leaks in values-secret
- Add | trim to ESO password template for path-sourced credentials
- Add ssh-keygen instructions and passwordless key requirement
- Fix make load-secrets -> ./pattern.sh make load-secrets
- Add explicit SSH URL example to qtodo.repository override comment

Signed-off-by: Min Zhang <minzhang@redhat.com>
minmzzhang added a commit to minmzzhang/layered-zero-trust that referenced this pull request May 28, 2026
…orenzofr)

- Restore PR validatedpatterns#139 dedup logic (named list upsert, duplicate override
  validation) that was inadvertently removed
- Use file-based path instead of inline value for HTTPS git credentials
  to avoid plaintext password leaks in values-secret
- Add | trim to ESO password template for path-sourced credentials
- Add ssh-keygen instructions and passwordless key requirement
- Fix make load-secrets -> ./pattern.sh make load-secrets
- Add explicit SSH URL example to qtodo.repository override comment

Signed-off-by: Min Zhang <minzhang@redhat.com>
minmzzhang added a commit to minmzzhang/layered-zero-trust that referenced this pull request May 28, 2026
…orenzofr)

- Restore PR validatedpatterns#139 dedup logic (named list upsert, duplicate override
  validation) that was inadvertently removed
- Use file-based path instead of inline value for HTTPS git credentials
  to avoid plaintext password leaks in values-secret
- Add | trim to ESO password template for path-sourced credentials
- Add ssh-keygen instructions and passwordless key requirement
- Fix make load-secrets -> ./pattern.sh make load-secrets
- Add explicit SSH URL example to qtodo.repository override comment

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

- Restore PR validatedpatterns#139 dedup logic (named list upsert, duplicate override
  validation) that was inadvertently removed
- Use file-based path instead of inline value for HTTPS git credentials
  and registry token to avoid plaintext password leaks in values-secret
- Add | trim to ESO password template for path-sourced credentials
- Add ssh-keygen instructions and passwordless key requirement
- Fix make load-secrets -> ./pattern.sh make load-secrets
- Add explicit SSH URL example to qtodo.repository override comment

Signed-off-by: Min Zhang <minzhang@redhat.com>
@minmzzhang minmzzhang force-pushed the tekton-protected-repos branch from cd8da04 to 0a50bb8 Compare May 28, 2026 14:45
Copy link
Copy Markdown
Collaborator

@mlorenzofr mlorenzofr left a comment

Choose a reason for hiding this comment

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

LGTM

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