WO2017020720A1 - 一种数据访问的方法及设备 - Google Patents

一种数据访问的方法及设备 Download PDF

Info

Publication number
WO2017020720A1
WO2017020720A1 PCT/CN2016/090821 CN2016090821W WO2017020720A1 WO 2017020720 A1 WO2017020720 A1 WO 2017020720A1 CN 2016090821 W CN2016090821 W CN 2016090821W WO 2017020720 A1 WO2017020720 A1 WO 2017020720A1
Authority
WO
WIPO (PCT)
Prior art keywords
metadata
key
data
accessed
server
Prior art date
Application number
PCT/CN2016/090821
Other languages
English (en)
French (fr)
Inventor
程霖
应叶琦
Original Assignee
阿里巴巴集团控股有限公司
程霖
应叶琦
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司, 程霖, 应叶琦 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2017020720A1 publication Critical patent/WO2017020720A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0442Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply asymmetric encryption, i.e. different keys for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities

Definitions

  • the present application relates to the field of computers, and in particular, to a method and device for data access.
  • a metadata server (NameNode) is used to store metadata information of a user file.
  • a data server (DataNode) is used to store data information of a user file.
  • the metadata server (NameNode) and the data server (DataNode) are accessed by a client (a client) that accesses the distributed file system, and the information of the client is easily Tampering, it is necessary to do a certain access control strategy to ensure the isolation of users and data to ensure security.
  • the industry does not have a good implementation of access control policies.
  • the ACL is used to set the user's permission.
  • the ACL is an object-based authorization. This method is based on the object accessed, but the hacker can still tamper with the data on the data server. For the metadata server and There is no good solution for the security control problem between data servers.
  • An object of the present application is to provide a method and device for data access, which can solve the problem of authority security control between a metadata server and a data server when data access is performed.
  • a method for a client for data access comprising:
  • the method when the permission of the data to be accessed signed by the private key is sent to the metadata server, the method further includes:
  • the metadata server verifies the permission of the unlocked data to be accessed, including:
  • the verification passes.
  • the metadata server verifies the permission of the unlocked data to be accessed, including:
  • the verification passes.
  • the metadata information processed by the key includes:
  • Metadata partial metadata extracted from the metadata, and partial metadata encrypted by the key
  • the data server verifies the metadata information processed by the key, including:
  • the data server locally encrypts the received portion of the received number with the key, and Comparing the result obtained by local encryption with the received partial metadata encrypted by the key, if the comparison is consistent, the verification is passed;
  • Obtaining the to-be-accessed data from the data server including:
  • the metadata information processed by the key includes:
  • Metadata partial metadata extracted from the metadata, partial metadata encrypted by the key, and expiration time of the metadata
  • the data server verifies the metadata information processed by the key, including:
  • the data server locally encrypts the received part of the received number with the key, and compares the result obtained by the local encryption with the received partial metadata encrypted by the key, and according to the Expiring the expiration time of the metadata to determine whether the metadata is out of date, and if the comparison is consistent and the metadata has not expired, the verification is passed;
  • Obtaining the to-be-accessed data from the data server including:
  • a method for assisting data access by a metadata server comprising:
  • the method when receiving the permission of the data to be accessed signed by the private key from the client, the method further includes:
  • the permission verification of the unlocked data to be accessed is passed, including:
  • the verification is passed.
  • the metadata information processed by the key includes:
  • Metadata partial metadata extracted from the metadata, and partial metadata encrypted with the key.
  • the metadata information processed by the key further includes:
  • a method for assisting data access by a data server comprising:
  • the data to be accessed is transmitted to the client.
  • the metadata information includes metadata, partial metadata extracted from the metadata, and partial metadata encrypted by the key
  • the data to be accessed is transmitted to the client, including:
  • the metadata information processed by the key includes: metadata, partial metadata extracted from the metadata, and a partial number of elements encrypted by the key And transmitting, according to the expiration time of the metadata, the data to be accessed to the client after the verification of the metadata information processed by the key, including:
  • the data server locally encrypts the received part of the received number with the key, and compares the result obtained by the local encryption with the received partial metadata encrypted by the key, and according to the Expiring the expiration time of the metadata to determine whether the metadata is out of date, and if the comparison is consistent and the metadata has not expired, the verification is passed;
  • a client for data access comprising:
  • a sending permission device configured to send, to the metadata server, the right to be accessed by the private key
  • Obtaining a metadata device configured to acquire, by the metadata server, metadata information processed by the key, wherein the authority of the data to be accessed signed by the private key is unlocked by the metadata server by using a public key,
  • the metadata information processed by the key is generated by the metadata server after verifying the authority of the unlocked data to be accessed;
  • Obtaining data device configured to send the metadata information processed by the key to the data server, and after the data server verifies the metadata information processed by the key, obtain the data information from the data server The data to be accessed, wherein the metadata information processed by the key is verified by the data server by using the key.
  • the client further includes a sending expiration time device, configured to send the to-be-accessed data to the metadata server while transmitting the right to be accessed by the private key to the metadata server.
  • the expiration time of the privilege wherein the metadata server is configured to verify that the privilege of the unlocked data to be accessed is not expired according to the expiration time of the privilege.
  • the metadata server is configured to use a preset permission If the threshold determines that the unlocked data to be accessed is not exceeding the permission threshold, the verification passes.
  • the metadata information processed by the key includes: metadata, partial metadata extracted from the metadata, and partial metadata encrypted by the key;
  • the data server is configured to perform local encryption on the received part of the received number with the key, and compare the result obtained by the local encryption with the received partial metadata encrypted by the key, If they are more consistent, the verification is passed;
  • Obtaining a data device configured to acquire the to-be-accessed data from the data server according to the metadata.
  • the metadata information processed by the key includes: metadata, partial metadata extracted from the metadata, and partial metadata and metadata encrypted by the key. Expiration time;
  • the data server is configured to perform local encryption on the received part of the received number with the key, and compare the result obtained by the local encryption with the received partial metadata encrypted by the key, And determining, according to the expiration time of the metadata, whether the metadata is expired, and if the comparison is consistent and the metadata is not expired, the verification is passed;
  • the acquiring data device is configured to acquire the to-be-accessed data from the data server according to the metadata.
  • a metadata server for assisting data access comprising:
  • a receiving authority device configured to receive, from the client, permission for the data to be accessed signed by the private key
  • Generating a metadata device configured to use the public key to unlock the permission of the data to be accessed signed by the private key, and generate the metadata information processed by the key after verifying the authority of the unlocked data to be accessed;
  • a sending metadata device configured to send the key processed metadata information to the client.
  • the metadata server further includes: an expiration time for receiving the expiration time device, and receiving the permission of the to-be-accessed data from the client;
  • the generating metadata device is configured to: when the permission of the unlocked data to be accessed is determined to be not expired according to the expiration time of the permission, the verification is passed.
  • the generating metadata device is configured to: when the permission of the unlocked data to be accessed is determined to be not exceeding the permission threshold according to the preset permission threshold, the verification is passed.
  • the metadata information processed by the key includes: metadata, partial metadata extracted from the metadata, and partial metadata encrypted by the key.
  • the metadata information processed by the key further includes: an expiration time of the metadata.
  • a data server for assisting data access comprising:
  • a metadata device configured to acquire, by the client, metadata information processed by the key
  • a verification device configured to verify, by using the key, the metadata information processed by the key
  • a data transmission device configured to transmit the to-be-accessed data to the client after verifying the metadata information processed by the key.
  • the data transmission device uses Performing local encryption on the received part of the received number with the key, and performing the result obtained by local encryption and the received partial metadata encrypted by the key For comparison, if the comparison is consistent, the verification is passed; and the to-be-accessed data is transmitted to the client according to the metadata.
  • the metadata information processed by the key includes: metadata, partial metadata extracted from the metadata, and partial metadata and elements encrypted by the key.
  • the data transmission device is configured to perform local encryption on the received portion of the received number with the key, and encrypt the result obtained by local encryption with the received key encrypted by the key.
  • the partial metadata is compared, and the metadata is judged to be expired according to the expiration time of the metadata. If the comparison is consistent and the metadata is not expired, the verification is passed; and the to-be-accessed is transmitted to the client according to the metadata. data.
  • the present application uses the public key to unlock the permission of the data to be accessed signed by the private key by using the public key, and after the authorization verification of the unlocked data to be accessed is passed, the method generates the
  • the metadata information processed by the key can realize the access control to the metadata server, so that the security of the metadata server can be ensured, and in addition, the metadata information of the key processed by the data server is verified by the data server.
  • the client is allowed to obtain the to-be-accessed data from the data server, and the access control of the data server can be implemented, thereby ensuring the security of the data server, and finally realizing the anti-forgery of the client.
  • the application further adds an additional condition, that is, the metadata server is unlocked according to the expiration time of the permission.
  • the permission of the data to be accessed is judged to be unexpired, when the additional condition is satisfied at the same time, it is judged that the authority to verify the unlocked data is passed, and the authority to access the data is more strictly verified, and If the additional conditions are met, the client's subsequent access to the data server is not allowed, and the data security on the data server that needs to be accessed later is guaranteed.
  • the application further adds an additional condition, that is, the metadata server is unpacked according to the preset permission threshold.
  • the permission to access data is determined not to exceed the permission threshold, then If it is determined that the additional condition is satisfied, if the permission of the unlocked data to be accessed is too large, and the preset permission threshold is exceeded, it is determined that the additional condition is not satisfied, and when the additional condition is satisfied at the same time, it is determined to be
  • the rights verification of the unlocked data to be accessed is passed, and the authority to access the data is more strictly verified. If the additional conditions are not satisfied, the subsequent access to the data server by the client is not allowed, and the data to be accessed subsequently is guaranteed. Data security on the server.
  • the data server in the present application locally encrypts the received part of the received number with the key, and obtains the result obtained by local encryption and the received partial metadata encrypted by the key. For comparison, if the comparison is consistent, the verification is passed, because the client does not have a key, indicating that the client is trusted, so that the client can establish a trusted connection with the data server and can safely transmit it. Access data.
  • the data server in the present application locally encrypts the received part of the received number with the key, and obtains the result obtained by local encryption and the received partial metadata encrypted by the key. Comparing and judging whether the metadata expires according to the expiration time of the metadata, and satisfying the relatively consistent condition, and another condition is required, that is, the data server determines that the metadata has not expired, and both conditions are satisfied, and then it is determined that After the verification is passed, the subsequent access to the data server can be performed, so that the verification of the metadata information after the key processing is more strictly verified, and the credibility of the client is ensured.
  • FIG. 1 shows a flow diagram of a method for a client to access data in accordance with an aspect of the present application
  • FIG. 2 is a diagram showing a distributed file system architecture of an embodiment of the present application.
  • FIG. 3 is a schematic diagram showing content of a message that a client sends to a metadata server according to an embodiment of the present application
  • FIG. 4 shows a flow chart of a method for assisting data access by a metadata server side in accordance with another aspect of the present application
  • FIG. 5 shows a flow chart of a method for assisting data access by a data server side in accordance with another aspect of the present application
  • FIG. 6 shows a block diagram of a client for data access in accordance with another aspect of the present application.
  • FIG. 7 shows a block diagram of a client for data access in accordance with a preferred embodiment of the present application.
  • FIG. 8 shows a block diagram of a metadata server assisting data access in accordance with another aspect of the present application.
  • FIG. 9 shows a block diagram of a metadata server assisting data access in accordance with a preferred embodiment of the present application.
  • FIG. 10 shows a block diagram of a data server assisting data access in accordance with another aspect of the present application.
  • Figure 11 shows a flow chart in accordance with a particular application embodiment of the present application.
  • the terminal, the device of the service network, and the trusted party each include one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
  • RAM random access memory
  • ROM read only memory
  • Memory is an example of a computer readable medium.
  • Computer readable media includes both permanent and non-persistent, removable and non-removable media.
  • Information storage can be implemented by any method or technology.
  • the information can be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of storage media for a computer include, but are not limited to, phase Variable Memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Other Types of Random Access Memory (RAM), Read Only Memory (ROM), EEPROM Memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, magnetic tape cartridge, tape storage or other magnetic storage
  • PRAM phase Variable Memory
  • SRAM Static Random Access Memory
  • DRAM Dynamic Random Access Memory
  • RAM Random Access Memory
  • RAM Read Only Memory
  • flash memory or other memory technology
  • CD-ROM compact disc
  • DVD digital versatile disc
  • computer readable media does not include non-transitory computer readable media, such as modulated data signals and carrier waves.
  • the present application provides a method for a client to access data, where the method includes:
  • Step S11 Send the permission of the data to be accessed signed by the private key to the metadata server; specifically, as shown in FIG. 2, the distributed file system architecture is involved by three parties: the client end (client 1) and the NameNode end (yuan) Data server 2), DataNode (data server 3), wherein HA (High Available) is a high-availability cluster, which is an effective solution to ensure business continuity.
  • client 1 client 1
  • DataNode data server 3
  • HA High Available
  • the metadata server stores metadata information (meta) of the data to be accessed, and the metadata information is used for recording.
  • the data to be accessed stores the location information on the data server, and the client obtains the metadata to be accessed by directly accessing the data server through the metadata information, and the access control for the metadata server can be used.
  • Capability is a data structure used for access control that defines one or more The specified resources (such as directories, files, etc.) have access rights.
  • the capability authentication needs to include the private key (Signature) and the permission of the data to be accessed (Permissions), so that the client sends the private key to the metadata server.
  • the permission to access the data can be a list of permission sets, each permission can have two fields: the permission set number resourceID and the permission bundle corresponding to the permission set number, Set permissions as needed
  • the number of data bits of the collection such as 32bits, each bit represents a user-defined permission.
  • the permissions of the data to be accessed may include: READ (read permission), WRITE (write permission), ROOT (read and write permission, equivalent to READ
  • Step S12 Obtain metadata information processed by the key from the metadata server, wherein the authority of the data to be accessed signed by the private key is decrypted by the metadata server by using a public key, where the key is processed
  • the subsequent metadata information is generated by the metadata server verifying the permission of the unlocked data to be accessed; here, the public key is a public key corresponding to the private key, to facilitate the metadata server Using the public key to unlock the right to be accessed by the private key, when the client accesses the metadata server, the authority to send the data to be accessed signed by the private key is sent to the metadata server, and then the metadata server takes After the permission to the data to be accessed signed by the private key is required to be verified, if the verification is passed, the client can obtain the metadata information processed by the key from the metadata server, and then continue the subsequent access to the data server, for example, When the client client1 requests to read the content of the data to be accessed file1, the request format under the RPC protocol is: (/client1/file1, READ), and
  • the permission of the data to be accessed sent by the private key of the request, and the content of the message sent by the client to the metadata server at this time can be seen in FIG. 3, and the message content includes: a message header (A), and a message containing the specific request content.
  • Body (B) and the permission (C) of the data to be accessed signed with the private key the client can transmit the message content in the format of protocolbuffer (a data exchange format of ***), and then the metadata server obtains the certificate issued by the private key.
  • protocolbuffer a data exchange format of ***
  • the public key is used to unlock the permission of the data to be accessed signed by the private key, and then the authority information of the unlocked data to be accessed is verified to generate the metadata information processed by the key
  • the client The terminal obtains the metadata information processed by the key from the metadata server, wherein the permission of the data to be accessed signed by the private key may be generated by the client itself, or may be generated by another third party, and then the client The third-party acquisition, in addition, when the client can use the public key to unlock the right to be accessed by the private key, the right to the unlocked data to be accessed can be determined.
  • Step S13 the metadata information processed by the key is sent to the data server, and after the data server verifies the metadata information processed by the key, the data server obtains the waiting from the data server. Accessing data, wherein the metadata information processed by the key is verified by the data server by the key.
  • the metadata server decrypts the right to be accessed by using the private key by using the public key, and after the authority verification of the unlocked data to be accessed is passed, the key processed by the key is generated.
  • the metadata information can implement access control to the metadata server, so that the security of the metadata server can be ensured, and in addition, the client is allowed to authenticate after the data server verifies the metadata information processed by the key.
  • the terminal obtains the to-be-accessed data from the data server, and can implement access control on the data server, so as to ensure the security of the data server, and finally achieve anti-counterfeiting of the client.
  • step S11 the permission of the data to be accessed signed by the private key is sent to the metadata server, and the method further includes:
  • the metadata server verifies the permission of the unlocked data to be accessed, including:
  • Capability can be defined as the following format:
  • Length indicates the length of Signarure
  • Signature represents the private key used to verify that the Permissions have been tampered with
  • ID indicates the ID number of Capability, which is unique
  • Permissions indicates the permissions of the data to be accessed.
  • the metadata server passes the verification of the rights of the unlocked data to be accessed, including:
  • the verification passes.
  • the additional condition is further added, that is, the metadata server performs the unlocked data to be accessed according to the preset permission threshold. If the permission is determined not to exceed the permission threshold, it is determined that the additional condition is satisfied. When the unlocked data to be accessed is too large, and the preset permission threshold is exceeded, it is determined that the additional condition is not satisfied.
  • the additional conditions it is judged that the authority to verify the data to be accessed is passed, and the authority to access the data is more strictly verified. If the condition is not satisfied, the client is not allowed to follow. Access to the data server ensures data security on subsequent data servers that need to be accessed.
  • the metadata information processed by the key includes:
  • Metadata, partial metadata extracted from the metadata, and partial metadata encrypted by the key; here, the same key (key) may be deployed in the metadata server and the data server, for example, The same file (key.txt) is deployed on the metadata server and the data server.
  • the key is stored in the file.
  • the key must be saved in a secure directory and requires specific permissions to be opened.
  • the length of the key can be randomly selected. The length cannot be too short or too long.
  • the length of the key can be set to 16 bytes (128 bits), and the key can be used.
  • Uuid generation of linux operating system can pass /proc/sys/kernel/random/uuid to randomly generate a uuid code, or use the openssl command to generate a key key.
  • the client requests access to the metadata server and passes the permission to unlock the data to be accessed.
  • the metadata information returned by the metadata server to the client includes HMAC(key, msg')
  • the subsequent client sends the key processed metadata information after serialization to the data server, where the encryption of the partial metadata encrypted by the key is generated.
  • the algorithm is not limited to the HMAC algorithm described above, wherein the HMAC is a message authentication code that can use any iterative hash function available for encryption by bundling a shared key;
  • the data server verifies the metadata information processed by the key, including:
  • the data server locally encrypts the received part of the received number with the key, and compares the result obtained by the local encryption with the received partial metadata encrypted by the key, if the comparison is consistent , the verification is passed; here, the data server receives the metadata information processed by the key after serialization sent by the client, and deserializes the received serialized information, and then deploys from the local Obtain a key (key) in the file (key.txt), and use the key value to perform HMAC (Hash-based Message Authentication Code) algorithm on the received msg' field to obtain HMAC (key, msg'), and obtain the HMAC (key).
  • HMAC Hash-based Message Authentication Code
  • the processed metadata information includes:
  • Metadata partial metadata extracted from the metadata, partial metadata encrypted by the key, and expiration time of the metadata;
  • the metadata information returned by the metadata server to the client includes HMAC (key, msg')
  • msg is an example, and the expiration time (expire_time) of the metadata can be set in part of the metadata (msg') encrypted by the key, such as msg' ⁇ FileID, READ /WRITE,expire_time ⁇ ;
  • the data server verifies the metadata information processed by the key, including:
  • the data server locally encrypts the received part of the received number with the key, and compares the result obtained by the local encryption with the received partial metadata encrypted by the key, and according to the Determining the expiration time of the metadata to determine whether the metadata is out of date, if the comparison is consistent and the metadata has not expired, the verification passes; here, the result obtained after the local encryption is combined with the received partial element encrypted by the key Comparing the data to meet the relatively consistent conditions, another condition is required, that is, the data server determines that the metadata has not expired, and after both conditions are satisfied, it is judged that the verification is passed, and subsequent access to the data server can be performed, thereby realizing Verification of the stricter verification of the metadata information processed by the key to ensure the credibility of the client.
  • the metadata server sets the expiration time (expire_time) of the data server by the client, and the expire_time expires. After that, the data server can trigger a token expire event, which will send a request. Client, the client needs to re-request the key element of the processed data information to the metadata server;
  • a method for assisting data access by a metadata server includes:
  • Step S21 Receive the permission of the data to be accessed signed by the private key from the client; specifically, as shown in FIG. 2, the distributed file system architecture is participated by the three parties: the client end (client 1) and the NameNode end (yuan) Data server 2), DataNode (data server 3), these three-party communication It may be based on the RPC protocol, which is built on the TCP/IP protocol, the metadata server stores metadata information (meta) of the data to be accessed, and the metadata information is used to record information of the location where the data to be accessed is stored on the data server. The client obtains the metadata information from the metadata server, and then directly accesses the data server through the metadata information to obtain the required data to be accessed.
  • client obtains the metadata information from the metadata server, and then directly accesses the data server through the metadata information to obtain the required data to be accessed.
  • the access control for the metadata server may use the capability of Capability, and the Capability is A data structure for access control that defines access rights to one or more specified resources (such as directories, files, etc.).
  • Capability authentication needs to include the private key (Signature) and the permissions of the data to be accessed. (Permissions), so that the client sends the permission of the data to be accessed signed by the private key to the metadata server.
  • the permission of the data to be accessed (Permissions) can be a list of permission sets, and each permission can have two fields: permission The collection number resourceID and the permission bundle corresponding to the permission collection number, Set the number of data bits of the permission set as needed. For example, 32 bits can be set. Each bit represents a user-defined permission.
  • the permissions of the data to be accessed may include: READ (read permission), WRITE (write permission), ROOT (read and write). Permission, equivalent to READ
  • Step S22 using the public key to unlock the permission of the data to be accessed signed by the private key, and generating the metadata information processed by the key after verifying the right of the unlocked data to be accessed;
  • the public The key is a public key corresponding to the private key, so that the metadata server can use the public key to unlock the right to be accessed by the private key, and when the client accesses the metadata server, the key is The data server sends the permission of the data to be accessed signed by the private key, and then the metadata server needs to verify the permission of the data to be accessed signed by the private key. If the verification is passed, the client can obtain the information from the metadata server.
  • the request format of the RPC protocol is: (/client1/file1, READ)
  • the client sends the permission of the requested data to be accessed by the private key to the metadata server.
  • the content of the message sent by the client to the metadata server may be specifically Referring to FIG. 3, the message content includes: a message header (A), a message body (B) containing a specific request content, and a number of to-be-visits issued with a private key.
  • the client can transmit the message content in the format of protocolbuffer (a data exchange format of ***), and then the metadata server obtains the permission of the data to be accessed signed by the private key, and then uses the public key to unlock
  • the authority to be accessed by the private key is used to generate the metadata information processed by the key after the authorization of the unlocked data to be accessed is verified, and the client obtains the processed key from the metadata server.
  • Metadata information wherein the right to be accessed by the private key may be generated by the client itself, or may be generated by another third party, and then obtained by the client from the third party, and when the client can utilize
  • the public key can be used to determine the right to verify the data to be accessed by the private key, and the metadata server can use the public key to unlock the private key to be accessed.
  • the additional condition is further added, and when the additional condition is satisfied at the same time, it is judged that the authority verification of the unlocked data to be accessed is passed.
  • Step S23 the metadata information processed by the key is sent to the client.
  • the metadata server decrypts the right to be accessed by using the private key by using the public key, and after the authority verification of the unlocked data to be accessed is passed, the key processed by the key is generated. Metadata information enables access control to the metadata server, which ensures the security of the metadata server.
  • the client receives the permission of the data to be accessed signed by the private key, and includes:
  • step S22 The authorization verification of the unlocked data to be accessed in step S22 is passed, including:
  • Capability can be defined as the following format:
  • Length indicates the length of Signarure
  • Signature represents the private key used to verify that the Permissions have been tampered with
  • ID indicates the ID number of Capability, which is unique
  • Permissions indicates the permissions of the data to be accessed.
  • the authorization verification of the unlocked data to be accessed in step S22 includes:
  • the verification is passed.
  • the additional condition is further added, that is, the metadata server performs the unlocked data to be accessed according to the preset permission threshold. If the permission is determined not to exceed the permission threshold, it is determined that the additional condition is satisfied. When the unlocked data to be accessed is too large, and the preset permission threshold is exceeded, it is determined that the additional condition is not satisfied. At the same time, when the additional conditions are met, it is judged that the authority to verify the data to be accessed is passed, and the authority to access the data is more strictly verified. If the condition is not satisfied, the client is not allowed to follow. Access to the data server ensures data security on subsequent data servers that need to be accessed.
  • the metadata server of the present application is used to assist data access.
  • the metadata information processed by the key includes:
  • Metadata partial metadata extracted from the metadata, and partial metadata encrypted with the key.
  • the same key can be deployed on the metadata server and the data server.
  • the file holds the key.
  • the key must be saved in a secure directory and requires specific permissions. Can be opened to prevent the key from being stolen, the length of the key can be randomly selected, the length can not be too short or too long, the length of the key can be set to 16 bytes (128 bits), the key (key You can use the uuid generation of the Linux operating system.
  • the client requests access to the metadata server.
  • the metadata information returned by the metadata server to the client includes HMAC(key, msg')
  • the lbuffer is serialized, it is sent to the client, and the subsequent client sends the key processed metadata information after serialization to the data server, where the partial metadata encrypted by the key is generated.
  • the encryption algorithm is not limited to the HMAC algorithm described above, wherein the HMAC is a message
  • the metadata server of the present application is used to assist data access.
  • the metadata information processed by the key further includes:
  • the expiration time of the metadata includes HMAC(key, msg')
  • a method for assisting data access by a data server includes:
  • Step S31 obtaining metadata information processed by the key from the client
  • Step S32 verifying, by using the key, the metadata information processed by the key
  • Step S33 After the metadata information processed by the key is verified, the data to be accessed is transmitted to the client.
  • the client After the data server verifies the metadata information processed by the key, the client is allowed to obtain the to-be-accessed data from the data server, and the access control to the data server can be implemented. It can ensure the security of the data server and ultimately achieve the anti-forgery of the client.
  • step S33 when the metadata information includes metadata, partial metadata extracted from the metadata, and encrypted with the key And a part of the metadata, in step S33, after the verification of the metadata information processed by the key, the data to be accessed is transmitted to the client, including:
  • the same key (key) can be deployed on the metadata server and the data server.
  • the same file (key.txt) can be deployed in the metadata server and the data server, and the key is saved in the file ( Key)
  • the key (key) must be stored in a secure directory, need specific permissions to open, to prevent the key from being stolen
  • the length of the key can be randomly selected, the length can not be too short or too Long, the length of the key can be set to 16 bytes (128 bits)
  • the key (key) can be generated using the uuid of the Linux operating system, and a uuid code can be randomly generated by /proc/sys/kernel/random/uuid.
  • the metadata information includes HMAC(key, msg')
  • HMAC is a message authentication code, which can use any iterative hash function available for encryption by bundling a shared key
  • the data server receives the key processing after serialization sent by the client.
  • a key is obtained from a locally deployed file (key.txt), and the received msg' field is used by the key value.
  • the HMAC (Hash-based Message Authentication Code) algorithm obtains HMAC (key, msg'), and the obtained HMAC (key, msg') and the received HMAC (key, msg') are the same.
  • the metadata information processed by the key is obtained from the metadata server, because the client does not have a key, indicating that the client is trusted, so that the client can establish a trusted connection with the data server. , you can safely transfer the data to be accessed;
  • step S33 when the metadata processed by the key includes: metadata, partial metadata extracted from the metadata,
  • the data to be accessed is transmitted to the client, include:
  • the data server locally encrypts the received part of the received number with the key, and compares the result obtained by the local encryption with the received partial metadata encrypted by the key, and according to the The expiration time of the metadata determines whether the metadata expires. If the comparison is consistent and the metadata has not expired, the verification passes; here, the metadata information returned by the metadata server to the client includes HMAC(key, msg')
  • msg, the expiration time (expire_time) of the metadata can be set in part of the metadata (msg') encrypted with the key, such as msg' ⁇ FileID, READ/WRITE, expire_time ⁇ ,
  • the result obtained by the local encryption is compared with the received partial metadata encrypted by the key, and the relatively consistent condition is satisfied, and another condition is required, that is, the data server determines that the metadata has not expired, and both conditions are After it is satisfied, it is judged that the verification is passed, and subsequent access to the data server can be performed,
  • the metadata server sets the expiration time (expire_time) of the data server by the client, and the expire_time expires. After that, the data server can trigger a token expire event, and the expiration event will send a request to the client, and the client needs to re-request the metadata information processed by the key from the metadata server;
  • a client for data access the client 1 includes:
  • the sending permission device 11 is configured to send the permission of the data to be accessed signed by the private key to the metadata server 2; specifically, as shown in FIG. 2, the distributed file system architecture is involved by three parties: the client end (client 1) , NameNode end (metadata server 2), DataNode end (data server 3), the three-party communication can be based on the RPC protocol to communicate, built on the TCP / IP protocol, the metadata server stores the metadata of the data to be accessed Meta information, the metadata information is used to record the information of the location where the data to be accessed is stored on the data server, and the client obtains the required to-be-accessed by directly obtaining the metadata information from the metadata server and then directly accessing the data server through the metadata information.
  • client 1 client 1
  • NameNode end metadata server 2
  • DataNode end data server 3
  • the three-party communication can be based on the RPC protocol to communicate
  • the metadata server stores the metadata of the data to be accessed Meta information
  • the metadata information is used to record the information of the location
  • Capability is a data structure for access control that defines one or more specified resources (such as directories, files, etc.)
  • the access rights, the capability authentication needs to include the private key (Signature) and the permissions of the data to be accessed (Permissions), so that the client can
  • the data server sends the permission of the data to be accessed signed by the private key.
  • the permission of the data to be accessed (Permissions) may be a list of permission sets, and each permission may have two fields: the permission set number resourceID and the permission set number.
  • the permission bundle can set the number of data bits of the permission set as needed. For example, 32 bits can be set. Each bit represents a user-defined permission.
  • the permissions of the data to be accessed can include: READ (read permission), WRITE ( Write permission), ROOT (read and write permissions, equivalent to READ
  • Obtaining metadata device 12 configured to acquire metadata information processed by the key from the metadata server 2, wherein the authority of the data to be accessed signed by the private key is used by the metadata server 2 is decrypted by the public key, and the metadata information processed by the key is generated by the metadata server 2 after verifying the permission of the unlocked data to be accessed; where the public key corresponds to the
  • the public key of the private key is used to facilitate the metadata server to use the public key to unlock the right to be accessed by the private key, and when the client accesses the metadata server, send the private data to the metadata server.
  • the client can obtain the processed key from the metadata server.
  • the metadata information for example, when the client client1 requests to read the content of the data to be accessed file1, the request format of the RPC protocol is: (/client1/file1, READ), and the client will go to the meta
  • the data server sends the permission of the pending data to be accessed by the private key of the request.
  • the content of the message sent by the client to the metadata server can be specifically seen in FIG. 3, the message content.
  • the client can transmit in the format of protocolbuffer (a data exchange format of ***) The content of the message, and then the metadata server obtains the permission of the data to be accessed signed by the private key, and then uses the public key to unlock the permission of the data to be accessed signed by the private key, and then passes the authority to verify the unlocked data to be accessed.
  • the metadata information processed by the key is generated, and the client obtains the metadata information processed by the key from the metadata server, wherein the permission of the data to be accessed signed by the private key may be generated by the client itself.
  • the client can use the public key to unlock the right to be accessed by the private key, it can be judged as being unpacked.
  • the additional conditions can be further added after the metadata server can use the public key to unlock the permission of the data to be accessed signed by the private key. When additional conditions are satisfied, it is determined that the permission to unlock the data to be accessed by the verification;
  • the acquiring data device 13 is configured to send the metadata information processed by the key to the data server 3, and after the data server 3 verifies the metadata information processed by the key, the The data server 3 acquires the to-be-accessed data, wherein the meta-processed element The data information is verified by the data server by the key.
  • the metadata server decrypts the right to be accessed by using the private key by using the public key, and after the authority verification of the unlocked data to be accessed is passed, the key processed by the key is generated.
  • the metadata information can implement access control to the metadata server, so that the security of the metadata server can be ensured, and in addition, the client is allowed to authenticate after the data server verifies the metadata information processed by the key.
  • the terminal obtains the to-be-accessed data from the data server, and can implement access control on the data server, so as to ensure the security of the data server, and finally achieve anti-counterfeiting of the client.
  • the client 1 further includes a sending expiration time means 14 for transmitting a request to be sent to the metadata server 2 with a private key.
  • the metadata server can use the public key to unlock the right to be accessed by the private key, the additional condition is further added, that is, the metadata server unlocks the to-be-accessed data according to the expiration time of the permission.
  • Capability can be defined as the following format:
  • Length indicates the length of Signarure
  • Signature represents the private key used to verify that the Permissions have been tampered with
  • ID indicates the ID number of Capability, which is unique
  • Permissions indicates the permissions of the data to be accessed.
  • the metadata server is configured to determine, according to a preset permission threshold, that the right to unlock the to-be-accessed data does not exceed the permission threshold. Verification passed. After the metadata server can use the public key to unlock the right to be accessed by the private key, the additional condition is further added, that is, the metadata server performs the unlocked data to be accessed according to the preset permission threshold. If the permission is determined not to exceed the permission threshold, it is determined that the additional condition is satisfied. When the unlocked data to be accessed is too large, and the preset permission threshold is exceeded, it is determined that the additional condition is not satisfied.
  • the metadata information processed by the key includes: metadata, partial metadata extracted from the metadata, and encryption with the key
  • the partial metadata here, you can deploy the same key (key) in the metadata server and the data server.
  • the key is stored. The key must be saved in a secure directory. It requires specific permissions to be opened to prevent the key from being stolen. The length of the key can be randomly selected.
  • the length cannot be Too short can not be too long, you can set the length of the key to 16 bytes (128 bits), the key (key) can be generated using the uuid of the Linux operating system, can be randomized by /proc/sys/kernel/random/uuid Generate a uuid code, you can also use the openssl command to generate a key key.
  • the client requests access to the metadata server and passes the verification of the unlocked data to be accessed, the metadata server returns to the client.
  • the metadata information of the end includes HMAC(key, msg')
  • the metadata may be serialized by the key processed metadata information and then sent to the client, and then sent to the client.
  • the client then sends the key processed metadata information after serialization to the data server, where the encryption algorithm for generating the partial metadata encrypted by the key is not limited to the HMAC algorithm, wherein HMAC a message authentication code that can use any iterative hash function available for encryption by bundling a shared key;
  • the data server 3 is configured to locally encrypt the received part of the received number with the key, and compare the result obtained by the local encryption with the received partial metadata encrypted by the key. If the comparison is consistent, the verification is passed; here, the data server receives the metadata information processed by the key after the serialization sent by the client, and after deserializing the received serialized information, Obtain a key (key) from the locally deployed file (key.txt), and use the key value to perform HMAC (Hash-based Message Authentication Code) algorithm on the received msg' field to obtain HMAC (key, msg').
  • HMAC Hash-based Message Authentication Code
  • HMAC key, msg'
  • received HMAC key, msg'
  • the obtaining data device 13 is configured to acquire the to-be-accessed data from the data server according to the metadata.
  • the metadata information processed by the key includes: metadata, partial metadata extracted from the metadata, and encryption with the key
  • the partial metadata and the expiration time of the metadata here, the metadata information returned by the metadata server to the client includes HMAC(key, msg')
  • the data server 3 is configured to use the key to perform a local number on the received portion Encrypting, and comparing the result obtained by local encryption with the received partial metadata encrypted by the key, and determining whether the metadata expires according to the expiration time of the metadata, if the comparison is consistent and the metadata is not If it expires, the verification is passed; here, the result obtained by the local encryption is compared with the received partial metadata encrypted by the key, and the condition of the comparison is satisfied, and another condition, that is, the data is needed.
  • the server determines that the metadata has not expired, and after both conditions are satisfied, it is determined that the verification is passed, and subsequent access to the data server can be performed, thereby implementing stricter verification of the metadata information verified by the key, and ensuring The credibility of the client.
  • the metadata server sets the expiration time (expire_time) of the client to access the data server. Once the expire_time expires, the data server can trigger a token expire event. A request will be sent to the client, and the client needs to re-request the metadata server after processing the key.
  • Metadata information
  • the acquiring data device 13 is configured to acquire the to-be-accessed data from the data server according to the metadata.
  • a metadata server for assisting data access is provided, and the metadata server 2 includes:
  • the receiving permission device 21 is configured to receive, from the client, the right to the data to be accessed signed by the private key; specifically, as shown in FIG. 2, the distributed file system architecture is involved by the three parties: the client end (client 1), NameNode side (metadata server 2), DataNode side (data server 3), the three-party communication can be based on the RPC protocol to communicate, based on the TCP/IP protocol, and the metadata server stores the metadata information of the data to be accessed. (meta), the metadata information is used to record the information of the location where the data to be accessed is stored on the data server, and the client obtains the required data to be accessed by directly obtaining the metadata information from the metadata server and then directly accessing the data server through the metadata information.
  • Access control for metadata servers can use Capability, a data structure for access control that defines one or more specified resources (such as directories, files, etc.). With access rights, capability authentication needs to include the private key (Signature) and the permissions of the data to be accessed (Permissions) for the client to metadata.
  • Server sending private Permissions of the data to be accessed issued by the key, the permission of the data to be accessed (Permissions) may be a list of permission sets, and each permission may have two fields: a permission set number resourceID and a permission set corresponding to the permission set number (permission) Bundle), you can set the number of data bits of the permission set as required. For example, you can set 32bits. Each bit represents a user-defined permission.
  • the permissions of the data to be accessed can include: READ (read permission), WRITE (write permission), ROOT (read and write permissions, equivalent to READ
  • the generating metadata device 22 is configured to use the public key to unlock the right to be accessed by the private key, and generate the metadata information processed by the key after verifying the unlocked data to be accessed;
  • the public key is a public key corresponding to the private key, so that the metadata server can use the public key to unlock the right to be accessed by the private key, and the client accesses the metadata server.
  • the metadata server sends the right to be accessed with the private key, the metadata server needs to verify the permission of the data to be accessed signed by the private key. If the verification is passed, the client can The metadata server obtains the metadata information processed by the key, and then continues the subsequent access to the data server.
  • the request format of the RPC protocol is: (/client1/ File1, READ)
  • the client will send the permission of the requested data to be accessed by the private key to the metadata server, and the client will send the data to the metadata server.
  • FIG. 3 For details of the content, refer to FIG. 3.
  • the message content includes: a message header (A), a message body (B) containing the specific request content, and a permission (C) of the data to be accessed signed by the private key
  • the client can use the protocolbuffer (*** a data exchange format) to transmit the message content, and then the metadata server obtains the permission of the data to be accessed signed by the private key, and then uses the public key to unlock the permission of the data to be accessed signed by the private key, and then solves the solution
  • the permission verification of the opened data to be accessed is passed, the metadata information processed by the key is generated, and the client obtains the metadata information processed by the key from the metadata server, where the private key is issued
  • the permission to access data may be generated by the client itself, or may be generated by another third party, and then obtained by the client from the third party.
  • the metadata server can further use the public key to unlock the permission of the data to be accessed issued by the private key, and further add additional conditions, and when the additional condition is satisfied at the same time, the solution is determined as a solution. The permission to open the data to be accessed is verified;
  • the sending metadata device 23 is configured to send the key processed metadata information to the client.
  • the metadata server decrypts the right to be accessed by using the private key by using the public key, and after the authority verification of the unlocked data to be accessed is passed, the key processed by the key is generated. Metadata information enables access control to the metadata server, which ensures the security of the metadata server.
  • the metadata server 2 further includes a receiving expiration time means 24 for receiving the data to be accessed from the client. Expiration of the permission (Expire);
  • the generating metadata device 22 is configured to verify that the authority of the unlocked data to be accessed is not expired according to the expiration time of the permission.
  • the metadata server can use the public key to unlock the right to be accessed by the private key, the additional condition is further added, that is, the metadata server unlocks the to-be-accessed data according to the expiration time of the permission.
  • the permission is judged to be unexpired, when the additional condition is satisfied at the same time, it is judged that the authority verification of the unlocked data to be accessed is passed, and the authority to access the data is more strictly verified, and the additional condition is not satisfied. In this case, the subsequent access to the data server by the client is not allowed, and the data security on the data server that needs to be accessed later is guaranteed.
  • Capability can be defined as the following format:
  • Length indicates the length of Signarure
  • Signature represents the private key used to verify that the Permissions have been tampered with
  • ID indicates the ID number of Capability, which is unique
  • Permissions indicates the permissions of the data to be accessed.
  • the generating metadata device 22 is configured to determine, according to a preset permission threshold, the authority of the unlocked data to be accessed as not exceeding the permission threshold. At the time, the verification is passed. After the metadata server can use the public key to unlock the right to be accessed by the private key, the additional condition is further added, that is, the metadata server performs the unlocked data to be accessed according to the preset permission threshold. If the permission is determined not to exceed the permission threshold, it is determined that the additional condition is satisfied. When the unlocked data to be accessed is too large, and the preset permission threshold is exceeded, it is determined that the additional condition is not satisfied.
  • the metadata information processed by the key includes: metadata, partial metadata extracted from the metadata, and using the key Part of the encrypted metadata.
  • the same key (key) can be deployed in the metadata server and the data server.
  • a same file (key.txt) can be deployed in the metadata server and the data server, and the key (key) is stored in the file.
  • the key must be saved in a secure directory, and requires specific permissions to be opened to prevent the key from being stolen.
  • the length of the key can be randomly selected. The length cannot be too short or too long.
  • the length of the key can be set to 16 bytes (128 bits), the key (key) can be generated using the uuid of the Linux operating system, and a uuid code can be randomly generated by /proc/sys/kernel/random/uuid. You can use the openssl command to generate a key.
  • the metadata information returned by the metadata server to the client includes HMAC (key).
  • msg, msg is metadata, where msg' is part of the metadata extracted from the metadata (msg), and HMAC (key, msg') is the key (key) ) and use the HMAC algorithm to encrypt the part Data (msg '),
  • the metadata can be used to serialize the metadata information processed by the key and then send it to the client, and the subsequent client sends the metadata information processed by the key after serialization to the data server, where
  • the encryption algorithm for generating the partial metadata encrypted by the key is not limited to the above HMAC algorithm, wherein the HMAC is a message authentication code, which can use any iterative hash function available for encryption by bundling a shared key. .
  • the metadata information processed by the key further includes: an expiration time of the metadata.
  • the metadata information returned by the metadata server to the client includes HMAC(key, msg')
  • the expiration time of the metadata (expire_time), such as msg' ⁇ FileID, READ/WRITE, expire_time ⁇ .
  • a data server for assisting data access comprising:
  • a metadata device 31 configured to acquire, by the client, metadata information processed by the key
  • the verification device 32 is configured to verify, by using the key, the metadata information processed by the key;
  • the data transmission device 33 is configured to transmit the to-be-accessed data to the client after verifying the metadata information processed by the key.
  • the client is allowed to obtain the to-be-accessed data from the data server, and the access control to the data server can be implemented. It can ensure the security of the data server and ultimately achieve the anti-forgery of the client.
  • the metadata information includes metadata, partial metadata extracted from the metadata, and partial metadata encrypted by the key
  • the data transmission device 33 is configured to perform local encryption on the received part of the received number with the key, and obtain the result obtained by local encryption and the received partial element encrypted by the key.
  • the data is compared, if the comparison is consistent, the verification is passed; and the to-be-accessed data is transmitted to the client according to the metadata.
  • the same key (key) is deployed as the data server. For example, you can deploy the same file (key.txt) in the metadata server and the data server. The file holds the key (key).
  • the length of the key can be randomly selected, the length can not be too short or too long, the length of the key can be set to 16 bytes (128 bits), the key (key) can be generated using the uuid of the Linux operating system. You can randomly generate a uuid code via /proc/sys/kernel/random/uuid, or you can use the openssl command to generate a secret. Key key.
  • the metadata information returned by the metadata server to the client includes HMAC(key, msg')
  • Partial metadata (msg') metadata can be After the key processing, the metadata information is serialized by the protocolbuffer and sent to the client, and the subsequent client sends the metadata information processed by the key after serialization to the data server, where the utility is generated.
  • the encryption algorithm for the partial metadata after the key encryption is not limited to the above HMAC algorithm, wherein the HMAC is a message authentication code, which can use any iterative hash function available for encryption by bundling a shared key, and the data server receives
  • the metadata information processed by the key after serialization sent by the client is deserialized after receiving the serialized information, and then the key is obtained from the locally deployed file (key.txt).
  • HMAC Hash-based Message Authentication Code
  • the data transmission device 33 when the metadata processed by the key includes: metadata, a partial element extracted from the metadata Data, the part of the metadata encrypted by the key, and the expiration time of the metadata, the data transmission device 33 is configured to locally encrypt the received part of the received key with the key, and localize The result obtained by the encryption is compared with the received partial metadata encrypted by the key, and the metadata is judged to be expired according to the expiration time of the metadata. If the comparison is consistent and the metadata is not expired, the verification is passed. Transmitting the to-be-accessed data to the client according to the metadata.
  • the metadata information returned by the metadata server to the client includes HMAC(key, msg')
  • a more consistent condition also requires another condition, that is, the data server determines that the metadata has not expired, and after both conditions are satisfied, it is determined that the verification is passed, and subsequent access to the data server can be performed, thereby implementing the confidentiality.
  • the metadata server can set the expiration time (expire_time) of the data server by the client. Once the expire_time expires, the data server can Trigger a token expire event, the expiration event will send a request to the client, the client needs to re-request to the metadata server Metadata key information after processing.
  • a specific application embodiment of the present application includes the following steps:
  • Step S111 the client sends the permission of the data to be accessed signed by the private key to the metadata server;
  • Step S112 the metadata server uses the public key to unlock the right to be accessed by the private key, and generates the metadata information processed by the key after verifying the unlocked data to be accessed.
  • Step S113 the client acquires the metadata information processed by the key from the metadata server, and sends the metadata information processed by the key to the data server;
  • Step S114 the data server processes the number of elements processed by the key by using the key Verify according to the information
  • Step S115 After the data server verifies the metadata information processed by the key, the client acquires the to-be-accessed data from the data server.
  • the application decrypts the right to be accessed by the private key by using the public key by the metadata server, and generates the secret by verifying the permission of the unlocked data to be accessed.
  • the key processed metadata information can implement access control to the metadata server, so that the security of the metadata server can be ensured, and after the data server verifies the metadata information processed by the key,
  • the client is allowed to obtain the data to be accessed from the data server, and the access control of the data server can be implemented, thereby ensuring the security of the data server, and finally realizing the anti-forgery of the client.
  • the application further adds an additional condition, that is, the metadata server is unlocked according to the expiration time of the permission.
  • the permission of the data to be accessed is judged to be unexpired, when the additional condition is satisfied at the same time, it is judged that the authority to verify the unlocked data is passed, and the authority to access the data is more strictly verified, and If the additional conditions are met, the client's subsequent access to the data server is not allowed, and the data security on the data server that needs to be accessed later is guaranteed.
  • the application further adds an additional condition, that is, the metadata server is unpacked according to the preset permission threshold. If the permission to access the data is determined not to exceed the permission threshold, it is determined that the additional condition is satisfied. When the unlocked data to be accessed is too large, and the preset permission threshold is exceeded, it is determined that the additional condition is not satisfied. Condition, when the additional conditions are satisfied at the same time, it is judged that the authority verification of the unlocked data to be accessed is passed, and the authority to access the data is more strictly verified, and the case where the additional condition is not satisfied is not allowed. The client subsequently accesses the data server to ensure data security on the data server that needs to be accessed later.
  • the data server in the application uses the key pair to receive the part without The number is locally encrypted, and the result obtained by the local encryption is compared with the received partial metadata encrypted by the key, and if the comparison is consistent, the verification is passed because the client does not have a key. Indicates that the client is trusted so that the client can establish a trusted connection with the data server and securely transfer the data to be accessed.
  • the data server in the present application locally encrypts the received part of the received number with the key, and obtains the result obtained by local encryption and the received partial metadata encrypted by the key. Comparing and judging whether the metadata expires according to the expiration time of the metadata, and satisfying the relatively consistent condition, and another condition is required, that is, the data server determines that the metadata has not expired, and both conditions are satisfied, and then it is determined that After the verification is passed, the subsequent access to the data server can be performed, so that the verification of the metadata information after the key processing is more strictly verified, and the credibility of the client is ensured.
  • the present invention can be implemented in software and/or a combination of software and hardware, for example, using an application specific integrated circuit (ASIC), a general purpose computer, or any other similar hardware device.
  • the software program of the present invention may be executed by a processor to implement the steps or functions described above.
  • the software program (including related data structures) of the present invention can be stored in a computer readable recording medium such as a RAM memory, a magnetic or optical drive or a floppy disk and the like.
  • some of the steps or functions of the present invention may be implemented in hardware, for example, as a circuit that cooperates with a processor to perform various steps or functions.
  • a portion of the invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide a method and/or solution in accordance with the present invention.
  • the program instructions that invoke the method of the present invention may be stored in a fixed or removable recording medium, and/or by broadcast or other signals.
  • the data stream in the media is transmitted and/or stored in a working memory of a computer device operating in accordance with the program instructions.
  • an embodiment in accordance with the present invention includes a device including a memory for storing computer program instructions and a processor for executing program instructions, wherein when the computer program instructions are executed by the processor, triggering
  • the apparatus operates based on the aforementioned methods and/or technical solutions in accordance with various embodiments of the present invention.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Storage Device Security (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请提供一种数据访问的方法及设备,本申请通过所述元数据服务器用公钥解开所述用私钥签发的待访问数据的权限,并对解开的待访问数据的权限验证通过后,生成所述由密钥加工后的元数据信息,可以实现对元数据服务器的访问控制,这样可以确保元数据服务器的安全性,另外,在所述数据服务器对所述由密钥加工后的元数据信息验证通过后,才允许客户端从所述数据服务器获取所述待访问数据,可以实现对数据服务器的访问控制,这样可以确保数据服务器的安全性,最终实现客户端的抗伪造性。

Description

一种数据访问的方法及设备 技术领域
本申请涉及计算机领域,尤其涉及一种数据访问的方法及设备。
背景技术
随着大数据时代的到来,为了解决分布式环境下海量数据的存储问题,怎么能够利用价格低廉的普通机器来实现海量数据的存储问题,提出了分布式文件***HDFS。后来这个HDFS***的架构基本成为了分布式文件***的通用框架。分布式文件***或多或少都存在网络安全相关的威胁。尤其是在公有云中不可信用户的访问,数据必须要做到相互隔离,用户访问数据需要具备一定的访问控制权限。分布式文件***中,元数据服务器(NameNode),用于存储用户文件的元数据信息。数据服务器(DataNode),用于存储用户文件的数据信息,元数据服务器(NameNode)和数据服务器(DataNode)都会由客户端(client)即访问分布式文件***的用户来访问,客户端的信息容易被篡改,因此需要做一定的访问控制策略,做到用户与数据的隔离,保证安全。
在现有的分布式文件***中,业界没有较好的实现访问控制策略。通常使用ACL方式设置用户的权限,ACL即访问控制列表,是一种基于对象的授权,这种方式是以访问的对象为出发点,但是黑客还是可以篡改数据服务器上的数据,对于元数据服务器和数据服务器之间的权限安全控制问题,目前业界并没有好的解决方案。
发明内容
本申请的一个目的是提供一种用于数据访问的方法及设备,能够解决进行数据访问时,元数据服务器和数据服务器之间的权限安全控制问题。
根据本申请的一个方面,提供了一种客户端用于数据访问的方法,该方法包括:
向元数据服务器发送用私钥签发的待访问数据的权限;
从元数据服务器获取由密钥加工后的元数据信息,其中,所述用私钥签发的待访问数据的权限由所述元数据服务器用公钥解开,所述由密钥加工后的元数据信息由所述元数据服务器对解开的待访问数据的权限验证通过后生成;
将所述由密钥加工后的元数据信息发送至数据服务器,待所述数据服务器对所述由密钥加工后的元数据信息验证通过后,从所述数据服务器获取所述待访问数据,其中,所述由密钥加工后的元数据信息由所述数据服务器通过所述密钥进行验证。
进一步的,上述方法中,向元数据服务器发送用私钥签发的待访问数据的权限的同时,还包括:
向元数据服务器发送所述待访问数据的权限的过期时间;
所述元数据服务器对解开的待访问数据的权限验证通过,包括:
所述元数据服务器根据所述权限的过期时间对解开的待访问数据的权限判断为未过期时,则验证通过。
进一步的,上述方法中,所述元数据服务器对解开的待访问数据的权限验证通过,包括:
所述元数据服务器根据预设的权限阈值对解开的待访问数据的权限判断为未超过所述权限阈值时,则验证通过。
进一步的,上述方法中,所述由密钥加工后的元数据信息包括:
元数据、从所述元数据中提取的部分元数据及用所述密钥加密后的部分元数据;
所述数据服务器对所述由密钥加工后的元数据信息验证通过,包括:
所述数据服务器用所述密钥对接收到的所述部分无数进行本地加密,并 将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,如果比较一致,则验证通过;
从所述数据服务器获取所述待访问数据,包括:
根据所述元数据从所述数据服务器获取所述待访问数据。
进一步的,上述方法中,所述由密钥加工后的元数据信息包括:
元数据、从所述元数据中提取的部分元数据、用所述密钥加密后的部分元数据及元数据的过期时间;
所述数据服务器对所述由密钥加工后的元数据信息验证通过,包括:
所述数据服务器用所述密钥对接收到的所述部分无数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,并根据所述元数据的过期时间判断元数据是否过期,如果比较一致且元数据未过期,则验证通过;
从所述数据服务器获取所述待访问数据,包括:
根据所述元数据从所述数据服务器获取所述待访问数据。
根据本申请的另一面还提供一种元数据服务器端用于辅助数据访问的方法,该方法包括:
从客户端接收用私钥签发的待访问数据的权限;
用公钥解开所述用私钥签发的待访问数据的权限,对解开的待访问数据的权限验证通过后生成由密钥加工后的元数据信息;
将所述由密钥加工后的元数据信息发送至所述客户端。
进一步的,上述方法中,从客户端接收用私钥签发的待访问数据的权限的同时,还包括:
从所述客户端接收所述待访问数据的权限的过期时间;
对解开的待访问数据的权限验证通过,包括:
根据所述权限的过期时间对解开的待访问数据的权限判断为未过期 时,则验证通过。
进一步的,上述方法中,对解开的待访问数据的权限验证通过,包括:
根据预设的权限阈值对解开的待访问数据的权限判断为未超过所述权限阈值时,则验证通过。
进一步的,上述方法中,所述由密钥加工后的元数据信息包括:
元数据、从所述元数据中提取的部分元数据及用所述密钥加密后的部分元数据。
进一步的,上述方法中,所述由密钥加工后的元数据信息还包括:
元数据的过期时间。
根据本申请的另一面,还提供一种数据服务器端用于辅助数据访问的方法,该方法包括:
从客户端获取由密钥加工后的元数据信息;
通过所述密钥对所述由密钥加工后的元数据信息进行验证;
对所述由密钥加工后的元数据信息验证通过后,向所述客户端传输所述待访问数据。
进一步的,上述方法中,当所述元数据信息包括元数据、从所述元数据中提取的部分元数据及用所述密钥加密后的部分元数据时,对所述由密钥加工后的元数据信息验证通过后,向所述客户端传输所述待访问数据,包括:
用所述密钥对接收到的所述部分无数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,如果比较一致,则验证通过;
根据所述元数据向所述客户端传输所述待访问数据。
进一步的,上述方法中,当所述由密钥加工后的元数据信息包括:元数据、从所述元数据中提取的部分元数据、用所述密钥加密后的部分元数 据及元数据的过期时间时,对所述由密钥加工后的元数据信息验证通过后,向所述客户端传输所述待访问数据,包括:
所述数据服务器用所述密钥对接收到的所述部分无数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,并根据所述元数据的过期时间判断元数据是否过期,如果比较一致且元数据未过期,则验证通过;
根据所述元数据向所述客户端传输所述待访问数据。
根据本申请的另一面还提供一种用于数据访问的客户端,该客户端包括:
发送权限装置,用于向元数据服务器发送用私钥签发的待访问数据的权限;
获取元数据装置,用于从元数据服务器获取由密钥加工后的元数据信息,其中,所述用私钥签发的待访问数据的权限由所述元数据服务器用公钥解开,所述由密钥加工后的元数据信息由所述元数据服务器对解开的待访问数据的权限验证通过后生成;
获取数据装置,用于将所述由密钥加工后的元数据信息发送至数据服务器,待所述数据服务器对所述由密钥加工后的元数据信息验证通过后,从所述数据服务器获取所述待访问数据,其中,所述由密钥加工后的元数据信息由所述数据服务器通过所述密钥进行验证。
进一步的,上述客户端中,所述客户端还包括发送过期时间装置,用于在向元数据服务器发送用私钥签发的待访问数据的权限的同时,向元数据服务器发送所述待访问数据的权限的过期时间,其中,所述元数据服务器,用于根据所述权限的过期时间对解开的待访问数据的权限判断为未过期时,则验证通过。
进一步的,上述客户端中,所述元数据服务器,用于根据预设的权限 阈值对解开的待访问数据的权限判断为未超过所述权限阈值时,则验证通过。
进一步的,上述客户端中,所述由密钥加工后的元数据信息包括:元数据、从所述元数据中提取的部分元数据及用所述密钥加密后的部分元数据;
所述数据服务器,用于用所述密钥对接收到的所述部分无数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,如果比较一致,则验证通过;
获取数据装置,用于根据所述元数据从所述数据服务器获取所述待访问数据。
进一步的,上述客户端中,所述由密钥加工后的元数据信息包括:元数据、从所述元数据中提取的部分元数据、用所述密钥加密后的部分元数据及元数据的过期时间;
所述数据服务器,用于用所述密钥对接收到的所述部分无数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,并根据所述元数据的过期时间判断元数据是否过期,如果比较一致且元数据未过期,则验证通过;
所述获取数据装置,用于根据所述元数据从所述数据服务器获取所述待访问数据。
根据本申请的另一面还提供一种辅助数据访问的元数据服务器,该元数据服务器包括:
接收权限装置,用于从客户端接收用私钥签发的待访问数据的权限;
生成元数据装置,用于用公钥解开所述用私钥签发的待访问数据的权限,对解开的待访问数据的权限验证通过后生成由密钥加工后的元数据信息;
发送元数据装置,用于将所述由密钥加工后的元数据信息发送至所述客户端。
进一步的,上述元数据服务器中,所述元数据服务器还包括接收过期时间装置,用于从所述客户端接收所述待访问数据的权限的过期时间;
所述生成元数据装置,用于根据所述权限的过期时间对解开的待访问数据的权限判断为未过期时,则验证通过。
进一步的,上述元数据服务器中,所述生成元数据装置,用于根据预设的权限阈值对解开的待访问数据的权限判断为未超过所述权限阈值时,则验证通过。
进一步的,上述元数据服务器中,所述由密钥加工后的元数据信息包括:元数据、从所述元数据中提取的部分元数据及用所述密钥加密后的部分元数据。
进一步的,上述元数据服务器中,所述由密钥加工后的元数据信息还包括:元数据的过期时间。
根据本申请的另一面还提供一种辅助数据访问的数据服务器,其中,该数据服务器包括:
元数据装置,用于从客户端获取由密钥加工后的元数据信息;
验证装置,用于通过所述密钥对所述由密钥加工后的元数据信息进行验证;
数据传输装置,用于对所述由密钥加工后的元数据信息验证通过后,向所述客户端传输所述待访问数据。
进一步的,上述数据服务器中,当所述元数据信息包括元数据、从所述元数据中提取的部分元数据及用所述密钥加密后的部分元数据时,所述数据传输装置,用于用所述密钥对接收到的所述部分无数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行 比较,如果比较一致,则验证通过;根据所述元数据向所述客户端传输所述待访问数据。
进一步的,上述数据服务器中,当所述由密钥加工后的元数据信息包括:元数据、从所述元数据中提取的部分元数据、用所述密钥加密后的部分元数据及元数据的过期时间时,所述数据传输装置,用于用所述密钥对接收到的所述部分无数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,并根据所述元数据的过期时间判断元数据是否过期,如果比较一致且元数据未过期,则验证通过;根据所述元数据向所述客户端传输所述待访问数据。
与现有技术相比,本申请通过所述元数据服务器用公钥解开所述用私钥签发的待访问数据的权限,并对解开的待访问数据的权限验证通过后,生成所述由密钥加工后的元数据信息,可以实现对元数据服务器的访问控制,这样可以确保元数据服务器的安全性,另外,在所述数据服务器对所述由密钥加工后的元数据信息验证通过后,才允许客户端从所述数据服务器获取所述待访问数据,可以实现对数据服务器的访问控制,这样可以确保数据服务器的安全性,最终实现客户端的抗伪造性。
进一步的,本申请在元数据服务器能够利用公钥解开用私钥签发的待访问数据的权限后,进一步增加附加的条件,即所述元数据服务器根据所述权限的过期时间对解开的待访问数据的权限判断为未过期时,当同时满足此附加的条件的时候,才判断为对解开的待访问数据的权限验证通过,进而更严格地对待访问数据的权限进行验证,对不满足附加条件的情况,则不充许客户端后续对数据服务器的访问,保证后续需要访问的数据服务器上的数据安全性。
进一步的,本申请在元数据服务器能够利用公钥解开用私钥签发的待访问数据的权限后,进一步增加附加的条件,即所述元数据服务器根据预设的权限阈值对解开的待访问数据的权限判断为未超过所述权限阈值时,则 判断为满足附加的条件,当解开的待访问数据的权限过大,超过所述预设的权限阈值,则判断为不满足附加的条件,当同时满足附加的条件的时候,才判断为对解开的待访问数据的权限验证通过,进而更严格地对待访问数据的权限进行验证,对不满足附加条件的情况,则不充许客户端后续对数据服务器的访问,保证后续需要访问的数据服务器上的数据安全性。
进一步的,本申请中所述数据服务器用所述密钥对接收到的所述部分无数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,在如果比较一致,才验证通过,因为客户端没有密钥(key),说明客户端是可信的,这样,客户端就可以与数据服务器建立可信连接,就可以安全地传输待访问数据。
进一步的,本申请中所述数据服务器用所述密钥对接收到的所述部分无数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,并根据所述元数据的过期时间判断元数据是否过期,满足比较一致的条件同时,还需要另一条件,即数据服务器判断元数据未过期,两个条件都满足后,才判断为验证通过,可以进行后续对数据服务器的访问,从而实现对所述由密钥加工后的元数据信息验证更严格的验证,保证客户端的可信度。
附图说明
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:
图1示出根据本申请一个方面的一种客户端用于数据访问的方法的流程图;
图2示出本申请一个实施例的分布式文件***架构图;
图3示出根据本申请一个实施例的客户端会向元数据服务器发送的消息内容示意图;
图4示出根据本申请另一个方面的元数据服务器端用于辅助数据访问的方法的流程图;
图5示出根据本申请另一个方面的数据服务器端用于辅助数据访问的方法的流程图;
图6示出根据本申请另一个方面的用于数据访问的客户端的模块图;
图7示出根据本申请一个优选实施例的用于数据访问的客户端的模块图;
图8示出根据本申请另一个方面的辅助数据访问的元数据服务器的模块图;
图9示出根据本申请一个优选实施例的辅助数据访问的元数据服务器的模块图;
图10示出根据本申请另一个方面的辅助数据访问的数据服务器的模块图;
图11示出根据本申请一个具体应用实施例的流程图。
附图中相同或相似的附图标记代表相同或相似的部件。
具体实施方式
下面结合附图对本发明作进一步详细描述。
在本申请一个典型的配置中,终端、服务网络的设备和可信方均包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相 变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
如图1所示,本申请提供一种客户端用于数据访问的方法,其中,该方法包括:
步骤S11,向元数据服务器发送用私钥签发的待访问数据的权限;具体的,如图2所示,分布式文件***架构由三方来参与:Client端(客户端1)、NameNode端(元数据服务器2)、DataNode端(数据服务器3),其中,图中HA(High Available)为高可用性集群,是保证业务连续性的有效解决方案,一般有两个或两个以上的节点,且分为活动节点及备用节点,这三方的通信可以是基于RPC协议来通信,建立在TCP/IP协议之上,元数据服务器存储着待访问数据的元数据信息(meta),元数据信息用于记录待访问数据在数据服务器上存储位置的信息,客户端通过从元数据服务器获取元数据信息,然后通过元数据信息直接访问数据服务器获取所需要的待访问数据,对于元数据服务器的访问控制可以使用能力鉴权(Capability)的方式,Capability是用于访问控制的一种数据结构,其定义了对一个或多个指定的资源(如目录、文件等)所具有的访问权限,能力鉴权需要包括私钥(Signature)和待访问数据的权限(Permissions),以便客户端向元数据服务器发送用私钥签发的待访问数据的权限,在此待访问数据的权限(Permissions)可以是一个权限集合列表,每一个permission可以有两个字段:权限集合编号resourceID和对应于权限集合编号的权限集合(permission bundle),可以根据需要设置权限 集合的数据位数,如可设置32bits,每个bit表示用户定义的一个权限,待访问数据的权限可以包括:READ(读权限)、WRITE(写权限)、ROOT(读写权限,等价于READ|WRITE);
步骤S12,从元数据服务器获取由密钥加工后的元数据信息,其中,所述用私钥签发的待访问数据的权限由所述元数据服务器用公钥解开,所述由密钥加工后的元数据信息由所述元数据服务器对解开的待访问数据的权限验证通过后生成;在此,所述公钥是对应于所述私钥的公钥,以方便所述元数据服务器用公钥解开所述用私钥签发的待访问数据的权限,当客户端去访问元数据服务器的时候,向元数据服务器发送用私钥签发的待访问数据的权限,然后元数据服务器拿到该用私钥签发的待访问数据的权限之后需要作验证,如果验证通过,客户端就可以从元数据服务器获取由密钥加工后的元数据信息,进而继续后续对数据服务器的访问,例如,当客户端client1请求读取待访问数据file1的内容,RPC协议下请求格式为:(/client1/file1,READ),客户端会向元数据服务器发送该请求的用私钥签发的待访问数据的权限,这个时候客户端会向元数据服务器发送的消息内容具体可参见图3,消息内容包括:消息头(A)、包含具体请求内容的消息体(B)及用私钥签发的待访问数据的权限(C),客户端可用protocolbuffer(***的一种数据交换的格式)格式来传输消息内容,然后元数据服务器拿到用私钥签发的待访问数据的权限之后,利用公钥解开用私钥签发的待访问数据的权限,然后对解开的待访问数据的权限验证通过后生成所述由密钥加工后的元数据信息,客户端从元数据服务器获取由密钥加工后的元数据信息,其中,所述用私钥签发的待访问数据的权限可由客户端自己生成,也可由另外的第三方生成后,由客户端从所述第三方获取,另外,当客户端能够利用公钥解开用私钥签发的待访问数据的权限,即可判断为对解开的待访问数据的权限验证通过,也可以在元数据服务器能够利用公钥解开用私钥签发的待访问数据的权限后,进一步增加附加的条件,当同时 满足附加的条件的时候,才判断为对解开的待访问数据的权限验证通过;
步骤S13,将所述由密钥加工后的元数据信息发送至数据服务器,待所述数据服务器对所述由密钥加工后的元数据信息验证通过后,从所述数据服务器获取所述待访问数据,其中,所述由密钥加工后的元数据信息由所述数据服务器通过所述密钥进行验证。本实施例通过所述元数据服务器用公钥解开所述用私钥签发的待访问数据的权限,并对解开的待访问数据的权限验证通过后,生成所述由密钥加工后的元数据信息,可以实现对元数据服务器的访问控制,这样可以确保元数据服务器的安全性,另外,在所述数据服务器对所述由密钥加工后的元数据信息验证通过后,才允许客户端从所述数据服务器获取所述待访问数据,可以实现对数据服务器的访问控制,这样可以确保数据服务器的安全性,最终实现客户端的抗伪造性。
本申请的客户端用于数据访问的方法一优选的实施例中,步骤S11,向元数据服务器发送用私钥签发的待访问数据的权限的同时,还包括:
向元数据服务器发送所述待访问数据的权限的过期时间(Expire);
所述元数据服务器对解开的待访问数据的权限验证通过,包括:
所述元数据服务器根据所述权限的过期时间(Expire)对解开的待访问数据的权限判断为未过期时,则验证通过。在元数据服务器能够利用公钥解开用私钥签发的待访问数据的权限后,在此进一步增加附加的条件,即所述元数据服务器根据所述权限的过期时间对解开的待访问数据的权限判断为未过期时,当同时满足此附加的条件的时候,才判断为对解开的待访问数据的权限验证通过,进而更严格地对待访问数据的权限进行验证,对不满足附加条件的情况,则不充许客户端后续对数据服务器的访问,保证后续需要访问的数据服务器上的数据安全性。详细的,在分布式文件***中,能力鉴权(Capability)可定义为如下格式:
Length Signature ID Expire Permissions
其中:Length表示Signarure的长度;
      Signature表示私钥,用于验证Permissions是否被篡改;
      ID表示Capability的ID号,是唯一的;
      Expire表示该Capability的过期时间;
      Permissions表示待访问数据的权限。
本申请的客户端用于数据访问的方法一优选的实施例中,所述元数据服务器对解开的待访问数据的权限验证通过,包括:
所述元数据服务器根据预设的权限阈值对解开的待访问数据的权限判断为未超过所述权限阈值时,则验证通过。在元数据服务器能够利用公钥解开用私钥签发的待访问数据的权限后,在此进一步增加附加的条件,即所述元数据服务器根据预设的权限阈值对解开的待访问数据的权限判断为未超过所述权限阈值时,则判断为满足附加的条件,当解开的待访问数据的权限过大,超过所述预设的权限阈值,则判断为不满足附加的条件,当同时满足附加的条件的时候,才判断为对解开的待访问数据的权限验证通过,进而更严格地对待访问数据的权限进行验证,对不满足附加条件的情况,则不充许客户端后续对数据服务器的访问,保证后续需要访问的数据服务器上的数据安全性。
本申请的客户端用于数据访问的方法一优选的实施例中,所述由密钥加工后的元数据信息包括:
元数据、从所述元数据中提取的部分元数据及用所述密钥加密后的部分元数据;在此,可以在元数据服务器和数据服务器部署相同的密钥(key),例如,可以在元数据服务器和数据服务器部署一个同样的文件(key.txt),该文件里保存着密钥(key),该密钥(key)必须要保存在一个安全的目录,需要特定权限才可以打开,以防止密钥被窃取,密钥(key)的长度可以随机选取,长度不能太短也不能太长,可设定key的长度为16字节(128位),密钥(key)可以使用linux操作***的uuid生成,可以通过 /proc/sys/kernel/random/uuid来随机生成一个uuid码,也可以使用openssl命令来生成一个密钥key,另外,客户端请求访问元数据服务器并通过对解开的待访问数据的权限的验证的时候,元数据服务器返回给客户端的元数据信息包括HMAC(key,msg’)|msg’|msg,msg为元数据,其中,msg’为从所述元数据(msg)中提取的部分元数据,HMAC(key,msg’)为用所述密钥(key)并采用HMAC算法加密后的部分元数据(msg’),元数据可对由密钥加工后的元数据信息进行protocolbuffer序列化之后将其发送给客户端,后续客户再将序列化之后的由密钥加工后的元数据信息发送至数据服务器,在此,生成所述用所述密钥加密后的部分元数据的加密算法不限于上述HMAC算法,其中,HMAC为消息认证码,其通过捆绑一个共享密钥可以使用任何迭代的可用于加密的散列函数;
所述数据服务器对所述由密钥加工后的元数据信息验证通过,包括:
所述数据服务器用所述密钥对接收到的所述部分无数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,如果比较一致,则验证通过;在此,数据服务器收到客户端发来的序列化之后的由密钥加工后的元数据信息,针对接收到的序列化后的信息进行反序列化之后,从本地部署的文件(key.txt)中获取密钥(key),利用该key值对接收的msg’字段进行HMAC(Hash-based Message Authentication Code)算法得到HMAC(key,msg’),看得到的HMAC(key,msg’)和接收到的HMAC(key,msg’)是否一样,如果一样就可以确定接收到的由密钥加工后的元数据信息是从元数据服务器获取到的,因为客户端没有密钥(key),说明客户端是可信的,这样,客户端就可以与数据服务器建立可信连接,就可以安全地传输待访问数据了;
步骤S13中的从所述数据服务器获取所述待访问数据,包括:
根据所述元数据从所述数据服务器获取所述待访问数据。
本申请的客户端用于数据访问的方法一优选的实施例中,所述由密钥 加工后的元数据信息包括:
元数据、从所述元数据中提取的部分元数据、用所述密钥加密后的部分元数据及元数据的过期时间;在此,以上述元数据服务器返回给客户端的元数据信息包括HMAC(key,msg’)|msg’|msg为例,可以在用所述密钥加密后的部分元数据(msg’)中设置元数据的过期时间(expire_time),如msg’={FileID,READ/WRITE,expire_time};
所述数据服务器对所述由密钥加工后的元数据信息验证通过,包括:
所述数据服务器用所述密钥对接收到的所述部分无数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,并根据所述元数据的过期时间判断元数据是否过期,如果比较一致且元数据未过期,则验证通过;在此,在将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,满足比较一致的条件同时,还需要另一条件,即数据服务器判断元数据未过期,两个条件都满足后,才判断为验证通过,可以进行后续对数据服务器的访问,从而实现对所述由密钥加工后的元数据信息验证更严格的验证,保证客户端的可信度,详细的,元数据服务器通过设置客户端访问数据服务器的过期时间(expire_time),一旦这个expire_time到期之后,数据服务器可以触发一个到期(token expire)事件,该到期事件会发个请求给客户端,客户端需要重新向元数据服务器请求由密钥加工后的元数据信息;
步骤S13中的从所述数据服务器获取所述待访问数据,包括:
根据所述元数据从所述数据服务器获取所述待访问数据。
如图4所示,根据本申请的另一面还提供一种元数据服务器端用于辅助数据访问的方法,该方法包括:
步骤S21,从客户端接收用私钥签发的待访问数据的权限;具体的,如图2所示,分布式文件***架构由三方来参与的:Client端(客户端1)、NameNode端(元数据服务器2)、DataNode端(数据服务器3),这三方的通信 可以是基于RPC协议来通信,建立在TCP/IP协议之上,元数据服务器存储着待访问数据的元数据信息(meta),元数据信息用于记录待访问数据在数据服务器上存储位置的信息,客户端通过从元数据服务器获取元数据信息,然后通过元数据信息直接访问数据服务器获取所需要的待访问数据,对于元数据服务器的访问控制可以使用能力鉴权(Capability)的方式,Capability是用于访问控制的一种数据结构,其定义了对一个或多个指定的资源(如目录、文件等)所具有的访问权限,能力鉴权需要包括私钥(Signature)和待访问数据的权限(Permissions),以便客户端向元数据服务器发送用私钥签发的待访问数据的权限,在此待访问数据的权限(Permissions)可以是一个权限集合列表,每一个permission可以有两个字段:权限集合编号resourceID和对应于权限集合编号的权限集合(permission bundle),可以根据需要设置权限集合的数据位数,如可设置32bits,每个bit表示用户定义的一个权限,待访问数据的权限可以包括:READ(读权限)、WRITE(写权限)、ROOT(读写权限,等价于READ|WRITE);
步骤S22,用公钥解开所述用私钥签发的待访问数据的权限,对解开的待访问数据的权限验证通过后生成由密钥加工后的元数据信息;在此,所述公钥是对应于所述私钥的公钥,以方便所述元数据服务器用公钥解开所述用私钥签发的待访问数据的权限,当客户端去访问元数据服务器的时候,向元数据服务器发送用私钥签发的待访问数据的权限,然后元数据服务器拿到该用私钥签发的待访问数据的权限之后需要作验证,如果验证通过,客户端就可以从元数据服务器获取由密钥加工后的元数据信息,进而继续后续对数据服务器的访问,例如,当客户端client1请求读取待访问数据file1的内容,RPC协议下请求格式为:(/client1/file1,READ),客户端会向元数据服务器发送该请求的用私钥签发的待访问数据的权限,这个时候客户端会向元数据服务器发送的消息内容具体可参见图3,消息内容包括:消息头(A)、包含具体请求内容的消息体(B)及用私钥签发的待访问数 据的权限(C),客户端可用protocolbuffer(***的一种数据交换的格式)格式来传输消息内容,然后元数据服务器拿到用私钥签发的待访问数据的权限之后,利用公钥解开用私钥签发的待访问数据的权限,然后对解开的待访问数据的权限验证通过后生成所述由密钥加工后的元数据信息,客户端从元数据服务器获取由密钥加工后的元数据信息,其中,所述用私钥签发的待访问数据的权限可由客户端自己生成,也可由另外的第三方生成后,由客户端从所述第三方获取,另外,当客户端能够利用公钥解开用私钥签发的待访问数据的权限,即可判断为对解开的待访问数据的权限验证通过,也可以在元数据服务器能够利用公钥解开用私钥签发的待访问数据的权限后,进一步增加附加的条件,当同时满足附加的条件的时候,才判断为对解开的待访问数据的权限验证通过;
步骤S23,将所述由密钥加工后的元数据信息发送至所述客户端。本实施例通过所述元数据服务器用公钥解开所述用私钥签发的待访问数据的权限,并对解开的待访问数据的权限验证通过后,生成所述由密钥加工后的元数据信息,可以实现对元数据服务器的访问控制,这样可以确保元数据服务器的安全性。
本申请的元数据服务器端用于辅助数据访问的方法一优选的实施例中,从客户端接收用私钥签发的待访问数据的权限的同时,还包括:
从所述客户端接收所述待访问数据的权限的过期时间(Expire);
步骤S22中的对解开的待访问数据的权限验证通过,包括:
根据所述权限的过期时间对解开的待访问数据的权限判断为未过期时,则验证通过。在元数据服务器能够利用公钥解开用私钥签发的待访问数据的权限后,在此进一步增加附加的条件,即所述元数据服务器根据所述权限的过期时间对解开的待访问数据的权限判断为未过期时,当同时满足此附加的条件的时候,才判断为对解开的待访问数据的权限验证通过,进而更严格地对待访问数据的权限进行验证,对不满足附加条件的情况, 则不充许客户端后续对数据服务器的访问,保证后续需要访问的数据服务器上的数据安全性。详细的,在分布式文件***中,能力鉴权(Capability)可定义为如下格式:
Length Signature ID Expire Permissions
其中:Length表示Signarure的长度;
      Signature表示私钥,用于验证Permissions是否被篡改;
      ID表示Capability的ID号,是唯一的;
      Expire表示该Capability的过期时间;
      Permissions表示待访问数据的权限。
本申请的元数据服务器端用于辅助数据访问的方法一优选的实施例中,步骤S22中的对解开的待访问数据的权限验证通过,包括:
根据预设的权限阈值对解开的待访问数据的权限判断为未超过所述权限阈值时,则验证通过。在元数据服务器能够利用公钥解开用私钥签发的待访问数据的权限后,在此进一步增加附加的条件,即所述元数据服务器根据预设的权限阈值对解开的待访问数据的权限判断为未超过所述权限阈值时,则判断为满足附加的条件,当解开的待访问数据的权限过大,超过所述预设的权限阈值,则判断为不满足附加的条件,当同时满足附加的条件的时候,才判断为对解开的待访问数据的权限验证通过,进而更严格地对待访问数据的权限进行验证,对不满足附加条件的情况,则不充许客户端后续对数据服务器的访问,保证后续需要访问的数据服务器上的数据安全性。
本申请的元数据服务器端用于辅助数据访问的方法一优选的实施例中,所述由密钥加工后的元数据信息包括:
元数据、从所述元数据中提取的部分元数据及用所述密钥加密后的部分元数据。在此,可以在元数据服务器和数据服务器部署相同的密钥(key), 例如,可以在元数据服务器和数据服务器部署一个同样的文件(key.txt),该文件里保存着密钥(key),该密钥(key)必须要保存在一个安全的目录,需要特定权限才可以打开,以防止密钥被窃取,密钥(key)的长度可以随机选取,长度不能太短也不能太长,可设定key的长度为16字节(128位),密钥(key)可以使用linux操作***的uuid生成,可以通过/proc/sys/kernel/random/uuid来随机生成一个uuid码,也可以使用openssl命令来生成一个密钥key,另外,客户端请求访问元数据服务器并通过对解开的待访问数据的权限的验证的时候,元数据服务器返回给客户端的元数据信息包括HMAC(key,msg’)|msg’|msg,msg为元数据,其中,msg’为从所述元数据(msg)中提取的部分元数据,HMAC(key,msg’)为用所述密钥(key)并采用HMAC算法加密后的部分元数据(msg’),元数据可对由密钥加工后的元数据信息进行protocolbuffer序列化之后将其发送给客户端,后续客户再将序列化之后的由密钥加工后的元数据信息发送至数据服务器,在此,生成所述用所述密钥加密后的部分元数据的加密算法不限于上述HMAC算法,其中,HMAC为消息认证码,其通过捆绑一个共享密钥可以使用任何迭代的可用于加密的散列函数。
本申请的元数据服务器端用于辅助数据访问的方法一优选的实施例中,所述由密钥加工后的元数据信息还包括:
元数据的过期时间。在此,以上述元数据服务器返回给客户端的元数据信息包括HMAC(key,msg’)|msg’|msg为例,可以在用所述密钥加密后的部分元数据(msg’)中设置元数据的过期时间(expire_time),如msg’={FileID,READ/WRITE,expire_time}。
如图5所示,根据本申请的另一面还提供一种数据服务器端用于辅助数据访问的方法,该方法包括:
步骤S31,从客户端获取由密钥加工后的元数据信息;
步骤S32,通过所述密钥对所述由密钥加工后的元数据信息进行验证;
步骤S33,对所述由密钥加工后的元数据信息验证通过后,向所述客户端传输所述待访问数据。本实施例在所述数据服务器对所述由密钥加工后的元数据信息验证通过后,才允许客户端从所述数据服务器获取所述待访问数据,可以实现对数据服务器的访问控制,这样可以确保数据服务器的安全性,最终实现客户端的抗伪造性。
本申请的数据服务器端用于辅助数据访问的方法的一优选的实施例中,当所述元数据信息包括元数据、从所述元数据中提取的部分元数据及用所述密钥加密后的部分元数据时,步骤S33,对所述由密钥加工后的元数据信息验证通过后,向所述客户端传输所述待访问数据,包括:
用所述密钥对接收到的所述部分无数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,如果比较一致,则验证通过;在此,可以在元数据服务器和数据服务器部署相同的密钥(key),例如,可以在元数据服务器和数据服务器部署一个同样的文件(key.txt),该文件里保存着密钥(key),该密钥(key)必须要保存在一个安全的目录,需要特定权限才可以打开,以防止密钥被窃取,密钥(key)的长度可以随机选取,长度不能太短也不能太长,可设定key的长度为16字节(128位),密钥(key)可以使用linux操作***的uuid生成,可以通过/proc/sys/kernel/random/uuid来随机生成一个uuid码,也可以使用openssl命令来生成一个密钥key,另外,客户端请求访问元数据服务器并通过对解开的待访问数据的权限的验证的时候,元数据服务器返回给客户端的元数据信息包括HMAC(key,msg’)|msg’|msg,msg为元数据,其中,msg’为从所述元数据(msg)中提取的部分元数据,HMAC(key,msg’)为用所述密钥(key)并采用HMAC算法加密后的部分元数据(msg’),元数据可对由密钥加工后的元数据信息进行protocolbuffer序列化之后将其发送给客户端,后续客户再将序列化之后的由密钥加工后的元数据信息发送至数据服务器,在此,生成所述用所述密钥加密后的部分元数据的加密算法不限 于上述HMAC算法,其中,HMAC为消息认证码,其通过捆绑一个共享密钥可以使用任何迭代的可用于加密的散列函数,数据服务器收到客户端发来的序列化之后的由密钥加工后的元数据信息,针对接收到的序列化后的信息进行反序列化之后,从本地部署的文件(key.txt)中获取密钥(key),利用该key值对接收的msg’字段进行HMAC(Hash-based Message Authentication Code)算法得到HMAC(key,msg’),看得到的HMAC(key,msg’)和接收到的HMAC(key,msg’)是否一样,如果一样就可以确定接收到的由密钥加工后的元数据信息是从元数据服务器获取到的,因为客户端没有密钥(key),说明客户端是可信的,这样,客户端就可以与数据服务器建立可信连接,就可以安全地传输待访问数据了;
根据所述元数据向所述客户端传输所述待访问数据。
本申请的数据服务器端用于辅助数据访问的方法的一优选的实施例中,当所述由密钥加工后的元数据信息包括:元数据、从所述元数据中提取的部分元数据、用所述密钥加密后的部分元数据及元数据的过期时间时,步骤S33,对所述由密钥加工后的元数据信息验证通过后,向所述客户端传输所述待访问数据,包括:
所述数据服务器用所述密钥对接收到的所述部分无数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,并根据所述元数据的过期时间判断元数据是否过期,如果比较一致且元数据未过期,则验证通过;在此,以上述元数据服务器返回给客户端的元数据信息包括HMAC(key,msg’)|msg’|msg为例,可以在用所述密钥加密后的部分元数据(msg’)中设置元数据的过期时间(expire_time),如msg’={FileID,READ/WRITE,expire_time},在将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,满足比较一致的条件同时,还需要另一条件,即数据服务器判断元数据未过期,两个条件都满足后,才判断为验证通过,可以进行后续对数据服务器的访问,从而实现 对所述由密钥加工后的元数据信息验证更严格的验证,保证客户端的可信度,详细的,元数据服务器通过设置客户端访问数据服务器的过期时间(expire_time),一旦这个expire_time到期之后,数据服务器可以触发一个到期(token expire)事件,该到期事件会发个请求给客户端,客户端需要重新向元数据服务器请求由密钥加工后的元数据信息;
根据所述元数据向所述客户端传输所述待访问数据。
如图6所示,一种用于数据访问的客户端,该客户端1包括:
发送权限装置11,用于向元数据服务器2发送用私钥签发的待访问数据的权限;具体的,如图2所示,分布式文件***架构由三方来参与:Client端(客户端1)、NameNode端(元数据服务器2)、DataNode端(数据服务器3),这三方的通信可以是基于RPC协议来通信,建立在TCP/IP协议之上,元数据服务器存储着待访问数据的元数据信息(meta),元数据信息用于记录待访问数据在数据服务器上存储位置的信息,客户端通过从元数据服务器获取元数据信息,然后通过元数据信息直接访问数据服务器获取所需要的待访问数据,对于元数据服务器的访问控制可以使用能力鉴权(Capability)的方式,Capability是用于访问控制的一种数据结构,其定义了对一个或多个指定的资源(如目录、文件等)所具有的访问权限,能力鉴权需要包括私钥(Signature)和待访问数据的权限(Permissions),以便客户端向元数据服务器发送用私钥签发的待访问数据的权限,在此待访问数据的权限(Permissions)可以是一个权限集合列表,每一个permission可以有两个字段:权限集合编号resourceID和对应于权限集合编号的权限集合(permission bundle),可以根据需要设置权限集合的数据位数,如可设置32bits,每个bit表示用户定义的一个权限,待访问数据的权限可以包括:READ(读权限)、WRITE(写权限)、ROOT(读写权限,等价于READ|WRITE);
获取元数据装置12,用于从元数据服务器2获取由密钥加工后的元数据信息,其中,所述用私钥签发的待访问数据的权限由所述元数据服务器 2用公钥解开,所述由密钥加工后的元数据信息由所述元数据服务器2对解开的待访问数据的权限验证通过后生成;在此,所述公钥是对应于所述私钥的公钥,以方便所述元数据服务器用公钥解开所述用私钥签发的待访问数据的权限,当客户端去访问元数据服务器的时候,向元数据服务器发送用私钥签发的待访问数据的权限,然后元数据服务器拿到该用私钥签发的待访问数据的权限之后需要作验证,如果验证通过,客户端就可以从元数据服务器获取由密钥加工后的元数据信息,进而继续后续对数据服务器的访问,例如,当客户端client1请求读取待访问数据file1的内容,RPC协议下请求格式为:(/client1/file1,READ),客户端会向元数据服务器发送该请求的用私钥签发的待访问数据的权限,这个时候客户端会向元数据服务器发送的消息内容具体可参见图3,消息内容包括:消息头(A)、包含具体请求内容的消息体(B)及用私钥签发的待访问数据的权限(C),客户端可用protocolbuffer(***的一种数据交换的格式)格式来传输消息内容,然后元数据服务器拿到用私钥签发的待访问数据的权限之后,利用公钥解开用私钥签发的待访问数据的权限,然后对解开的待访问数据的权限验证通过后生成所述由密钥加工后的元数据信息,客户端从元数据服务器获取由密钥加工后的元数据信息,其中,所述用私钥签发的待访问数据的权限可由客户端自己生成,也可由另外的第三方生成后,由客户端从所述第三方获取,另外,当客户端能够利用公钥解开用私钥签发的待访问数据的权限,即可判断为对解开的待访问数据的权限验证通过,也可以在元数据服务器能够利用公钥解开用私钥签发的待访问数据的权限后,进一步增加附加的条件,当同时满足附加的条件的时候,才判断为对解开的待访问数据的权限验证通过;
获取数据装置13,用于将所述由密钥加工后的元数据信息发送至数据服务器3,待所述数据服务器3对所述由密钥加工后的元数据信息验证通过后,从所述数据服务器3获取所述待访问数据,其中,所述由密钥加工后的元 数据信息由所述数据服务器通过所述密钥进行验证。本实施例通过所述元数据服务器用公钥解开所述用私钥签发的待访问数据的权限,并对解开的待访问数据的权限验证通过后,生成所述由密钥加工后的元数据信息,可以实现对元数据服务器的访问控制,这样可以确保元数据服务器的安全性,另外,在所述数据服务器对所述由密钥加工后的元数据信息验证通过后,才允许客户端从所述数据服务器获取所述待访问数据,可以实现对数据服务器的访问控制,这样可以确保数据服务器的安全性,最终实现客户端的抗伪造性。
如图7所示,本申请用于数据访问的客户端一优选的实施例中,所述客户端1还包括发送过期时间装置14,用于在向元数据服务器2发送用私钥签发的待访问数据的权限的同时,向元数据服务器2发送所述待访问数据的权限的过期时间(Expire),其中,所述元数据服务器2,用于根据所述权限的过期时间对解开的待访问数据的权限判断为未过期时,则验证通过。在元数据服务器能够利用公钥解开用私钥签发的待访问数据的权限后,在此进一步增加附加的条件,即所述元数据服务器根据所述权限的过期时间对解开的待访问数据的权限判断为未过期时,当同时满足此附加的条件的时候,才判断为对解开的待访问数据的权限验证通过,进而更严格地对待访问数据的权限进行验证,对不满足附加条件的情况,则不充许客户端后续对数据服务器的访问,保证后续需要访问的数据服务器上的数据安全性。详细的,在分布式文件***中,能力鉴权(Capability)可定义为如下格式:
Length Signature ID Expire Permissions
其中:Length表示Signarure的长度;
      Signature表示私钥,用于验证Permissions是否被篡改;
      ID表示Capability的ID号,是唯一的;
      Expire表示该Capability的过期时间;
      Permissions表示待访问数据的权限。
本申请用于数据访问的客户端一优选的实施例中,所述元数据服务器,用于根据预设的权限阈值对解开的待访问数据的权限判断为未超过所述权限阈值时,则验证通过。在元数据服务器能够利用公钥解开用私钥签发的待访问数据的权限后,在此进一步增加附加的条件,即所述元数据服务器根据预设的权限阈值对解开的待访问数据的权限判断为未超过所述权限阈值时,则判断为满足附加的条件,当解开的待访问数据的权限过大,超过所述预设的权限阈值,则判断为不满足附加的条件,当同时满足附加的条件的时候,才判断为对解开的待访问数据的权限验证通过,进而更严格地对待访问数据的权限进行验证,对不满足附加条件的情况,则不充许客户端后续对数据服务器的访问,保证后续需要访问的数据服务器上的数据安全性。
本申请用于数据访问的客户端一优选的实施例中,所述由密钥加工后的元数据信息包括:元数据、从所述元数据中提取的部分元数据及用所述密钥加密后的部分元数据;在此,可以在元数据服务器和数据服务器部署相同的密钥(key),例如,可以在元数据服务器和数据服务器部署一个同样的文件(key.txt),该文件里保存着密钥(key),该密钥(key)必须要保存在一个安全的目录,需要特定权限才可以打开,以防止密钥被窃取,密钥(key)的长度可以随机选取,长度不能太短也不能太长,可设定key的长度为16字节(128位),密钥(key)可以使用linux操作***的uuid生成,可以通过/proc/sys/kernel/random/uuid来随机生成一个uuid码,也可以使用openssl命令来生成一个密钥key,另外,客户端请求访问元数据服务器并通过对解开的待访问数据的权限的验证的时候,元数据服务器返回给客户端的元数据信息包括HMAC(key,msg’)|msg’|msg,msg为元数据,其中,msg’为从所述元数据(msg)中提取的部分元数据,HMAC(key,msg’) 为用所述密钥(key)并采用HMAC算法加密后的部分元数据(msg’),元数据可对由密钥加工后的元数据信息进行protocolbuffer序列化之后将其发送给客户端,后续客户再将序列化之后的由密钥加工后的元数据信息发送至数据服务器,在此,生成所述用所述密钥加密后的部分元数据的加密算法不限于上述HMAC算法,其中,HMAC为消息认证码,其通过捆绑一个共享密钥可以使用任何迭代的可用于加密的散列函数;
所述数据服务器3,用于用所述密钥对接收到的所述部分无数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,如果比较一致,则验证通过;在此,数据服务器收到客户端发来的序列化之后的由密钥加工后的元数据信息,针对接收到的序列化后的信息进行反序列化之后,从本地部署的文件(key.txt)中获取密钥(key),利用该key值对接收的msg’字段进行HMAC(Hash-based Message Authentication Code)算法得到HMAC(key,msg’),看得到的HMAC(key,msg’)和接收到的HMAC(key,msg’)是否一样,如果一样就可以确定接收到的由密钥加工后的元数据信息是从元数据服务器获取到的,因为客户端没有密钥(key),说明客户端是可信的,这样,客户端就可以与数据服务器建立可信连接,就可以安全地传输待访问数据了;
获取数据装置13,用于根据所述元数据从所述数据服务器获取所述待访问数据。
本申请用于数据访问的客户端一优选的实施例中,所述由密钥加工后的元数据信息包括:元数据、从所述元数据中提取的部分元数据、用所述密钥加密后的部分元数据及元数据的过期时间;在此,以上述元数据服务器返回给客户端的元数据信息包括HMAC(key,msg’)|msg’|msg为例,可以在用所述密钥加密后的部分元数据(msg’)中设置元数据的过期时间(expire_time),如msg’={FileID,READ/WRITE,expire_time};
所述数据服务器3,用于用所述密钥对接收到的所述部分无数进行本地 加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,并根据所述元数据的过期时间判断元数据是否过期,如果比较一致且元数据未过期,则验证通过;在此,在将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,满足比较一致的条件同时,还需要另一条件,即数据服务器判断元数据未过期,两个条件都满足后,才判断为验证通过,可以进行后续对数据服务器的访问,从而实现对所述由密钥加工后的元数据信息验证更严格的验证,保证客户端的可信度,详细的,元数据服务器通过设置客户端访问数据服务器的过期时间(expire_time),一旦这个expire_time到期之后,数据服务器可以触发一个到期(token expire)事件,该到期事件会发个请求给客户端,客户端需要重新向元数据服务器请求由密钥加工后的元数据信息;
所述获取数据装置13,用于根据所述元数据从所述数据服务器获取所述待访问数据。
如图8所示,根据本申请的另一面,还提供一种辅助数据访问的元数据服务器,该元数据服务器2包括:
接收权限装置21,用于从客户端接收用私钥签发的待访问数据的权限;具体的,如图2所示,分布式文件***架构由三方来参与的:Client端(客户端1)、NameNode端(元数据服务器2)、DataNode端(数据服务器3),这三方的通信可以是基于RPC协议来通信,建立在TCP/IP协议之上,元数据服务器存储着待访问数据的元数据信息(meta),元数据信息用于记录待访问数据在数据服务器上存储位置的信息,客户端通过从元数据服务器获取元数据信息,然后通过元数据信息直接访问数据服务器获取所需要的待访问数据,对于元数据服务器的访问控制可以使用能力鉴权(Capability)的方式,Capability是用于访问控制的一种数据结构,其定义了对一个或多个指定的资源(如目录、文件等)所具有的访问权限,能力鉴权需要包括私钥(Signature)和待访问数据的权限(Permissions),以便客户端向元数据服务器发送用私 钥签发的待访问数据的权限,在此待访问数据的权限(Permissions)可以是一个权限集合列表,每一个permission可以有两个字段:权限集合编号resourceID和对应于权限集合编号的权限集合(permission bundle),可以根据需要设置权限集合的数据位数,如可设置32bits,每个bit表示用户定义的一个权限,待访问数据的权限可以包括:READ(读权限)、WRITE(写权限)、ROOT(读写权限,等价于READ|WRITE);
生成元数据装置22,用于用公钥解开所述用私钥签发的待访问数据的权限,对解开的待访问数据的权限验证通过后生成由密钥加工后的元数据信息;在此,所述公钥是对应于所述私钥的公钥,以方便所述元数据服务器用公钥解开所述用私钥签发的待访问数据的权限,当客户端去访问元数据服务器的时候,向元数据服务器发送用私钥签发的待访问数据的权限,然后元数据服务器拿到该用私钥签发的待访问数据的权限之后需要作验证,如果验证通过,客户端就可以从元数据服务器获取由密钥加工后的元数据信息,进而继续后续对数据服务器的访问,例如,当客户端client1请求读取待访问数据file1的内容,RPC协议下请求格式为:(/client1/file1,READ),客户端会向元数据服务器发送该请求的用私钥签发的待访问数据的权限,这个时候客户端会向元数据服务器发送的消息内容具体可参见图3,消息内容包括:消息头(A)、包含具体请求内容的消息体(B)及用私钥签发的待访问数据的权限(C),客户端可用protocolbuffer(***的一种数据交换的格式)格式来传输消息内容,然后元数据服务器拿到用私钥签发的待访问数据的权限之后,利用公钥解开用私钥签发的待访问数据的权限,然后对解开的待访问数据的权限验证通过后生成所述由密钥加工后的元数据信息,客户端从元数据服务器获取由密钥加工后的元数据信息,其中,所述用私钥签发的待访问数据的权限可由客户端自己生成,也可由另外的第三方生成后,由客户端从所述第三方获取,另外,当客户端能够利用公钥解开用私钥签发的待访问数据的权限,即可判断为对解开的待访问 数据的权限验证通过,也可以在元数据服务器能够利用公钥解开用私钥签发的待访问数据的权限后,进一步增加附加的条件,当同时满足附加的条件的时候,才判断为对解开的待访问数据的权限验证通过;
发送元数据装置23,用于将所述由密钥加工后的元数据信息发送至所述客户端。本实施例通过所述元数据服务器用公钥解开所述用私钥签发的待访问数据的权限,并对解开的待访问数据的权限验证通过后,生成所述由密钥加工后的元数据信息,可以实现对元数据服务器的访问控制,这样可以确保元数据服务器的安全性。
如图9所示,本申请的辅助数据访问的元数据服务器一优选的实施例中,所述元数据服务器2还包括接收过期时间装置24,用于从所述客户端接收所述待访问数据的权限的过期时间(Expire);
所述生成元数据装置22,用于根据所述权限的过期时间对解开的待访问数据的权限判断为未过期时,则验证通过。在元数据服务器能够利用公钥解开用私钥签发的待访问数据的权限后,在此进一步增加附加的条件,即所述元数据服务器根据所述权限的过期时间对解开的待访问数据的权限判断为未过期时,当同时满足此附加的条件的时候,才判断为对解开的待访问数据的权限验证通过,进而更严格地对待访问数据的权限进行验证,对不满足附加条件的情况,则不充许客户端后续对数据服务器的访问,保证后续需要访问的数据服务器上的数据安全性。详细的,在分布式文件***中,能力鉴权(Capability)可定义为如下格式:
Length Signature ID Expire Permissions
其中:Length表示Signarure的长度;
      Signature表示私钥,用于验证Permissions是否被篡改;
      ID表示Capability的ID号,是唯一的;
      Expire表示该Capability的过期时间;
      Permissions表示待访问数据的权限。
本申请的辅助数据访问的元数据服务器一优选的实施例中,所述生成元数据装置22,用于根据预设的权限阈值对解开的待访问数据的权限判断为未超过所述权限阈值时,则验证通过。在元数据服务器能够利用公钥解开用私钥签发的待访问数据的权限后,在此进一步增加附加的条件,即所述元数据服务器根据预设的权限阈值对解开的待访问数据的权限判断为未超过所述权限阈值时,则判断为满足附加的条件,当解开的待访问数据的权限过大,超过所述预设的权限阈值,则判断为不满足附加的条件,当同时满足附加的条件的时候,才判断为对解开的待访问数据的权限验证通过,进而更严格地对待访问数据的权限进行验证,对不满足附加条件的情况,则不充许客户端后续对数据服务器的访问,保证后续需要访问的数据服务器上的数据安全性。
本申请的辅助数据访问的元数据服务器一优选的实施例中,所述由密钥加工后的元数据信息包括:元数据、从所述元数据中提取的部分元数据及用所述密钥加密后的部分元数据。在此,可以在元数据服务器和数据服务器部署相同的密钥(key),例如,可以在元数据服务器和数据服务器部署一个同样的文件(key.txt),该文件里保存着密钥(key),该密钥(key)必须要保存在一个安全的目录,需要特定权限才可以打开,以防止密钥被窃取,密钥(key)的长度可以随机选取,长度不能太短也不能太长,可设定key的长度为16字节(128位),密钥(key)可以使用linux操作***的uuid生成,可以通过/proc/sys/kernel/random/uuid来随机生成一个uuid码,也可以使用openssl命令来生成一个密钥key,另外,客户端请求访问元数据服务器并通过对解开的待访问数据的权限的验证的时候,元数据服务器返回给客户端的元数据信息包括HMAC(key,msg’)|msg’|msg,msg为元数据,其中,msg’为从所述元数据(msg)中提取的部分元数据,HMAC(key,msg’)为用所述密钥(key)并采用HMAC算法加密后的部分元数据(msg’), 元数据可对由密钥加工后的元数据信息进行protocolbuffer序列化之后将其发送给客户端,后续客户再将序列化之后的由密钥加工后的元数据信息发送至数据服务器,在此,生成所述用所述密钥加密后的部分元数据的加密算法不限于上述HMAC算法,其中,HMAC为消息认证码,其通过捆绑一个共享密钥可以使用任何迭代的可用于加密的散列函数。
本申请的辅助数据访问的元数据服务器一优选的实施例中,所述由密钥加工后的元数据信息还包括:元数据的过期时间。在此,以上述元数据服务器返回给客户端的元数据信息包括HMAC(key,msg’)|msg’|msg为例,可以在用所述密钥加密后的部分元数据(msg’)中设置元数据的过期时间(expire_time),如msg’={FileID,READ/WRITE,expire_time}。
如图10所示,根据本申请的另一面,还提供一种辅助数据访问的数据服务器,该数据服务器3包括:
元数据装置31,用于从客户端获取由密钥加工后的元数据信息;
验证装置32,用于通过所述密钥对所述由密钥加工后的元数据信息进行验证;
数据传输装置33,用于对所述由密钥加工后的元数据信息验证通过后,向所述客户端传输所述待访问数据。本实施例在所述数据服务器对所述由密钥加工后的元数据信息验证通过后,才允许客户端从所述数据服务器获取所述待访问数据,可以实现对数据服务器的访问控制,这样可以确保数据服务器的安全性,最终实现客户端的抗伪造性。
本申请的辅助数据访问的数据服务器的一优选的实施例中,当所述元数据信息包括元数据、从所述元数据中提取的部分元数据及用所述密钥加密后的部分元数据时,所述数据传输装置33,用于用所述密钥对接收到的所述部分无数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,如果比较一致,则验证通过;根据所述元数据向所述客户端传输所述待访问数据。在此,可以在元数据服务器 和数据服务器部署相同的密钥(key),例如,可以在元数据服务器和数据服务器部署一个同样的文件(key.txt),该文件里保存着密钥(key),该密钥(key)必须要保存在一个安全的目录,需要特定权限才可以打开,以防止密钥被窃取,密钥(key)的长度可以随机选取,长度不能太短也不能太长,可设定key的长度为16字节(128位),密钥(key)可以使用linux操作***的uuid生成,可以通过/proc/sys/kernel/random/uuid来随机生成一个uuid码,也可以使用openssl命令来生成一个密钥key,另外,客户端请求访问元数据服务器并通过对解开的待访问数据的权限的验证的时候,元数据服务器返回给客户端的元数据信息包括HMAC(key,msg’)|msg’|msg,msg为元数据,其中,msg’为从所述元数据(msg)中提取的部分元数据,HMAC(key,msg’)为用所述密钥(key)并采用HMAC算法加密后的部分元数据(msg’),元数据可对由密钥加工后的元数据信息进行protocolbuffer序列化之后将其发送给客户端,后续客户再将序列化之后的由密钥加工后的元数据信息发送至数据服务器,在此,生成所述用所述密钥加密后的部分元数据的加密算法不限于上述HMAC算法,其中,HMAC为消息认证码,其通过捆绑一个共享密钥可以使用任何迭代的可用于加密的散列函数,数据服务器收到客户端发来的序列化之后的由密钥加工后的元数据信息,针对接收到的序列化后的信息进行反序列化之后,从本地部署的文件(key.txt)中获取密钥(key),利用该key值对接收的msg’字段进行HMAC(Hash-based Message Authentication Code)算法得到HMAC(key,msg’),看得到的HMAC(key,msg’)和接收到的HMAC(key,msg’)是否一样,如果一样就可以确定接收到的由密钥加工后的元数据信息是从元数据服务器获取到的,因为客户端没有密钥(key),说明客户端是可信的,这样,客户端就可以与数据服务器建立可信连接,就可以安全地传输待访问数据了。
本申请的辅助数据访问的数据服务器的一优选的实施例中,当所述由密钥加工后的元数据信息包括:元数据、从所述元数据中提取的部分元 数据、用所述密钥加密后的部分元数据及元数据的过期时间时,所述数据传输装置33,用于用所述密钥对接收到的所述部分无数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,并根据所述元数据的过期时间判断元数据是否过期,如果比较一致且元数据未过期,则验证通过;根据所述元数据向所述客户端传输所述待访问数据。在此,以上述元数据服务器返回给客户端的元数据信息包括HMAC(key,msg’)|msg’|msg为例,可以在用所述密钥加密后的部分元数据(msg’)中设置元数据的过期时间(expire_time),如msg’={FileID,READ/WRITE,expire_time},在将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,满足比较一致的条件同时,还需要另一条件,即数据服务器判断元数据未过期,两个条件都满足后,才判断为验证通过,可以进行后续对数据服务器的访问,从而实现对所述由密钥加工后的元数据信息验证更严格的验证,保证客户端的可信度,详细的,元数据服务器通过设置客户端访问数据服务器的过期时间(expire_time),一旦这个expire_time到期之后,数据服务器可以触发一个到期(token expire)事件,该到期事件会发个请求给客户端,客户端需要重新向元数据服务器请求由密钥加工后的元数据信息。
详细的,如图11所示,本申请一具体的应用实施例包括如下步骤:
步骤S111,客户端向元数据服务器发送用私钥签发的待访问数据的权限;
步骤S112,所述元数据服务器用公钥解开所述用私钥签发的待访问数据的权限,并对解开的待访问数据的权限验证通过后生成由密钥加工后的元数据信息;
步骤S113,所述客户端从所述元数据服务器获取所述由密钥加工后的元数据信息,并将所述由密钥加工后的元数据信息发送至数据服务器;
步骤S114,所述数据服务器通过所述密钥对所述由密钥加工后的元数 据信息进行验证;
步骤S115,待所述数据服务器对所述由密钥加工后的元数据信息验证通过后,所述客户端从所述数据服务器获取所述待访问数据。
综上所述,本申请通过所述元数据服务器用公钥解开所述用私钥签发的待访问数据的权限,并对解开的待访问数据的权限验证通过后,生成所述由密钥加工后的元数据信息,可以实现对元数据服务器的访问控制,这样可以确保元数据服务器的安全性,另外,在所述数据服务器对所述由密钥加工后的元数据信息验证通过后,才允许客户端从所述数据服务器获取所述待访问数据,可以实现对数据服务器的访问控制,这样可以确保数据服务器的安全性,最终实现客户端的抗伪造性。
进一步的,本申请在元数据服务器能够利用公钥解开用私钥签发的待访问数据的权限后,进一步增加附加的条件,即所述元数据服务器根据所述权限的过期时间对解开的待访问数据的权限判断为未过期时,当同时满足此附加的条件的时候,才判断为对解开的待访问数据的权限验证通过,进而更严格地对待访问数据的权限进行验证,对不满足附加条件的情况,则不充许客户端后续对数据服务器的访问,保证后续需要访问的数据服务器上的数据安全性。
进一步的,本申请在元数据服务器能够利用公钥解开用私钥签发的待访问数据的权限后,进一步增加附加的条件,即所述元数据服务器根据预设的权限阈值对解开的待访问数据的权限判断为未超过所述权限阈值时,则判断为满足附加的条件,当解开的待访问数据的权限过大,超过所述预设的权限阈值,则判断为不满足附加的条件,当同时满足附加的条件的时候,才判断为对解开的待访问数据的权限验证通过,进而更严格地对待访问数据的权限进行验证,对不满足附加条件的情况,则不充许客户端后续对数据服务器的访问,保证后续需要访问的数据服务器上的数据安全性。
进一步的,本申请中所述数据服务器用所述密钥对接收到的所述部分无 数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,在如果比较一致,才验证通过,因为客户端没有密钥(key),说明客户端是可信的,这样,客户端就可以与数据服务器建立可信连接,就可以安全地传输待访问数据。
进一步的,本申请中所述数据服务器用所述密钥对接收到的所述部分无数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,并根据所述元数据的过期时间判断元数据是否过期,满足比较一致的条件同时,还需要另一条件,即数据服务器判断元数据未过期,两个条件都满足后,才判断为验证通过,可以进行后续对数据服务器的访问,从而实现对所述由密钥加工后的元数据信息验证更严格的验证,保证客户端的可信度。
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。
需要注意的是,本发明可在软件和/或软件与硬件的组合体中被实施,例如,可采用专用集成电路(ASIC)、通用目的计算机或任何其他类似硬件设备来实现。在一个实施例中,本发明的软件程序可以通过处理器执行以实现上文所述步骤或功能。同样地,本发明的软件程序(包括相关的数据结构)可以被存储到计算机可读记录介质中,例如,RAM存储器,磁或光驱动器或软磁盘及类似设备。另外,本发明的一些步骤或功能可采用硬件来实现,例如,作为与处理器配合从而执行各个步骤或功能的电路。
另外,本发明的一部分可被应用为计算机程序产品,例如计算机程序指令,当其被计算机执行时,通过该计算机的操作,可以调用或提供根据本发明的方法和/或技术方案。而调用本发明的方法的程序指令,可能被存储在固定的或可移动的记录介质中,和/或通过广播或其他信号承 载媒体中的数据流而被传输,和/或被存储在根据所述程序指令运行的计算机设备的工作存储器中。在此,根据本发明的一个实施例包括一个装置,该装置包括用于存储计算机程序指令的存储器和用于执行程序指令的处理器,其中,当该计算机程序指令被该处理器执行时,触发该装置运行基于前述根据本发明的多个实施例的方法和/或技术方案。
对于本领域技术人员而言,显然本发明不限于上述示范性实施例的细节,而且在不背离本发明的精神或基本特征的情况下,能够以其他的具体形式实现本发明。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本发明的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本发明内。不应将权利要求中的任何附图标记视为限制所涉及的权利要求。此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。装置权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第一,第二等词语用来表示名称,而并不表示任何特定的顺序。

Claims (26)

  1. 一种客户端用于数据访问的方法,其中,该方法包括:
    向元数据服务器发送用私钥签发的待访问数据的权限;
    从元数据服务器获取由密钥加工后的元数据信息,其中,所述用私钥签发的待访问数据的权限由所述元数据服务器用公钥解开,所述由密钥加工后的元数据信息由所述元数据服务器对解开的待访问数据的权限验证通过后生成;
    将所述由密钥加工后的元数据信息发送至数据服务器,待所述数据服务器对所述由密钥加工后的元数据信息验证通过后,从所述数据服务器获取所述待访问数据,其中,所述由密钥加工后的元数据信息由所述数据服务器通过所述密钥进行验证。
  2. 如权利要求1所述的方法,其中,向元数据服务器发送用私钥签发的待访问数据的权限的同时,还包括:
    向元数据服务器发送所述待访问数据的权限的过期时间;
    所述元数据服务器对解开的待访问数据的权限验证通过,包括:
    所述元数据服务器根据所述权限的过期时间对解开的待访问数据的权限判断为未过期时,则验证通过。
  3. 如权利要求1或2所述的方法,其中,所述元数据服务器对解开的待访问数据的权限验证通过,包括:
    所述元数据服务器根据预设的权限阈值对解开的待访问数据的权限判断为未超过所述权限阈值时,则验证通过。
  4. 如权利要求1至3任一项所述的方法,其中,所述由密钥加工后的元数据信息包括:
    元数据、从所述元数据中提取的部分元数据及用所述密钥加密后的部分元数据;
    所述数据服务器对所述由密钥加工后的元数据信息验证通过,包括:
    所述数据服务器用所述密钥对接收到的所述部分无数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,如果比较一致,则验证通过;
    从所述数据服务器获取所述待访问数据,包括:
    根据所述元数据从所述数据服务器获取所述待访问数据。
  5. 如权利要求1至3任一项所述的方法,其中,所述由密钥加工后的元数据信息包括:
    元数据、从所述元数据中提取的部分元数据、用所述密钥加密后的部分元数据及元数据的过期时间;
    所述数据服务器对所述由密钥加工后的元数据信息验证通过,包括:
    所述数据服务器用所述密钥对接收到的所述部分无数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,并根据所述元数据的过期时间判断元数据是否过期,如果比较一致且元数据未过期,则验证通过;
    从所述数据服务器获取所述待访问数据,包括:
    根据所述元数据从所述数据服务器获取所述待访问数据。
  6. 一种元数据服务器端用于辅助数据访问的方法,其中,该方法包括:
    从客户端接收用私钥签发的待访问数据的权限;
    用公钥解开所述用私钥签发的待访问数据的权限,对解开的待访问数据的权限验证通过后生成由密钥加工后的元数据信息;
    将所述由密钥加工后的元数据信息发送至所述客户端。
  7. 如权利要求6所述的方法,其中,从客户端接收用私钥签发的待访问数据的权限的同时,还包括:
    从所述客户端接收所述待访问数据的权限的过期时间;
    对解开的待访问数据的权限验证通过,包括:
    根据所述权限的过期时间对解开的待访问数据的权限判断为未过期 时,则验证通过。
  8. 如权利要求6或7所述的方法,其中,对解开的待访问数据的权限验证通过,包括:
    根据预设的权限阈值对解开的待访问数据的权限判断为未超过所述权限阈值时,则验证通过。
  9. 如权利要求6至8任一项所述的方法,其中,所述由密钥加工后的元数据信息包括:
    元数据、从所述元数据中提取的部分元数据及用所述密钥加密后的部分元数据。
  10. 如权利要求9所述的方法,其中,所述由密钥加工后的元数据信息还包括:
    元数据的过期时间。
  11. 一种数据服务器端用于辅助数据访问的方法,其中,该方法包括:
    从客户端获取由密钥加工后的元数据信息;
    通过所述密钥对所述由密钥加工后的元数据信息进行验证;
    对所述由密钥加工后的元数据信息验证通过后,向所述客户端传输所述待访问数据。
  12. 如权利要求11所述的方法,其中,当所述元数据信息包括元数据、从所述元数据中提取的部分元数据及用所述密钥加密后的部分元数据时,对所述由密钥加工后的元数据信息验证通过后,向所述客户端传输所述待访问数据,包括:
    用所述密钥对接收到的所述部分无数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,如果比较一致,则验证通过;
    根据所述元数据向所述客户端传输所述待访问数据。
  13. 如权利要求12所述的方法,其中,当所述由密钥加工后的元数据 信息包括:元数据、从所述元数据中提取的部分元数据、用所述密钥加密后的部分元数据及元数据的过期时间时,对所述由密钥加工后的元数据信息验证通过后,向所述客户端传输所述待访问数据,包括:
    所述数据服务器用所述密钥对接收到的所述部分无数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,并根据所述元数据的过期时间判断元数据是否过期,如果比较一致且元数据未过期,则验证通过;
    根据所述元数据向所述客户端传输所述待访问数据。
  14. 一种用于数据访问的客户端,其中,该客户端包括:
    发送权限装置,用于向元数据服务器发送用私钥签发的待访问数据的权限;
    获取元数据装置,用于从元数据服务器获取由密钥加工后的元数据信息,其中,所述用私钥签发的待访问数据的权限由所述元数据服务器用公钥解开,所述由密钥加工后的元数据信息由所述元数据服务器对解开的待访问数据的权限验证通过后生成;
    获取数据装置,用于将所述由密钥加工后的元数据信息发送至数据服务器,待所述数据服务器对所述由密钥加工后的元数据信息验证通过后,从所述数据服务器获取所述待访问数据,其中,所述由密钥加工后的元数据信息由所述数据服务器通过所述密钥进行验证。
  15. 如权利要求14所述的客户端,其中,所述客户端还包括发送过期时间装置,用于在向元数据服务器发送用私钥签发的待访问数据的权限的同时,向元数据服务器发送所述待访问数据的权限的过期时间,其中,所述元数据服务器,用于根据所述权限的过期时间对解开的待访问数据的权限判断为未过期时,则验证通过。
  16. 如权利要求14或15所述的客户端,其中,所述元数据服务器,用于根据预设的权限阈值对解开的待访问数据的权限判断为未超过所述 权限阈值时,则验证通过。
  17. 如权利要求14至16任一项所述的客户端,其中,所述由密钥加工后的元数据信息包括:元数据、从所述元数据中提取的部分元数据及用所述密钥加密后的部分元数据;
    所述数据服务器,用于用所述密钥对接收到的所述部分无数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,如果比较一致,则验证通过;
    获取数据装置,用于根据所述元数据从所述数据服务器获取所述待访问数据。
  18. 如权利要求14至16任一项所述的客户端,其中,所述由密钥加工后的元数据信息包括:元数据、从所述元数据中提取的部分元数据、用所述密钥加密后的部分元数据及元数据的过期时间;
    所述数据服务器,用于用所述密钥对接收到的所述部分无数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,并根据所述元数据的过期时间判断元数据是否过期,如果比较一致且元数据未过期,则验证通过;
    所述获取数据装置,用于根据所述元数据从所述数据服务器获取所述待访问数据。
  19. 一种辅助数据访问的元数据服务器,其中,该元数据服务器包括:
    接收权限装置,用于从客户端接收用私钥签发的待访问数据的权限;
    生成元数据装置,用于用公钥解开所述用私钥签发的待访问数据的权限,对解开的待访问数据的权限验证通过后生成由密钥加工后的元数据信息;
    发送元数据装置,用于将所述由密钥加工后的元数据信息发送至所述客户端。
  20. 如权利要求19所述的元数据服务器,其中,所述元数据服务器还 包括接收过期时间装置,用于从所述客户端接收所述待访问数据的权限的过期时间;
    所述生成元数据装置,用于根据所述权限的过期时间对解开的待访问数据的权限判断为未过期时,则验证通过。
  21. 如权利要求19或20所述的元数据服务器,其中,所述生成元数据装置,用于根据预设的权限阈值对解开的待访问数据的权限判断为未超过所述权限阈值时,则验证通过。
  22. 如权利要求19至21任一项所述的元数据服务器,其中,所述由密钥加工后的元数据信息包括:元数据、从所述元数据中提取的部分元数据及用所述密钥加密后的部分元数据。
  23. 如权利要求22所述的元数据服务器,其中,所述由密钥加工后的元数据信息还包括:元数据的过期时间。
  24. 一种辅助数据访问的数据服务器,其中,该数据服务器包括:
    元数据装置,用于从客户端获取由密钥加工后的元数据信息;
    验证装置,用于通过所述密钥对所述由密钥加工后的元数据信息进行验证;
    数据传输装置,用于对所述由密钥加工后的元数据信息验证通过后,向所述客户端传输所述待访问数据。
  25. 如权利要求24所述的数据服务器,其中,当所述元数据信息包括元数据、从所述元数据中提取的部分元数据及用所述密钥加密后的部分元数据时,所述数据传输装置,用于用所述密钥对接收到的所述部分无数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,如果比较一致,则验证通过;根据所述元数据向所述客户端传输所述待访问数据。
  26. 如权利要求25所述的数据服务器,其中,当所述由密钥加工后的元数据信息包括:元数据、从所述元数据中提取的部分元数据、用所述密 钥加密后的部分元数据及元数据的过期时间时,所述数据传输装置,用于用所述密钥对接收到的所述部分无数进行本地加密,并将本地加密后得到的结果与接收到的用所述密钥加密后的部分元数据进行比较,并根据所述元数据的过期时间判断元数据是否过期,如果比较一致且元数据未过期,则验证通过;根据所述元数据向所述客户端传输所述待访问数据。
PCT/CN2016/090821 2015-08-03 2016-07-21 一种数据访问的方法及设备 WO2017020720A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510469417.7A CN106411826B (zh) 2015-08-03 2015-08-03 一种数据访问的方法及设备
CN201510469417.7 2015-08-03

Publications (1)

Publication Number Publication Date
WO2017020720A1 true WO2017020720A1 (zh) 2017-02-09

Family

ID=57942377

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/090821 WO2017020720A1 (zh) 2015-08-03 2016-07-21 一种数据访问的方法及设备

Country Status (2)

Country Link
CN (1) CN106411826B (zh)
WO (1) WO2017020720A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107659574A (zh) * 2017-10-10 2018-02-02 郑州云海信息技术有限公司 一种数据访问控制***
US11469890B2 (en) * 2020-02-06 2022-10-11 Google Llc Derived keys for connectionless network protocols

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102457561A (zh) * 2010-10-28 2012-05-16 无锡江南计算技术研究所 数据访问方法及使用该数据访问方法的设备
CN102546664A (zh) * 2012-02-27 2012-07-04 中国科学院计算技术研究所 用于分布式文件***的用户与权限管理方法及***
US20130151884A1 (en) * 2011-12-09 2013-06-13 Promise Technology, Inc. Cloud data storage system
CN103488755A (zh) * 2013-09-24 2014-01-01 华为技术有限公司 一种文件***访问方法及设备
CN104580487A (zh) * 2015-01-20 2015-04-29 成都信升斯科技有限公司 一种海量数据存储***及处理方法

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104123288B (zh) * 2013-04-24 2018-06-01 阿里巴巴集团控股有限公司 一种数据查询方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102457561A (zh) * 2010-10-28 2012-05-16 无锡江南计算技术研究所 数据访问方法及使用该数据访问方法的设备
US20130151884A1 (en) * 2011-12-09 2013-06-13 Promise Technology, Inc. Cloud data storage system
CN102546664A (zh) * 2012-02-27 2012-07-04 中国科学院计算技术研究所 用于分布式文件***的用户与权限管理方法及***
CN103488755A (zh) * 2013-09-24 2014-01-01 华为技术有限公司 一种文件***访问方法及设备
CN104580487A (zh) * 2015-01-20 2015-04-29 成都信升斯科技有限公司 一种海量数据存储***及处理方法

Also Published As

Publication number Publication date
CN106411826B (zh) 2019-06-18
CN106411826A (zh) 2017-02-15

Similar Documents

Publication Publication Date Title
TWI707245B (zh) 使用高可用性的可信執行環境檢索區塊鏈網路的存取資料
US11108753B2 (en) Securing files using per-file key encryption
US8838961B2 (en) Security credential deployment in cloud environment
US9219722B2 (en) Unclonable ID based chip-to-chip communication
US9805210B2 (en) Encryption-based data access management
JP4662706B2 (ja) サーバーレス分散ファイルシステムにおけるセキュアリカバリ
US8196186B2 (en) Security architecture for peer-to-peer storage system
US11675919B2 (en) Separation of managed and unmanaged data in a computing device
US8863255B2 (en) Security credential deployment in cloud environment
US20140019753A1 (en) Cloud key management
US7970142B2 (en) System, method and apparatus for decrypting data stored on removable media
WO2018032379A1 (zh) 一种用于区块链的非信任远程交易文件安全存储***
JP2017515413A (ja) 継続的な所有者アクセスを伴う、暗号化された仮想マシンの安全なトランスポート
US20210377022A1 (en) Unmanaged secure inter-application data communications
US10516653B2 (en) Public key pinning for private networks
US8265270B2 (en) Utilizing cryptographic keys and online services to secure devices
CN114826652A (zh) 一种基于双区块链的可溯源访问控制方法
US20170329982A1 (en) Performing an operation on a data storage
WO2017020720A1 (zh) 一种数据访问的方法及设备
US20230205908A1 (en) Protected storage for decryption data
KR102649485B1 (ko) 가상 사설 네트워크 시스템 및 그 제어방법
US11804969B2 (en) Establishing trust between two devices for secure peer-to-peer communication
Usharani Integrity and Privacy through Authentication Key Exchange Protocols for Distributed Systems
CN117294457A (zh) 一种数据共享***、方法、装置及电子设备
CN114398331A (zh) 基于区块链的可信数据共享方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16832208

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16832208

Country of ref document: EP

Kind code of ref document: A1