-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encryption of TXT records not working as per documentation #4063
Encryption of TXT records not working as per documentation #4063
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @theloneexplorerquest. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Interesting. |
I am not sure haha. Probably need some more investigation. |
For the migration path, there are various options:
|
Hi @mloiseleur Thank you for your suggestion. I'm inclined towards documenting the process for a manual migration. However, even when proceeding manually, the process appears to be non-trivial. Here's my query: Is it necessary to always keep at least one encrypted TXT record in the system for the sake of high availability? |
If I understand correctly external-dns documentation about this feature, the txt records contains only metadata. => But I'm unsure, is this really safe to stop external-dns previous version, remove TXT records and start external-dns new version ? 🤔 Will this really just re-create new encrypted TXT records without any unexpected side effects ? |
decodedaesKey, err := base64.URLEncoding.DecodeString(string(aesKey)) | ||
if err != nil { | ||
fmt.Println("Error decoding base64 when decrypt text:", err) | ||
return "", "", err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break users that are already using txt encryption as far as I understand.
Maybe we should provide a migration path, so for example if it fails to decrypt we use the former StdEncoding.
I think we should have a fallback on the read path to ensure we can read old encrypted txt records, which we will update in the next iteration anyways. Right now I think we would just break users, which is not acceptable. |
@szuecs thanks for suggestion. Sorry I was a bit busy in last few weeks. do you think we should:
|
@theloneexplorerquest I know you didn't ask me but both options sound good to me. |
I would go for option 2, because users should not care about configuring some option correctly. I expect that if we re-encrypt then it will not do much harm and does the automatic migration. |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Description
Fix the issue that Encryption of TXT records does take base64 encryption key.
base64.URLEncoding
instead ofbase64.StdEncoding
: Since TXT records are often used in DNS settings, which can be included in URLs, it makes sense to use URL-safe characters to avoid potential issues with special characters that have different meanings in URLs. Also per document https://github.com/kubernetes-sigs/external-dns/blob/master/docs/registry/txt.md#encryption the key we generated is URL safe.EncryptText
andDecryptText
to take encode aes key as input however decode before encrypt and decrypt. Matching doc description.Fixes #3992
Checklist