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

feat: enable sensitive fields encryption by default #11076

Merged
merged 10 commits into from Mar 28, 2024

Conversation

shreemaan-abhishek
Copy link
Contributor

Description

Fixes https://lists.apache.org/thread/30wf080qvrzokronrx283sy8x8kondqf

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@shreemaan-abhishek
Copy link
Contributor Author

shreemaan-abhishek commented Mar 21, 2024

I presume test cases are not needed.

EDIT: A lot of test cases are failing so it might be the case that we actually need to add test cases.

@moonming
Copy link
Member

If a user upgrades APISIX from an old version to a new version, will this configuration be updated? Expected behavior is to not update

@shreemaan-abhishek
Copy link
Contributor Author

shreemaan-abhishek commented Mar 22, 2024

Expected behavior is to not update

By default encrypt_fields will be updated to true (only in the config-default.yaml, the users still have the freedom to set it to false.

@shreemaan-abhishek shreemaan-abhishek marked this pull request as draft March 22, 2024 05:37
@moonming
Copy link
Member

Expected behavior is to not update

By default encrypt_fields will be updated to true (only in the config-default.yaml, the users still have the freedom to set it to false.

Got it, so it's a break change

@@ -907,7 +907,7 @@ local function enable_gde()
if enable_data_encryption == nil then
enable_data_encryption =
core.table.try_read_attr(local_conf, "apisix", "data_encryption",
"enable_encrypt_fields")
"enable_encrypt_fields") and (core.config.type == "etcd")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

encrypt fields only when config type is etcd. Without this addition, enabling encrypt_fields on standalone mode would cause unexpected failures.

@@ -87,7 +87,7 @@ passed
"desc": "new consumer",
"plugins": {
"key-auth": {
"key": "auth-one"
"key": "4y+JvURBE6ZwRbbgaryrhg=="
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since data encryption is true now, the body returned after a PUT operation would consist of encrypted information.

@shreemaan-abhishek shreemaan-abhishek marked this pull request as ready for review March 27, 2024 02:48
@starsz starsz requested a review from moonming March 27, 2024 09:13
@shreemaan-abhishek shreemaan-abhishek merged commit cca94f1 into apache:master Mar 28, 2024
53 checks passed
@shreemaan-abhishek shreemaan-abhishek deleted the enable-encrypt branch March 28, 2024 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants