fix(cert): add per-pool wildcard SANs to pgbackrest server cert - #564
Merged
Conversation
pgbackrest clients connect to a replica pod's per pooler, per-cell headless-Service FQDN (<pod>.<headless-svc>.<ns>.svc.cluster.local) for pg2 backups, but the server cert only had the generic pgbackrest.<ns>.svc[.cluster.local] SANs, causing TLS hostname verification to fail with: [CryptoError] unable to find hostname '...' in certificate common name or subject alternative names. Retrieve each pool/cell's headless Service and add a scoped wildcard SAN per one (a single *.<ns>.svc... wildcard can't match since the headless-svc name is an extra label). Also rotate the server cert when desired DNS SANs drift from what's issued (not just on expiry/CA change), so existing deployments self-heal. Signed-off-by: Nicolas Nosenzo <niconosenzo@gmail.com>
🔬 Go Test Coverage ReportSummary
Status✅ PASS DetailShow New Coverage |
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.
pgbackrest clients connect to a replica pod's per pooler, per-cell headless-Service FQDN (...svc.cluster.local) for pg2 backups, but the server cert only had the generic pgbackrest..svc[.cluster.local] SANs, causing TLS hostname verification to fail with:
Retrieve each pool/cell's headless Service and add a scoped wildcard SAN per one (a single *..svc... wildcard can't match since the headless-svc name is an extra label). Also rotate the server cert when desired DNS SANs drift from what's issued (not just on expiry/CA change), so existing deployments self-heal.