Skip to content

feat: enable sensitive fields encryption by default#11076

Merged
shreemaan-abhishek merged 10 commits into
apache:masterfrom
shreemaan-abhishek:enable-encrypt
Mar 28, 2024
Merged

feat: enable sensitive fields encryption by default#11076
shreemaan-abhishek merged 10 commits into
apache:masterfrom
shreemaan-abhishek:enable-encrypt

Conversation

@shreemaan-abhishek

Copy link
Copy Markdown
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

shreemaan-abhishek commented Mar 21, 2024

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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

shreemaan-abhishek commented Mar 22, 2024

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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

Comment thread apisix/plugin.lua
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
Copy Markdown
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.

Comment thread t/admin/consumers.t
"plugins": {
"key-auth": {
"key": "auth-one"
"key": "4y+JvURBE6ZwRbbgaryrhg=="

Copy link
Copy Markdown
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.

Comment thread t/plugin/key-auth.t
@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
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.

3 participants