Skip to content
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

fix(aes-encryption): support plain txt and url safe base64 strings #4980

Merged
merged 13 commits into from
Jan 23, 2025

Conversation

ivankatliarchuk
Copy link
Contributor

@ivankatliarchuk ivankatliarchuk commented Dec 28, 2024

Description

Fixes #4975
Fixes #3992

The primary change in behavior is that the service will now successfully start when an AES key is provided as outlined in the documentation (text or base64 form). The core business logic related to encryption remains unchanged.

  • added tests to cover missing branches for endpoint.{labels,crypto}
  • added tests to cover logic when AES keys is base64 form
  • added tests to cover current label encryption logic for records
  • updated/rephrased documentation

While was working on a fix, found a bug, where Dynamodb not encrypting labels

statements = im.appendInsert(statements, key, r.Labels)

Trying to keep the scope of this pull request small. And could tweak DynamoDB encryption in follow up if required.

When TXT registry behaves correctly

filteredChanges.Delete = append(filteredChanges.Delete, im.generateTXTRecord(r)...)

Look's like the feature is not in use as was not able to find a single issue to date

Added tests

Screenshot 2024-12-29 at 12 40 43

Checklist

  • Unit tests updated
  • End user documentation updated

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 28, 2024
@ivankatliarchuk ivankatliarchuk marked this pull request as draft December 28, 2024 15:39
@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Dec 28, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @ivankatliarchuk. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 28, 2024
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 28, 2024
@ivankatliarchuk ivankatliarchuk marked this pull request as ready for review December 29, 2024 14:57
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 29, 2024
@mloiseleur
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 3, 2025
@mloiseleur
Copy link
Contributor

mloiseleur commented Jan 3, 2025

A related issue is declared in #3992
There was also a PR, but it did not manage to get merged, see #4063

If I follow correctly this PR, there is no migration needed, not like with #4063.

/lgtm
/assign @Raffo

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 3, 2025
@mloiseleur mloiseleur removed their assignment Jan 3, 2025
@ivankatliarchuk
Copy link
Contributor Author

ivankatliarchuk commented Jan 3, 2025

I'm blind. Could just refresh a PR 😄😄😄. But at least now I'm a bit familiar with the code behind it

@mloiseleur
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mloiseleur

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 23, 2025
@k8s-ci-robot k8s-ci-robot merged commit 290f8c8 into kubernetes-sigs:master Jan 23, 2025
14 checks passed
@ivankatliarchuk ivankatliarchuk deleted the fix-aes-4976 branch January 23, 2025 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
4 participants