Skip to content

feat: support global data encryption of secret information#8403

Merged
spacewander merged 17 commits into
apache:masterfrom
tzssangglass:gde
Nov 30, 2022
Merged

feat: support global data encryption of secret information#8403
spacewander merged 17 commits into
apache:masterfrom
tzssangglass:gde

Conversation

@tzssangglass

@tzssangglass tzssangglass commented Nov 25, 2022

Copy link
Copy Markdown
Member

Description

Fixes #8407

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)

Comment thread apisix/consumer.lua Outdated
Comment on lines +44 to +49
for key, props in pairs(consumer_schema.properties) do
if props.type == "string" and props.encrypted then
local encrypted = apisix_ssl.aes_decrypt_pkey(conf[key], "global_data_encrypt")
conf[key] = encrypted
end
end

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The schema may have nested objects

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I know that since this PR does not include this case, we can optimize this point in the next PR.

@tzssangglass
tzssangglass marked this pull request as ready for review November 28, 2022 11:37
Comment thread docs/zh/latest/plugin-develop.md Outdated
Comment thread apisix/plugin.lua Outdated
Comment thread apisix/admin/routes.lua Outdated
Comment thread conf/config-default.yaml Outdated
Comment thread t/plugin/clickhouse-logger.t Outdated
Comment thread apisix/plugin.lua
return
end

for key, props in pairs(schema.properties) do

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't we consider the case of configuration nesting here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I know that since this PR does not include this case, we can optimize this point in the next PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's better to notice this point at doc ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't think it's needed and will finish it soon.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's a bit complicated, like 'anyof', 'oneof' need to be considered.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Anyof or oneof only restricts the existence of items, if an item has encrypted = true but does not exist in conf, it will not be encrypted.

Comment thread apisix/plugins/basic-auth.lua
Comment thread t/node/consumer-group.t Outdated
Comment thread t/node/consumer-group.t Outdated
@tzssangglass
tzssangglass requested review from juststillthinking, membphis and soulbird and removed request for juststillthinking November 29, 2022 10:27
Comment thread apisix/admin/utils.lua Outdated
Comment thread apisix/plugin.lua Outdated
Comment thread apisix/plugin.lua Outdated
Comment thread apisix/ssl.lua
Comment thread docs/en/latest/plugin-develop.md Outdated
Comment thread docs/zh/latest/plugin-develop.md Outdated
Comment thread t/node/data_encrypt.t Outdated
Comment thread t/node/data_encrypt.t Outdated
Comment thread t/node/data_encrypt.t Outdated
@tzssangglass
tzssangglass requested review from spacewander and removed request for juststillthinking November 29, 2022 14:33
Comment thread t/node/data_encrypt.t Outdated
Comment thread apisix/plugin.lua
Comment thread apisix/admin/utils.lua Outdated
Comment thread t/node/data_encrypt2.t Outdated
@spacewander
spacewander merged commit 3d5128d into apache:master Nov 30, 2022
hongbinhsu added a commit to fitphp/apix that referenced this pull request Dec 4, 2022
* upstream/master: (48 commits)
  fix(ai): remove BUILD_ROUTER event when ai module is unloaded (apache#8184)
  chore: add some comment for make_request_to_vault function (apache#8420)
  docs: update admin api English doc (apache#8227)
  ci: use fixed os version of ubuntu (apache#8438)
  feat: Support store secrets in secrets manager for auth plugin via kms components (apache#8421)
  feat: interact via gRPC in APISIX Admin API (apache#8411)
  fix: last_err can be nil when the reconnection is successful (apache#8377)
  feat: support global data encryption of secret information (apache#8403)
  refactor(env): rename funtion name (apache#8426)
  feat(admin): add kms admin api (apache#8394)
  docs: update consumer and upstream docs (apache#8223)
  ci: add cron job for GM (apache#8398)
  docs: add kms env doc (apache#8419)
  feat: Added log format support in syslog plugin. (apache#8279)
  feat: add vault common components (apache#8412)
  docs: update global-rule/plugin-config/plugin/ docs (apache#8262)
  docs: update consumer-group/router/service/script doc (apache#8332)
  feat: support store secret in env for auth plugin (apache#8390)
  docs: update Upgrade Guide CN version (apache#8392)
  docs: add GM plugin EN doc to make website display normally (apache#8393)
  ...
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.

Proposal: APISIX Supports Global Data Encryption

5 participants