Method, device, equipment and storage medium for encryption and decryption of application configuration data
By mounting application configuration plaintext and ciphertext storage volumes in the Kubernetes cluster, and using the encryption and decryption module to process sensitive information, the problem of insufficient flexibility in the configuration data encryption scheme is solved, security and compatibility are improved, and operation and maintenance costs are reduced. .
Patent Information
- Application Number
- CN202210281716.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-21
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-03-21
AI Technical Summary
In Kubernetes clusters, the flexibility of configuring data encryption solutions in the existing technology is not high, resulting in the leakage of sensitive information and increased operation and maintenance costs. Especially for applications that cannot be transformed, the compatibility is insufficient.
By mounting the application configuration plaintext storage volume and the application configuration ciphertext storage volume in the container, the encryption and decryption module is used to encrypt sensitive information, and the encryption result is stored in the ciphertext storage volume to replace the sensitive information in the plaintext storage volume. , providing a hook mechanism to intercept mounting modules to support applications that do not integrate encryption and decryption modules.
It improves the security and compatibility of application configuration data, achieves effective protection of sensitive information, and is compatible with both plaintext and ciphertext configuration methods, reducing system operation and maintenance costs.
Smart Images

Figure CN114547661B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device, electronic device, and non-transitory computer-readable storage medium for encrypting and decrypting application configuration data. Background Art
[0002] In a cloud platform based on a kubernetes cluster, application configuration information is generally stored using the configmap resource type, and some sensitive information such as passwords are stored using the secret object type. The cloud platform mounts the configmap to a specified directory or file in the application container for the application to read and use. Configmap stores text information, and secret stores base64-encoded information, which may lead to the leakage of sensitive information. To avoid the leakage of sensitive information, you can encrypt the data in advance and store the encrypted data in the configmap or secret. The application in the user container can obtain the encrypted content and use it after decryption through the built-in decryption component.
[0003] The above solution can solve the security problem of sensitive information in the Kubernetes cluster environment, but it requires all applications to be modified to integrate decryption components, which incurs modification costs. In addition, it is also necessary to provide plain text configuration data for some applications that cannot be modified, which increases the system's operation and maintenance costs and error probability. Summary of the invention
[0004] The present invention provides an encryption and decryption method, device, electronic device and non-transitory computer-readable storage medium for application configuration data, so as to solve the problem of low flexibility of configuration data encryption scheme in the prior art and improve the flexibility and compatibility of application configuration data.
[0005] The present disclosure provides an encryption and decryption method for application configuration data, wherein a current container in which a current application is located includes an application configuration plaintext storage volume and an application configuration ciphertext storage volume, and the method includes: if the current application includes an encryption and decryption module, obtaining first application configuration data of the current application in the application configuration plaintext storage volume; if the first application configuration data includes data to be processed, after encrypting the first application configuration data using the encryption and decryption module, storing the encryption result in the application configuration ciphertext storage volume, and replacing the first application configuration data in the application configuration plaintext storage volume with a set character string.
[0006] According to the method for encrypting and decrypting application configuration data provided by the present disclosure, after storing the encryption processing result in the application configuration ciphertext storage volume, the method also includes: reading the encryption processing result from the application configuration ciphertext storage volume and performing decryption processing to configure the current application according to the decryption processing result.
[0007] According to the method for encrypting and decrypting application configuration data provided by the present disclosure, before obtaining the first application configuration data of the current application in the application configuration plaintext storage volume, the method also includes: obtaining a creation request for the current application, the creation request including the first application configuration data, and the first application configuration data including annotation data for characterizing whether the first application configuration data contains the data to be processed.
[0008] According to the encryption and decryption method of application configuration data provided by the present disclosure, after obtaining the creation request of the current application, the method further includes: obtaining the annotation data according to the creation request; judging whether the first application configuration data contains the data to be processed according to the annotation data; and if so, mounting the application configuration ciphertext storage volume in the current container.
[0009] According to the encryption and decryption method of application configuration data provided by the present disclosure, the method further includes: receiving the creation request forwarded by the kubernetes cluster through a hook mechanism.
[0010] According to the encryption and decryption method of application configuration data provided by the present disclosure, the method also includes: if the current application does not include an encryption and decryption module, obtaining the first application configuration data of the current application in the application configuration plaintext storage volume to configure the current application according to the first application configuration data.
[0011] According to the method for encrypting and decrypting application configuration data provided by the present disclosure, after obtaining the first application configuration data of the current application in the application configuration plaintext storage volume, the method further includes: judging whether the first application configuration data contains data to be processed according to the annotation data.
[0012] According to an encryption and decryption device for application configuration data provided by the present disclosure, a current container where a current application is located includes an application configuration plaintext storage volume and an application configuration ciphertext storage volume, and the device includes: a first acquisition unit, used to acquire first application configuration data of the current application in the application configuration plaintext storage volume when the current application includes an encryption and decryption module; a processing unit, used to, when the first application configuration data includes data to be processed, store the encryption result in the application configuration ciphertext storage volume after encrypting the first application configuration data using the encryption and decryption module, and replace the first application configuration data in the application configuration plaintext storage volume with a set string.
[0013] According to the device for encrypting and decrypting application configuration data provided by the present disclosure, the device also includes a decryption unit for reading the encryption processing result from the application configuration ciphertext storage volume and performing decryption processing to configure the current application according to the decryption processing result.
[0014] According to the device for encrypting and decrypting application configuration data provided by the present disclosure, the device also includes a second acquisition unit, which is used to obtain a creation request for the current application, the creation request includes the first application configuration data, and the first application configuration data includes annotation data for characterizing whether the first application configuration data contains the data to be processed.
[0015] According to the device for encrypting and decrypting application configuration data provided by the present disclosure, the device also includes a third acquisition unit, used to obtain the annotation data according to the creation request; a judgment unit, used to judge whether the first application configuration data contains the data to be processed according to the annotation data; and a mounting unit, used to mount the application configuration ciphertext storage volume in the current container when the first application configuration data contains the data to be processed.
[0016] According to the device for encrypting and decrypting application configuration data provided by the present disclosure, the device also includes a receiving unit for receiving the creation request forwarded by the kubernetes cluster through a hook mechanism.
[0017] According to the encryption and decryption device for application configuration data provided by the present disclosure, the first acquisition unit is also used to obtain the first application configuration data of the current application in the application configuration plaintext storage volume when the current application does not include an encryption and decryption module, so as to configure the current application according to the first application configuration data.
[0018] According to the device for encrypting and decrypting application configuration data provided by the present disclosure, the judgment unit is further used to, after obtaining the first application configuration data of the current application in the application configuration plaintext storage volume, judge whether the first application configuration data contains data to be processed according to the annotation data.
[0019] The present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the encryption and decryption method for application configuration data as described in any one of the above are implemented.
[0020] The present disclosure also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of any of the above-mentioned methods for encrypting and decrypting application configuration data are implemented.
[0021] The present disclosure provides an encryption and decryption method, device, electronic device, and non-transitory computer-readable storage medium for application configuration data. By mounting an application configuration plaintext storage volume and an application configuration ciphertext storage volume in a current container, when an application has an encryption and decryption module, the specified configuration data in the application configuration plaintext storage volume can be encrypted and stored in the application configuration ciphertext storage volume, thereby improving the security of the configuration data. At the same time, the application configuration plaintext storage volume can provide configuration data for applications that do not have a decryption module, thereby improving the compatibility of the configuration data, thereby achieving a balance between the security and compatibility of the configuration data. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the present disclosure or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0023] Figure 1 It is a flowchart of the encryption and decryption method of application configuration data provided by the present disclosure;
[0024] Figure 2 is a schematic diagram of the relationship between storage volumes, applications and containers provided by the present disclosure;
[0025] Figure 3 This is one of the schematic diagrams of the relationship between the interception and mounting module and the kubernetes cluster provided by the present disclosure;
[0026] Figure 4 This is the second schematic diagram of the relationship between the interception and mounting module and the kubernetes cluster provided by the present disclosure;
[0027] Figure 5 It is a schematic diagram of the structure of the device for encrypting and decrypting application configuration data provided by the present disclosure;
[0028] Figure 6 It is a schematic diagram of the structure of an electronic device provided by the present disclosure. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solutions and advantages of the present disclosure clearer, the technical solutions in the present disclosure will be clearly and completely described below in conjunction with the drawings in the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0030] The terms used in one or more embodiments of the present disclosure are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present disclosure. The singular forms of "a", "said" and "the" used in one or more embodiments of the present disclosure and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present disclosure refers to and includes any or all possible combinations of one or more associated listed items.
[0031] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present disclosure, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present disclosure, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0032] The following is an explanation of the technical terms in the embodiments of the present disclosure:
[0033] Container: A technology for packaging applications and the environment in which they run.
[0034] Storage volume: A directory containing data that can be accessed by a container. The data in the storage volume will not be lost during container restarts.
[0035] Configmap: It is an API (Application Programming Interface) object of Kubernetes technology, which is used to separate application configuration data from application code. It can save unencrypted data into key-value pairs and use them as environment variables, command line parameters, or configuration files in storage volumes. Configmap can decouple environment variable configuration information from container images, making it easier to modify application configuration.
[0036] The exemplary embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0037] like Figure 1 The flowchart of the encryption and decryption method of application configuration data of the embodiment of the present disclosure is shown. The method provided by the embodiment of the present disclosure can be executed by any electronic device with computer processing capability, such as a terminal device and / or a server.
[0038] In the encryption and decryption method of application configuration data of the embodiment of the present disclosure, the current container where the current application is located may include an application configuration plaintext storage volume and an application configuration ciphertext storage volume.
[0039] Specifically, the current container is the container where the current application is located. A container is a means of packaging an application or service and the dependencies required for its operation, which may be code, runtime, system libraries, etc. In the disclosed embodiment, the current container may be a container of a kubernetes cluster. kubernetes is a container orchestration engine that supports automated deployment, large-scale scalability, and application containerized management. The kubernetes cluster is formed based on kubernetes technology and is a computer system composed of physical servers or virtual machines.
[0040] like Figure 1 As shown, the encryption and decryption method of the application configuration data includes:
[0041] Step 102: If the current application includes an encryption and decryption module, obtain first application configuration data of the current application in the application configuration plaintext storage volume.
[0042] Specifically, the application configuration plaintext storage volume is used to store configuration data in plaintext form, and the application configuration ciphertext storage volume is used to store configuration data in ciphertext form. Both the application configuration plaintext storage volume and the application configuration ciphertext storage volume can be mounted in the current container. The configuration data includes various parameters required during the startup, driver loading and operation of the application. For example, the configuration data may include general information such as the initialization information of the application, and may also include sensitive information that needs to be encrypted, such as user identification and user password.
[0043] Step 104, if the first application configuration data contains data to be processed, after encrypting the first application configuration data using the encryption and decryption module, the encryption result is stored in the application configuration ciphertext storage volume, and the first application configuration data in the application configuration plaintext storage volume is replaced with a set string.
[0044] Specifically, the data to be processed is configuration data including sensitive information that needs to be encrypted. The encryption and decryption module is a functional module in the current application, which can encrypt the sensitive information in the plaintext configuration data and store it in the ciphertext storage volume before the application loads the configuration data to ensure that the sensitive information is not leaked. Replacing the data to be processed in the application configuration plaintext storage volume with a setting string can make the application configuration plaintext storage volume no longer contain sensitive information, thereby further ensuring that the sensitive information is not leaked. The meaning of the setting string can be: the corresponding configuration data has been encrypted and replaced to distinguish the original file of the encrypted first application configuration data from other application configuration data.
[0045] In the technical solution of the embodiment of the present disclosure, by mounting an application configuration plaintext storage volume and an application configuration ciphertext storage volume in a container, when the configuration data stored in the application configuration plaintext storage volume contains sensitive information to be processed, the sensitive information can be encrypted and stored in the application configuration ciphertext storage volume for use after being decrypted by the application through a decryption module; and the sensitive information in the application configuration plaintext storage volume can be removed by replacing the sensitive information with a set string, thereby ensuring the security of the sensitive information during the application operation process.
[0046] For example, the database password of the production environment is mainly managed by the operation and maintenance. The developer can see the plaintext password when entering the container, or the program vulnerability may expose the plaintext password, which will cause security problems. The technical solution in the embodiment of the present disclosure can ensure information security. In addition, in the kubernetes cloud platform, some applications cannot use the commonly used ciphertext configuration data because they cannot integrate the encryption and decryption module. The technical solution of the embodiment of the present disclosure sets the application configuration plaintext storage volume and the application configuration ciphertext storage volume, which can be compatible with applications that cannot integrate the encryption and decryption module, and ensure the flexibility of the system that executes the encryption and decryption method.
[0047] When the encryption and decryption module cannot be integrated in some applications, the configuration data in the application configuration plaintext storage volume can be directly used, so that the configuration data in the technical solution of the embodiment of the present disclosure can be compatible with both plaintext and ciphertext usage, ensuring the high compatibility and flexibility of the technical solution of the present disclosure.
[0048] like Figure 2 As shown, in the embodiment of the present disclosure, both the application configuration plaintext storage volume 201 and the application configuration ciphertext storage volume 202 are mounted in the application container 203 of the kubernetes cluster. The application 204 can read the configuration data in the application configuration plaintext storage volume 201 and the application configuration ciphertext storage volume 202. The encryption and decryption module 205 in the application 204 can encrypt the data to be processed in the configuration data before the application 204 loads the configuration data.
[0049] Before step 102, under the kubernetes cloud platform, the application configuration content can be stored in plain text in the form of configmap in the distributed registration service center etcd. etcd is a distributed and consistent key-value pair storage system for shared configuration and service discovery.
[0050] Before step 102, a creation request of the current application is obtained, the creation request includes first application configuration data, and the first application configuration data includes annotation data for indicating whether the first application configuration data includes data to be processed.
[0051] Specifically, when creating an application, the user can specify the use of the above configmap, and can generate label data through label or annotation to identify whether the configmap contains sensitive information, so as to facilitate encryption and decryption processing in subsequent links.
[0052] In the embodiments of the present disclosure, Figure 3 As shown, an interception and mounting module 302 may be provided. The interception and mounting module is used to intercept the application creation request and mount the application configuration ciphertext storage volume in the container of the kubernetes cluster when the set condition is met. The set condition is that the first application configuration data contains the data to be processed.
[0053] The interception and mounting module can receive the application creation request 301. When the interception and mounting module finds that the configmap used by the application contains sensitive information, it will automatically add an encrypted data volume to the application, that is, the application sets the ciphertext storage volume, for subsequent storage of encrypted files. Together with the original plaintext configmap mounting volume, that is, the application sets the ciphertext storage volume, the application is equivalent to having a plaintext storage volume and a ciphertext storage volume.
[0054] Specifically, the interception and mounting module can obtain the annotation data according to the creation request, and determine whether the first application configuration data contains the data to be processed according to the annotation data; if so, the application configuration ciphertext storage volume is mounted in the current container through the kubernetes cluster 303.
[0055] In addition, if Figure 4As shown, the interception and mounting module can be placed later, and the application can be directly sent to the kubernetes cluster and forwarded by the hook mechanism of the kubernetes cluster. The interception and mounting module receives the creation request forwarded by the kubernetes cluster through the hook mechanism and performs interception and mounting processing. Specifically, the application creation request 401 created by the user is first sent to the kubernetes cluster 402. Through the kubernetes webhook (hook) mechanism, the application creation request is forwarded to the interception and mounting module 403, and after being processed by the interception and mounting module, it is handed over to the kubernetes cluster for subsequent processing.
[0056] The interception mount module creates an application configuration ciphertext storage volume based on the application configuration plaintext storage volume, so that the application container has two storage volumes, plaintext + ciphertext, so as to use different storage volumes according to whether the application integrates the encryption and decryption module.
[0057] Before step 102, it is necessary to determine whether the current application includes an encryption and decryption module. If the current application does not include an encryption and decryption module, the first application configuration data of the current application in the application configuration plaintext storage volume is obtained to configure the current application according to the first application configuration data.
[0058] Specifically, for applications that do not integrate encryption and decryption modules, plaintext configuration data can be read from the application configuration plaintext storage volume in the original way. The configuration data is compatible with both plaintext and ciphertext usage, ensuring the high compatibility and flexibility of the disclosed technical solution.
[0059] Before step 104, it can be determined based on the annotation data whether the first application configuration data contains the data to be processed. If so, the data to be processed can be encrypted in step 104. If not, step 104 does not need to be performed.
[0060] In the embodiment of the present disclosure, the encryption and decryption module may include an encryption module and a decryption module.
[0061] In step 104, if the current application includes an encryption and decryption module, during the container startup process before the application is started, the encryption module can be used to read configuration data from the application configuration plaintext storage volume. If there is sensitive information in the configuration data, the configuration data containing the sensitive information in the plaintext configuration data can be encrypted according to the encryption method built into the encryption module, and the encrypted file is stored in the application configuration ciphertext storage volume path, and the original plaintext configuration file content is replaced with a specific string indicating that the encryption is complete.
[0062] After step 104, the encryption processing result can be read from the application configuration ciphertext storage volume and decrypted to configure the current application according to the decryption processing result.
[0063] Specifically, the decryption module can be integrated into the application. Through the decryption module, the application can read the encrypted configuration file from the application configuration ciphertext storage volume according to the configuration content, and return the encrypted configuration file to the application for use after decrypting the encrypted configuration file.
[0064] The encryption and decryption method for application configuration data provided by the present disclosure mounts an application configuration plaintext storage volume and an application configuration ciphertext storage volume in the current container, and can encrypt the specified configuration data in the application configuration plaintext storage volume and store it in the application configuration ciphertext storage volume when the application has an encryption and decryption module, thereby improving the security of the configuration data. At the same time, the application configuration plaintext storage volume can provide configuration data for applications that do not have a decryption module, thereby improving the compatibility of the configuration data, thereby achieving a balance between the security and compatibility of the configuration data.
[0065] The following is a description of an encryption and decryption device for application configuration data provided by the present disclosure. The encryption and decryption device for application configuration data described below and the encryption and decryption method for application configuration data described above can refer to each other.
[0066] like Figure 5 As shown, in the encryption and decryption device for application configuration data of the embodiment of the present disclosure, the current container where the current application is located includes an application configuration plaintext storage volume and an application configuration ciphertext storage volume, and the encryption and decryption device for application configuration data may include:
[0067] The first acquisition unit 502 may be configured to acquire first application configuration data of the current application in the application configuration plaintext storage volume when the current application includes an encryption and decryption module.
[0068] Specifically, the application configuration plaintext storage volume is used to store configuration data in plaintext form, and the application configuration ciphertext storage volume is used to store configuration data in ciphertext form. Both the application configuration plaintext storage volume and the application configuration ciphertext storage volume can be mounted in the current container. The configuration data includes various parameters required during the startup, driver loading and operation of the application. For example, the configuration data may include general information such as the initialization information of the application, and may also include sensitive information that needs to be encrypted, such as user identification and user password.
[0069] The processing unit 504 can be used to, when the first application configuration data contains data to be processed, store the encryption result in the application configuration ciphertext storage volume after encrypting the first application configuration data using the encryption and decryption module, and replace the first application configuration data in the application configuration plaintext storage volume with a set string.
[0070] Specifically, the data to be processed is configuration data including sensitive information that needs to be encrypted. The encryption and decryption module is a functional module in the current application, which can encrypt the sensitive information in the plaintext configuration data and store it in the ciphertext storage volume before the application loads the configuration data to ensure that the sensitive information is not leaked. Replacing the data to be processed in the application configuration plaintext storage volume with a setting string can make the application configuration plaintext storage volume no longer contain sensitive information, thereby further ensuring that the sensitive information is not leaked. The meaning of the setting string can be: the corresponding configuration data has been encrypted and replaced to distinguish the original file of the encrypted first application configuration data from other application configuration data.
[0071] The processing unit 504 may be a part of the encryption and decryption module, that is, the processing unit belongs to a part of the encryption and decryption module, and the encryption and decryption module belongs to the encryption and decryption device in the embodiment of the present disclosure. The processing unit 504 may also be a unit in the encryption and decryption device that uses the encryption and decryption module to perform encryption and decryption processing.
[0072] In the technical solution of the embodiment of the present disclosure, by mounting an application configuration plaintext storage volume and an application configuration ciphertext storage volume in a container, when the configuration data stored in the application configuration plaintext storage volume contains sensitive information to be processed, the sensitive information can be encrypted and stored in the application configuration ciphertext storage volume for use after being decrypted by the application through a decryption module; and the sensitive information in the application configuration plaintext storage volume can be removed by replacing the sensitive information with a set string, thereby ensuring the security of the sensitive information during the application operation process.
[0073] For example, the database password of the production environment is mainly managed by the operation and maintenance. The developer can see the plaintext password when entering the container, or the program vulnerability may expose the plaintext password, which will cause security problems. The technical solution in the embodiment of the present disclosure can ensure information security. In addition, in the kubernetes cloud platform, some applications cannot use the commonly used ciphertext configuration data because they cannot integrate the encryption and decryption module. The technical solution of the embodiment of the present disclosure sets the application configuration plaintext storage volume and the application configuration ciphertext storage volume, which can be compatible with applications that cannot integrate the encryption and decryption module, ensuring the flexibility of the encryption and decryption device.
[0074] When the encryption and decryption module cannot be integrated in some applications, the configuration data in the application configuration plaintext storage volume can be directly used, so that the configuration data in the technical solution of the embodiment of the present disclosure can be compatible with both plaintext and ciphertext usage, ensuring the high compatibility and flexibility of the technical solution of the present disclosure.
[0075] In the embodiment of the present disclosure, the device for encrypting and decrypting application configuration data may further include a decryption unit for reading the encryption processing result from the application configuration ciphertext storage volume and performing decryption processing to configure the current application according to the decryption processing result.
[0076] In the embodiment of the present disclosure, the encryption and decryption device for application configuration data may further include a second acquisition unit, which is used to acquire a creation request of the current application, the creation request includes first application configuration data, and the first application configuration data includes annotation data used to characterize whether the first application configuration data contains data to be processed. Specifically, when creating an application, the user may specify the use of the above configmap, and may generate annotation data in a label or annotation manner to identify whether the configmap contains sensitive information, so as to facilitate encryption and decryption processing in subsequent links.
[0077] In an embodiment of the present disclosure, the encryption and decryption device for application configuration data may further include a third acquisition unit, used to obtain annotation data according to a creation request; a judgment unit, used to judge whether the first application configuration data contains data to be processed according to the annotation data; and a mounting unit, used to mount the application configuration ciphertext storage volume in the current container when the first application configuration data contains data to be processed.
[0078] Among them, the third acquisition unit, the judgment unit and the mounting unit can intercept and mount, that is, intercept the application creation request, and mount the application configuration ciphertext storage volume in the container of the kubernetes cluster when the set condition is met. The set condition is that the first application configuration data contains the data to be processed.
[0079] In the embodiment of the present disclosure, the device for encrypting and decrypting application configuration data may further include a receiving unit for receiving a creation request forwarded by the kubernetes cluster through a hook mechanism.
[0080] In the embodiment of the present disclosure, the first acquisition unit can also be used to obtain the first application configuration data of the current application in the application configuration plaintext storage volume when the current application does not include the encryption and decryption module, so as to configure the current application according to the first application configuration data. Specifically, for applications that do not integrate encryption and decryption modules, the plaintext configuration data can be read from the application configuration plaintext storage volume in the original way. The configuration data is compatible with both plaintext and ciphertext usage, ensuring the high compatibility and flexibility of the technical solution of the present disclosure.
[0081] In the embodiment of the present disclosure, the judgment unit may also be used to, after obtaining the first application configuration data of the current application in the application configuration plaintext storage volume, judge whether the first application configuration data contains the data to be processed according to the annotation data. If it contains, the processing unit 504 may encrypt the data to be processed. If it does not contain, the processing unit 504 does not need to encrypt the data to be processed.
[0082] Since the various functional modules of the device for encrypting and decrypting application configuration data of the example embodiment of the present disclosure correspond to the steps of the example embodiment of the method for encrypting and decrypting application configuration data described above, for details not disclosed in the device embodiment of the present disclosure, please refer to the embodiment of the method for encrypting and decrypting application configuration data described above in the present disclosure.
[0083] The encryption and decryption device for application configuration data provided by the present disclosure mounts an application configuration plaintext storage volume and an application configuration ciphertext storage volume in the current container, and can encrypt the specified configuration data in the application configuration plaintext storage volume and store it in the application configuration ciphertext storage volume when the application has an encryption and decryption module, thereby improving the security of the configuration data. At the same time, the application configuration plaintext storage volume can provide configuration data for applications that do not have a decryption module, thereby improving the compatibility of the configuration data, thereby achieving a balance between the security and compatibility of the configuration data.
[0084] Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6 As shown, the electrical processing sub-device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the encryption and decryption method of the application configuration data, the method comprising: the current container where the current application is located includes an application configuration plaintext storage volume and an application configuration ciphertext storage volume, if the current application includes an encryption and decryption module, then obtaining the first application configuration data of the current application in the application configuration plaintext storage volume; if the first application configuration data includes data to be processed, then after the first application configuration data is encrypted by using the encryption and decryption module, the encryption processing result is stored in the application configuration ciphertext storage volume, and the first application configuration data in the application configuration plaintext storage volume is replaced with a set string.
[0085] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0086] On the other hand, the present disclosure also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the encryption and decryption methods of application configuration data provided by the above methods, the method including: the current container where the current application is located includes an application configuration plaintext storage volume and an application configuration ciphertext storage volume. If the current application includes an encryption and decryption module, the first application configuration data of the current application in the application configuration plaintext storage volume is obtained; if the first application configuration data includes data to be processed, after using the encryption and decryption module to encrypt the first application configuration data, the encryption processing result is stored in the application configuration ciphertext storage volume, and the first application configuration data in the application configuration plaintext storage volume is replaced with a set string.
[0087] On the other hand, the present disclosure also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the above-mentioned encryption and decryption methods for application configuration data provided, the method comprising: the current container where the current application is located contains an application configuration plaintext storage volume and an application configuration ciphertext storage volume. If the current application contains an encryption and decryption module, the first application configuration data of the current application in the application configuration plaintext storage volume is obtained; if the first application configuration data contains data to be processed, after encrypting the first application configuration data using the encryption and decryption module, the encryption result is stored in the application configuration ciphertext storage volume, and the first application configuration data in the application configuration plaintext storage volume is replaced with a set string.
[0088] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0089] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0090] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present disclosure.
Claims
1. A method for encrypting and decrypting application configuration data, characterized in that: The current container where the current application is located includes an application configuration plaintext storage volume and an application configuration ciphertext storage volume, and the method includes: If the current application includes an encryption and decryption module, obtaining first application configuration data of the current application in the application configuration plaintext storage volume; If the first application configuration data contains data to be processed, after encrypting the first application configuration data using the encryption and decryption module, the encryption result is stored in the application configuration ciphertext storage volume, and the first application configuration data in the application configuration plaintext storage volume is replaced with a set string; Before obtaining the first application configuration data of the current application in the application configuration plaintext storage volume, the method further includes: Obtaining a creation request for the current application, where the creation request includes the first application configuration data, and the first application configuration data includes annotation data for indicating whether the first application configuration data includes the data to be processed; The creation request is passed to the interception and mounting module, which is used to obtain the annotation data according to the creation request, and determine whether the first application configuration data contains the data to be processed according to the annotation data; if so, the application configuration ciphertext storage volume is mounted in the current container.
2. The method according to claim 1, characterized in that After storing the encryption processing result in the application configuration ciphertext storage volume, the method further includes: The encryption processing result is read from the application configuration ciphertext storage volume and decrypted to configure the current application according to the decryption processing result.
3. The method according to claim 1, characterized in that After obtaining the creation request of the current application, the method further includes: Acquire the annotation data according to the creation request; Determining whether the first application configuration data includes the data to be processed according to the marked data; If so, mount the application configuration ciphertext storage volume in the current container.
4. The method according to claim 1, characterized in that: The method further comprises: Receive the creation request forwarded by the kubernetes cluster through the hook mechanism.
5. The method according to claim 2, characterized in that: The method further includes: if the current application does not include an encryption / decryption module, obtaining first application configuration data of the current application in the application configuration plaintext storage volume, so as to configure the current application according to the first application configuration data.
6. The method according to claim 1, characterized in that After obtaining the first application configuration data of the current application in the application configuration plaintext storage volume, the method further includes: It is determined whether the first application configuration data contains data to be processed according to the marked data.
7. An encryption and decryption device for application configuration data, characterized in that: The current container where the current application is located includes an application configuration plaintext storage volume and an application configuration ciphertext storage volume, and the device includes: A first acquisition unit, configured to acquire first application configuration data of the current application in the application configuration plaintext storage volume when the current application includes an encryption and decryption module; a processing unit, configured to, when the first application configuration data includes data to be processed, encrypt the first application configuration data using the encryption / decryption module, store the encryption result in the application configuration ciphertext storage volume, and replace the first application configuration data in the application configuration plaintext storage volume with a set character string; A second acquisition unit is used to acquire a creation request of the current application, where the creation request includes first application configuration data, and the first application configuration data includes annotation data used to indicate whether the first application configuration data includes data to be processed; A creation request delivery unit is used to deliver the creation request to the interception and mounting module, and the interception and mounting module is used to obtain annotation data according to the creation request, and determine whether the first application configuration data contains data to be processed according to the annotation data; if so, mount the application configuration ciphertext storage volume in the current container.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
