Feat/configurable certificate authorities#1773
Open
JuanmaBM wants to merge 4 commits into
Open
Conversation
78f08eb to
48d9a9c
Compare
Contributor
Author
|
/test-e2e |
2 similar comments
Contributor
Author
|
/test-e2e |
Contributor
Author
|
/test-e2e |
51ab74d to
c3e250b
Compare
Contributor
Author
|
/test-e2e |
Add support for ClowdApps to configure custom CA certificates for TLS connections to dependencies. This enables multi-environment support (non-OpenShift), custom PKI infrastructure, and granular security control. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add clowder/ca-secret-hash annotation to deployments that mount CA secrets. When a CA certificate is rotated, the hash changes and Kubernetes automatically restarts pods with the new certificate. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
c3e250b to
2a10caf
Compare
Contributor
Author
|
/test-e2e |
3 tasks
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.
Add Configurable Certificate Authorities for TLS Connections
Summary
This PR implements configurable certificate authority (CA) support for ClowdApps to use custom certificates when connecting to dependencies via TLS.
Motivation
Previously, Clowder hardcoded the CA certificate source (
openshift-service-ca.crtConfigMap) for all TLS connections between ClowdApps. This created limitations:This change provides flexibility while maintaining backward compatibility.
Changes
API Changes
ClowdEnvironment CRD
Added
certificateAuthoritiesfield to define a bundle of available CAs:ClowdApp CRD
Added two mutually exclusive fields for CA configuration:
tlsCertificateAuthorityName: Select from environment's bundletlsCertificateAuthoritySecretRef: Use app-managed secretImplementation
New Certificate Authority Provider (
controllers/cloud.redhat.com/providers/certificateauthority/)EnvProvide(): Creates single bundle secret containing all CAs from environment specProvide(): Validates CA selection and copies bundle to app namespace if needed{envName}-ca-bundlesystem-trust-storecannot be used in certificateAuthorities listUpdated Web Providers (
providers/web/default.go,providers/web/local.go)resolveCAForApp(): Determines which CA secret to mount based on app's configurationaddCAHashAnnotation(): Addsclowder/ca-secret-hashannotation for automatic rollouts on CA rotationUpdated Job Provider (
providers/job/impl.go)Updated Dependencies Provider (
providers/dependencies/impl.go)tlsCAPathin V2 dependency endpoints based on consumer app's CA selectionnullvalue for system-trust-store scenarioWebhook Validation (
apis/cloud.redhat.com/v1alpha1/clowdapp_webhook.go)tlsCertificateAuthorityNameandtlsCertificateAuthoritySecretRefare mutually exclusiveFour Configuration Scenarios
openshift-service-ca.crt/cdapp/certs/cdapp/certs/service-ca.crttlsCertificateAuthorityName: internal-ca{env}-ca-bundle/cdapp/certs/cdapp/certs/internal-ca.crttlsCertificateAuthoritySecretRef: {name: my-certs}my-certs/cdapp/certs/cdapp/certs/ca.crttlsCertificateAuthorityName: system-trust-storenullExample Usage
Scenario 1: Default (Backward Compatible)
Scenario 2: Environment Bundle
Scenario 3: App-Managed Override
Scenario 4: System Trust Store
Automatic Certificate Rotation
When a CA certificate is rotated, deployments automatically restart:
clowder/ca-secret-hashannotation changesNote: This only applies to Secret-based CAs (bundle and override). ConfigMap and system-trust scenarios are unaffected.
Backward Compatibility
✅ Fully backward compatible
openshift-service-ca.crtca_certificatefieldMigration Path
tlsCertificateAuthorityNameortlsCertificateAuthoritySecretRefSecurity Considerations
system-trust-storeprevents accidental misconfigurationDocumentation
Certificate rotation behavior:
Related Issues
Closes: (ENGPROD-9704)
Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com