-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Proposal: APISIX Supports Global Data Encryption #8407
Comments
|
|
Yes we can, as long as the compatibility can be sure. |
what about the compatibility between apisix supported/unsupported DE and the data in etcd with/without DE?
we need to take more care when upgrading/downgrading apisix's version. |
similar issue #8319 |
@kwanhur I have noticed that
|
An additional question: in the admin API, do we need to return encrypted data or decrypted data? Or provide the configuration for the user to choose? |
Background
Nowadays, if a plugin needs to store sensitive information, it will design a separate set of encryption mechanism, which causes the problem of repeated development and cumbersome management. Now we consider introducing Data Encryption function, hereinafter referred to as DE, to encrypt the specified information, and any module/plugin that needs to encrypt sensitive information only needs to specify the fields to be encrypted on display, so that transparent encryption/decryption can be performed when saving/reading the information.
Benefits
Unify the encryption mechanism of APISIX to avoid duplication of development while improving product competitiveness
Goals
APISIX provides DE functionality to support the use of this capability in plugins and elsewhere to protect sensitive information.
The user scenarios are as follows
Detailed Design
Commonly used algorithms AES, ChaCha20, we use AES128CBC encryption algorithm, the logic is the same as ssl encryption and decryption, that is, only use the first key to encrypt, if it fails to take turns to use all keys to decrypt, consider reusing the ssl encryption and decryption function (https://github.com/apache/apisix/blob/master/apisix/ssl.lua)
Currently, only those distributed through the apisix admin interface can be encrypted. Many users have developed their own admin and directly manipulated storage media such as etcd, so they need to implement the encryption function themselves.
After the encryption function is enabled, the data that was not encrypted needs to be sent down again through the interface in order to be encrypted, is a refresh interface provided? Consider not providing it for now
Combining the above, the original string is used directly after decryption failure
Admin now only uses etcd, considering that the first version only supports etcd and only supports encryption of plugin parameters
Encryption:
Add encryption and decryption to check_single_plugin_schema, note that there are 2 different types of schema within the plugin, namely: schema and consumer_schema
The encryption and decryption function iterates through the corresponding schema, and if it finds the encrypted = true field, it encrypts and decrypts the field in the corresponding configuration
Add corresponding options in check_schema and stream_check_schema, now directly called in admin, no need to modify, encrypt_or_decrypt is nil by default, i.e. encrypt
plugin_checker and stream_plugin_checker are used for checksumming when reading data from etcd, and are decrypted by default
The text was updated successfully, but these errors were encountered: