Repository navigation
mbp-1142: Use short-lived tokens for the Quay registry - #194
Open
mlorenzofr wants to merge 2 commits into
Open
mlorenzofr wants to merge 2 commits into
mlorenzofr wants to merge 2 commits into
Conversation
Collaborator
|
@mlorenzofr Both jobs are failing due to TLS issues It appears that TLS for the requests are only trusting the cluster CA. In my cluster, letsencrypt certs are being used to protect quay |
Signed-off-by: Manuel Lorenzo <mlorenzofr@redhat.com>
The Quay robot provisioner only trusted the cluster service CA, so it failed with CERTIFICATE_VERIFY_FAILED when Quay is protected by a publicly trusted certificate such as Let's Encrypt. The provisioner now verifies Quay with the system trust store plus the ztvp-trusted-ca bundle from ztvp-certificates, mounted as an optional ConfigMap. When the bundle is not distributed to the namespace, the system trust store alone is used. Kubernetes API requests use the pod's service account CA, and connection or certificate errors on that path are retried instead of failing the Job. The ztvp-certificates profile now distributes the bundle to the real supply-chain namespace, which is vp-gitops in single Argo CD mode. Signed-off-by: Manuel Lorenzo <mlorenzofr@redhat.com>
Collaborator
Author
|
@sabre1041 Fixed in the latest commit. The provisioner now verifies Quay with the container's system trust store plus the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
With the built-in Quay registry (Option 1), the pipeline and
qtodoused the Quay admin password for push and pull. This PR adds an optional feature that replaces it with one-hour Quay robot tokens, each scoped to a single repository and role.The External Secrets Operator generates them with two chained generators:
VaultDynamicSecret: logs in to Vault with a dedicated ServiceAccount (Kubernetes auth / TokenReview) and gets a 15-minute JWT from the Vault identity OIDC provider.Webhook: exchanges that JWT for a Quay robot token through Quay robot account federation, which trusts the Vault issuer.This works without exposing the API server's issuer endpoints, and no long-lived registry credential reaches workloads. The admin password is now only used by the robot provisioner.
Changes
ansible/configure-vault-quay-federation.yaml(imperative job) plusoverrides/values-vault-quay-federation.yamlconfigure the identity OIDC issuer, signing key, roles, policies and Kubernetes auth roles.qtodo-registry-authbuilt from the robot token, and aquay-robot-provisioner(Sync hook + CronJob) that creates the robots, their federation and repository permissions.quay-token-generatorfeature (requires--registry-option 1), plus aregistry_options_allowedfield.docs/quay-short-lived-tokens.md; updates tosupply-chain.md,SYNC-WAVE-INVENTORY.mdandgen-feature-variants.md.The feature is disabled by default. Enable it with:
With the feature disabled, the charts render the same as before.
Testing
Deployed on OpenShift 4.22 with Quay 3.18: the pipeline pushes with
ztvp+pipeline, qtodo pulls withztvp+qtodo, and the tokens rotate automatically.