WO2023065969A1 - Access control method, apparatus, and system - Google Patents
Access control method, apparatus, and system Download PDFInfo
- Publication number
- WO2023065969A1 WO2023065969A1 PCT/CN2022/120910 CN2022120910W WO2023065969A1 WO 2023065969 A1 WO2023065969 A1 WO 2023065969A1 CN 2022120910 W CN2022120910 W CN 2022120910W WO 2023065969 A1 WO2023065969 A1 WO 2023065969A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- information
- token
- target
- request
- authorization
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 144
- 238000013475 authorization Methods 0.000 claims abstract description 263
- 238000004891 communication Methods 0.000 claims description 93
- 230000006870 function Effects 0.000 claims description 61
- 230000007717 exclusion Effects 0.000 claims description 53
- 239000003999 initiator Substances 0.000 claims description 39
- 238000004590 computer program Methods 0.000 claims description 17
- 238000007689 inspection Methods 0.000 claims description 11
- 230000005540 biological transmission Effects 0.000 claims description 10
- 230000000875 corresponding effect Effects 0.000 description 78
- 238000012545 processing Methods 0.000 description 31
- 238000010586 diagram Methods 0.000 description 28
- 235000014510 cooky Nutrition 0.000 description 27
- 238000012795 verification Methods 0.000 description 22
- 230000008569 process Effects 0.000 description 16
- 238000004364 calculation method Methods 0.000 description 14
- 230000004044 response Effects 0.000 description 11
- 238000013461 design Methods 0.000 description 10
- 230000000694 effects Effects 0.000 description 7
- 239000003795 chemical substances by application Substances 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 5
- 239000000284 extract Substances 0.000 description 5
- 238000012986 modification Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 230000011218 segmentation Effects 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 4
- 238000012546 transfer Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 230000001419 dependent effect Effects 0.000 description 3
- 238000001914 filtration Methods 0.000 description 2
- 230000014509 gene expression Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000012550 audit Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000000903 blocking effect Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 230000001276 controlling effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000013508 migration Methods 0.000 description 1
- 230000005012 migration Effects 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000002085 persistent effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 230000009897 systematic effect Effects 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/40—Network security protocols
Definitions
- the embodiments of the present application relate to the communication field, and in particular, to an access control method, device and system.
- the present application provides an access control method, device and system, which can perform access control efficiently and flexibly, thereby reducing data leakage.
- an access control method is provided, which can be executed by an authorization server, or by components of the authorization server, such as processors, chips, or chip systems, etc., or can be implemented by all or part of the authorization server.
- a logical module or software implementation of a function Taking the method executed by the authorization server as an example, the method includes: the authorization server receives the token application information for applying for the target token from the client device, generates the target token according to the token application information, and sends the client The device sends the target token.
- the target token includes a token description and a first authorization code
- the token description includes an authorization vector
- the authorization vector indicates target information
- the first authorization code is generated according to the token description, target information, and a password hash function.
- the authorization server issues a token to the client device based on the application of the client device.
- the token includes a token description and a first authorization code.
- Target information so that after receiving the request message, the execution point of the access control policy can obtain the information involved in the calculation of the authorization code based on the authorization vector, and generate the second authorization code.
- Consistent access control for example, allowing access when the second authorization code is consistent with the first authorization code, and denying access when the second authorization code is inconsistent with the first authorization code, thereby preventing data leakage.
- the target information is information to be carried in a request packet of the client device.
- the request message is used to request establishment of a TCP connection to the target resource; or, the request message is used to request access to the target resource.
- the information in the request message is used to participate in the calculation of the authorization code, and subsequent token verification can prevent illegal requests from being sent using the target token.
- subsequent token verification can prevent illegal requests from being sent using the target token.
- an illegal user uses the target token to send a request
- since the calculation of the authorization code needs the information in the request message to participate if he wants to pass the token verification, he needs to falsify the target information in the request message at the same time.
- the information falsification in this article may not be able to complete the illegal request of illegal users, so the target token of this application can be used freely within the scope of authorization without worrying about theft, which can further improve security performance.
- the authorization vector includes an offset value and length information, the offset value indicates the starting position of the target information, and the length information indicates the length of the target information; or, the authorization vector includes Bitmap, the bitmap indicates the fields that carry the target information.
- the target information includes at least one of the following: network layer information corresponding to the target resource, transport layer information, authorization request initiator, request end identifier, requester description information , or responder description information, the target resource is the resource to be accessed by the client device.
- the content included in the target information can be adjusted as needed, so as to flexibly adjust the granularity of access control, and realize multi-level and refined access control.
- the target information can include information at the network layer to implement access control at the network layer, or the target information can include information at the network layer, transport layer, and application layer to achieve fine-grained control at the URL level, or the target information can include the requester or The responder describes information to implement access control on security level, network type, etc.
- the target information when the requirement information included in the token application information indicates the establishment of a TCP connection, the target information includes network layer information and transport layer information corresponding to the target resource;
- the target information includes network layer information, transport layer information, authorization request initiator, and request end identifier corresponding to the target resource;
- the target information includes the first sub-target information corresponding to the initial segment of the complete request message, the second sub-target information corresponding to the middle segment of the complete request message, and the complete The third sub-target information corresponding to the end segment of the request message.
- the first sub-object information includes network layer information, transport layer information, and authorization request initiator;
- the second sub-object information includes network layer information and transport layer information;
- the third sub-object information includes network layer information, transport layer information, and Request terminator.
- the authorization request initiator includes request information and part or all of the Uniform Resource Locator URL prefix of the target resource, and the request information indicates operations related to the target resource.
- the authorization server generates the target token according to the token application information, including: the authorization server determines the requester's access authority according to the requester description information in the token application information ; and determine the authorization request initiator according to the requester's access rights.
- the network layer information includes a source Internet Protocol IP address and a destination IP address;
- the transport layer information includes a destination port, or, includes a destination port and a source port;
- the requester description information Including at least one of the following: identity information of the requesting party, status information of the requesting party, group identification of the requesting party, security level of the requesting party, or network type of the network where the requesting party is located;
- description information of the responding party includes at least one of the following: The group ID of the responder, the security level of the responder, or the network type of the network where the responder is located.
- the token description further includes a validity period and at least one of the following: checking policy, issuer ID, cipher suite, or exclusion information; wherein the validity period indicates the target token's The validity period; the check policy indicates whether to trust the requester of the target resource; the issuer ID indicates the device that issued the target token; the cipher suite indicates information about the cryptographic hash function; and the exclusion information indicates information that is prohibited from being carried.
- the execution point of the access control policy can be further verified according to the validity period, inspection policy, exclusion information, etc., and the security performance can be further improved.
- the prohibited information when the request message is used to request the establishment of a transmission control protocol TCP connection corresponding to the target resource, the prohibited information is the payload; or, the request message is a complete request message
- the prohibited information is the request end character; or, when the request message is the end segment of the complete request message, the prohibited information is the request information; or, the request message is the complete request message
- the prohibited information is the request information and the request terminator; or, when the request message is a complete request message, the exclusion information indicates that it is prohibited to carry multiple request information and multiple request terminators.
- an access control method is provided, which can be executed by a gateway device, or by a component of the gateway device, such as a processor, a chip, or a chip system, etc., and can also be implemented by all or part of the gateway device A logical module or software implementation of a function.
- the method includes: the gateway device receives a request message from a client device including a target token and target information, the target token includes a token description and a first authorization code, and the token The description includes the authorization vector, and the authorization vector indicates the target information; then, the gateway device generates a second authorization code according to the token description, target information, and secret key hash function; when the second authorization code is the same as the first authorization code, the gateway device sends The data server forwards the request message.
- the request message includes a target token and target information
- the token includes a token description and a first authorization code
- the token description includes an authorization vector
- the authorization vector indicates the target information participating in the calculation of the authorization code
- the gateway device does not need to maintain access control policies or access control lists. Compared with the existing ACL and firewall solutions, it can be deployed flexibly, reducing the cost of deployment and use.
- the gateway device does not need to analyze the application layer semantics of the request message, and does not need to query the access control policy and user information.
- Scale decoupling enables efficient access control.
- the authorization vector includes an offset value and length information, the offset value indicates the starting position of the target information, and the length information indicates the length of the target information; or, the authorization vector includes Bitmap, the bitmap indicates the fields that carry the target information.
- the target information includes at least one of the following: network layer information corresponding to the target resource, transport layer information, authorization request initiator, request end identifier, requester description information , or responder description information, the target resource is the resource to be accessed by the client device.
- the authorization request initiator includes request information and a part or all of the Uniform Resource Locator URL prefix of the target resource, and the request information indicates operations related to the target resource.
- the network layer information includes a source Internet Protocol IP address and a destination IP address;
- the transport layer information includes a destination port, or, includes a destination port and a source port;
- the requester description information Including at least one of the following: identity information of the requesting party, status information of the requesting party, group identification of the requesting party, security level of the requesting party, or network type of the network where the requesting party is located;
- description information of the responding party includes at least one of the following: The group ID of the responder, the security level of the responder, or the network type of the network where the responder is located.
- the token description further includes a validity period and at least one of the following: checking policy, issuer ID, cipher suite, or exclusion information; wherein the validity period indicates the target token's The validity period; the check policy indicates whether to trust the requester of the target resource; the issuer ID indicates the device that issued the target token; the cipher suite indicates information about the cryptographic hash function; and the exclusion information indicates information that is prohibited from being carried.
- the method further includes: the gateway device determines that the target token has not expired according to the validity period of the target token. Based on this embodiment, by checking the validity period, it is possible to prevent illegal users from using expired tokens to send requests.
- the method further includes: the gateway device determines, according to the inspection policy, that the requester of the target resource is trusted; or, the gateway device determines, according to the inspection policy, that the requester of the target resource is not trusted, And determine that the request message is legal according to the exclusion information.
- the gateway device determines that the request message is legal according to the exclusion information, including: when the request message does not carry prohibited information, the gateway device determines that the request message is legal.
- the exclusion information when the exclusion information is the first value, the prohibited information is the payload; when the exclusion information is the second value, the prohibited information is the request terminator; the exclusion information When it is the third value, the prohibited information is the request information; when the excluded information is the fourth value, the prohibited information is the request information and the request terminator; when the excluded information is the fifth value, it indicates that it is forbidden to carry multiple request information and Multiple request terminators.
- the method further includes: the gateway device extracts target information from the request message according to the authorization vector.
- an access control method is provided, which can be executed by a client device, or by a component of the client device, such as a processor, a chip, or a chip system, etc., and can also be implemented by all or part of the Logical modules or software implementations of client device functionality.
- the method includes: the client device sends token application information for applying for a target token to the authorization server, then obtains the target token, and sends a request message, and the request message
- the text includes target token and target information.
- the target token includes a token description and a first authorization code
- the token description includes an authorization vector
- the authorization vector indicates target information
- the first authorization code is generated according to the token description, target information, and a password hash function.
- the authorization server issues a token to the client device based on the application of the client device, and the client device carries the token when sending a request message.
- the token includes a token description and a first authorization code
- the token description includes an authorization vector, which indicates the target information involved in the calculation of the authorization code, so that after receiving the request message, the gateway device or the data server side can
- the vector obtains the information involved in the calculation of the authorization code, and generates the second authorization code, and performs access control based on whether the first authorization code is consistent with the second authorization code, for example, access is allowed when the second authorization code is consistent with the first authorization code , deny access when the second authorization code is inconsistent with the first authorization code, thereby preventing data leakage.
- the authorization vector includes an offset value and length information, the offset value indicates the starting position of the target information, and the length information indicates the length of the target information; or, the authorization vector includes Bitmap, the bitmap indicates the fields that carry the target information.
- the target information includes at least one of the following: network layer information corresponding to the target resource, transport layer information, authorization request initiator, request end identifier, requester description information , or responder description information, the target resource is the resource to be accessed by the client device.
- the authorization request initiator includes request information and part or all of the Uniform Resource Locator URL prefix of the target resource, and the request information indicates operations related to the target resource.
- the network layer information includes a source Internet Protocol IP address and a destination IP address;
- the transport layer information includes a destination port, or, includes a destination port and a source port;
- requester description information Including at least one of the following: identity information of the requesting party, status information of the requesting party, group identification of the requesting party, security level of the requesting party, or network type of the network where the requesting party is located;
- description information of the responding party includes at least one of the following: The group ID of the responder, the security level of the responder, or the network type of the network where the responder is located.
- the client device acquires the target token, including: the client device according to the authorization request initiator corresponding to the target resource, and the authorization request initiator and token Correspondence, find the target token.
- the token description further includes a validity period and at least one of the following: checking policy, issuer ID, cipher suite, or exclusion information; wherein the validity period indicates the target token's The validity period; the check policy indicates whether to trust the requester of the target resource; the issuer ID indicates the device that issued the target token; the cipher suite indicates information about the cryptographic hash function; and the exclusion information indicates information that is prohibited from being carried.
- the prohibited information when the request message is used to request the establishment of a transmission control protocol TCP connection corresponding to the target resource, the prohibited information is the payload; or, the request message is a complete request message
- the prohibited information is the request end character; or, when the request message is the end segment of the complete request message, the prohibited information is the request information; or, the request message is the complete request message
- the prohibited information is the request information and the request terminator; or, when the request message is a complete request message, the exclusion information indicates that it is prohibited to carry multiple request information and multiple request terminators.
- the token application information includes at least one of the following: network layer information, transport layer information, application layer information, requester description information, or demand information corresponding to the target resource ;
- the application layer information includes at least one of the following: the URL of the target resource, request information, or request terminator; the requirement information indicates at least one of the following: the expected token usage time, whether the complete request message is segmented, and whether to establish a TCP connection .
- a communication device for implementing the above various methods.
- the communication device may be the authorization server in the first aspect, or a device included in the authorization server, such as a chip or a module; or, the communication device may be the gateway device in the second aspect, or a device included in the gateway device, such as a chip or a module; or, the communication device may be the client device in the third aspect, or a device included in the client device, such as a chip.
- the communication device includes a corresponding module, unit, or means (means) for implementing the above method, and the module, unit, or means can be implemented by hardware, software, or by executing corresponding software on hardware.
- the hardware or software includes one or more modules or units corresponding to the above functions.
- the communication device may include a transceiver module and a processing module.
- the transceiver module which may also be referred to as a transceiver unit, is configured to implement the sending and/or receiving functions in any of the above aspects and any possible implementation manners thereof.
- the transceiver module may be composed of a transceiver circuit, a transceiver, a transceiver or a communication interface.
- the processing module may be used to implement the processing functions in any of the above aspects and any possible implementation manners thereof.
- the transceiver module includes a sending module and a receiving module, respectively configured to implement the sending and receiving functions in any of the above aspects and any possible implementations thereof.
- a communication device including: a processor and a communication interface; the communication interface is used to communicate with modules other than the communication device; the processor is used to execute computer programs or instructions, so that the communication device Perform the method described in any one of the above aspects.
- the communication device may be the authorization server in the first aspect, or a device included in the authorization server, such as a chip or a module; or, the communication device may be the gateway device in the second aspect, or a device included in the gateway device, such as a chip or a module; or, the communication device may be the client device in the third aspect, or a device included in the client device, such as a chip.
- a communication device including: an interface circuit and a processor, the interface circuit is a code/data read and write interface circuit, and the interface circuit is used to receive computer-executed instructions (computer-executed instructions are stored in a memory, possibly read directly from the memory, or possibly through other devices) and transmit to the processor; the processor is used to execute computer-executed instructions to enable the communication device to perform the method described in any aspect above.
- the communication device may be the authorization server in the first aspect, or a device included in the authorization server, such as a chip or a module; or, the communication device may be the gateway device in the second aspect, or a device included in the gateway device, such as a chip or a module; or, the communication device may be the client device in the third aspect, or a device included in the client device, such as a chip.
- a communication device including: at least one processor; the processor is configured to execute computer programs or instructions, so that the communication device executes the method described in any aspect above.
- the communication device may be the authorization server in the first aspect, or a device included in the authorization server, such as a chip or a module; or, the communication device may be the gateway device in the second aspect, or a device included in the gateway device, such as a chip or a module; or, the communication device may be the client device in the third aspect, or a device included in the client device, such as a chip.
- the communication device includes a memory for storing necessary program instructions and data.
- the memory can be coupled to the processor, or it can be independent of the processor.
- the communication device may be a chip or system-on-a-chip.
- the device When the device is a system-on-a-chip, it may consist of chips, or may include chips and other discrete devices.
- a computer-readable storage medium is provided, and instructions are stored in the computer-readable storage medium.
- the computer-readable storage medium is run on a communication device, the method described in any one of the above aspects is executed.
- a computer program product including instructions, which, when run on a communication device, enable the method described in any one of the above aspects to be executed.
- the above-mentioned sending action/function can be understood as output information
- the above-mentioned receiving action/function can be understood as input information
- the technical effect brought by any one of the design methods from the fourth aspect to the ninth aspect can refer to the technical effects brought by the different design methods in the above-mentioned first aspect or the second aspect or the third aspect, and no longer repeat.
- a communication system includes the authorization server, the gateway device, and the client device described in the above aspect.
- Fig. 1 is a schematic diagram of normal access and unauthorized access in a campus network
- FIG. 2 is a schematic diagram of access control based on an access control list
- FIG. 3 is a schematic diagram of access control based on a firewall
- Fig. 4 is a schematic diagram of access control based on JWT
- Fig. 5 is a schematic diagram of access control based on network cookies
- FIG. 6a is a schematic structural diagram of a communication system applicable to the present application.
- FIG. 6b is a schematic diagram of an access control provided by the present application.
- FIG. 7 is a schematic flowchart of an access control method provided by the present application.
- FIG. 8 is a schematic diagram of the types of parameters included in target information provided by the present application.
- FIG. 9 is a schematic diagram of the types of parameters included in target information provided by the present application.
- Fig. 10a is a schematic diagram of the types of parameters included in the target information provided by the present application.
- Fig. 10b is a schematic diagram of the types of parameters included in the target information provided by the present application.
- Fig. 10c is a schematic diagram of the types of parameters included in the target information provided by the present application.
- Figure 11a is a schematic diagram of the format of a token provided by this application.
- FIG 11b is a schematic diagram of the format of another token provided by this application.
- FIG. 12a is a schematic structural diagram of an IP packet load provided by the present application.
- FIG. 12b is a schematic structural diagram of an IP packet load provided by the present application.
- FIG. 12c is a schematic structural diagram of an IP packet load provided by the present application.
- FIG. 12d is a schematic structural diagram of an IP packet load provided by the present application.
- Figure 13a is a schematic diagram of the format of a token provided by this application.
- FIG. 13b is a schematic diagram of the format of another token provided by this application.
- Figure 14 is a schematic diagram of a token verification process provided by this application.
- Fig. 15 is a schematic diagram of a sub-sub-process of checking token validity provided by the present application.
- FIG. 16 is a schematic diagram of a client deployment method provided by this application.
- FIG. 17 is a schematic flow diagram of an access control method when deploying request proxy middleware provided by the present application.
- FIG. 18 is a schematic structural diagram of a communication device provided by the present application.
- FIG. 19 is a schematic structural diagram of another communication device provided by the present application.
- plural means two or more than two.
- At least one of the following or similar expressions refer to any combination of these items, including any combination of single or plural items.
- at least one item (piece) of a, b, or c can represent: a, b, c, a and b, a and c, b and c, a and b and c, where a, b, c Can be single or multiple.
- words such as “first” and “second” are used to distinguish the same or similar items with basically the same function and effect.
- words such as “first” and “second” do not limit the number and execution order, and words such as “first” and “second” do not necessarily limit the difference.
- words such as “exemplary” or “for example” are used as examples, illustrations or illustrations. Any embodiment or design scheme described as “exemplary” or “for example” in the embodiments of the present application shall not be interpreted as being more preferred or more advantageous than other embodiments or design schemes.
- the use of words such as “exemplary” or “such as” is intended to present related concepts in a concrete manner for easy understanding.
- references to "an embodiment” throughout the specification mean that a particular feature, structure, or characteristic related to the embodiment is included in at least one embodiment of the present application.
- the various embodiments throughout the specification are not necessarily referring to the same embodiment.
- the particular features, structures or characteristics may be combined in any suitable manner in one or more embodiments.
- the serial numbers of the processes do not mean the order of execution, and the execution order of the processes should be determined by their functions and internal logic, and should not be used in the embodiments of the present application.
- the implementation process constitutes no limitation.
- HTTP Hypertext Transfer Protocol
- the first type of solution is to deploy access control list (access control list, ACL) services on the data plane of the network layer (such as routers/switches), and its principle is shown in Figure 2.
- the authorization server formulates an access control policy from the client address to the data server address, and generates ACL entries.
- ACL configuration that is, send the ACL entry to the gateway through a specific transmission protocol, software, or an out-of-band method.
- the gateway receives the data request from the client, it searches and matches the ACL rules by querying the ACL entries. If the ACL match passes, the data request is forwarded to the data server; if the ACL match fails, the data request is discarded.
- the ACL entry may include an ACL number (ACL Number) and one or more rules (rule).
- Each rule includes a rule identifier (identifier, ID), that is, rule ID, access policy (permit/deny), source address, destination address, and effective time range wait.
- ID a rule identifier
- access policy permit/deny
- rule 5 permit source 10.108.234.100 destination 10.108.234.114 time-range time 1
- rule 10 permit source 10.108.234.101 destination 10.108.234.114 time-range time 2
- ACL entries grow individually and are dependent on each other, making it difficult to delete and other operations.
- ACL entries are bound to addresses, which is very inflexible when address changes and migration deployments are performed, making update and maintenance difficult.
- search and storage of ACL entries generally require the use of special hardware, which is highly dependent on the hardware and requires high deployment and use costs.
- the second type of solution is firewall-based access control, which mainly implements request filtering and connection blocking by deploying a firewall.
- the basic principle is shown in Figure 3. Mainly through the dedicated software and hardware deployed on the firewall device, the information of each layer of the message is analyzed, and many functions such as access policy enforcement, content audit monitoring, and harmful traffic filtering can be realized.
- the firewall When the firewall receives the request from the client, it can execute the access policy, and if the request is legal, it will forward the request to the data server; if the request is not legal, it will discard the request.
- the access control granularity and scope of the firewall are very flexible, and it is one of the main methods of access control in the current campus network.
- the firewall-based access control scheme is implemented by the logic of the data plane. It needs to deploy special equipment and software to analyze the information of each layer of the network. The complexity is high, and the communication overhead and computing overhead are relatively large.
- the third type of scheme is based on application layer token (token) access control.
- the fine-grained access control of data is mainly carried out through the application layer token issued by the server.
- the basic principle is shown in Figure 4.
- the server ( Figure 4 takes the data server as an example, and it can also be a trusted authorization server) verifies the username and password, and issues tokens with corresponding permissions according to user permissions, such as JSON network tokens ( JSON web token, JWT), returned to the client.
- JSON network tokens JSON web token, JWT
- the client stores the token from the server, and embeds the token in the header (usually the Authorization header) of the HTTP request when the request is initiated.
- the data server After the data server receives the request, it extracts the token and uses methods such as querying the database or signature verification to verify the legitimacy of the token. If the token is legal, the request will be responded to, and if the token is not valid, the request will be rejected.
- the above token-based access control needs to consume resources on the data server side for permission verification, and cannot intercept illegal requests before reaching the data server, and cannot block the establishment of unauthorized request connections.
- the fourth type of solution is access control based on zero trust architecture.
- Access control based on zero-trust architecture is not a specific technology, but a design concept based on the assumption that the entire network is untrustworthy and there are persistent internal and external threats. Based on this concept, relevant security technologies are used to build a zero-trust security system. Its access control is completed in two stages.
- the access proxy acts as a backward proxy and is the logic center for the first stage of access policy enforcement. It is used to complete functions such as user/device authentication, credential uninstallation, and sending requests to the backend. , you can deploy ACL to implement coarse-grained access control, and then forward requests.
- the second stage is completed in the back-end application, that is, when the back-end application receives the request, it queries its own service access policy configuration to perform fine-grained access control.
- the access control solution based on zero trust architecture has a high cost of deployment and overhead; in addition, this solution is more about the integration and use of existing access control technologies (such as JWT, ACL engine), and does not Solve the problems existing in the related technology itself.
- existing access control technologies such as JWT, ACL engine
- the fifth type of scheme is a scheme based on network cookies.
- the basic framework of the Network cookies system is shown in Figure 5.
- the client requests a cookie descriptor (descriptor) from the cookie server (server) according to its own needs (for example, to access resources).
- the information included in the cookie descriptor is as follows:
- the client After the client obtains the cookie descriptor, it can locally generate the cookie carried when sending the message.
- the information included in the cookie is as follows:
- the switch or middleware When the switch or middleware receives the cookie-carrying message sent by the client, it searches for the signature key according to the cookie_id, and uses the signature key to calculate the cookie digest, and compares the calculated cookie digest with the cookie's own signature. If the two are the same, further verification is performed according to the cookie timestamp, and if the verification passes, the message is forwarded to the data server, so that the data server provides services corresponding to the cookie_descriptor.
- the method of generating cookies locally after the client obtains the cookie descriptor is adopted.
- the cookie descriptor needs to be synchronized between the client, the cookie server, and the switch/middleware.
- the communication and storage complexity of synchronizing cookie descriptor between client-cookie server-switch/middleware will increase linearly.
- the switch/middleware needs to retrieve the signature key in the cookie descriptor through the cookie carried by the cookie, so the complexity of verifying the validity of the cookie will increase linearly.
- cookie verification is only done through the cookie itself and the information stored in the switch/middleware. If HTTP access control is implemented, there may be cases where illegal users use legitimate cookies to send unauthorized HTTP requests. There will be security gaps in the environment.
- the present application provides an access control method, which can perform access control reasonably, efficiently and flexibly, thereby reducing data leakage.
- the method provided by this application can be used for access control of various transmission protocols with standardized formats, including but not limited to HTTP, for example, it can also be applied to other protocols such as file transfer protocol (file transfer protocol, FTP).
- HTTP HyperText Transfer Protocol
- FTP file transfer protocol
- Fig. 6a is a schematic structural diagram of a communication system 600 applied by an embodiment of the present application.
- the communication system includes a client device 601 and an authorization server 602 .
- the communication system may further include a data server 603 or a gateway device 604 .
- the authorization server is a setting point for access control policies, such as issuing tokens.
- Data servers are responders for data or resources.
- the gateway device is the execution point of the access control policy, for example, for token verification; or, the execution point of the access control policy may also be the data server, that is, the token verification can be performed on the data server side.
- the client device first sends token application information to the authorization server, and then the authorization server Return the target token to the client device.
- the client device sends the request message, it sends the target token in the request message.
- the gateway device verifies the legitimacy of the token after receiving the request message, and forwards the request message to the data server when the token is legal. Subsequently, the data server may send a response to the request message.
- the gateway device can directly forward the request message to the data server after receiving the request message, and the data server will perform token verification, and can send the request message to the client device when the token is valid. response.
- the authorization server and the data server may be an application server or a personal computer (personal computer, PC).
- the gateway device may be a network device capable of forwarding data packets, such as a router and a switch.
- the client device may be a terminal device with a communication function.
- the client device may be: an Internet of Things (Internet of Things, IoT) device (for example, a sensor, an electric meter, a water meter, etc.), a vehicle networking (vehicle to everything, V2X) device, a wireless local area network (wireless local area networks, Station (station, ST) in WLAN), personal digital assistant (PDA) equipment, handheld equipment (such as mobile phone) with wireless communication function, computing equipment or other processing equipment connected to a wireless modem, vehicle equipment, Wearable devices (also called wearable smart devices), tablet computers or computers with wireless transceiver functions, etc.
- IoT Internet of Things
- V2X vehicle to everything
- V2X vehicle to everything
- wireless local area network wireless local area networks
- PDA personal digital assistant
- handheld equipment such as mobile phone
- the communication system described in the embodiment of the present application is to illustrate the technical solutions of the embodiments of the present application more clearly, and does not constitute a limitation to the technical solutions provided in the embodiments of the present application.
- the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
- the executive body may perform some or all of the steps in the embodiments of the present application, these steps or operations are only examples, and the embodiments of the present application may also perform other operations or variations of various operations.
- each step may be performed in a different order presented in the embodiment of the present application, and it may not be necessary to perform all operations in the embodiment of the present application.
- the client device sends token application information to the authorization server.
- the authorization server receives token application information from the client device.
- the token application information is used to apply for the target token.
- the token application information may include at least one of the following: network layer information corresponding to the target resource, transport layer information corresponding to the target resource, application layer information corresponding to the target resource, requester description information corresponding to the target resource, or demand information.
- the target resource is a resource to be accessed by the client device.
- the target resource can be any resource on the Internet, and its location on the Internet can be identified by a uniform resource locator (URL).
- URL uniform resource locator
- This application refers to The data server provides (or responds to) the target resource as an example for illustration.
- a specific URL may be w3.huawei.com/next/indexa.html.
- the network layer information may include a source Internet Protocol (internet protocol, IP) address and a destination IP address.
- IP Internet Protocol
- the source IP address corresponding to the target resource is the IP address of the client device, and the destination IP address is the IP address of the data server.
- the transport layer information may include a destination port (port), or may include a destination port and a source port.
- the destination port corresponding to the target resource is the port of the data server, and the source port is the port of the client device.
- the application layer information may include at least one of the following: URL of the target resource, request information, and request terminator.
- the request information indicates the operation related to the target resource, and the URL and the request information can indicate the resource that a certain request wants to access and the metadata to be operated on.
- the request information may be a method (method), such as Get, Post, Connect, etc.;
- the request information may be a command (command), such as Put, Delete, etc.
- the request terminator when there is no request body in the HTTP request, the request terminator can be /r/n/r/n; when there is a request body in the HTTP request, the request terminator can be 0/r/n/r /n.
- the form of the request terminator may be pre-negotiated between the authorization server and the client device, or may be configured or notified by the authorization server to the client device.
- the requestor corresponding to the target resource may include a client device and/or a user.
- the user may log in on the client device as an account (ie, user name), and request to access the target resource.
- the requester description information corresponding to the target resource may include at least one of the following: identity information of the requester (such as user name and password, certificate of the client device, etc.), status information of the requester (such as a summary of the running state of the client device), The group identifier of the requesting party, the security level of the requesting party, or the network type of the network where the requesting party is located (such as a mobile network or a fixed network).
- the requirement information indicates at least one of the following: expected token usage time, whether the complete request message is segmented, and whether a transmission control protocol (transmission control protocol, TCP) connection is established.
- TCP connection refers to the TCP connection corresponding to the target resource, or refers to the TCP connection between the client device and the data server. Usually before a certain request, a TCP connection between the client device and the data server needs to be established.
- the client device can establish a secure and trusted channel with the authorization server through a secure transport layer (transport layer security, TLS) protocol, out-of-band configuration, etc.
- TLS transport layer security
- the authorization server sends the token application information to prevent the token application information from being tampered with or leaked.
- the authorization server generates a target token according to the token application information.
- the target token includes a token description (TokenDescrption) and a first authorization code (AuthCode).
- the token description includes an authorization vector (AuthVector), which indicates target information.
- the first authorization code is generated based on the token description, target information, and a cryptographic hash function.
- the first authorization code is generated by a character string composed of token description and target information through a cryptographic hash function.
- the cryptographic hash function can be an HMAC algorithm.
- the calculation formula of the authorization code can be expressed as the following formula (1):
- AuthVector HMAC(TokenDescrption
- MasterKey is the key of password hash function
- MasterKey can be generated by the authorization server and updated periodically.
- the authorization server can also send the MasterKey to the gateway device or data server for token verification.
- the target information is information to be carried in the request message of the client device, or in other words, the target information is some bytes in the request message. That is, the information in the request message participates in the calculation of the authorization code.
- the target information can be expressed as AuthSegments, and the above formula (1) can be replaced with the following formula (2):
- AuthVector HMAC(TokenDescrption
- the information in the request message is used to participate in the calculation of the authorization code, and subsequent token verification can prevent illegal requests from being sent using the target token.
- an illegal user uses the target token to send a request
- since the calculation of the authorization code needs the information in the request message to participate if he wants to pass the token verification, he needs to falsify the target information in the request message at the same time.
- the information falsification in this article may not be able to complete the illegal request of illegal users, so the target token of this application can be used freely within the scope of authorization without worrying about theft.
- the network cookies scheme it can further improve security performance.
- the target information may include at least one of the following: network layer information, transport layer information, authorization request initiator, request end identifier, requester description information, or responder description information corresponding to the target resource.
- the destination IP address in the network layer information included in the destination information may be the complete IP address of the data server, or may be a prefix of the IP address of the data server.
- the destination token can be used when accessing multiple data servers under the IP address prefix.
- the authorization request initiator includes request information and part or all of the URL prefix of the target resource.
- the authorization server can flexibly control the access scope. For example, taking the URL of the target resource as w3.huawei.com/next/indexa.html as an example, if the URL prefix part of the target resource in the authorization request initiator is w3.huawei.com, it means that the authorization server is the requester Authorize the relevant operation permissions under the host; if the URL prefix part of the target resource in the authorization request initiator is w3.huawei.com/next, it means that the authorization server grants the requester the relevant operation permissions under the next target in the host. Based on the relevant operation permissions granted to the host, the access scope of the requester is narrowed.
- the authorization server may determine the requester's access rights according to the requester's description information, and then determine the authorization request initiator according to the requester's access rights.
- the authorization server may pre-store or configure the corresponding relationship between the access authority and the requesting party, and after receiving the requesting party description information of the client device, it may obtain the information of the requesting party, and then search for the requesting party according to the corresponding relationship. access rights.
- the responder is a data server
- the responder description information may include at least one of the following: a group identifier of the responder, a security level of the responder, or a network type of a network where the responder is located.
- the authorization server may determine the parameters included in the target information according to the requirement information in the token application information. Exemplary:
- the target information includes network layer information and transport layer information corresponding to the target resource.
- the target token may be called a TCP connection token.
- the target information includes network layer information, transport layer information, authorization request initiator, and request end identifier corresponding to the target resource.
- the target token can be recorded as A_Token.
- the target information includes the first sub-target information corresponding to the start segment of the complete request message, the second sub-target information corresponding to the middle segment, and the third sub-target information corresponding to the end segment. subgoal information.
- the target token includes the first sub-target token (denoted as S_Token) corresponding to the start segment, the second sub-target token (denoted as M_Token) corresponding to the middle segment, and the third sub-target token corresponding to the end segment Sub-target token (denoted as E_Token).
- the initial segment of the complete request message includes an IP header, a TCP header, and a payload (payload), and the payload includes request information, URL, and part of request bytes.
- the first sub-object information corresponding to the initial segment includes network layer information, transport layer information, and authorization request initiator.
- the middle segment of the complete request message includes an IP header, a TCP header, and a payload (payload), and the payload includes part of the request bytes.
- the second sub-object information corresponding to the middle segment includes network layer information and transport layer information.
- the end segment of the complete request packet includes an IP header, a TCP header, and a payload (payload), and the payload includes a part of request bytes and a request terminator.
- the third sub-object information corresponding to the end segment includes network layer information, transport layer information, and a request terminator.
- the authorization server can generate a TCP connection token and A_Token; or, can generate a TCP connection token, S_Token, M_Token, and E_Token; or, can generate a TCP connection token, A_Token, S_Token, M_Token, and E_Token.
- the content of the target information can be adjusted as needed, so as to flexibly adjust the granularity of access control and realize multi-level and refined access control.
- the target information can include information at the network layer to implement access control at the network layer, or the target information can include information at the network layer, transport layer, and application layer to achieve fine-grained control at the URL level, or the target information can include the requester or The responder describes information to implement access control on security level, network type, etc.
- the authorization vector may include offset value (offset) and length (length) information
- the offset value indicates the starting position of the target information
- the length information indicates the length of the target information.
- the offset value may be an offset of the start position of the target information relative to the start position or end position of the request message.
- the length information indicates the length from offset.
- the grant vector may include multiple offset values and multiple length information, respectively indicating the multiple parameters.
- the target information includes parameter 1 and parameter 2
- the authorization vector may include offset value 1 and length 1 to indicate the starting position and length of parameter 1, and offset value 2 and length 2 to indicate the starting position and length of parameter 2. start position and length.
- the format of the target token may be as shown in FIG. 11a.
- the authorization vector may include a bitmap, where the bitmap indicates a field bearing target information.
- the bitmap includes N bits, N is the total number of fields included in the request message, each bit corresponds to a field in the request message, and the authorization server can set the bit corresponding to the field carrying the target information as 1. Taking N equal to 8 as an example, if the target information includes information carried in fields 4-6, the bitmap may be 00011100. In this case, for example, the format of the target token may be as shown in FIG. 11b.
- the authorization server can know the format of the request message even if the client device does not send the request message, and then can indicate the target information through the authorization vector.
- the authorization server sends the target token to the client device. Accordingly, the client device receives the target token from the authorization server.
- the authorization server may send the target token to the client device through a secure and trusted channel with the client device.
- the token sent by the authorization server to the client device may include a TCP connection token and A_Token; or, may include a TCP connection token, S_Token, M_Token, and E_Token; or may include a TCP connection token, A_Token, S_Token, M_Token, and E_Token.
- the client device may establish a correspondence between the authorization request initiator corresponding to the target resource and the target token.
- the authorization request initiator corresponding to the target resource can be obtained by the client device according to the authorization vector of the target token, or it can be sent by the authorization server to the client device, that is, in addition to the target token, the authorization server also sends The end device returns the authorization request initiator corresponding to the target resource.
- the above steps S701-S703 may be continued to obtain tokens corresponding to other resources, so as to establish a correspondence table between authorization request initiators and tokens.
- the correspondence table may be shown in Table 1 below.
- step S704 is performed.
- the client device acquires the target token.
- step S704 may include: searching for the target token according to the authorization request initiator corresponding to the target resource and the corresponding relationship between the authorization request initiator and the token.
- this step S704 can be understood as the above: the client device receives the target token from the authorization server. After the client device receives the target token from the authorization server, it can be used directly.
- the client device sends a request packet.
- the gateway device receives the request message from the client device.
- the request message includes the target token and target information.
- the request message may be used to request establishment of a TCP connection corresponding to the target resource, or may be used to request access to the target resource, for example, the request message may be an HTTP request message or an FTP request message.
- the target token can be carried in the network layer header of the request message.
- the specific position of the target token in the network layer header can be determined according to the specific network layer protocol.
- the target token can be carried in option fields such as the destination option (destination option) of the network layer header; when the network layer protocol is New IP (NewIP), the target token can carry or in the security option field of the network layer header.
- the target token can be carried in the application layer of the request message.
- the execution point of the access control policy may be a gateway device, that is, the gateway device performs token verification.
- the execution point of the access control policy can be the data server, that is, the data server performs token verification.
- the target token may be a TCP connection token.
- the execution point of the access control policy is the gateway device, the use of the TCP connection token enables the unauthorized client device to be identified and filtered when requesting to establish a TCP connection, realizing the first communication between the client device and the data server. Packet interception.
- the application layer of the client device may generate a complete request message for requesting access to the target resource. Subsequently, the application layer delivers the complete request message to the transport layer, and the transport layer determines whether to perform TCP segmentation on the complete request message, and in the case of TCP segmentation, marks the type of each segment and delivers it to the network layer. After the network layer receives the message from the transport layer, it identifies the segment type and adds the corresponding target token to the network layer header.
- HTTPSeg HTTPSeg
- HTTPSeg when HTTPSeg is equal to 1, it indicates the initial segment of the complete request message.
- the load of the IP message includes the HTTP request initiator (ie method+URL) and the remaining HTTP request part, and the corresponding target token For S_Token.
- HTTPSeg when HTTPSeg is equal to 2, it means the middle segment of the complete request message, the payload of the IP message includes the rest of the HTTP request, and the corresponding target token is M_Token.
- HTTPSeg when HTTPSeg is equal to 3, it means the end segment of the complete request message, the payload of the IP message includes the remaining HTTP request part and the request terminator, and the corresponding target token is E_Token.
- the gateway device or the data server generates a second authorization code according to the token description, the target information, and the key hash function.
- step S706 is performed by the gateway device.
- step S706 is executed by the data server.
- the gateway device needs to forward the request message to the data server.
- the step S706 performed by the gateway device is taken as an example for illustration.
- the method of generating the second authorization code by the gateway device or the data server and the key used are the same as those of the authorization server.
- the target information may be extracted from the request message by the gateway device or the data server according to the authorization vector in the token description.
- step S706 when the second authorization code is the same (or consistent) with the first authorization code, if step S706 is executed by the gateway device, the following step S707 can be continued; if step S706 is executed by the data server, the following step can be continuously executed Step S708.
- the gateway device or the data server may discard the request message.
- the gateway device can forward the request message to the data server through the first path; or, the gateway device can add a label to the request message, and forward the tagged request message to the data server. server.
- the data server receives a request message through the first path or receives a request message with a label, it can know that the request message is a message that fails token verification, and then perform corresponding processing, for example, discard the request message text or respond to partial requests.
- the execution point of the access control policy is the gateway device, compared with the existing JWT scheme, the illegal request can be intercepted before reaching the data server.
- the gateway device forwards the request message to the data server.
- the data server receives the request message from the gateway device.
- the gateway device may forward the request message to the data server through the second path.
- the data server receives the request message through the second path, it can know that the request message is a message that passes the token verification, so as to execute the following step S708.
- the data server sends a response message to the client device.
- the client device receives the response message from the data server.
- the response message is a response to the above request message.
- the client device can perform related processing according to the response message, which is not specifically limited in this application.
- the authorization server issues a token to the client device based on the application of the client device, and the client device carries the token when sending a request message.
- the token includes a token description and a first authorization code
- the token description includes an authorization vector, which indicates the target information involved in the calculation of the authorization code, so that after receiving the request message, the gateway device or the data server side can
- the vector obtains the information involved in the calculation of the authorization code, and generates the second authorization code, and performs access control based on whether the first authorization code is consistent with the second authorization code, for example, access is allowed when the second authorization code is consistent with the first authorization code , deny access when the second authorization code is inconsistent with the first authorization code, thereby preventing data leakage.
- the authorization server can flexibly formulate access control policies, that is, it can flexibly formulate tokens without synchronizing access control policies with the gateway device, so that the gateway device does not need to maintain access control policies or access control lists.
- the gateway device does not need to maintain access control policies or access control lists.
- the execution point of the access control policy does not need to analyze the application layer semantics of the request message, and does not need to query the access control policy and user information.
- Policies and user scales are decoupled to achieve efficient access control.
- the token description may also include an expiration date (ExpiredTime) and at least one of the following: check policy (CheckPolicy), issuer ID (IssuerID), cipher suite (CypherSuit), or exclusion information (Exclude).
- CheckPolicy check policy
- issuer ID issuer ID
- CipherSuit cipher suite
- Exclusion information Exclude
- the format of the target token may be as shown in Figure 13a or Figure 13b.
- the validity period indicates the limited duration of the target token.
- the limited period may be determined by the authorization server according to the expected token usage time indicated by the requirement information.
- the checking policy indicates whether to trust the requester of the target resource, or indicates whether to trust the user of the target token.
- CheckPolicy when CheckPolicy is set to 0, it means that the requester of the target resource is trusted; when CheckPolicy is set to 1, it means that the requester of the target resource is not trusted.
- the global inspection strategy is unique, that is, when all requesters in the network are trusted or distrusted, the inspection strategy can be omitted.
- the authorization server may determine whether to trust the requester of the target resource according to the description information of the requester, so as to set the checking policy. For example, when the client device is authenticated by the authorization server and the user is a trusted user, it is determined to trust the requester of the target resource, and CheckPolicy is set to 0. When the client device is not authenticated by the authorization server or the user is untrustworthy, it is determined that the requester of the target resource is not trusted, and CheckPolicy is set to 1.
- the issuer identifier indicates the device that issues the target token (referred to as a token issuing device), that is, indicates the authorization server.
- the enforcement point of the access control policy can look up the relevant information of the token issuing device through this identification.
- the token issuing device is globally unique, the issuer ID can be omitted.
- the cipher suite indicates information about a cryptographic hash function used to calculate the authorization code.
- the enforcement point of the access control policy can determine the cryptographic information required for token verification according to the cipher suite.
- the cipher suite may include the identifier of the MasterKey, so that the execution point of the access control policy determines the MasterKey according to the identifier; or, the execution point of the access control policy may also determine the type and length of the cryptographic hash function according to the cipher suite.
- the exclusion information indicates information that is prohibited from being carried, and the information that is prohibited from being carried is information that is prohibited from being carried in the request message of the client device.
- the exclusion information indicates information that cannot appear in the request message. Exclusion information MAY be omitted when the checking policy indicates that the requestor of the target resource is trusted.
- the prohibited information is payload.
- the exclusion information may be set as a first value, for example, the first value may be 0.
- the prohibited information is the request terminator.
- the exclusion information may be set as a second value, for example, the second value may be 1.
- the prohibited information is request information.
- the exclusion information may be set as a third value, for example, the third value may be 2.
- the prohibited information is the request information and the request terminator.
- the exclusion information may be set as a fourth value, for example, the fourth value may be 3.
- the exclusion information indicates that it is forbidden to carry multiple request information and multiple request terminators.
- the exclusion information may be set to a fifth value, for example, the fifth value may be 4.
- the authorization server may determine the relevant information of the request message according to the requirement information from the client device, so as to set the exclusion information. For example, when the demand information indicates the establishment of a TCP connection, the request message is used to establish the TCP connection corresponding to the target resource, and the exclusion information can be set to the first value; when the demand information indicates a complete request message segment, the exclusion information corresponding to the initial segment Can be set to a second value, etc.
- Figure 14 is a verification process of the gateway device, as shown in Figure 14, the verification process includes the following steps:
- the target protocol is a protocol currently undergoing access control, such as HTTP protocol or FTP protocol, and of course other transmission protocols, which are not specifically limited in this application.
- step S1402 if the destination port is a port corresponding to the target protocol, perform the following step S1402; if the destination port is not a port corresponding to the target protocol, perform other access control procedures.
- this application does not limit, here I won't go into details.
- step S1403 if the request message carries the target token, perform the following step S1403; if the request message does not carry the token, discard the request message.
- the gateway device may acquire the valid period of the target token from the token description, so as to determine whether the target token has expired according to the valid period of the target token. This application assumes that the target token has not expired.
- the target token when the token legality checking sub-process outputs the first result, the target token is legal; when the token legality checking sub-process outputs the second result, the target token is invalid.
- the first result may be expressed as Y
- the second result may be expressed as N.
- step S1405 if the target token is legal, perform the following step S1405; if the target token is invalid, discard the request message, or forward the request message to the data server through the first path, or add a label to the request message After forwarding to the data server, you can refer to the relevant description in the above step S706, and will not repeat it here.
- the token validity checking sub-process includes the following steps:
- the gateway device may determine whether to trust the requester of the target resource according to the check policy in the token description. For example, when the check policy is set to 0, it is determined to trust the requester of the target resource; when the check policy is set to 1, it is determined not to trust the requester of the target resource.
- step S1502 if the requester of the target resource is not trusted, perform the following step S1502; if the requester of the target resource is trusted, perform the following step S1503.
- the request message does not carry the prohibited information indicated by the exclusion information, it is determined that the request message is legal; if the request message carries the prohibited information, the request message is invalid, and the request message can be discarded.
- the request packet may be discarded.
- the request message may be discarded.
- the request message may be discarded.
- the request message may be discarded.
- the request message when the request message carries a single request information and a single request terminator, continue to perform the following step S1503; when the request message carries multiple request information or multiple request terminators, the request message can be discarded.
- step S1503. Extract target information from the request packet according to the authorization vector. After the target information is extracted, the following step S1504 can be continued.
- the relevant information of the cryptographic hash function may be determined according to the cryptographic suite in the token description.
- step S1504 reference may be made to the relevant description in the above-mentioned step S706, which will not be repeated here.
- the first authorization code when the first authorization code is the same as the second authorization, output the first result and return to the process shown in Figure 14; when the first authorization code is different from the second authorization code, output the second result and return to the process shown in Figure 14 process.
- the first result is expressed as Y and the second result is expressed as N as an example for illustration.
- the use of tokens involves information interaction and cooperation between the application layer and the network layer, and the existing network model may no longer be applicable.
- the token application is mainly implemented by the application layer
- the application of the token (such as embedding a message) is mainly implemented by the network layer.
- the application layer and the network layer need to interact so that the network layer correctly
- the token is embedded in the message, for example, the application layer needs to indicate to the network layer the token corresponding to the TCP connection, the complete request message, and each segment of the complete request message.
- the following three deployment methods can be adopted: 1) deployment based on request proxy middleware; 2) deployment based on a dedicated browser; 3) deployment based on request proxy.
- the existing general browser and request proxy middleware can be deployed in the client device, and the request proxy middleware realizes the functions of token proxy application and use. For example, realize the sending of token application information, the establishment of the corresponding relationship between resources and tokens, the segmentation and queue sorting of request messages, forward proxy, and the embedding of tokens into request messages, etc.
- the request proxy middleware sets the browser proxy at startup, generates a self-signed certificate, and then issues a self-signed certificate to the browser. Among them, the request proxy middleware can regenerate the self-signed certificate after each startup.
- the browser After the browser receives the self-signed certificate, it adds the self-signed certificate to the browser or system trust certificate list, and uses the username and password to log in to the agent.
- the proxy middleware After the user logs in, the proxy middleware is requested to establish a connection to the authorization server.
- the request proxy middleware may have a built-in authorization server to approve the certificate, and encrypt and send relevant information of the request proxy middleware, the client device, and the user to the authorization server.
- the authorization server can verify the legitimacy of the request agent middleware, the client device, and the user, and establish a connection with the request agent middleware after passing the verification.
- the browser sends an HTTP request to the request proxy middleware.
- the proxy middleware receives the HTTP request, if the size of the HTTP request is greater than the maximum segment size (MSS) of the TCP packet, the proxy middleware is requested to segment the received HTTP request and build a request queue. If the size of the HTTP request is smaller than the MSS size of the TCP packet, no segmentation is performed.
- MSS maximum segment size
- the proxy middleware can extract the parameters included in the token application information from the HTTP request, such as network layer information, transport layer information, application layer information, etc., and then send the token application information to the authorization server.
- the authorization server generates the target token after receiving the token application information, and returns the target token to the request proxy middleware.
- the target token may include a TCP connection token and A_Token, or may include a TCP connection token, S_Token, M_Token, and E_Token.
- the request proxy middleware After receiving the target token, the request proxy middleware establishes the corresponding relationship between resources and tokens.
- the request proxy middleware initiates a TCP connection request to the data server, and the TCP connection request carries a TCP connection token.
- the gateway device forwards the TCP connection request to the data server after verifying that the token is legal.
- the data server accepts and establishes a TCP connection.
- the request proxy middleware After the TCP connection is established, the request proxy middleware initiates HTTP requests according to the queue order of the request queue, and carries the corresponding token in the HTTP request. For example, in the case of HTTP segmentation, embed the corresponding token in the request according to HTTPSeg token.
- the gateway device forwards the HTTP request to the data server after verifying that the token is valid.
- the data server responds to the request.
- the request proxy middleware After receiving the response from the data server, the request proxy middleware sends the response to the browser, and the browser receives and parses the response.
- the request proxy middleware has the operation logic of the application layer and the network layer at the same time.
- it can query the corresponding token and call the underlying network application program interface (application program interface, API ) or raw sockets, and send the token embedded in the request message.
- application program interface application program interface, API
- a dedicated browser can be developed and deployed in the client device, so that the dedicated browser natively supports the above-mentioned functions in the middle of the request agent.
- HTTP HyperText Transfer Protocol
- a dedicated browser needs to parse the user request to construct an HTTP request, and can extract relevant parameters to apply for a token from the authorization server. After receiving the authorization token, select the token corresponding to the HTTP request as a parameter, directly call the underlying network API or raw socket to construct the network layer data packet of the HTTP request, embed the corresponding token into the packet header, and then send it to in the network.
- an existing general browser can be deployed in the client device, and a request proxy is deployed independently of the client device.
- the function of the request proxy is similar to the above-mentioned request proxy middleware. That is to say, the function of the request proxy middleware is deployed on an independent device or proxy server instead of being deployed in the client device. It should be noted that in this deployment method, a remote TCP connection needs to be established between the browser and the request agent.
- this deployment method can be applied to scenarios where the client device cannot install a dedicated browser or request proxy middleware, for example, the client device is an IoT node with limited resources, or a cloud center where the agent is separated from the upper-layer application, etc. Scenes.
- each device may also be implemented by components (such as processors, chips, chip systems, circuits, logic modules, or software) that can be used in the device .
- components such as processors, chips, chip systems, circuits, logic modules, or software
- the present application also provides a communication device, which is used to implement the above various methods.
- the communication device includes hardware structures and/or software modules corresponding to each function.
- the present application can be implemented in the form of hardware or a combination of hardware and computer software with reference to the units and method steps of the examples described in the embodiments disclosed in the present application. Whether a certain function is executed by hardware or computer software drives the hardware depends on the specific application scenario and design constraints of the technical solution.
- FIG. 18 and FIG. 19 are schematic structural diagrams of possible communication devices provided by the embodiments of the present application. These communication devices can be used to realize the functions of the authorization server, the gateway device, the client device, or the data server in the above method embodiments, so the beneficial effects of the above method embodiments can also be realized.
- the communication device may be an authorization server, a gateway device, a client device, or a data server as shown in FIG. 6a, and may also be an authorization server, a gateway device, a client device, or a Modules (such as chips).
- the communication device 180 includes a processing module 1801 and a transceiver module 1802 .
- the communication device 180 is configured to realize functions of an authorization server, a gateway device, a client device, or a data server in the foregoing method embodiments.
- a transceiver module 1802 configured to receive token application information from a client device, where the token application information is used to apply for a target token;
- the processing module 1801 is configured to generate a target token according to the token application information, the target token includes a token description and a first authorization code, the token description includes an authorization vector, the authorization vector indicates the target information, and the first authorization code is based on the order card description, target information, and a cryptographic hash function;
- the transceiver module 1802 is also configured to send the target token to the client device.
- the processing module 1801 is configured to generate the target token according to the token application information, including: the processing module 1801 is configured to determine the access authority of the requester according to the requester description information in the token application information; the processing module 1801 , which is also used to determine the authorization request initiator according to the requester's access rights.
- the transceiver module 1802 is configured to receive a request message from a client device, the request message includes a target token and target information, the target token includes a token description and a first authorization code, the token description includes an authorization vector, and the authorization vector Indicate target information;
- a processing module 1801 configured to generate a second authorization code according to the token description, target information, and key hash function
- the transceiver module 1802 is also used for the gateway device to forward the request message to the data server.
- the processing module 1801 is further configured to determine that the target token has not expired according to the validity period of the target token.
- the processing module 1801 is further configured to determine the requester of the trusted target resource according to the inspection policy; or, the processing module 1801 is further configured to determine the requester of the untrusted target resource according to the inspection policy, and determine the requester of the requester according to the exclusion information.
- the text is legal.
- the processing module 1801 is further configured to determine that the request message is legal according to the exclusion information, including: the processing module 1801 is further configured to determine that the request message is legal when the request message does not carry information prohibited from being carried.
- processing module 1801 is further configured to extract target information from the request message according to the authorization vector.
- Transceiver module 1802 configured to send token application information to the authorization server, where the token application information is used to apply for a target token;
- the processing module 1801 is used to acquire a target token, the target token includes a token description and a first authorization code, the token description includes an authorization vector, the authorization vector indicates target information, and the first authorization code is based on the token description, target information, and generated by cryptographic hash functions;
- the transceiver module 1802 is also configured to send a request message, where the request message includes the target token and target information.
- the processing module 1801 is used to obtain the target token, including: the processing module 1801 is used to search for the target token according to the authorization request initiator corresponding to the target resource and the corresponding relationship between the authorization request initiator and the token. Card.
- processing module 1801 and the transceiver module 1802 can be directly obtained by referring to the relevant descriptions in the method embodiment shown in FIG. 7 , and will not be repeated here.
- the communication device 190 includes one or more processors 1901, communication lines 1902, and at least one communication interface (in FIG. description), optionally, a memory 1903 may also be included.
- the processor 1901 is mainly used to process communication protocols and communication data, control the entire communication device, execute software programs, and process data of the software programs.
- the processor can be a general-purpose central processing unit (central processing unit, CPU), a microprocessor, or an application-specific integrated circuit (application-specific integrated circuit, ASIC).
- the communication line 1902 may be used for communication between different components included in the communication device 190 .
- the communication interface 1904 may be a transceiver or a device such as a transceiver; the transceiver may include a radio frequency circuit and an antenna, and the radio frequency circuit is mainly used for converting baseband signals to radio frequency signals and processing radio frequency signals. Antennas are mainly used to send and receive radio frequency signals in the form of electromagnetic waves.
- the communication interface 1904 may be a transceiver circuit located in the processor 1901 to realize signal input and signal output of the processor.
- the memory 1903 is mainly used to store software programs and data. It may be a device with a storage function. For example, it can be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (random access memory, RAM) or other types of memory that can store information and instructions
- ROM read-only memory
- RAM random access memory
- a dynamic storage device can also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program code in the form of instructions or data structures and can be stored by a computer Any other medium, but not limited to.
- the memory may exist independently and be connected to the processor through the communication line 1902. Memory can also be integrated with the processor.
- the processor 1901 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 19 .
- the communication device 190 may include multiple processors, for example, the processor 1901 and the processor 1908 in FIG. 19 .
- processors may be a single-core processor or a multi-core processor.
- the processor here may include but not limited to at least one of the following: central processing unit (central processing unit, CPU), microprocessor, digital signal processor (DSP), microcontroller (microcontroller unit, MCU), or artificial intelligence
- central processing unit central processing unit, CPU
- microprocessor digital signal processor
- microcontroller microcontroller unit, MCU
- artificial intelligence Various types of computing devices that run software such as processors, each computing device may include one or more cores for executing software instructions to perform calculations or processing.
- the communication device 190 may further include an output device 1905 and an input device 1906 .
- Output device 1905 is in communication with processor 1901 and can display information in a variety of ways.
- the output device 1905 may be a liquid crystal display (liquid crystal display, LCD), a light emitting diode (light emitting diode, LED) display device, a cathode ray tube (cathode ray tube, CRT) display device, or a projector (projector), etc.
- the input device 1906 communicates with the processor 1901 and can receive user input in various ways.
- the input device 1906 may be a mouse, a keyboard, a touch screen device, or a sensory device, among others.
- composition structure shown in FIG. 19 does not constitute a limitation to the communication device. Except for the components shown in FIG. certain components, or a different arrangement of components.
- the illustrated components can be realized in hardware, software or a combination of software and hardware.
- the processor 1901 may be used to implement the functions of the processing module 1801 described above, and the communication interface 1904 may be used to implement the functions of the transceiver module 1802 described above.
- the function/implementation process of the processing module 1801 in FIG. 18 can be realized by the processor 1901 shown in FIG. The process can be implemented through the communication interface 1904 shown in FIG. 19 .
- the present application further provides a communication device, where the communication device includes a processor, configured to implement the method in any one of the foregoing method embodiments.
- the communication device further includes a memory.
- the memory is used to store necessary program instructions and data, and the processor can call the program code stored in the memory to instruct the communication device to execute the method in any one of the above method embodiments.
- the memory may not be in the communication device.
- the communication device further includes an interface circuit, the interface circuit is a code/data read and write interface circuit, and the interface circuit is used to receive computer-executed instructions (computer-executed instructions are stored in the memory, and may be directly read from memory read, or possibly through other devices) and transferred to the processor.
- the interface circuit is a code/data read and write interface circuit, and the interface circuit is used to receive computer-executed instructions (computer-executed instructions are stored in the memory, and may be directly read from memory read, or possibly through other devices) and transferred to the processor.
- the communication device further includes a communication interface, where the communication interface is used to communicate with modules other than the communication device.
- the communication device may be a chip or a system-on-a-chip.
- the communication device may consist of a chip, or may include a chip and other discrete devices, which is not specifically limited in this embodiment of the present application.
- the present application also provides a computer-readable storage medium, on which a computer program or instruction is stored, and when the computer program or instruction is executed by a computer, the functions of any one of the above method embodiments are realized.
- the present application also provides a computer program product, which implements the functions of any one of the above method embodiments when executed by a computer.
- all or part of them may be implemented by software, hardware, firmware or any combination thereof.
- a software program it may be implemented in whole or in part in the form of a computer program product.
- the computer program product includes one or more computer instructions.
- the computer program instructions When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application will be generated in whole or in part.
- the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices.
- the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server, or data center Transmission to another website site, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.).
- the computer-readable storage medium may be any available medium that can be accessed by a computer, or may be a data storage device including one or more servers, data centers, etc. that can be integrated with the medium.
- the available medium may be a magnetic medium (such as a floppy disk, a hard disk, or a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (solid state disk, SSD)), etc.
- the computer may include the aforementioned apparatus.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The present application provides an access control method, apparatus, and system, which allows for efficient and flexible access control, thereby reducing data leakage. The method comprises: an authorization server issues a token to a client device on the basis of an application from the client device, the token comprising a token description and a first authorization code, the token description comprising an authorization vector, the authorization vector indicating target information, and the first authorization code being generated according to the token description, the target information, and a cryptographic hash function; when sending a request packet, the client device carries the token and the target information in the request packet; after receiving the request packet, a gateway device generates a second authorization code according to the token description, the target information, and the cryptographic hash function, and forwards the request packet to a data server when the second authorization code is the same as the first authorization code.
Description
本申请要求于2021年10月20日提交国家知识产权局、申请号为202111223457.5、申请名称为“访问控制方法、装置及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application with application number 202111223457.5 and application title "Access Control Method, Device and System" filed with the State Intellectual Property Office on October 20, 2021, the entire contents of which are incorporated by reference in this application middle.
本申请实施例涉及通信领域,尤其涉及访问控制方法、装置及系统。The embodiments of the present application relate to the communication field, and in particular, to an access control method, device and system.
随着网络的广泛普及,新的软件应用模式层出不穷,极大地影响和改变了人们工作和生活的方式,提高了人们对于网络信息的依赖程度。然而,由于网络自身的复杂性、广泛可接入性等因素,网络面临日益增多的安全威胁,安全问题日益突出。With the wide popularization of the network, new software application models emerge in an endless stream, which greatly affects and changes the way people work and live, and increases people's dependence on network information. However, due to the complexity of the network itself, wide accessibility and other factors, the network is facing increasing security threats, and security issues have become increasingly prominent.
目前,一个重要的安全问题是由于越权访问导致的数据泄露。示例性的,如图1所示,在园区网的场景中,园区内部区域的正常雇员正常访问内部资料,而恶意雇员越权访问数据中心,从而导致数据泄露。此外,园区外部区域的正常用户正常访问公共数据,而恶意黑客越权访问内部资料,从而导致数据泄露。因此,有必要进行合理的访问控制以防止越权访问导致的数据泄露。Currently, an important security issue is data leakage due to unauthorized access. Exemplarily, as shown in FIG. 1 , in a campus network scenario, normal employees in the internal area of the campus normally access internal data, while malicious employees access data centers with unauthorized access, resulting in data leakage. In addition, normal users in the external area of the park normally access public data, while malicious hackers have unauthorized access to internal data, resulting in data leakage. Therefore, it is necessary to implement reasonable access control to prevent data leakage caused by unauthorized access.
发明内容Contents of the invention
本申请提供一种访问控制方法、装置及系统,能够高效、灵活地进行访问控制,从而减少数据泄露。The present application provides an access control method, device and system, which can perform access control efficiently and flexibly, thereby reducing data leakage.
第一方面,提供了一种访问控制方法,该方法可以由授权服务器执行,也可以由授权服务器的部件,例如处理器、芯片、或芯片系统等执行,还可以由能实现全部或部分授权服务器功能的逻辑模块或软件实现。以该方法由授权服务器执行为例,该方法包括:授权服务器接收来自客户端设备的用于申请目标令牌的令牌申请信息,根据该令牌申请信息,生成目标令牌后,向客户端设备发送该目标令牌。其中,目标令牌包括令牌描述和第一授权码,令牌描述包括授权向量,授权向量指示目标信息,第一授权码是根据令牌描述、目标信息、以及密码散列函数生成的。In the first aspect, an access control method is provided, which can be executed by an authorization server, or by components of the authorization server, such as processors, chips, or chip systems, etc., or can be implemented by all or part of the authorization server. A logical module or software implementation of a function. Taking the method executed by the authorization server as an example, the method includes: the authorization server receives the token application information for applying for the target token from the client device, generates the target token according to the token application information, and sends the client The device sends the target token. Wherein, the target token includes a token description and a first authorization code, the token description includes an authorization vector, the authorization vector indicates target information, and the first authorization code is generated according to the token description, target information, and a password hash function.
基于该方案,授权服务器基于客户端设备的申请向客户端设备颁发令牌,该令牌包括令牌描述和第一授权码,令牌描述中包括授权向量,该授权向量指示参与授权码计算的目标信息,从而使得访问控制策略的执行点在收到请求报文后,能够基于授权向量获取参与授权码计算的信息,并生成第二授权码,根据比较第一授权码和第二授权码是否一致来进行访问控制,例如,在第二授权码和第一授权码一致时允许访问,在第二授权码和第一授权码不一致时拒绝访问,从而防止数据泄露。Based on this solution, the authorization server issues a token to the client device based on the application of the client device. The token includes a token description and a first authorization code. Target information, so that after receiving the request message, the execution point of the access control policy can obtain the information involved in the calculation of the authorization code based on the authorization vector, and generate the second authorization code. According to whether the first authorization code and the second authorization code are compared Consistent access control, for example, allowing access when the second authorization code is consistent with the first authorization code, and denying access when the second authorization code is inconsistent with the first authorization code, thereby preventing data leakage.
结合第一方面,在第一方面的某些实施方式中,目标信息为待携带在客户端设备的请求报文中的信息。示例性的,该请求报文用于请求建立目标资源的TCP连接;或者,该请求报文用于请求访问目标资源。With reference to the first aspect, in some implementation manners of the first aspect, the target information is information to be carried in a request packet of the client device. Exemplarily, the request message is used to request establishment of a TCP connection to the target resource; or, the request message is used to request access to the target resource.
基于该实施方式,使用请求报文中的信息参与授权码计算,后续进行令牌验证时,可以防止使用目标令牌发送非法请求的发生。例如,非法用户利用目标令牌发送请求时,由于授权码的计算需要请求报文中的信息参与,若想通过令牌验证,需要同时对请求报文中的目标 信息进行造假,然而对请求报文中的信息造假可能无法完成非法用户的非法请求,从而本申请的目标令牌可以在授权范围内随意使用而无需担心盗用,能够进一步提升安全性能。Based on this embodiment, the information in the request message is used to participate in the calculation of the authorization code, and subsequent token verification can prevent illegal requests from being sent using the target token. For example, when an illegal user uses the target token to send a request, since the calculation of the authorization code needs the information in the request message to participate, if he wants to pass the token verification, he needs to falsify the target information in the request message at the same time. The information falsification in this article may not be able to complete the illegal request of illegal users, so the target token of this application can be used freely within the scope of authorization without worrying about theft, which can further improve security performance.
结合第一方面,在第一方面的某些实施方式中,授权向量包括偏移值和长度信息,偏移值指示目标信息的起始位置,长度信息指示目标信息的长度;或者,授权向量包括比特位图,比特位图指示承载目标信息的字段。With reference to the first aspect, in some embodiments of the first aspect, the authorization vector includes an offset value and length information, the offset value indicates the starting position of the target information, and the length information indicates the length of the target information; or, the authorization vector includes Bitmap, the bitmap indicates the fields that carry the target information.
结合第一方面,在第一方面的某些实施方式中,目标信息包括以下至少一项:目标资源对应的网络层信息、传输层信息、授权请求起始符、请求结束符、请求方描述信息、或响应方描述信息,目标资源为客户端设备待访问的资源。With reference to the first aspect, in some implementations of the first aspect, the target information includes at least one of the following: network layer information corresponding to the target resource, transport layer information, authorization request initiator, request end identifier, requester description information , or responder description information, the target resource is the resource to be accessed by the client device.
基于该实施方式,可以按需调整目标信息包括的内容,从而灵活调整访问控制粒度,实现多层次精细化的访问控制。例如可以使目标信息包括网络层的信息,实现网络层的访问控制,或者,使目标信息包括网络层、传输层、应用层信息,实现URL级别的精细控制,或者,使目标信息包括请求方或响应方描述信息,实现对安全等级、网络类型等的访问控制。Based on this embodiment, the content included in the target information can be adjusted as needed, so as to flexibly adjust the granularity of access control, and realize multi-level and refined access control. For example, the target information can include information at the network layer to implement access control at the network layer, or the target information can include information at the network layer, transport layer, and application layer to achieve fine-grained control at the URL level, or the target information can include the requester or The responder describes information to implement access control on security level, network type, etc.
例如,在令牌申请信息包括的需求信息指示建立TCP连接时,目标信息包括目标资源对应的网络层信息和传输层信息;For example, when the requirement information included in the token application information indicates the establishment of a TCP connection, the target information includes network layer information and transport layer information corresponding to the target resource;
在需求信息指示完整请求报文不分段时,目标信息包括目标资源对应的网络层信息、传输层信息、授权请求起始符、和请求结束符;When the requirement information indicates that the complete request message is not segmented, the target information includes network layer information, transport layer information, authorization request initiator, and request end identifier corresponding to the target resource;
在需求信息指示完整请求报文分段时,目标信息包括完整请求报文的起始分段对应的第一子目标信息、完整请求报文的中间分段对应的第二子目标信息、和完整请求报文的末尾分段对应的第三子目标信息。第一子目标信息包括网络层信息、传输层信息、和授权请求起始符;第二子目标信息包括网络层信息和传输层信息;第三子目标信息包括网络层信息、传输层信息、和请求结束符。When the requirement information indicates a complete request message segment, the target information includes the first sub-target information corresponding to the initial segment of the complete request message, the second sub-target information corresponding to the middle segment of the complete request message, and the complete The third sub-target information corresponding to the end segment of the request message. The first sub-object information includes network layer information, transport layer information, and authorization request initiator; the second sub-object information includes network layer information and transport layer information; the third sub-object information includes network layer information, transport layer information, and Request terminator.
结合第一方面,在第一方面的某些实施方式中,授权请求起始符包括请求信息和目标资源的部分或全部统一资源定位符URL前缀,请求信息指示与目标资源相关的操作。With reference to the first aspect, in some embodiments of the first aspect, the authorization request initiator includes request information and part or all of the Uniform Resource Locator URL prefix of the target resource, and the request information indicates operations related to the target resource.
结合第一方面,在第一方面的某些实施方式中,授权服务器根据令牌申请信息生成目标令牌,包括:授权服务器根据令牌申请信息中的请求方描述信息,确定请求方的访问权限;以及根据请求方的访问权限,确定授权请求起始符。With reference to the first aspect, in some implementations of the first aspect, the authorization server generates the target token according to the token application information, including: the authorization server determines the requester's access authority according to the requester description information in the token application information ; and determine the authorization request initiator according to the requester's access rights.
结合第一方面,在第一方面的某些实施方式中,网络层信息包括源互联网协议IP地址和目的IP地址;传输层信息包括目的端口,或者,包括目的端口和源端口;请求方描述信息包括以下至少一项:请求方的身份信息、请求方的状态信息、请求方的组标识、请求方的安全等级、或请求方所处网络的网络类型;响应方描述信息包括以下至少一项:响应方的组标识、响应方的安全等级、或响应方所处网络的网络类型。With reference to the first aspect, in some embodiments of the first aspect, the network layer information includes a source Internet Protocol IP address and a destination IP address; the transport layer information includes a destination port, or, includes a destination port and a source port; the requester description information Including at least one of the following: identity information of the requesting party, status information of the requesting party, group identification of the requesting party, security level of the requesting party, or network type of the network where the requesting party is located; description information of the responding party includes at least one of the following: The group ID of the responder, the security level of the responder, or the network type of the network where the responder is located.
结合第一方面,在第一方面的某些实施方式中,令牌描述还包括有效期和以下至少一项:检查策略、颁发者标识、密码套件、或排除信息;其中,有效期指示目标令牌的有效期限;检查策略指示是否信任目标资源的请求方;颁发者标识指示颁发目标令牌的设备;密码套件指示密码散列函数的相关信息;排除信息指示禁止携带的信息。In conjunction with the first aspect, in some implementations of the first aspect, the token description further includes a validity period and at least one of the following: checking policy, issuer ID, cipher suite, or exclusion information; wherein the validity period indicates the target token's The validity period; the check policy indicates whether to trust the requester of the target resource; the issuer ID indicates the device that issued the target token; the cipher suite indicates information about the cryptographic hash function; and the exclusion information indicates information that is prohibited from being carried.
基于该实施方式的令牌描述,可以使得访问控制策略的执行点根据有效期限、检查策略、排除信息等进行进一步验证,进一步提高安全性能。Based on the token description of this embodiment, the execution point of the access control policy can be further verified according to the validity period, inspection policy, exclusion information, etc., and the security performance can be further improved.
结合第一方面,在第一方面的某些实施方式中,请求报文用于请求建立目标资源对应的传输控制协议TCP连接时,禁止携带的信息为负载;或者,请求报文为完整请求报文的起始分段时,禁止携带的信息为请求结束符;或者,请求报文为完整请求报文的末尾分段时,禁止携带的信息为请求信息;或者,请求报文为完整请求报文的中间分段时,禁止携带的信息 为请求信息和请求结束符;或者,请求报文为完整请求报文时,排除信息指示禁止携带多个请求信息和多个请求结束符。In combination with the first aspect, in some implementations of the first aspect, when the request message is used to request the establishment of a transmission control protocol TCP connection corresponding to the target resource, the prohibited information is the payload; or, the request message is a complete request message When the initial segment of the message, the prohibited information is the request end character; or, when the request message is the end segment of the complete request message, the prohibited information is the request information; or, the request message is the complete request message When the middle segment of the text is used, the prohibited information is the request information and the request terminator; or, when the request message is a complete request message, the exclusion information indicates that it is prohibited to carry multiple request information and multiple request terminators.
第二方面,提供了一种访问控制方法,该方法可以由网关设备执行,也可以由网关设备的部件,例如处理器、芯片、或芯片系统等执行,还可以由能实现全部或部分网关设备功能的逻辑模块或软件实现。以该方法由网关设备执行为例,该方法包括:网关设备接收来自客户端设备的包括目标令牌和目标信息的请求报文,该目标令牌包括令牌描述和第一授权码,令牌描述包括授权向量,授权向量指示目标信息;之后,网关设备根据令牌描述、目标信息、以及秘钥散列函数生成第二授权码;第二授权码与第一授权码相同时,网关设备向数据服务器转发请求报文。In the second aspect, an access control method is provided, which can be executed by a gateway device, or by a component of the gateway device, such as a processor, a chip, or a chip system, etc., and can also be implemented by all or part of the gateway device A logical module or software implementation of a function. Taking the method performed by a gateway device as an example, the method includes: the gateway device receives a request message from a client device including a target token and target information, the target token includes a token description and a first authorization code, and the token The description includes the authorization vector, and the authorization vector indicates the target information; then, the gateway device generates a second authorization code according to the token description, target information, and secret key hash function; when the second authorization code is the same as the first authorization code, the gateway device sends The data server forwards the request message.
基于该方案,请求报文中包括目标令牌和目标信息,该令牌包括令牌描述和第一授权码,令牌描述中包括授权向量,该授权向量指示参与授权码计算的目标信息,从而网关设备在收到请求报文后,能够基于授权向量获取参与授权码计算的信息(即目标信息),并生成第二授权码,根据比较第一授权码和第二授权码是否一致来进行访问控制,在第二授权码和第一授权码一致时向数据服务器转发请求报文,从而防止数据泄露。Based on this scheme, the request message includes a target token and target information, the token includes a token description and a first authorization code, the token description includes an authorization vector, and the authorization vector indicates the target information participating in the calculation of the authorization code, thus After receiving the request message, the gateway device can obtain the information involved in the calculation of the authorization code (that is, the target information) based on the authorization vector, and generate a second authorization code, and perform access based on whether the first authorization code and the second authorization code are consistent. Controlling, forwarding the request message to the data server when the second authorization code is consistent with the first authorization code, thereby preventing data leakage.
另一方面,网关设备无需维护访问控制策略或访问控制列表,相比于现有的ACL和防火墙的方案可以灵活部署,降低部署使用成本。On the other hand, the gateway device does not need to maintain access control policies or access control lists. Compared with the existing ACL and firewall solutions, it can be deployed flexibly, reducing the cost of deployment and use.
再一方面,网关设备无需分析请求报文的应用层语义,无需查询访问控制策略、用户信息等,可无感知地傻瓜式计算授权码并验证,存储与计算复杂度与访问控制策略、以及用户规模解耦,从而实现高效率的访问控制。On the other hand, the gateway device does not need to analyze the application layer semantics of the request message, and does not need to query the access control policy and user information. Scale decoupling enables efficient access control.
结合第二方面,在第二方面的某些实施方式中,授权向量包括偏移值和长度信息,偏移值指示目标信息的起始位置,长度信息指示目标信息的长度;或者,授权向量包括比特位图,比特位图指示承载目标信息的字段。With reference to the second aspect, in some embodiments of the second aspect, the authorization vector includes an offset value and length information, the offset value indicates the starting position of the target information, and the length information indicates the length of the target information; or, the authorization vector includes Bitmap, the bitmap indicates the fields that carry the target information.
结合第二方面,在第二方面的某些实施方式中,目标信息包括以下至少一项:目标资源对应的网络层信息、传输层信息、授权请求起始符、请求结束符、请求方描述信息、或响应方描述信息,目标资源为客户端设备待访问的资源。With reference to the second aspect, in some implementations of the second aspect, the target information includes at least one of the following: network layer information corresponding to the target resource, transport layer information, authorization request initiator, request end identifier, requester description information , or responder description information, the target resource is the resource to be accessed by the client device.
结合第二方面,在第二方面的某些实施方式中,授权请求起始符包括请求信息和目标资源的部分或全部统一资源定位符URL前缀,请求信息指示与目标资源相关的操作。With reference to the second aspect, in some implementations of the second aspect, the authorization request initiator includes request information and a part or all of the Uniform Resource Locator URL prefix of the target resource, and the request information indicates operations related to the target resource.
结合第二方面,在第二方面的某些实施方式中,网络层信息包括源互联网协议IP地址和目的IP地址;传输层信息包括目的端口,或者,包括目的端口和源端口;请求方描述信息包括以下至少一项:请求方的身份信息、请求方的状态信息、请求方的组标识、请求方的安全等级、或请求方所处网络的网络类型;响应方描述信息包括以下至少一项:响应方的组标识、响应方的安全等级、或响应方所处网络的网络类型。In conjunction with the second aspect, in some implementations of the second aspect, the network layer information includes a source Internet Protocol IP address and a destination IP address; the transport layer information includes a destination port, or, includes a destination port and a source port; the requester description information Including at least one of the following: identity information of the requesting party, status information of the requesting party, group identification of the requesting party, security level of the requesting party, or network type of the network where the requesting party is located; description information of the responding party includes at least one of the following: The group ID of the responder, the security level of the responder, or the network type of the network where the responder is located.
结合第二方面,在第二方面的某些实施方式中,令牌描述还包括有效期和以下至少一项:检查策略、颁发者标识、密码套件、或排除信息;其中,有效期指示目标令牌的有效期限;检查策略指示是否信任目标资源的请求方;颁发者标识指示颁发目标令牌的设备;密码套件指示密码散列函数的相关信息;排除信息指示禁止携带的信息。In conjunction with the second aspect, in some implementations of the second aspect, the token description further includes a validity period and at least one of the following: checking policy, issuer ID, cipher suite, or exclusion information; wherein the validity period indicates the target token's The validity period; the check policy indicates whether to trust the requester of the target resource; the issuer ID indicates the device that issued the target token; the cipher suite indicates information about the cryptographic hash function; and the exclusion information indicates information that is prohibited from being carried.
结合第二方面,在第二方面的某些实施方式中,该方法还包括:网关设备根据目标令牌的有效期限,确定目标令牌未过期。基于该实施方式,通过有效期检查,能够防止非法用户使用过期的令牌发送请求。With reference to the second aspect, in some implementation manners of the second aspect, the method further includes: the gateway device determines that the target token has not expired according to the validity period of the target token. Based on this embodiment, by checking the validity period, it is possible to prevent illegal users from using expired tokens to send requests.
结合第二方面,在第二方面的某些实施方式中,该方法还包括:网关设备根据检查策略确定信任目标资源的请求方;或者,网关设备根据检查策略确定不信任目标资源的请求方, 并根据排除信息确定请求报文合法。With reference to the second aspect, in some implementation manners of the second aspect, the method further includes: the gateway device determines, according to the inspection policy, that the requester of the target resource is trusted; or, the gateway device determines, according to the inspection policy, that the requester of the target resource is not trusted, And determine that the request message is legal according to the exclusion information.
结合第二方面,在第二方面的某些实施方式中,网关设备根据排除信息确定请求报文合法,包括:请求报文不携带禁止携带的信息时,网关设备确定请求报文合法。With reference to the second aspect, in some implementations of the second aspect, the gateway device determines that the request message is legal according to the exclusion information, including: when the request message does not carry prohibited information, the gateway device determines that the request message is legal.
基于该实施方式,根据排除信息的检查,能够防止非法用户使用合法的令牌发送非法请求,例如防止非法用户使用TCP连接令牌发送HTTP请求,从而进行更为严格的访问控制,提高网络安全性。Based on this embodiment, according to the inspection of exclusion information, it is possible to prevent illegal users from sending illegal requests using legitimate tokens, for example, prevent illegal users from sending HTTP requests using TCP connection tokens, thereby performing stricter access control and improving network security .
结合第二方面,在第二方面的某些实施方式中,排除信息为第一数值时,禁止携带的信息为负载;排除信息为第二数值时,禁止携带的信息为请求结束符;排除信息为第三数值时,禁止携带的信息为请求信息;排除信息为第四数值时,禁止携带的信息为请求信息和请求结束符;排除信息为第五数值时,指示禁止携带多个请求信息和多个请求结束符。In conjunction with the second aspect, in some implementations of the second aspect, when the exclusion information is the first value, the prohibited information is the payload; when the exclusion information is the second value, the prohibited information is the request terminator; the exclusion information When it is the third value, the prohibited information is the request information; when the excluded information is the fourth value, the prohibited information is the request information and the request terminator; when the excluded information is the fifth value, it indicates that it is forbidden to carry multiple request information and Multiple request terminators.
结合第二方面,在第二方面的某些实施方式中,该方法还包括:网关设备根据授权向量,从请求报文中提取目标信息。With reference to the second aspect, in some implementation manners of the second aspect, the method further includes: the gateway device extracts target information from the request message according to the authorization vector.
其中,第二方面的各种实施方式所带来的技术效果,可参考上述第一方面中相应实施方式所带来的技术效果,在此不再赘述。Wherein, for the technical effects brought about by the various implementations of the second aspect, reference may be made to the technical effects brought about by the corresponding implementations in the first aspect above, and details are not repeated here.
第三方面,提供了一种访问控制方法,该方法可以由客户端设备执行,也可以由客户端设备的部件,例如处理器、芯片、或芯片系统等执行,还可以由能实现全部或部分客户端设备功能的逻辑模块或软件实现。以该方法由客户端设备执行为例,该方法包括:客户端设备向授权服务器发送用于申请目标令牌的令牌申请信息,之后获取该目标令牌,并发送请求报文,该请求报文包括目标令牌和目标信息。其中,目标令牌包括令牌描述和第一授权码,令牌描述包括授权向量,授权向量指示目标信息,第一授权码是根据令牌描述、目标信息、以及密码散列函数生成的。In the third aspect, an access control method is provided, which can be executed by a client device, or by a component of the client device, such as a processor, a chip, or a chip system, etc., and can also be implemented by all or part of the Logical modules or software implementations of client device functionality. Taking this method performed by a client device as an example, the method includes: the client device sends token application information for applying for a target token to the authorization server, then obtains the target token, and sends a request message, and the request message The text includes target token and target information. Wherein, the target token includes a token description and a first authorization code, the token description includes an authorization vector, the authorization vector indicates target information, and the first authorization code is generated according to the token description, target information, and a password hash function.
基于该方案,授权服务器基于客户端设备的申请向客户端设备颁发令牌,客户端设备在发送请求报文时携带该令牌。该令牌包括令牌描述和第一授权码,令牌描述中包括授权向量,该授权向量指示参与授权码计算的目标信息,使得网关设备或数据服务器侧收到请求报文后,可以基于授权向量获取参与授权码计算的信息,并生成第二授权码,根据比较第一授权码和第二授权码是否一致来进行访问控制,例如,在第二授权码和第一授权码一致时允许访问,在第二授权码和第一授权码不一致时拒绝访问,从而防止数据泄露。Based on this solution, the authorization server issues a token to the client device based on the application of the client device, and the client device carries the token when sending a request message. The token includes a token description and a first authorization code, and the token description includes an authorization vector, which indicates the target information involved in the calculation of the authorization code, so that after receiving the request message, the gateway device or the data server side can The vector obtains the information involved in the calculation of the authorization code, and generates the second authorization code, and performs access control based on whether the first authorization code is consistent with the second authorization code, for example, access is allowed when the second authorization code is consistent with the first authorization code , deny access when the second authorization code is inconsistent with the first authorization code, thereby preventing data leakage.
结合第三方面,在第三方面的某些实施方式中,授权向量包括偏移值和长度信息,偏移值指示目标信息的起始位置,长度信息指示目标信息的长度;或者,授权向量包括比特位图,比特位图指示承载目标信息的字段。With reference to the third aspect, in some embodiments of the third aspect, the authorization vector includes an offset value and length information, the offset value indicates the starting position of the target information, and the length information indicates the length of the target information; or, the authorization vector includes Bitmap, the bitmap indicates the fields that carry the target information.
结合第三方面,在第三方面的某些实施方式中,目标信息包括以下至少一项:目标资源对应的网络层信息、传输层信息、授权请求起始符、请求结束符、请求方描述信息、或响应方描述信息,目标资源为客户端设备待访问的资源。In conjunction with the third aspect, in some embodiments of the third aspect, the target information includes at least one of the following: network layer information corresponding to the target resource, transport layer information, authorization request initiator, request end identifier, requester description information , or responder description information, the target resource is the resource to be accessed by the client device.
结合第三方面,在第三方面的某些实施方式中,授权请求起始符包括请求信息和目标资源的部分或全部统一资源定位符URL前缀,请求信息指示与目标资源相关的操作。With reference to the third aspect, in some implementations of the third aspect, the authorization request initiator includes request information and part or all of the Uniform Resource Locator URL prefix of the target resource, and the request information indicates operations related to the target resource.
结合第三方面,在第三方面的某些实施方式中,网络层信息包括源互联网协议IP地址和目的IP地址;传输层信息包括目的端口,或者,包括目的端口和源端口;请求方描述信息包括以下至少一项:请求方的身份信息、请求方的状态信息、请求方的组标识、请求方的安全等级、或请求方所处网络的网络类型;响应方描述信息包括以下至少一项:响应方的组标识、响应方的安全等级、或响应方所处网络的网络类型。In conjunction with the third aspect, in some implementations of the third aspect, the network layer information includes a source Internet Protocol IP address and a destination IP address; the transport layer information includes a destination port, or, includes a destination port and a source port; requester description information Including at least one of the following: identity information of the requesting party, status information of the requesting party, group identification of the requesting party, security level of the requesting party, or network type of the network where the requesting party is located; description information of the responding party includes at least one of the following: The group ID of the responder, the security level of the responder, or the network type of the network where the responder is located.
结合第三方面,在第三方面的某些实施方式中,客户端设备获取目标令牌,包括:客户 端设备根据目标资源对应的授权请求起始符、以及授权请求起始符和令牌的对应关系,查找目标令牌。With reference to the third aspect, in some implementations of the third aspect, the client device acquires the target token, including: the client device according to the authorization request initiator corresponding to the target resource, and the authorization request initiator and token Correspondence, find the target token.
结合第三方面,在第三方面的某些实施方式中,令牌描述还包括有效期和以下至少一项:检查策略、颁发者标识、密码套件、或排除信息;其中,有效期指示目标令牌的有效期限;检查策略指示是否信任目标资源的请求方;颁发者标识指示颁发目标令牌的设备;密码套件指示密码散列函数的相关信息;排除信息指示禁止携带的信息。In conjunction with the third aspect, in some implementations of the third aspect, the token description further includes a validity period and at least one of the following: checking policy, issuer ID, cipher suite, or exclusion information; wherein the validity period indicates the target token's The validity period; the check policy indicates whether to trust the requester of the target resource; the issuer ID indicates the device that issued the target token; the cipher suite indicates information about the cryptographic hash function; and the exclusion information indicates information that is prohibited from being carried.
结合第三方面,在第三方面的某些实施方式中,请求报文用于请求建立目标资源对应的传输控制协议TCP连接时,禁止携带的信息为负载;或者,请求报文为完整请求报文的起始分段时,禁止携带的信息为请求结束符;或者,请求报文为完整请求报文的末尾分段时,禁止携带的信息为请求信息;或者,请求报文为完整请求报文的中间分段时,禁止携带的信息为请求信息和请求结束符;或者,请求报文为完整请求报文时,排除信息指示禁止携带多个请求信息和多个请求结束符。In conjunction with the third aspect, in some implementations of the third aspect, when the request message is used to request the establishment of a transmission control protocol TCP connection corresponding to the target resource, the prohibited information is the payload; or, the request message is a complete request message When the initial segment of the message, the prohibited information is the request end character; or, when the request message is the end segment of the complete request message, the prohibited information is the request information; or, the request message is the complete request message When the middle segment of the text is used, the prohibited information is the request information and the request terminator; or, when the request message is a complete request message, the exclusion information indicates that it is prohibited to carry multiple request information and multiple request terminators.
结合第三方面,在第三方面的某些实施方式中,令牌申请信息包括以下至少一项:目标资源对应的网络层信息、传输层信息、应用层信息、请求方描述信息、或需求信息;应用层信息包括以下至少一项:目标资源的URL、请求信息、或请求结束符;需求信息指示以下至少一项:期望的令牌使用时长、完整请求报文是否分段、是否建立TCP连接。With reference to the third aspect, in some embodiments of the third aspect, the token application information includes at least one of the following: network layer information, transport layer information, application layer information, requester description information, or demand information corresponding to the target resource ; The application layer information includes at least one of the following: the URL of the target resource, request information, or request terminator; the requirement information indicates at least one of the following: the expected token usage time, whether the complete request message is segmented, and whether to establish a TCP connection .
其中,第三方面的各种实施方式所带来的技术效果,可参考上述第一方面中相应实施方式所带来的技术效果,在此不再赘述。Wherein, for the technical effects brought about by the various implementations of the third aspect, reference may be made to the technical effects brought about by the corresponding implementations in the first aspect above, and details are not repeated here.
第四方面,提供了一种通信装置用于实现上述各种方法。该通信装置可以为第一方面的授权服务器,或者授权服务器中包含的装置,比如芯片或模块;或者,该通信装置可以为第二方面中的网关设备,或者网关设备中包含的装置,比如芯片或模块;或者,该通信装置可以为第三方面中的客户端设备,或者客户端设备中包含的装置,比如芯片。所述通信装置包括实现上述方法相应的模块、单元、或手段(means),该模块、单元、或means可以通过硬件实现,软件实现,或者通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块或单元。In a fourth aspect, a communication device for implementing the above various methods is provided. The communication device may be the authorization server in the first aspect, or a device included in the authorization server, such as a chip or a module; or, the communication device may be the gateway device in the second aspect, or a device included in the gateway device, such as a chip or a module; or, the communication device may be the client device in the third aspect, or a device included in the client device, such as a chip. The communication device includes a corresponding module, unit, or means (means) for implementing the above method, and the module, unit, or means can be implemented by hardware, software, or by executing corresponding software on hardware. The hardware or software includes one or more modules or units corresponding to the above functions.
在一些可能的设计中,该通信装置可以包括收发模块和处理模块。该收发模块,也可以称为收发单元,用以实现上述任一方面及其任意可能的实现方式中的发送和/或接收功能。该收发模块可以由收发电路,收发机,收发器或者通信接口构成。该处理模块,可以用于实现上述任一方面及其任意可能的实现方式中的处理功能。In some possible designs, the communication device may include a transceiver module and a processing module. The transceiver module, which may also be referred to as a transceiver unit, is configured to implement the sending and/or receiving functions in any of the above aspects and any possible implementation manners thereof. The transceiver module may be composed of a transceiver circuit, a transceiver, a transceiver or a communication interface. The processing module may be used to implement the processing functions in any of the above aspects and any possible implementation manners thereof.
在一些可能的设计中,收发模块包括发送模块和接收模块,分别用于实现上述任一方面及其任意可能的实现方式中的发送和接收功能。In some possible designs, the transceiver module includes a sending module and a receiving module, respectively configured to implement the sending and receiving functions in any of the above aspects and any possible implementations thereof.
第五方面,提供一种通信装置,包括:处理器和通信接口;该通信接口,用于与该通信装置之外的模块通信;所述处理器用于执行计算机程序或指令,以使该通信装置执行上述任一方面所述的方法。该通信装置可以为第一方面的授权服务器,或者授权服务器中包含的装置,比如芯片或模块;或者,该通信装置可以为第二方面中的网关设备,或者网关设备中包含的装置,比如芯片或模块;或者,该通信装置可以为第三方面中的客户端设备,或者客户端设备中包含的装置,比如芯片。In a fifth aspect, a communication device is provided, including: a processor and a communication interface; the communication interface is used to communicate with modules other than the communication device; the processor is used to execute computer programs or instructions, so that the communication device Perform the method described in any one of the above aspects. The communication device may be the authorization server in the first aspect, or a device included in the authorization server, such as a chip or a module; or, the communication device may be the gateway device in the second aspect, or a device included in the gateway device, such as a chip or a module; or, the communication device may be the client device in the third aspect, or a device included in the client device, such as a chip.
第六方面,提供了一种通信装置,包括:接口电路和处理器,该接口电路为代码/数据读写接口电路,该接口电路用于接收计算机执行指令(计算机执行指令存储在存储器中,可能直接从存储器读取,或可能经过其他器件)并传输至该处理器;处理器用于执行计算机执行指令以使该通信装置执行上述任一方面所述的方法。该通信装置可以为第一方面的授权服务 器,或者授权服务器中包含的装置,比如芯片或模块;或者,该通信装置可以为第二方面中的网关设备,或者网关设备中包含的装置,比如芯片或模块;或者,该通信装置可以为第三方面中的客户端设备,或者客户端设备中包含的装置,比如芯片。In a sixth aspect, a communication device is provided, including: an interface circuit and a processor, the interface circuit is a code/data read and write interface circuit, and the interface circuit is used to receive computer-executed instructions (computer-executed instructions are stored in a memory, possibly read directly from the memory, or possibly through other devices) and transmit to the processor; the processor is used to execute computer-executed instructions to enable the communication device to perform the method described in any aspect above. The communication device may be the authorization server in the first aspect, or a device included in the authorization server, such as a chip or a module; or, the communication device may be the gateway device in the second aspect, or a device included in the gateway device, such as a chip or a module; or, the communication device may be the client device in the third aspect, or a device included in the client device, such as a chip.
第七方面,提供了一种通信装置,包括:至少一个处理器;所述处理器用于执行计算机程序或指令,以使该通信装置执行上述任一方面所述的方法。该通信装置可以为第一方面的授权服务器,或者授权服务器中包含的装置,比如芯片或模块;或者,该通信装置可以为第二方面中的网关设备,或者网关设备中包含的装置,比如芯片或模块;或者,该通信装置可以为第三方面中的客户端设备,或者客户端设备中包含的装置,比如芯片。In a seventh aspect, a communication device is provided, including: at least one processor; the processor is configured to execute computer programs or instructions, so that the communication device executes the method described in any aspect above. The communication device may be the authorization server in the first aspect, or a device included in the authorization server, such as a chip or a module; or, the communication device may be the gateway device in the second aspect, or a device included in the gateway device, such as a chip or a module; or, the communication device may be the client device in the third aspect, or a device included in the client device, such as a chip.
在一些可能的设计中,该通信装置包括存储器,该存储器,用于保存必要的程序指令和数据。该存储器可以与处理器耦合,或者,也可以独立于该处理器。In some possible designs, the communication device includes a memory for storing necessary program instructions and data. The memory can be coupled to the processor, or it can be independent of the processor.
在一些可能的设计中,该通信装置可以是芯片或芯片系统。该装置是芯片系统时,可以由芯片构成,也可以包含芯片和其他分立器件。In some possible designs, the communication device may be a chip or system-on-a-chip. When the device is a system-on-a-chip, it may consist of chips, or may include chips and other discrete devices.
第八方面,提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其在通信装置上运行时,使得上述任一方面所述的方法被执行。In an eighth aspect, a computer-readable storage medium is provided, and instructions are stored in the computer-readable storage medium. When the computer-readable storage medium is run on a communication device, the method described in any one of the above aspects is executed.
第九方面,提供了一种包含指令的计算机程序产品,当其在通信装置上运行时,使得上述任一方面所述的方法被执行。In a ninth aspect, there is provided a computer program product including instructions, which, when run on a communication device, enable the method described in any one of the above aspects to be executed.
可以理解的是,第四方面至第九方面中任一方面提供的通信装置是芯片时,上述的发送动作/功能可以理解为输出信息,上述的接收动作/功能可以理解为输入信息。It can be understood that when the communication device provided by any one of the fourth to ninth aspects is a chip, the above-mentioned sending action/function can be understood as output information, and the above-mentioned receiving action/function can be understood as input information.
其中,第四方面至第九方面中任一种设计方式所带来的技术效果可参见上述第一方面或第二方面或第三方面中不同设计方式所带来的技术效果,在此不再赘述。Wherein, the technical effect brought by any one of the design methods from the fourth aspect to the ninth aspect can refer to the technical effects brought by the different design methods in the above-mentioned first aspect or the second aspect or the third aspect, and no longer repeat.
第十方面,提供一种通信系统,该通信系统包括上述方面所述的授权服务器、网关设备、和客户端设备。In a tenth aspect, a communication system is provided, and the communication system includes the authorization server, the gateway device, and the client device described in the above aspect.
图1为一种园区网中正常访问和越权访问的示意图;Fig. 1 is a schematic diagram of normal access and unauthorized access in a campus network;
图2为一种基于访问控制列表的访问控制示意图;FIG. 2 is a schematic diagram of access control based on an access control list;
图3为一种基于防火墙的访问控制示意图;FIG. 3 is a schematic diagram of access control based on a firewall;
图4为一种基于JWT的访问控制示意图;Fig. 4 is a schematic diagram of access control based on JWT;
图5为一种基于网络cookie的访问控制示意图;Fig. 5 is a schematic diagram of access control based on network cookies;
图6a为本申请适用的一种通信系统的结构示意图;FIG. 6a is a schematic structural diagram of a communication system applicable to the present application;
图6b为本申请提供的一种访问控制的示意图;FIG. 6b is a schematic diagram of an access control provided by the present application;
图7为本申请提供的一种访问控制方法的流程示意图;FIG. 7 is a schematic flowchart of an access control method provided by the present application;
图8为本申请提供的一种目标信息包括的参数类型的示意图;FIG. 8 is a schematic diagram of the types of parameters included in target information provided by the present application;
图9为本申请提供的一种目标信息包括的参数类型的示意图;FIG. 9 is a schematic diagram of the types of parameters included in target information provided by the present application;
图10a为本申请提供的一种目标信息包括的参数类型的示意图;Fig. 10a is a schematic diagram of the types of parameters included in the target information provided by the present application;
图10b为本申请提供的一种目标信息包括的参数类型的示意图;Fig. 10b is a schematic diagram of the types of parameters included in the target information provided by the present application;
图10c为本申请提供的一种目标信息包括的参数类型的示意图;Fig. 10c is a schematic diagram of the types of parameters included in the target information provided by the present application;
图11a为本申请提供的一种令牌的格式示意图;Figure 11a is a schematic diagram of the format of a token provided by this application;
图11b为本申请提供的另一种令牌的格式示意图;Figure 11b is a schematic diagram of the format of another token provided by this application;
图12a为本申请提供的一种IP报文负载的结构示意图;FIG. 12a is a schematic structural diagram of an IP packet load provided by the present application;
图12b为本申请提供的一种IP报文负载的结构示意图;FIG. 12b is a schematic structural diagram of an IP packet load provided by the present application;
图12c为本申请提供的一种IP报文负载的结构示意图;FIG. 12c is a schematic structural diagram of an IP packet load provided by the present application;
图12d为本申请提供的一种IP报文负载的结构示意图;FIG. 12d is a schematic structural diagram of an IP packet load provided by the present application;
图13a为本申请提供的一种令牌的格式示意图;Figure 13a is a schematic diagram of the format of a token provided by this application;
图13b为本申请提供的另一种令牌的格式示意图;Figure 13b is a schematic diagram of the format of another token provided by this application;
图14为本申请提供的一种令牌验证流程的示意图;Figure 14 is a schematic diagram of a token verification process provided by this application;
图15为本申请提供的一种令牌合法性检查子子流程的示意图;Fig. 15 is a schematic diagram of a sub-sub-process of checking token validity provided by the present application;
图16为本申请提供的一种客户端部署方式示意图;FIG. 16 is a schematic diagram of a client deployment method provided by this application;
图17为本申请提供的一种部署请求代理中间件时的访问控制方法的流程示意图;FIG. 17 is a schematic flow diagram of an access control method when deploying request proxy middleware provided by the present application;
图18为本申请提供的一种通信装置的结构示意图;FIG. 18 is a schematic structural diagram of a communication device provided by the present application;
图19为本申请提供的另一种通信装置的结构示意图。FIG. 19 is a schematic structural diagram of another communication device provided by the present application.
在本申请的描述中,除非另有说明,“/”表示前后关联的对象是一种“或”的关系,例如,A/B可以表示A或B;本申请中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,其中A,B可以是单数或者复数。In the description of this application, unless otherwise specified, "/" means that the objects associated with each other are an "or" relationship, for example, A/B can mean A or B; "and/or" in this application is only It is an association relationship describing associated objects, which means that there can be three kinds of relationships, for example, A and/or B, which can mean: A exists alone, A and B exist at the same time, and B exists alone, among which A, B Can be singular or plural.
在本申请的描述中,除非另有说明,“多个”是指两个或多于两个。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c,a和b,a和c,b和c,a和b和c,其中a,b,c可以是单个,也可以是多个。In the description of the present application, unless otherwise specified, "plurality" means two or more than two. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one item (piece) of a, b, or c can represent: a, b, c, a and b, a and c, b and c, a and b and c, where a, b, c Can be single or multiple.
另外,为了便于清楚描述本申请实施例的技术方案,在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。同时,在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念,便于理解。In addition, in order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with basically the same function and effect. Those skilled in the art can understand that words such as "first" and "second" do not limit the number and execution order, and words such as "first" and "second" do not necessarily limit the difference. Meanwhile, in the embodiments of the present application, words such as "exemplary" or "for example" are used as examples, illustrations or illustrations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of the present application shall not be interpreted as being more preferred or more advantageous than other embodiments or design schemes. To be precise, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete manner for easy understanding.
可以理解,说明书通篇中提到的“实施例”意味着与实施例有关的特定特征、结构或特性包括在本申请的至少一个实施例中。因此,在整个说明书各个实施例未必一定指相同的实施例。此外,这些特定的特征、结构或特性可以任意适合的方式结合在一个或多个实施例中。可以理解,在本申请的各种实施例中,各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It is to be understood that references to "an embodiment" throughout the specification mean that a particular feature, structure, or characteristic related to the embodiment is included in at least one embodiment of the present application. Thus, the various embodiments throughout the specification are not necessarily referring to the same embodiment. Furthermore, the particular features, structures or characteristics may be combined in any suitable manner in one or more embodiments. It can be understood that in various embodiments of the present application, the serial numbers of the processes do not mean the order of execution, and the execution order of the processes should be determined by their functions and internal logic, and should not be used in the embodiments of the present application. The implementation process constitutes no limitation.
可以理解,在本申请中,“…时”、“若”均指在某种客观情况下会做出相应的处理,并非是限定时间,且也不要求实现时一定要有判断的动作,也不意味着存在其它限定。It can be understood that in this application, "...when" and "if" both refer to the corresponding processing under certain objective circumstances, and are not time-limited, nor do they require that there must be an action of judgment when it is realized. No other limitations are implied.
可以理解,本申请实施例中的一些可选的特征,在某些场景下,可以不依赖于其他特征,比如其当前所基于的方案,而独立实施,解决相应的技术问题,达到相应的效果,也可以在某些场景下,依据需求与其他特征进行结合。相应的,本申请实施例中给出的装置也可以相应的实现这些特征或功能,在此不予赘述。It can be understood that some optional features in the embodiments of the present application, in some scenarios, can be independently implemented without relying on other features, such as the current solution on which they are based, to solve corresponding technical problems and achieve corresponding effects , and can also be combined with other features according to requirements in some scenarios. Correspondingly, the devices provided in the embodiments of the present application can also correspondingly implement these features or functions, which will not be repeated here.
本申请中,除特殊说明外,各个实施例之间相同或相似的部分可以互相参考。在本申请中各个实施例、以及各实施例中的各个实施方式/实施方法/实现方法中,如果没有特殊说明以 及逻辑冲突,不同的实施例之间、以及各实施例中的各个实施方式/实施方法/实现方法之间的术语和/或描述具有一致性、且可以相互引用,不同的实施例、以及各实施例中的各个实施方式/实施方法/实现方法中的技术特征根据其内在的逻辑关系可以组合形成新的实施例、实施方式、实施方法、或实现方法。以下所述的本申请实施方式并不构成对本申请保护范围的限定。In this application, unless otherwise specified, the parts that are the same or similar among the various embodiments can be referred to each other. In the various embodiments in this application, and the various implementation methods/implementation methods/implementation methods in each embodiment, if there is no special description and logical conflict, different embodiments, and each implementation method/implementation method in each embodiment The terms and/or descriptions between implementation methods/implementation methods are consistent and can be referred to each other. Different embodiments, and the technical features in each implementation manner/implementation method/implementation method in each embodiment are based on their inherent Logical relationships can be combined to form new embodiments, implementation modes, implementation methods, or implementation methods. The following embodiments of the present application are not intended to limit the protection scope of the present application.
超文本传输协议(hypertext transfer protocol,HTTP)作为广泛应用的数据传输协议,是进行访问控制的关键。目前,进行HTTP访问控制的方法主要分为以下五类:As a widely used data transfer protocol, Hypertext Transfer Protocol (HTTP) is the key to access control. At present, the methods for HTTP access control are mainly divided into the following five categories:
第一类方案是在网络层数据面(例如路由器/交换机)部署访问控制列表(access control list,ACL)服务,其原理如图2所示。首先,授权服务器制定客户端地址到数据服务器地址的访问控制策略,生成ACL表项。随后进行ACL配置,即通过特定的传输协议、软件、或者带外的方式向网关下发该ACL表项。最后,网关收到来自客户端的数据请求时,通过查询ACL表项进行ACL规则搜索与匹配。若ACL匹配通过,向数据服务器转发该数据请求;若ACL匹配不通过,则丢弃该数据请求。The first type of solution is to deploy access control list (access control list, ACL) services on the data plane of the network layer (such as routers/switches), and its principle is shown in Figure 2. First, the authorization server formulates an access control policy from the client address to the data server address, and generates ACL entries. Then perform ACL configuration, that is, send the ACL entry to the gateway through a specific transmission protocol, software, or an out-of-band method. Finally, when the gateway receives the data request from the client, it searches and matches the ACL rules by querying the ACL entries. If the ACL match passes, the data request is forwarded to the data server; if the ACL match fails, the data request is discarded.
可选的,ACL表项中可以包括ACL编号(ACL Number)和一条或多条规则(rule)。每条规则包括规则标识(identifier,ID),即rule ID、访问策略(允许(permit)/拒绝(deny))、源地址(source address)、目的地址(destination address)、有效期(effective time range)等。示例性的,一个具体的ACL表项可以如下所示:Optionally, the ACL entry may include an ACL number (ACL Number) and one or more rules (rule). Each rule includes a rule identifier (identifier, ID), that is, rule ID, access policy (permit/deny), source address, destination address, and effective time range wait. Exemplarily, a specific ACL entry can be as follows:
acl number 2000acl number 2000
rule 5 permit source 10.108.234.100 destination 10.108.234.114 time-range time 1rule 5 permit source 10.108.234.100 destination 10.108.234.114 time-range time 1
rule 10 permit source 10.108.234.101 destination 10.108.234.114 time-range time 2rule 10 permit source 10.108.234.101 destination 10.108.234.114 time-range time 2
……
……
然而,从上述介绍可知,基于ACL进行访问控制时,控制粒度较粗。其受限于ACL规则的表达方式以及网络层能够获取的有限信息,最多只能进行网络五元组级别(即源地址、目的地址、源端口、目的端口、协议)的访问控制,即进行HTTP数据服务器地址级别的访问控制,无法进行HTTP统一资源定位符(uniform resource locator,URL)级别的精细化控制。另一方面,ACL的表项单项增长且相互前后依赖,难以进行删除等操作,同时ACL表项与地址绑定,当进行地址变更与迁移部署时,十分不灵活,从而导致更新维护较为困难。再一方面,ACL表项的查找与存储一般需要使用特殊的硬件,对硬件依赖较强,部署使用成本较高。However, it can be seen from the above introduction that when access control is performed based on ACL, the control granularity is relatively coarse. It is limited by the expression of ACL rules and the limited information that the network layer can obtain. At most, it can only perform access control at the network quintuple level (ie, source address, destination address, source port, destination port, protocol), that is, HTTP Access control at the data server address level cannot be fine-tuned at the HTTP Uniform Resource Locator (URL) level. On the other hand, ACL entries grow individually and are dependent on each other, making it difficult to delete and other operations. At the same time, ACL entries are bound to addresses, which is very inflexible when address changes and migration deployments are performed, making update and maintenance difficult. On the other hand, the search and storage of ACL entries generally require the use of special hardware, which is highly dependent on the hardware and requires high deployment and use costs.
第二类方案是基于防火墙的访问控制,主要通过部署防火墙来实现请求过滤和连接阻断,其基本原理如图3所示。主要通过部署在防火墙设备上的专用软件与硬件,对报文的各层信息进行分析,可以实现访问策略执行、内容审计监控、有害流量过滤等许多功能。防火墙在收到客户端的请求时,可以执行访问策略,若请求合法则向数据服务器转发请求;若请求不合法则丢弃请求。The second type of solution is firewall-based access control, which mainly implements request filtering and connection blocking by deploying a firewall. The basic principle is shown in Figure 3. Mainly through the dedicated software and hardware deployed on the firewall device, the information of each layer of the message is analyzed, and many functions such as access policy enforcement, content audit monitoring, and harmful traffic filtering can be realized. When the firewall receives the request from the client, it can execute the access policy, and if the request is legal, it will forward the request to the data server; if the request is not legal, it will discard the request.
防火墙的访问控制粒度与范围均十分灵活,是当前园区网进行访问控制的主要方式之一。然而,基于防火墙的访问控制方案由数据面逻辑负责策略执行,需要部署专用的设备与软件,对网络各层信息进行解析,复杂度较高,通信开销与计算开销均较大。The access control granularity and scope of the firewall are very flexible, and it is one of the main methods of access control in the current campus network. However, the firewall-based access control scheme is implemented by the logic of the data plane. It needs to deploy special equipment and software to analyze the information of each layer of the network. The complexity is high, and the communication overhead and computing overhead are relatively large.
第三类方案是基于应用层令牌(token)的访问控制,主要通过服务器端颁发的应用层token来进行数据的细粒度访问控制,其基本原理如图4所示。首先,用户在客户端登录服务器并发起请求,服务器(图4以数据服务器为例,还可以是可信授权服务器)验证用户名密码,根据用户权限颁发对应权限的token,如JSON网络令牌(JSON web token,JWT),返回给客 户端。随后,客户端存储来自服务器token,并在发起请求时将该token嵌入HTTP请求的标头(一般是授权(Authorization)标头)中。数据服务器收到请求后提取出token并使用查询数据库或者签名验证等方法验证token的合法性。若token合法则响应请求,token不合法则拒绝请求。The third type of scheme is based on application layer token (token) access control. The fine-grained access control of data is mainly carried out through the application layer token issued by the server. The basic principle is shown in Figure 4. First, the user logs in to the server on the client side and initiates a request. The server (Figure 4 takes the data server as an example, and it can also be a trusted authorization server) verifies the username and password, and issues tokens with corresponding permissions according to user permissions, such as JSON network tokens ( JSON web token, JWT), returned to the client. Subsequently, the client stores the token from the server, and embeds the token in the header (usually the Authorization header) of the HTTP request when the request is initiated. After the data server receives the request, it extracts the token and uses methods such as querying the database or signature verification to verify the legitimacy of the token. If the token is legal, the request will be responded to, and if the token is not valid, the request will be rejected.
然而,上述基于token的访问控制需要在数据服务器端消耗资源进行权限验证,无法在非法请求到达数据服务器之前进行拦截,无法阻断非授权请求连接的建立。However, the above token-based access control needs to consume resources on the data server side for permission verification, and cannot intercept illegal requests before reaching the data server, and cannot block the establishment of unauthorized request connections.
第四类方案是基于零信任架构的访问控制。基于零信任架构的访问控制不是一个特定的技术,而是基于整个网络不可信、存在持续性的内外部威胁假设的设计理念,并基于此理念使用相关安全技术并构建零信任的安全系统。其访问控制分为两段完成,访问代理(access proxy)作为后向代理,是第一段访问策略强制执行的逻辑中心,用于完成用户/设备认证、凭据卸载、向后端发送请求等功能,可以部署ACL完成粗粒度的访问控制,随后转发请求。第二段在后端应用完成,即当后端应用收到请求后,查询自身服务访问策略配置,从而进行细粒度的访问控制。The fourth type of solution is access control based on zero trust architecture. Access control based on zero-trust architecture is not a specific technology, but a design concept based on the assumption that the entire network is untrustworthy and there are persistent internal and external threats. Based on this concept, relevant security technologies are used to build a zero-trust security system. Its access control is completed in two stages. The access proxy (access proxy) acts as a backward proxy and is the logic center for the first stage of access policy enforcement. It is used to complete functions such as user/device authentication, credential uninstallation, and sending requests to the backend. , you can deploy ACL to implement coarse-grained access control, and then forward requests. The second stage is completed in the back-end application, that is, when the back-end application receives the request, it queries its own service access policy configuration to perform fine-grained access control.
基于零信任架构的访问控制方案作为系统化的解决方案,其部署与开销代价较大;此外,该方案更多的是现有访问控制技术(如JWT、ACL引擎)的整合与使用,并没有解决相关技术本身所存在的问题。As a systematic solution, the access control solution based on zero trust architecture has a high cost of deployment and overhead; in addition, this solution is more about the integration and use of existing access control technologies (such as JWT, ACL engine), and does not Solve the problems existing in the related technology itself.
第五类方案是基于网络(network)cookies的方案。Network cookies的系统基本框架如图5所示。客户端根据自身需求(如欲访问资源)向cookie服务器(server)请求cookie描述符(descriptor)。示例性的,cookie descriptor包括的信息如下:The fifth type of scheme is a scheme based on network cookies. The basic framework of the Network cookies system is shown in Figure 5. The client requests a cookie descriptor (descriptor) from the cookie server (server) according to its own needs (for example, to access resources). Exemplarily, the information included in the cookie descriptor is as follows:
当客户端获得此cookie descriptor后,可以在本地生成发送报文时携带的cookie。示例性的,cookie包括的信息如下:After the client obtains the cookie descriptor, it can locally generate the cookie carried when sending the message. Exemplarily, the information included in the cookie is as follows:
当交换机或者中间件收到客户端发送的携带cookie的报文后,根据cookie_id查找签名秘钥,并使用该签名秘钥计算cookie摘要,将计算得到的cookie摘要与cookie自带签名进行比对,若二者相同,根据cookie时间戳进行进一步验证,若验证通过,向数据服务器转发报文,以使数据服务器提供cookie_descriptor对应的服务。When the switch or middleware receives the cookie-carrying message sent by the client, it searches for the signature key according to the cookie_id, and uses the signature key to calculate the cookie digest, and compares the calculated cookie digest with the cookie's own signature. If the two are the same, further verification is performed according to the cookie timestamp, and if the verification passes, the message is forwarded to the data server, so that the data server provides services corresponding to the cookie_descriptor.
在基于network cookies的方案中,采用了客户端获取cookie descriptor后在本地生成cookie的方法。然而,cookie descriptor需要在客户端、cookie server、以及交换机/中间件之间进行同步。当客户端数量增加时,会线性增大客户端-cookie server-交换机/中间件之间同步cookie descriptor的通信与存储复杂度。In the solution based on network cookies, the method of generating cookies locally after the client obtains the cookie descriptor is adopted. However, the cookie descriptor needs to be synchronized between the client, the cookie server, and the switch/middleware. When the number of clients increases, the communication and storage complexity of synchronizing cookie descriptor between client-cookie server-switch/middleware will increase linearly.
另一方面,交换机/中间件需要通过cookie携带的cookie检索cookie descriptor中的签名秘钥,从而验证cookie合法性的复杂度也会线性增加。On the other hand, the switch/middleware needs to retrieve the signature key in the cookie descriptor through the cookie carried by the cookie, so the complexity of verifying the validity of the cookie will increase linearly.
再一方面,cookie的验证仅仅通过cookie自身信息和存储在交换机/中间件中的信息进行,如果进行HTTP访问控制,可能存在非法用户使用合法的cookie发送未授权HTTP请求的情况,在高安全的环境中会存在安全漏洞。On the other hand, cookie verification is only done through the cookie itself and the information stored in the switch/middleware. If HTTP access control is implemented, there may be cases where illegal users use legitimate cookies to send unauthorized HTTP requests. There will be security gaps in the environment.
由上可知,目前的访问控制方法存在各种问题,基于此,本申请提供一种访问控制方法,能够合理、高效、灵活地进行访问控制,从而减少数据泄露。It can be seen from the above that there are various problems in the current access control method. Based on this, the present application provides an access control method, which can perform access control reasonably, efficiently and flexibly, thereby reducing data leakage.
可以理解的,本申请提供的方法可以用于各种具有标准化格式的传输协议的访问控制,包括但不限于HTTP,例如,还可以应用于文件传输协议(file transfer protocol,FTP)等其他协议。It can be understood that the method provided by this application can be used for access control of various transmission protocols with standardized formats, including but not limited to HTTP, for example, it can also be applied to other protocols such as file transfer protocol (file transfer protocol, FTP).
图6a是本申请的实施例应用的通信系统600的架构示意图。如图6a所示,该通信系统包括客户端设备601和授权服务器602。可选的,该通信系统还可以包括数据服务器603或网关设备604。Fig. 6a is a schematic structural diagram of a communication system 600 applied by an embodiment of the present application. As shown in FIG. 6 a , the communication system includes a client device 601 and an authorization server 602 . Optionally, the communication system may further include a data server 603 or a gateway device 604 .
可选的,授权服务器为访问控制策略的制定点,例如用于颁发令牌等。数据服务器为数据或资源的响应者。网关设备为访问控制策略的执行点,例如用于令牌验证等;或者,访问控制策略的执行点也可以是数据服务器,即可以在数据服务器侧进行令牌验证。Optionally, the authorization server is a setting point for access control policies, such as issuing tokens. Data servers are responders for data or resources. The gateway device is the execution point of the access control policy, for example, for token verification; or, the execution point of the access control policy may also be the data server, that is, the token verification can be performed on the data server side.
基于该通信系统600,如图6b所示,以网关设备为访问控制策略的执行点为例,本申请提供的访问控制方法中,客户端设备首先向授权服务器发送令牌申请信息,随后授权服务器向客户端设备返回目标令牌。客户端设备在发送请求报文时,将目标令牌携带在请求报文中发送。网关设备收到请求报文后验证令牌合法性,在令牌合法时向数据服务器转发该请求报文。后续,数据服务器可以发送请求报文的响应。Based on the communication system 600, as shown in Figure 6b, taking the gateway device as the execution point of the access control policy as an example, in the access control method provided by this application, the client device first sends token application information to the authorization server, and then the authorization server Return the target token to the client device. When the client device sends the request message, it sends the target token in the request message. The gateway device verifies the legitimacy of the token after receiving the request message, and forwards the request message to the data server when the token is legal. Subsequently, the data server may send a response to the request message.
在数据服务器作为访问控制策略的执行点时,网关设备收到请求报文后可以直接转发给数据服务器,由数据服务器进行令牌验证,在令牌合法时可以向客户端设备发送请求报文的响应。上述方案的详细说明将在后续实施例进行描述,在此不予赘述。When the data server is used as the execution point of the access control policy, the gateway device can directly forward the request message to the data server after receiving the request message, and the data server will perform token verification, and can send the request message to the client device when the token is valid. response. The detailed description of the above solutions will be described in subsequent embodiments, and will not be repeated here.
可选的,授权服务器和数据服务器可以是应用服务器或个人计算机(personal computer,PC)等。网关设备可以是路由器、交换机等具备数据包转发能力的网络设备。Optionally, the authorization server and the data server may be an application server or a personal computer (personal computer, PC). The gateway device may be a network device capable of forwarding data packets, such as a router and a switch.
可选的,客户端设备可以为具有通信功能的终端设备。示例性的,客户端设备可以为:物联网(Internet of Things,IoT)设备(例如,传感器,电表,水表等)、车联网(vehicle to everything,V2X)设备、无线局域网(wireless local area networks,WLAN)中的站点(station,ST)、个人数字处理(personal digital assistant,PDA)设备、具有无线通信功能的手持设备(如手机)、计算设备或连接到无线调制解调器的其它处理设备、车载设备、可穿戴设备(也可以称为穿戴式智能设备)、平板电脑或带无线收发功能的电脑等。Optionally, the client device may be a terminal device with a communication function. Exemplarily, the client device may be: an Internet of Things (Internet of Things, IoT) device (for example, a sensor, an electric meter, a water meter, etc.), a vehicle networking (vehicle to everything, V2X) device, a wireless local area network (wireless local area networks, Station (station, ST) in WLAN), personal digital assistant (PDA) equipment, handheld equipment (such as mobile phone) with wireless communication function, computing equipment or other processing equipment connected to a wireless modem, vehicle equipment, Wearable devices (also called wearable smart devices), tablet computers or computers with wireless transceiver functions, etc.
需要说明的是,本申请实施例描述的通信系统是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域普通技术人员可知,随着网络架构的演变和新业务场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。It should be noted that the communication system described in the embodiment of the present application is to illustrate the technical solutions of the embodiments of the present application more clearly, and does not constitute a limitation to the technical solutions provided in the embodiments of the present application. With the evolution of the network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
下面将结合附图,对本申请实施例提供的方法进行展开说明。可以理解的,本申请实施例中,执行主体可以执行本申请实施例中的部分或全部步骤,这些步骤或操作仅是示例,本申请实施例还可以执行其它操作或者各种操作的变形。此外,各个步骤可以按照本申请实施例呈现的不同的顺序来执行,并且有可能并非要执行本申请实施例中的全部操作。The method provided in the embodiment of the present application will be described below with reference to the accompanying drawings. It can be understood that in the embodiments of the present application, the executive body may perform some or all of the steps in the embodiments of the present application, these steps or operations are only examples, and the embodiments of the present application may also perform other operations or variations of various operations. In addition, each step may be performed in a different order presented in the embodiment of the present application, and it may not be necessary to perform all operations in the embodiment of the present application.
需要说明的是,本申请下述实施例中各个信息或参数的名称等只是一个示例,具体实现 中也可以是其他的名称,本申请实施例对此不作具体限定。It should be noted that the name of each information or parameter in the following embodiments of this application is just an example, and other names may also be used in specific implementations, which are not specifically limited in this embodiment of this application.
如图7所示,为本申请提供的一种访问控制方法,该访问控制方法包括如下步骤:As shown in Figure 7, it is an access control method provided by the present application, which includes the following steps:
S701、客户端设备向授权服务器发送令牌申请信息。相应的,授权服务器接收来自客户端设备的令牌申请信息。S701. The client device sends token application information to the authorization server. Correspondingly, the authorization server receives token application information from the client device.
其中,该令牌申请信息用于申请目标令牌。Wherein, the token application information is used to apply for the target token.
可选的,该令牌申请信息可以包括以下至少一项:目标资源对应的网络层信息、目标资源对应的传输层信息、目标资源对应的应用层信息、目标资源对应的请求方描述信息、或需求信息。Optionally, the token application information may include at least one of the following: network layer information corresponding to the target resource, transport layer information corresponding to the target resource, application layer information corresponding to the target resource, requester description information corresponding to the target resource, or demand information.
可选的,目标资源为客户端设备待访问的资源,该目标资源可以为互联网中的任意资源,其在互联网中的位置可以用统一资源定位符(uniform resource locator,URL)标识,本申请以数据服务器提供(或响应)该目标资源为例进行说明。示例性的,一个具体的URL可以为w3.huawei.com/next/indexa.html。Optionally, the target resource is a resource to be accessed by the client device. The target resource can be any resource on the Internet, and its location on the Internet can be identified by a uniform resource locator (URL). This application refers to The data server provides (or responds to) the target resource as an example for illustration. Exemplarily, a specific URL may be w3.huawei.com/next/indexa.html.
网络层信息可以包括源互联网协议(internet protocol,IP)地址和目的IP地址。目标资源对应的源IP地址即为客户端设备的IP地址,目的IP地址为数据服务器的IP地址。The network layer information may include a source Internet Protocol (internet protocol, IP) address and a destination IP address. The source IP address corresponding to the target resource is the IP address of the client device, and the destination IP address is the IP address of the data server.
传输层信息可以包括目的端口(port),或者,可以包括目的端口和源端口。目标资源对应的目的端口为数据服务器的端口,源端口为客户端设备的端口。The transport layer information may include a destination port (port), or may include a destination port and a source port. The destination port corresponding to the target resource is the port of the data server, and the source port is the port of the client device.
应用层信息可以包括以下至少一项:目标资源的URL、请求信息、请求结束符。请求信息指示与目标资源相关的操作,通过URL和请求信息可以指示某个请求想要访问的资源和欲操作的元数据。示例性的,对于HTTP协议,请求信息可以为方法(method),例如可以为Get、Post、Connect等;对于FTP协议,请求信息可以为命令(command),例如可以为Put、Delete等。The application layer information may include at least one of the following: URL of the target resource, request information, and request terminator. The request information indicates the operation related to the target resource, and the URL and the request information can indicate the resource that a certain request wants to access and the metadata to be operated on. Exemplarily, for the HTTP protocol, the request information may be a method (method), such as Get, Post, Connect, etc.; for the FTP protocol, the request information may be a command (command), such as Put, Delete, etc.
示例性的,对于HTTP协议,HTTP请求中没有请求正文时,请求结束符可以为/r/n/r/n;HTTP请求中有请求正文时,请求结束符可以为0/r/n/r/n。在HTTP请求中有请求正文时,请求结束符的形式可以是授权服务器和客户端设备预先协商的,或者可以是授权服务器向客户端设备配置或通知的。Exemplarily, for the HTTP protocol, when there is no request body in the HTTP request, the request terminator can be /r/n/r/n; when there is a request body in the HTTP request, the request terminator can be 0/r/n/r /n. When there is a request body in the HTTP request, the form of the request terminator may be pre-negotiated between the authorization server and the client device, or may be configured or notified by the authorization server to the client device.
目标资源对应的请求方可以包括客户端设备和/或用户。用户可以为一个账号(即用户名),在客户端设备上登录,并请求访问目标资源。目标资源对应的请求方描述信息可以包括以下至少一项:请求方的身份信息(例如用户名和密码、客户端设备的证书等)、请求方的状态信息(例如客户端设备的运行态摘要)、请求方的组标识、请求方的安全等级、或请求方所处网络的网络类型(例如移动网络或固定网络)。The requestor corresponding to the target resource may include a client device and/or a user. The user may log in on the client device as an account (ie, user name), and request to access the target resource. The requester description information corresponding to the target resource may include at least one of the following: identity information of the requester (such as user name and password, certificate of the client device, etc.), status information of the requester (such as a summary of the running state of the client device), The group identifier of the requesting party, the security level of the requesting party, or the network type of the network where the requesting party is located (such as a mobile network or a fixed network).
需求信息指示以下至少一项:期望的令牌使用时长、完整请求报文是否分段、是否建立传输控制协议(transmission control protocol,TCP)连接。TCP连接指目标资源对应的TCP连接,或者说指客户端设备和数据服务器之间的TCP连接。通常在某个请求之前,需要建立客户端设备与数据服务器之间的TCP连接。The requirement information indicates at least one of the following: expected token usage time, whether the complete request message is segmented, and whether a transmission control protocol (transmission control protocol, TCP) connection is established. The TCP connection refers to the TCP connection corresponding to the target resource, or refers to the TCP connection between the client device and the data server. Usually before a certain request, a TCP connection between the client device and the data server needs to be established.
可选的,在该步骤S701之前,客户端设备可以通过安全传输层(transport layer security,TLS)协议、带外配置等方式,与授权服务器建立安全可信通道,随后通过该安全可信通道向授权服务器发送令牌申请信息,以防止令牌申请信息被篡改或泄露。Optionally, before this step S701, the client device can establish a secure and trusted channel with the authorization server through a secure transport layer (transport layer security, TLS) protocol, out-of-band configuration, etc. The authorization server sends the token application information to prevent the token application information from being tampered with or leaked.
S702、授权服务器根据令牌申请信息,生成目标令牌。S702. The authorization server generates a target token according to the token application information.
其中,目标令牌包括令牌描述(TokenDescrption)和第一授权码(AuthCode)。令牌描述包括授权向量(AuthVector),授权向量指示目标信息。第一授权码是根据令牌描述、目标信息、以及密码散列函数生成的。Wherein, the target token includes a token description (TokenDescrption) and a first authorization code (AuthCode). The token description includes an authorization vector (AuthVector), which indicates target information. The first authorization code is generated based on the token description, target information, and a cryptographic hash function.
示例性的,第一授权码是由令牌描述和目标信息组成的字符串通过密码散列函数生成的。该密码散列函数可以为HMAC算法,该情况下,授权码的计算公式可以表示为如下公式(1):Exemplarily, the first authorization code is generated by a character string composed of token description and target information through a cryptographic hash function. The cryptographic hash function can be an HMAC algorithm. In this case, the calculation formula of the authorization code can be expressed as the following formula (1):
AuthVector=HMAC(TokenDescrption||目标信息,MasterKey) (1)AuthVector=HMAC(TokenDescrption||target information, MasterKey) (1)
其中,||表示连接;MasterKey为密码散列函数的密钥,MasterKey可以由授权服务器生成并定期更新。此外,授权服务器还可以将MasterKey发送给网关设备或数据服务器进行令牌验证。Among them, || indicates connection; MasterKey is the key of password hash function, and MasterKey can be generated by the authorization server and updated periodically. In addition, the authorization server can also send the MasterKey to the gateway device or data server for token verification.
可选的,目标信息为待携带在客户端设备的请求报文中的信息,或者说,目标信息为请求报文中的部分字节。即请求报文中的信息参与授权码的计算。该场景下,目标信息可以表示为AuthSegments,上述公式(1)可以替换为如下公式(2):Optionally, the target information is information to be carried in the request message of the client device, or in other words, the target information is some bytes in the request message. That is, the information in the request message participates in the calculation of the authorization code. In this scenario, the target information can be expressed as AuthSegments, and the above formula (1) can be replaced with the following formula (2):
AuthVector=HMAC(TokenDescrption||AuthSegments,MasterKey) (2)AuthVector=HMAC(TokenDescrption||AuthSegments,MasterKey) (2)
基于该方案,使用请求报文中的信息参与授权码计算,后续进行令牌验证时,可以防止使用目标令牌发送非法请求的发生。例如,非法用户利用目标令牌发送请求时,由于授权码的计算需要请求报文中的信息参与,若想通过令牌验证,需要同时对请求报文中的目标信息进行造假,然而对请求报文中的信息造假可能无法完成非法用户的非法请求,从而本申请的目标令牌可以在授权范围内随意使用而无需担心盗用,相比于network cookies方案,能够进一步提升安全性能。Based on this scheme, the information in the request message is used to participate in the calculation of the authorization code, and subsequent token verification can prevent illegal requests from being sent using the target token. For example, when an illegal user uses the target token to send a request, since the calculation of the authorization code needs the information in the request message to participate, if he wants to pass the token verification, he needs to falsify the target information in the request message at the same time. The information falsification in this article may not be able to complete the illegal request of illegal users, so the target token of this application can be used freely within the scope of authorization without worrying about theft. Compared with the network cookies scheme, it can further improve security performance.
可选的,目标信息可以包括以下至少一项:目标资源对应的网络层信息、传输层信息、授权请求起始符、请求结束符、请求方描述信息、或响应方描述信息。Optionally, the target information may include at least one of the following: network layer information, transport layer information, authorization request initiator, request end identifier, requester description information, or responder description information corresponding to the target resource.
可选的,目标信息包括的网络层信息中的目的IP地址可以是数据服务器的完整IP地址,或者可以是数据服务器的IP地址前缀。在目的IP为数据服务器的IP地址前缀时,使得目标令牌可以在访问该IP地址前缀下的多个数据服务器时使用。Optionally, the destination IP address in the network layer information included in the destination information may be the complete IP address of the data server, or may be a prefix of the IP address of the data server. When the destination IP is the IP address prefix of the data server, the destination token can be used when accessing multiple data servers under the IP address prefix.
可选的,授权请求起始符包括请求信息和目标资源的部分或全部URL前缀,通过调整授权请求起始符中目标资源的URL前缀部分,授权服务器可以灵活控制访问范围。示例性的,以目标资源的URL为w3.huawei.com/next/indexa.html为例,若授权请求起始符中目标资源的URL前缀部分为w3.huawei.com,表示授权服务器为请求方授予主机下的相关操作权限;若授权请求起始符中目标资源的URL前缀部分为w3.huawei.com/next,表示授权服务器为请求方授予主机中的next目标下的相关操作权限,相比于授予主机下的相关操作权限,缩小了请求方的访问范围。Optionally, the authorization request initiator includes request information and part or all of the URL prefix of the target resource. By adjusting the URL prefix of the target resource in the authorization request initiator, the authorization server can flexibly control the access scope. For example, taking the URL of the target resource as w3.huawei.com/next/indexa.html as an example, if the URL prefix part of the target resource in the authorization request initiator is w3.huawei.com, it means that the authorization server is the requester Authorize the relevant operation permissions under the host; if the URL prefix part of the target resource in the authorization request initiator is w3.huawei.com/next, it means that the authorization server grants the requester the relevant operation permissions under the next target in the host. Based on the relevant operation permissions granted to the host, the access scope of the requester is narrowed.
可选的,授权服务器可以根据请求方描述信息,确定请求方的访问权限,再根据请求方的访问权限,确定授权请求起始符。示例性的,授权服务器中可以预先存储或配置访问权限与请求方的对应关系,收到客户端设备的请求方描述信息后,可以从中获知请求方的信息,再根据该对应关系,查找请求方的访问权限。Optionally, the authorization server may determine the requester's access rights according to the requester's description information, and then determine the authorization request initiator according to the requester's access rights. Exemplarily, the authorization server may pre-store or configure the corresponding relationship between the access authority and the requesting party, and after receiving the requesting party description information of the client device, it may obtain the information of the requesting party, and then search for the requesting party according to the corresponding relationship. access rights.
可选的,响应方为数据服务器,响应方描述信息可以包括以下至少一项:响应方的组标识、响应方的安全等级、或响应方所处网络的网络类型。目标信息包括的其他参数的说明可参考上述步骤S701中的相关描述,在此不再赘述。可选的,授权服务器可以根据令牌申请信息中的需求信息确定目标信息包括的参数。示例性的:Optionally, the responder is a data server, and the responder description information may include at least one of the following: a group identifier of the responder, a security level of the responder, or a network type of a network where the responder is located. For descriptions of other parameters included in the target information, reference may be made to relevant descriptions in the above-mentioned step S701, and details are not repeated here. Optionally, the authorization server may determine the parameters included in the target information according to the requirement information in the token application information. Exemplary:
需求信息指示建立TCP连接时,如图8所示,目标信息包括目标资源对应的网络层信息和传输层信息。此时,目标令牌可以称为TCP连接token。When the requirement information indicates to establish a TCP connection, as shown in FIG. 8 , the target information includes network layer information and transport layer information corresponding to the target resource. At this time, the target token may be called a TCP connection token.
需求信息指示完整请求报文不分段时,如图9所示,目标信息包括目标资源对应的网络层信息、传输层信息、授权请求起始符、和请求结束符。此时,目标令牌可以记为A_Token。When the requirement information indicates that the complete request message is not segmented, as shown in FIG. 9 , the target information includes network layer information, transport layer information, authorization request initiator, and request end identifier corresponding to the target resource. At this point, the target token can be recorded as A_Token.
需求信息指示完整请求报文分段时,目标信息包括完整请报文的起始分段对应的第一子 目标信息、中间分段对应的第二子目标信息、以及末尾分段对应的第三子目标信息。相应的,目标令牌包括起始分段对应的第一子目标令牌(记为S_Token)、中间分段对应的第二子目标令牌(记为M_Token)、以及末尾分段对应的第三子目标令牌(记为E_Token)。When the demand information indicates the segment of the complete request message, the target information includes the first sub-target information corresponding to the start segment of the complete request message, the second sub-target information corresponding to the middle segment, and the third sub-target information corresponding to the end segment. subgoal information. Correspondingly, the target token includes the first sub-target token (denoted as S_Token) corresponding to the start segment, the second sub-target token (denoted as M_Token) corresponding to the middle segment, and the third sub-target token corresponding to the end segment Sub-target token (denoted as E_Token).
可选的,如图10a所示,完整请求报文的起始分段包括IP头、TCP头、和负载(payload),负载包括请求信息、URL、以及部分请求字节。起始分段对应的第一子目标信息包括网络层信息、传输层信息、和授权请求起始符。Optionally, as shown in FIG. 10a, the initial segment of the complete request message includes an IP header, a TCP header, and a payload (payload), and the payload includes request information, URL, and part of request bytes. The first sub-object information corresponding to the initial segment includes network layer information, transport layer information, and authorization request initiator.
可选的,如图10b所示,完整请求报文的中间分段包括IP头、TCP头、和负载(payload),负载包括部分请求字节。中间分段对应的第二子目标信息包括网络层信息和传输层信息。Optionally, as shown in FIG. 10b, the middle segment of the complete request message includes an IP header, a TCP header, and a payload (payload), and the payload includes part of the request bytes. The second sub-object information corresponding to the middle segment includes network layer information and transport layer information.
可选的,如图10c所示,完整请求报文的末尾分段包括IP头、TCP头、和负载(payload),负载包括部分请求字节和请求结束符。末尾分段对应的第三子目标信息包括网络层信息、传输层信息、和请求结束符。Optionally, as shown in FIG. 10c, the end segment of the complete request packet includes an IP header, a TCP header, and a payload (payload), and the payload includes a part of request bytes and a request terminator. The third sub-object information corresponding to the end segment includes network layer information, transport layer information, and a request terminator.
可选的,基于步骤S701中的令牌申请信息,授权服务器可以生成TCP连接令牌和A_Token;或者,可以生成TCP连接令牌、S_Token、M_Token、以及E_Token;或者,可以生成TCP连接令牌、A_Token、S_Token、M_Token、以及E_Token。Optionally, based on the token application information in step S701, the authorization server can generate a TCP connection token and A_Token; or, can generate a TCP connection token, S_Token, M_Token, and E_Token; or, can generate a TCP connection token, A_Token, S_Token, M_Token, and E_Token.
基于该方案,可以按需调整目标信息包括的内容,从而灵活调整访问控制粒度,实现多层次精细化的访问控制。例如可以使目标信息包括网络层的信息,实现网络层的访问控制,或者,使目标信息包括网络层、传输层、应用层信息,实现URL级别的精细控制,或者,使目标信息包括请求方或响应方描述信息,实现对安全等级、网络类型等的访问控制。Based on this solution, the content of the target information can be adjusted as needed, so as to flexibly adjust the granularity of access control and realize multi-level and refined access control. For example, the target information can include information at the network layer to implement access control at the network layer, or the target information can include information at the network layer, transport layer, and application layer to achieve fine-grained control at the URL level, or the target information can include the requester or The responder describes information to implement access control on security level, network type, etc.
可选的,关于授权向量指示目标信息的方式:Optionally, regarding the way the authorization vector indicates target information:
作为一种可能的实现,授权向量可以包括偏移值(offset)和长度(length)信息,偏移值指示目标信息的起始位置,长度信息指示目标信息的长度。示例性的,偏移值可以为目标信息的起始位置相对于请求报文的起始位置或结束位置的偏移量。长度信息指示从offset开始的长度。As a possible implementation, the authorization vector may include offset value (offset) and length (length) information, the offset value indicates the starting position of the target information, and the length information indicates the length of the target information. Exemplarily, the offset value may be an offset of the start position of the target information relative to the start position or end position of the request message. The length information indicates the length from offset.
可选的,在目标信息包括多个参数的情况下,授权向量可以包括多个偏移值和多个长度信息,分别指示该多个参数。例如,目标信息包括参数1和参数2,授权向量可以包括偏移值1和长度1用于指示参数1的起始位置和长度,还包括偏移值2和长度2用于指示参数2的起始位置和长度。该情况下,示例性的,目标令牌的格式可以如图11a所示。Optionally, when the target information includes multiple parameters, the grant vector may include multiple offset values and multiple length information, respectively indicating the multiple parameters. For example, the target information includes parameter 1 and parameter 2, and the authorization vector may include offset value 1 and length 1 to indicate the starting position and length of parameter 1, and offset value 2 and length 2 to indicate the starting position and length of parameter 2. start position and length. In this case, for example, the format of the target token may be as shown in FIG. 11a.
作为另一种可能的实现,授权向量可以包括比特位图,该比特位图指示承载目标信息的字段。示例性的,该比特位图包括N个比特,N为请求报文包括的字段总数,每个比特对应请求报文中的一个字段,授权服务器可以将承载目标信息的字段所对应的比特设置为1。以N等于8为例,若目标信息包括第4-6个字段承载的信息,该比特位图可以为00011100。该情况下,示例性的,目标令牌的格式可以如图11b所示。As another possible implementation, the authorization vector may include a bitmap, where the bitmap indicates a field bearing target information. Exemplarily, the bitmap includes N bits, N is the total number of fields included in the request message, each bit corresponds to a field in the request message, and the authorization server can set the bit corresponding to the field carrying the target information as 1. Taking N equal to 8 as an example, if the target information includes information carried in fields 4-6, the bitmap may be 00011100. In this case, for example, the format of the target token may be as shown in FIG. 11b.
可以理解的,由于请求报文具有标准化格式,从而在客户端设备未发送请求报文的情况下,授权服务器也可以获知请求报文的格式,进而可以通过授权向量指示目标信息。It can be understood that since the request message has a standardized format, the authorization server can know the format of the request message even if the client device does not send the request message, and then can indicate the target information through the authorization vector.
S703、授权服务器向客户端设备发送目标令牌。相应的,客户端设备接收来自授权服务器的目标令牌。S703. The authorization server sends the target token to the client device. Accordingly, the client device receives the target token from the authorization server.
可选的,授权服务器可以通过与客户端设备之间的安全可信通道向客户端设备发送目标令牌。Optionally, the authorization server may send the target token to the client device through a secure and trusted channel with the client device.
可选的,授权服务器向客户端设备发送的令牌可以包括TCP连接token和A_Token;或者,可以包括TCP连接token、S_Token、M_Token、以及E_Token;或者,可以包括TCP连接令牌、A_Token、S_Token、M_Token、以及E_Token。Optionally, the token sent by the authorization server to the client device may include a TCP connection token and A_Token; or, may include a TCP connection token, S_Token, M_Token, and E_Token; or may include a TCP connection token, A_Token, S_Token, M_Token, and E_Token.
可选的,客户端设备可以建立目标资源对应的授权请求起始符和目标令牌的对应关系。该目标资源对应的授权请求起始符可以是客户端设备根据目标令牌的授权向量获取的,或者,可以是授权服务器向客户端设备发送的,即除了目标令牌外,授权服务器还向客户端设备返回目标资源对应的授权请求起始符。Optionally, the client device may establish a correspondence between the authorization request initiator corresponding to the target resource and the target token. The authorization request initiator corresponding to the target resource can be obtained by the client device according to the authorization vector of the target token, or it can be sent by the authorization server to the client device, that is, in addition to the target token, the authorization server also sends The end device returns the authorization request initiator corresponding to the target resource.
之后,可以继续执行上述步骤S701-S703,获取其他资源对应的令牌,从而建立授权请求起始符和令牌的对应关系表,示例性的,该对应关系表可以如下表1所示。Afterwards, the above steps S701-S703 may be continued to obtain tokens corresponding to other resources, so as to establish a correspondence table between authorization request initiators and tokens. Exemplarily, the correspondence table may be shown in Table 1 below.
表1Table 1
后续,在客户端设备请求访问目标资源或建立目标资源对应的TCP连接时,执行下述步骤S704。Subsequently, when the client device requests to access the target resource or establish a TCP connection corresponding to the target resource, the following step S704 is performed.
S704、客户端设备获取目标令牌。S704. The client device acquires the target token.
可选的,在客户端设备建立了授权请求起始符和令牌的对应关系表的情况下,目标令牌的获取和使用解耦,即客户端设备可以预先向授权服务器请求目标令牌并存储,在需要发送请求报文时再使用该目标令牌。此时,该步骤S704可以包括:根据目标资源对应的授权请求起始符、以及授权请求起始符和令牌的对应关系,查找目标令牌。Optionally, in the case where the client device has established a correspondence table between the authorization request initiator and the token, the acquisition and use of the target token are decoupled, that is, the client device can request the target token from the authorization server in advance and Store and use the target token when a request message needs to be sent. At this point, step S704 may include: searching for the target token according to the authorization request initiator corresponding to the target resource and the corresponding relationship between the authorization request initiator and the token.
可选的,在客户端设备未建立授权请求起始符和令牌的对应关系的情况下,该步骤S704可以理解为上述:客户端设备接收来自授权服务器的目标令牌。客户端设备从授权服务器处接收到目标令牌后,可以直接使用。Optionally, in the case that the client device has not established the correspondence between the authorization request initiator and the token, this step S704 can be understood as the above: the client device receives the target token from the authorization server. After the client device receives the target token from the authorization server, it can be used directly.
S705、客户端设备发送请求报文。网关设备接收来自客户端设备的请求报文。其中,该请求报文包括目标令牌和目标信息。S705. The client device sends a request packet. The gateway device receives the request message from the client device. Wherein, the request message includes the target token and target information.
可选的,该请求报文可以用于请求建立目标资源对应的TCP连接,或者,可以用于请求访问目标资源,例如请求报文可以为HTTP请求报文或FTP请求报文。Optionally, the request message may be used to request establishment of a TCP connection corresponding to the target resource, or may be used to request access to the target resource, for example, the request message may be an HTTP request message or an FTP request message.
可选的,目标令牌可以携带在请求报文的网络层头部。目标令牌在网络层头部的具体位置可以根据具体的网络层协议确定。示例性的,网络层协议为IPv6时,目标令牌可以携带在网络层头部的目的地选项(destination option)等选项字段中;网络层协议为新IP(NewIP)时,目标令牌可以携带者网络层头部的安全(security)选项字段中。或者,目标令牌可以携带在请求报文的应用层中。Optionally, the target token can be carried in the network layer header of the request message. The specific position of the target token in the network layer header can be determined according to the specific network layer protocol. Exemplarily, when the network layer protocol is IPv6, the target token can be carried in option fields such as the destination option (destination option) of the network layer header; when the network layer protocol is New IP (NewIP), the target token can carry or in the security option field of the network layer header. Alternatively, the target token can be carried in the application layer of the request message.
可选的,目标令牌携带在请求报文的网络层头部时,访问控制策略的执行点可以为网关设备,即由网关设备进行令牌验证。目标令牌携带在请求报文的应用层中时,访问控制策略的执行点可以为数据服务器,即由数据服务器进行令牌验证。Optionally, when the target token is carried in the network layer header of the request message, the execution point of the access control policy may be a gateway device, that is, the gateway device performs token verification. When the target token is carried in the application layer of the request message, the execution point of the access control policy can be the data server, that is, the data server performs token verification.
可选的,请求报文用于请求建立目标资源对应的TCP连接时,目标令牌可以为TCP连接令牌。在访问控制策略的执行点为网关设备时,TCP连接令牌的使用,使得未经授权的客户端设备在请求建立TCP连接时便被识别并过滤,实现客户端设备和数据服务器之间的首包拦截。Optionally, when the request message is used to request to establish a TCP connection corresponding to the target resource, the target token may be a TCP connection token. When the execution point of the access control policy is the gateway device, the use of the TCP connection token enables the unauthorized client device to be identified and filtered when requesting to establish a TCP connection, realizing the first communication between the client device and the data server. Packet interception.
可选的,以目标令牌携带在请求报文的网络层头部为例,客户端设备的应用层可以生成完整的请求报文,用于请求访问目标资源。随后,应用层将完整请求报文交付至传输层,由传输层确定是否对完整请求报文进行TCP分段,在进行TCP分段的情况下,标记各个分段的类型交付至网络层。网络层收到来自传输层的报文后,识别分段类型,并在网络层头部添加相应的目标令牌。Optionally, taking the target token carried in the network layer header of the request message as an example, the application layer of the client device may generate a complete request message for requesting access to the target resource. Subsequently, the application layer delivers the complete request message to the transport layer, and the transport layer determines whether to perform TCP segmentation on the complete request message, and in the case of TCP segmentation, marks the type of each segment and delivers it to the network layer. After the network layer receives the message from the transport layer, it identifies the segment type and adds the corresponding target token to the network layer header.
示例性的,以HTTP请求报文为例,如图12a所示,HTTP分段(HTTPSeg)等于0时,表示无需对HTTP请求报文分段,IP报文的负载包括完整的HTTP请求,对应的目标令牌为A_Token。Exemplarily, taking an HTTP request message as an example, as shown in Figure 12a, when the HTTP segment (HTTPSeg) is equal to 0, it means that there is no need to segment the HTTP request message, and the load of the IP message includes a complete HTTP request, corresponding to The target token for is A_Token.
如图12b所示,HTTPSeg等于1时,表示完整请求报文的起始分段,IP报文的负载包括HTTP请求起始符(即method+URL)和剩余HTTP请求部分,对应的目标令牌为S_Token。As shown in Figure 12b, when HTTPSeg is equal to 1, it indicates the initial segment of the complete request message. The load of the IP message includes the HTTP request initiator (ie method+URL) and the remaining HTTP request part, and the corresponding target token For S_Token.
如图12c所示,HTTPSeg等于2时,表示完整请求报文的中间分段,IP报文的负载包括剩余HTTP请求部分,对应的目标令牌为M_Token。As shown in Figure 12c, when HTTPSeg is equal to 2, it means the middle segment of the complete request message, the payload of the IP message includes the rest of the HTTP request, and the corresponding target token is M_Token.
如图12d所示,HTTPSeg等于3时,表示完整请求报文的末尾分段,IP报文的负载包括剩余HTTP请求部分和请求结束符,对应的目标令牌为E_Token。As shown in Figure 12d, when HTTPSeg is equal to 3, it means the end segment of the complete request message, the payload of the IP message includes the remaining HTTP request part and the request terminator, and the corresponding target token is E_Token.
S706、网关设备或数据服务器根据令牌描述、目标信息、以及秘钥散列函数生成第二授权码。S706. The gateway device or the data server generates a second authorization code according to the token description, the target information, and the key hash function.
可选的,访问控制策略的执行点为网关设备时,该步骤S706由网关设备执行。访问控制策略的执行点为数据服务器时,该步骤S706由数据服务器执行,此时,在步骤S706之前,网关设备需要将请求报文转发给数据服务器。图7中以网关设备执行该步骤S706为例进行说明。Optionally, when the execution point of the access control policy is a gateway device, step S706 is performed by the gateway device. When the execution point of the access control policy is the data server, step S706 is executed by the data server. At this time, before step S706, the gateway device needs to forward the request message to the data server. In FIG. 7, the step S706 performed by the gateway device is taken as an example for illustration.
可选的,网关设备或数据服务器生成第二授权码的方式、以及所使用的密钥与授权服务器相同。Optionally, the method of generating the second authorization code by the gateway device or the data server and the key used are the same as those of the authorization server.
可选的,目标信息可以是网关设备或数据服务器根据令牌描述中的授权向量从请求报文中提取的。Optionally, the target information may be extracted from the request message by the gateway device or the data server according to the authorization vector in the token description.
可选的,在第二授权码与第一授权码相同(或一致)时,若步骤S706由网关设备执行,可以继续执行下述步骤S707;若步骤S706由数据服务器执行,可以继续执行下述步骤S708。Optionally, when the second authorization code is the same (or consistent) with the first authorization code, if step S706 is executed by the gateway device, the following step S707 can be continued; if step S706 is executed by the data server, the following step can be continuously executed Step S708.
可选的,在第二授权码与第一授权码不同(或不一致)时,网关设备或数据服务器可以丢弃该请求报文。或者,若步骤S706由网关设备执行,网关设备可以通过第一路径向数据服务器转发该请求报文;或者,网关设备可以在请求报文中添加标签,将带有标签的请求报文转发给数据服务器。数据服务器在通过第一路径接收到请求报文或者接收到带有标签的请求报文时,可以获知该请求报文为令牌验证未通过的报文,从而进行相应处理,例如,丢弃请求报文或响应部分请求。Optionally, when the second authorization code is different (or inconsistent) from the first authorization code, the gateway device or the data server may discard the request message. Or, if step S706 is performed by the gateway device, the gateway device can forward the request message to the data server through the first path; or, the gateway device can add a label to the request message, and forward the tagged request message to the data server. server. When the data server receives a request message through the first path or receives a request message with a label, it can know that the request message is a message that fails token verification, and then perform corresponding processing, for example, discard the request message text or respond to partial requests.
基于该方案,当访问控制策略的执行点为网关设备时,相比于现有的JWT方案,可以在非法请求到达数据服务器之前进行拦截。Based on this scheme, when the execution point of the access control policy is the gateway device, compared with the existing JWT scheme, the illegal request can be intercepted before reaching the data server.
S707、网关设备向数据服务器转发请求报文。相应的,数据服务器接收来自网关设备的请求报文。S707. The gateway device forwards the request message to the data server. Correspondingly, the data server receives the request message from the gateway device.
可选的,网关设备可以通过第二路径向数据服务器转发请求报文。数据服务器在通过第 二路径接收到请求报文时,可以获知该请求报文为令牌验证通过的报文,从而执行下述步骤S708。Optionally, the gateway device may forward the request message to the data server through the second path. When the data server receives the request message through the second path, it can know that the request message is a message that passes the token verification, so as to execute the following step S708.
S708、数据服务器向客户端设备发送响应报文。相应的,客户端设备接收来自数据服务器的响应报文。其中,该响应报文为上述请求报文的响应。S708. The data server sends a response message to the client device. Correspondingly, the client device receives the response message from the data server. Wherein, the response message is a response to the above request message.
可选的,客户端设备接收来自响应报文后,即可根据该响应报文进行相关处理,本申请对此不作具体限定。Optionally, after receiving the response message, the client device can perform related processing according to the response message, which is not specifically limited in this application.
本申请中,一方面,授权服务器基于客户端设备的申请向客户端设备颁发令牌,客户端设备在发送请求报文时携带该令牌。该令牌包括令牌描述和第一授权码,令牌描述中包括授权向量,该授权向量指示参与授权码计算的目标信息,使得网关设备或数据服务器侧收到请求报文后,可以基于授权向量获取参与授权码计算的信息,并生成第二授权码,根据比较第一授权码和第二授权码是否一致来进行访问控制,例如,在第二授权码和第一授权码一致时允许访问,在第二授权码和第一授权码不一致时拒绝访问,从而防止数据泄露。In this application, on the one hand, the authorization server issues a token to the client device based on the application of the client device, and the client device carries the token when sending a request message. The token includes a token description and a first authorization code, and the token description includes an authorization vector, which indicates the target information involved in the calculation of the authorization code, so that after receiving the request message, the gateway device or the data server side can The vector obtains the information involved in the calculation of the authorization code, and generates the second authorization code, and performs access control based on whether the first authorization code is consistent with the second authorization code, for example, access is allowed when the second authorization code is consistent with the first authorization code , deny access when the second authorization code is inconsistent with the first authorization code, thereby preventing data leakage.
另一方面,授权服务器可以灵活制定访问控制策略,即可以灵活制定令牌,无需向网关设备同步访问控制策略,从而网关设备无需维护访问控制策略或访问控制列表,相比于现有的ACL和防火墙的方案可以灵活部署,降低部署使用成本。On the other hand, the authorization server can flexibly formulate access control policies, that is, it can flexibly formulate tokens without synchronizing access control policies with the gateway device, so that the gateway device does not need to maintain access control policies or access control lists. Compared with the existing ACL and The firewall solution can be deployed flexibly, reducing the cost of deployment and use.
再一方面,访问控制策略的执行点无需分析请求报文的应用层语义,无需查询访问控制策略、用户信息等,可无感知地傻瓜式计算授权码并验证,存储与计算复杂度与访问控制策略、以及用户规模解耦,从而实现高效率的访问控制。On the other hand, the execution point of the access control policy does not need to analyze the application layer semantics of the request message, and does not need to query the access control policy and user information. Policies and user scales are decoupled to achieve efficient access control.
在一些实施例中,令牌描述中除授权向量外,还可以包括有效期(ExpiredTime)和以下至少一项:检查策略(CheckPolicy)、颁发者标识(IssuerID)、密码套件(CypherSuit)、或排除信息(Exclude)。该场景下,目标令牌的格式可以如图13a或图13b所示。In some embodiments, in addition to the authorization vector, the token description may also include an expiration date (ExpiredTime) and at least one of the following: check policy (CheckPolicy), issuer ID (IssuerID), cipher suite (CypherSuit), or exclusion information (Exclude). In this scenario, the format of the target token may be as shown in Figure 13a or Figure 13b.
可选的,有效期指示目标令牌的有限期限。该有限期限可以是授权服务器根据需求信息指示的期望的令牌使用时长确定的。Optionally, the validity period indicates the limited duration of the target token. The limited period may be determined by the authorization server according to the expected token usage time indicated by the requirement information.
可选的,检查策略指示是否信任目标资源的请求方,或者说指示是否信任目标令牌的使用者。示例性的,当CheckPolicy设置为0时,表示信任目标资源的请求方,当CheckPolicy设置为1时,表示不信任目标资源的请求方。在全局的检查策略唯一时,即信任或不信任网络中的全部请求方时,检查策略可以省略。Optionally, the checking policy indicates whether to trust the requester of the target resource, or indicates whether to trust the user of the target token. Exemplarily, when CheckPolicy is set to 0, it means that the requester of the target resource is trusted; when CheckPolicy is set to 1, it means that the requester of the target resource is not trusted. When the global inspection strategy is unique, that is, when all requesters in the network are trusted or distrusted, the inspection strategy can be omitted.
在上述步骤S702中,授权服务器可以根据请求方描述信息确定是否信任该目标资源的请求方,从而设置检查策略。例如,当客户端设备为经过授权服务器认证的客户端设备且用户为可信用户时,确定信任目标资源的请求方,将CheckPolicy设置为0。当客户端设备未经授权服务器认证或者用户不可信时,确定不信任目标资源的请求方,将CheckPolicy设置为1。In the above step S702, the authorization server may determine whether to trust the requester of the target resource according to the description information of the requester, so as to set the checking policy. For example, when the client device is authenticated by the authorization server and the user is a trusted user, it is determined to trust the requester of the target resource, and CheckPolicy is set to 0. When the client device is not authenticated by the authorization server or the user is untrustworthy, it is determined that the requester of the target resource is not trusted, and CheckPolicy is set to 1.
可选的,颁发者标识指示颁发目标令牌的设备(称为令牌颁发设备),即指示授权服务器。访问控制策略的执行点可以通过该标识查找令牌颁发设备的相关信息。在令牌颁发设备全局唯一时,颁发者标识可以省略。Optionally, the issuer identifier indicates the device that issues the target token (referred to as a token issuing device), that is, indicates the authorization server. The enforcement point of the access control policy can look up the relevant information of the token issuing device through this identification. When the token issuing device is globally unique, the issuer ID can be omitted.
可选的,密码套件指示用于计算授权码的密码散列函数的相关信息。访问控制策略的执行点可以根据密码套件确定令牌验证所需的密码学信息。例如密码套件可以包括MasterKey的标识,使得访问控制策略的执行点根据该标识确定MasterKey;或者,访问控制策略的执行点还可以根据密码套件确定密码散列函数对应的类型、长度等。Optionally, the cipher suite indicates information about a cryptographic hash function used to calculate the authorization code. The enforcement point of the access control policy can determine the cryptographic information required for token verification according to the cipher suite. For example, the cipher suite may include the identifier of the MasterKey, so that the execution point of the access control policy determines the MasterKey according to the identifier; or, the execution point of the access control policy may also determine the type and length of the cryptographic hash function according to the cipher suite.
可选的,排除信息指示禁止携带的信息,该禁止携带的信息为客户端设备的请求报文中禁止携带的信息。或者说,排除信息指示请求报文中不能出现的信息。在检查策略指示信任目标资源的请求方时,排除信息可以省略。Optionally, the exclusion information indicates information that is prohibited from being carried, and the information that is prohibited from being carried is information that is prohibited from being carried in the request message of the client device. In other words, the exclusion information indicates information that cannot appear in the request message. Exclusion information MAY be omitted when the checking policy indicates that the requestor of the target resource is trusted.
可选的,请求报文用于请求建立目标资源对应的TCP连接时,禁止携带的信息为负载。此时,排除信息可以设置为第一数值,示例性的,第一数值可以为0。Optionally, when the request message is used to request to establish a TCP connection corresponding to the target resource, the prohibited information is payload. At this time, the exclusion information may be set as a first value, for example, the first value may be 0.
请求报文为完整请求报文的起始分段时,禁止携带的信息为请求结束符。此时,排除信息可以设置为第二数值,示例性的,第二数值可以1。When the request message is the initial segment of a complete request message, the prohibited information is the request terminator. At this time, the exclusion information may be set as a second value, for example, the second value may be 1.
请求报文为完整请求报文的末尾分段时,禁止携带的信息为请求信息。此时,排除信息可以设置为第三数值,示例性的,第三数值可以2。When the request message is the end segment of a complete request message, the prohibited information is request information. At this time, the exclusion information may be set as a third value, for example, the third value may be 2.
请求报文为完整请求报文的中间分段时,禁止携带的信息为请求信息和请求结束符。此时,排除信息可以设置为第四数值,示例性的,第四数值可以3。When the request message is the middle segment of a complete request message, the prohibited information is the request information and the request terminator. At this time, the exclusion information may be set as a fourth value, for example, the fourth value may be 3.
请求报文为完整请求报文时,排除信息指示禁止携带多个请求信息和多个请求结束符。此时,排除信息可以设置为第五数值,示例性的,第五数值可以4。When the request message is a complete request message, the exclusion information indicates that it is forbidden to carry multiple request information and multiple request terminators. At this time, the exclusion information may be set to a fifth value, for example, the fifth value may be 4.
在上述步骤S702中,授权服务器可以根据来自客户端设备的需求信息确定请求报文的相关信息,从而设置排除信息。例如需求信息指示建立TCP连接时,请求报文用于建立目标资源对应的TCP连接,排除信息可以设置为第一数值;需求信息指示完整请求报文分段时,起始分段对应的排除信息可以设置为第二数值等。In the above step S702, the authorization server may determine the relevant information of the request message according to the requirement information from the client device, so as to set the exclusion information. For example, when the demand information indicates the establishment of a TCP connection, the request message is used to establish the TCP connection corresponding to the target resource, and the exclusion information can be set to the first value; when the demand information indicates a complete request message segment, the exclusion information corresponding to the initial segment Can be set to a second value, etc.
可选的,基于上述令牌描述,访问控制策略的执行点还可以根据有效期限、检查策略、排除信息等进行进一步验证。示例性的,以访问控制策略的执行点为网关设备为例,图14为一种网关设备的验证流程,如图14所示,该验证流程包括如下步骤:Optionally, based on the token description above, the execution point of the access control policy can be further verified according to the validity period, inspection policy, and exclusion information. Exemplarily, taking the execution point of the access control policy as the gateway device as an example, Figure 14 is a verification process of the gateway device, as shown in Figure 14, the verification process includes the following steps:
S1401、确定请求报文中的目的端口是否为目标协议对应的端口。S1401. Determine whether the destination port in the request message is a port corresponding to the target protocol.
其中,目标协议为当前正在进行访问控制的协议,例如可以为HTTP协议或FTP协议,当然也可以为其他传输协议,本申请对此不作具体限定。Wherein, the target protocol is a protocol currently undergoing access control, such as HTTP protocol or FTP protocol, and of course other transmission protocols, which are not specifically limited in this application.
可选的,若目的端口为目标协议对应的端口,执行下述步骤S1402;若目的端口不是目标协议对应的端口,执行其他访问控制流程,对于其他访问控制流程,本申请不予限制,在此不予赘述。Optionally, if the destination port is a port corresponding to the target protocol, perform the following step S1402; if the destination port is not a port corresponding to the target protocol, perform other access control procedures. For other access control procedures, this application does not limit, here I won't go into details.
S1402、确定请求报文中是否携带目标令牌。S1402. Determine whether the request message carries the target token.
可选的,若请求报文中携带目标令牌,执行下述步骤S1403;若请求报文中不携带令牌,丢弃该请求报文。Optionally, if the request message carries the target token, perform the following step S1403; if the request message does not carry the token, discard the request message.
S1403、确定目标令牌是否过期。S1403. Determine whether the target token is expired.
可选的,网关设备可以从令牌描述中获取目标令牌的有效期限,从而根据目标令牌的有效期限,确定目标令牌是否过期。本申请以目标令牌未过期进行说明。Optionally, the gateway device may acquire the valid period of the target token from the token description, so as to determine whether the target token has expired according to the valid period of the target token. This application assumes that the target token has not expired.
可选的,若目标令牌未过期,执行图15所示的令牌合法性检查子流程;若目标令牌已过期,丢弃该请求报文。Optionally, if the target token has not expired, execute the token validity checking sub-process shown in Figure 15; if the target token has expired, discard the request message.
S1404、根据令牌合法性检查子流程的输出,确定目标令牌是否合法。S1404. Determine whether the target token is legal according to the output of the token validity checking sub-process.
可选的,令牌合法性检查子流程的输出第一结果时,目标令牌合法;令牌合法性检查子流程的输出第二结果时,目标令牌不合法。示例性的,第一结果可以表示为Y,第二结果可以表示为N。Optionally, when the token legality checking sub-process outputs the first result, the target token is legal; when the token legality checking sub-process outputs the second result, the target token is invalid. Exemplarily, the first result may be expressed as Y, and the second result may be expressed as N.
可选的,若目标令牌合法,执行下述步骤S1405;若目标令牌不合法,丢弃该请求报文,或者通过第一路径向数据服务器转发请求报文,或者在请求报文中添加标签后向数据服务器转发,可参考上述步骤S706中的相关说明,在此不再赘述。Optionally, if the target token is legal, perform the following step S1405; if the target token is invalid, discard the request message, or forward the request message to the data server through the first path, or add a label to the request message After forwarding to the data server, you can refer to the relevant description in the above step S706, and will not repeat it here.
S1405、向数据服务器转发请求报文。可参考上述步骤S707中的相关说明,在此不再赘述。S1405. Forward the request message to the data server. Reference may be made to relevant descriptions in the above step S707, which will not be repeated here.
可选的,如图15所示,令牌合法性检查子流程包括如下步骤:Optionally, as shown in Figure 15, the token validity checking sub-process includes the following steps:
S1501、确定是否信任目标资源的请求方。S1501. Determine whether to trust the requester of the target resource.
可选的,网关设备可以根据令牌描述中的检查策略确定是否信任目标资源的请求方。例如,在检查策略设置为0时,确定信任目标资源的请求方;在检查策略设置为1时,确定不信任目标资源的请求方。Optionally, the gateway device may determine whether to trust the requester of the target resource according to the check policy in the token description. For example, when the check policy is set to 0, it is determined to trust the requester of the target resource; when the check policy is set to 1, it is determined not to trust the requester of the target resource.
可选的,若不信任目标资源的请求方,执行下述步骤S1502;若信任目标资源的请求方,执行下述步骤S1503。Optionally, if the requester of the target resource is not trusted, perform the following step S1502; if the requester of the target resource is trusted, perform the following step S1503.
S1502、根据排除信息进行请求报文的合法性检查。S1502. Check the validity of the request message according to the exclusion information.
可选的,请求报文不携带排除信息指示的禁止携带的信息时,确定请求报文合法;请求报文携带有禁止携带的信息时,请求报文不合法,可以丢弃该请求报文。Optionally, if the request message does not carry the prohibited information indicated by the exclusion information, it is determined that the request message is legal; if the request message carries the prohibited information, the request message is invalid, and the request message can be discarded.
可选的,如图15所示,排除信息为第一数值时,执行步骤S15021;排除信息为第二数值时,执行步骤S15022;排除信息为第三数值时,执行步骤S15023;排除信息为第四数值时,执行步骤S15024;排除信息为第五数值时,执行步骤S15025。Optionally, as shown in Figure 15, when the exclusion information is the first value, execute step S15021; when the exclusion information is the second value, execute step S15022; when the exclusion information is the third value, execute step S15023; When the value is four, execute step S15024; when the exclusion information is the fifth value, execute step S15025.
S15021、检查请求报文是否携带负载。S15021. Check whether the request packet carries a payload.
可选的,请求报文不携带负载时,继续执行下述步骤S1503;请求报文携带负载时,可以丢弃该请求报文。Optionally, if the request packet does not carry a payload, continue to perform the following step S1503; if the request packet carries a payload, the request packet may be discarded.
S15022、检查请报文是否携带请求结束符。S15022. Check whether the request message carries a request terminator.
可选的,请求报文不携请求结束符时,继续执行下述步骤S1503;请求报文携带请求结束符时,可以丢弃该请求报文。Optionally, if the request message does not carry a request terminator, continue to perform the following step S1503; if the request message carries a request terminator, the request message may be discarded.
S15023、检查请报文是否携带请求信息。S15023. Check whether the request message carries request information.
可选的,请求报文不携请求信息时,继续执行下述步骤S1503;请求报文携带请求信息时,可以丢弃该请求报文。Optionally, if the request message does not carry the request information, continue to perform the following step S1503; if the request message carries the request information, the request message may be discarded.
S15024、检查请报文是否携带请求信息和请求结束符。S15024. Check whether the request message carries request information and a request terminator.
可选的,请求报文不携请求信息和请求结束符时,继续执行下述步骤S1503;请求报文携带请求信息或请求结束符时,可以丢弃该请求报文。Optionally, if the request message does not carry the request information and the request terminator, continue to perform the following step S1503; if the request message carries the request information or the request terminator, the request message may be discarded.
S15025、检查请报文是否携带多个请求信息和多个请求结束符。S15025. Check whether the request message carries multiple request information and multiple request terminators.
可选的,请求报文携带单个请求信息和单个请求结束符时,继续执行下述步骤S1503;请求报文携带多个请求信息或多个请求结束符时,可以丢弃该请求报文。Optionally, when the request message carries a single request information and a single request terminator, continue to perform the following step S1503; when the request message carries multiple request information or multiple request terminators, the request message can be discarded.
S1503、根据授权向量从请求报文中提取目标信息。提取目标信息后,可以继续执行下述步骤S1504。S1503. Extract target information from the request packet according to the authorization vector. After the target information is extracted, the following step S1504 can be continued.
S1504、根据令牌描述、目标信息、以及密码散列函数生成第二授权码。S1504. Generate a second authorization code according to the token description, target information, and cryptographic hash function.
可选的,密码散列函数的相关信息可以是根据令牌描述中的密码套件确定的。该步骤S1504的具体实现可参考上述步骤S706中的相关描述,在此不再赘述。Optionally, the relevant information of the cryptographic hash function may be determined according to the cryptographic suite in the token description. For the specific implementation of step S1504, reference may be made to the relevant description in the above-mentioned step S706, which will not be repeated here.
S1505、确定第一授权码和第二授权码是否相同。S1505. Determine whether the first authorization code is the same as the second authorization code.
可选的,第一授权码和第二授权相同时,输出第一结果并返回图14所示的流程;第一授权码和第二授权码不同时,输出第二结果并返回图14所示的流程。图15中以第一结果表示为Y,第二结果表示为N为例进行说明。Optionally, when the first authorization code is the same as the second authorization, output the first result and return to the process shown in Figure 14; when the first authorization code is different from the second authorization code, output the second result and return to the process shown in Figure 14 process. In FIG. 15 , the first result is expressed as Y and the second result is expressed as N as an example for illustration.
基于该方案,通过有效期检查,能够防止非法用户使用过期的令牌发送请求。根据排除信息的检查,能够防止非法用户使用合法的令牌发送非法请求,例如防止非法用户使用TCP连接令牌发送HTTP请求,从而进行更为严格的访问控制,提高网络安全性。Based on this scheme, by valid period checking, illegal users can be prevented from using expired tokens to send requests. According to the inspection of exclusion information, it can prevent illegal users from sending illegal requests using legal tokens, such as preventing illegal users from sending HTTP requests using TCP connection tokens, so as to implement stricter access control and improve network security.
在上述访问控制方法中,令牌的使用涉及到应用层与网络层的信息交互与配合,现有的网络模型可能不再适用。例如在网络层携带令牌时,令牌的申请主要由应用层实现,令牌的 应用(如嵌入报文)主要由网络层实现,应用层和网络层需要进行交互以使得网络层正确地将令牌嵌入报文,例如应用层需要向网络层指示TCP连接、完整请求报文、完整请求报文的各个分段所对应的令牌。基于此,本申请下述实施例将提供示例性的部署方式,以支持本申请方案的实现。In the above access control method, the use of tokens involves information interaction and cooperation between the application layer and the network layer, and the existing network model may no longer be applicable. For example, when the token is carried at the network layer, the token application is mainly implemented by the application layer, and the application of the token (such as embedding a message) is mainly implemented by the network layer. The application layer and the network layer need to interact so that the network layer correctly The token is embedded in the message, for example, the application layer needs to indicate to the network layer the token corresponding to the TCP connection, the complete request message, and each segment of the complete request message. Based on this, the following embodiments of the present application will provide an exemplary deployment manner to support the realization of the solution of the present application.
可选的,如图16所示,可以采用如下三种部署方式实现:1)、基于请求代理中间件的部署;2)、基于专用浏览器部署;3)、基于请求代理部署。Optionally, as shown in FIG. 16 , the following three deployment methods can be adopted: 1) deployment based on request proxy middleware; 2) deployment based on a dedicated browser; 3) deployment based on request proxy.
在第一种部署方式中,客户端设备中可以部署现有的通用浏览器和请求代理中间件,由请求代理中间件实现令牌代理申请和使用的功能。例如,实现令牌申请信息的发送、资源与令牌的对应关系的建立、请求报文的分割与队列排序、前向代理、将令牌嵌入请求报文等功能。In the first deployment mode, the existing general browser and request proxy middleware can be deployed in the client device, and the request proxy middleware realizes the functions of token proxy application and use. For example, realize the sending of token application information, the establishment of the corresponding relationship between resources and tokens, the segmentation and queue sorting of request messages, forward proxy, and the embedding of tokens into request messages, etc.
示例性的,以进行HTTP的访问控制,访问控制策略的执行点为网关设备为例,基于请求代理中间件的部署方式的实现流程可以如图17所示:Exemplarily, taking HTTP access control and the execution point of the access control policy as the gateway device as an example, the implementation process of the deployment method based on the request proxy middleware can be shown in Figure 17:
请求代理中间件在启动时设置浏览器代理,生成自签名证书后,向浏览器下发自签名证书。其中,请求代理中间件每次启动后可以重新生成自签名证书。The request proxy middleware sets the browser proxy at startup, generates a self-signed certificate, and then issues a self-signed certificate to the browser. Among them, the request proxy middleware can regenerate the self-signed certificate after each startup.
浏览器收到自签名证书后,将自签名证书添加到浏览器或系统信任证书列表,并使用用户名密码登录代理。After the browser receives the self-signed certificate, it adds the self-signed certificate to the browser or system trust certificate list, and uses the username and password to log in to the agent.
用户登录后,请求代理中间件建立到授权服务器的连接。示例性的,请求代理中间件可以内置授权服务器认可证书,并向授权服务器加密发送请求代理中间件、客户端设备、用户的相关信息。授权服务器可以验证请求代理中间、客户端设备、用户的合法性,验证通过后,建立与请求代理中间件之间的连接。After the user logs in, the proxy middleware is requested to establish a connection to the authorization server. Exemplarily, the request proxy middleware may have a built-in authorization server to approve the certificate, and encrypt and send relevant information of the request proxy middleware, the client device, and the user to the authorization server. The authorization server can verify the legitimacy of the request agent middleware, the client device, and the user, and establish a connection with the request agent middleware after passing the verification.
随后,浏览器向请求代理中间件发送HTTP请求。请代理中间件收到HTTP请求后,若HTTP请求的大小大于TCP包的最大分段大小(maximum segment size,MSS),请求代理中间件对接收到的HTTP请求进行分段并建立请求队列。若HTTP请求的大小小于TCP包的MSS大小,不进行分段。Subsequently, the browser sends an HTTP request to the request proxy middleware. After the proxy middleware receives the HTTP request, if the size of the HTTP request is greater than the maximum segment size (MSS) of the TCP packet, the proxy middleware is requested to segment the received HTTP request and build a request queue. If the size of the HTTP request is smaller than the MSS size of the TCP packet, no segmentation is performed.
此外,请代理中间件可以从HTTP请求中提取令牌申请信息中包括的参数,例如网络层信息、传输层信息、应用层信息等,随后向授权服务器发送令牌申请信息。授权服务器收到令牌申请信息后生成目标令牌,并向请求代理中间件返回目标令牌。该目标令牌可以包括TCP连接令牌和A_Token,或者可以包括TCP连接令牌、S_Token、M_Token、和E_Token。请求代理中间件接收到目标令牌后,建立资源与令牌的对应关系。In addition, the proxy middleware can extract the parameters included in the token application information from the HTTP request, such as network layer information, transport layer information, application layer information, etc., and then send the token application information to the authorization server. The authorization server generates the target token after receiving the token application information, and returns the target token to the request proxy middleware. The target token may include a TCP connection token and A_Token, or may include a TCP connection token, S_Token, M_Token, and E_Token. After receiving the target token, the request proxy middleware establishes the corresponding relationship between resources and tokens.
之后,请求代理中间件向数据服务器发起TCP连接请求,在该TCP连接请求中携带TCP连接令牌。网关设备验证令牌合法后向数据服务器转发该TCP连接请求。数据服务器接受并建立TCP连接。Afterwards, the request proxy middleware initiates a TCP connection request to the data server, and the TCP connection request carries a TCP connection token. The gateway device forwards the TCP connection request to the data server after verifying that the token is legal. The data server accepts and establishes a TCP connection.
TCP连接建立完成后,请求代理中间件按照请求队列的队列顺序发起HTTP请求,并在HTTP请求中携带相应的令牌,例如在进行了HTTP分段的情况下,根据HTTPSeg在请求中嵌入相应的令牌。网关设备验证令牌合法后向数据服务器转发HTTP请求。数据服务器响应该请求。请求代理中间件收到数据服务器的响应后向浏览器发送该响应,浏览器接收并解析响应。After the TCP connection is established, the request proxy middleware initiates HTTP requests according to the queue order of the request queue, and carries the corresponding token in the HTTP request. For example, in the case of HTTP segmentation, embed the corresponding token in the request according to HTTPSeg token. The gateway device forwards the HTTP request to the data server after verifying that the token is valid. The data server responds to the request. After receiving the response from the data server, the request proxy middleware sends the response to the browser, and the browser receives and parses the response.
由上所述,请求代理中间件同时具有应用层与网络层的操作逻辑,可以在收到应用层的请求报文时,查询对应的令牌并调用底层网络应用程序接口(application program interface,API)或原始套接字,将令牌嵌入请求报文中发送。As mentioned above, the request proxy middleware has the operation logic of the application layer and the network layer at the same time. When receiving the request message from the application layer, it can query the corresponding token and call the underlying network application program interface (application program interface, API ) or raw sockets, and send the token embedded in the request message.
在第二种部署方式中,可以开发专用浏览器部署于客户端设备中,使得该专用浏览器原 生支持上述请求代理中间的功能。以HTTP为例,专用浏览器需要解析用户请求构造HTTP请求,并能提取相关参数向授权服务器申请令牌。收到授权令牌后,选择与HTTP请求对应的令牌作为参数,直接调用底层网络API或原始套接字构造HTTP请求的网络层数据包,将相应的令牌嵌入到包头中,随后发送至网络中。In the second deployment mode, a dedicated browser can be developed and deployed in the client device, so that the dedicated browser natively supports the above-mentioned functions in the middle of the request agent. Taking HTTP as an example, a dedicated browser needs to parse the user request to construct an HTTP request, and can extract relevant parameters to apply for a token from the authorization server. After receiving the authorization token, select the token corresponding to the HTTP request as a parameter, directly call the underlying network API or raw socket to construct the network layer data packet of the HTTP request, embed the corresponding token into the packet header, and then send it to in the network.
在第三种部署方式中,可以在客户端设备中部署现有的通用浏览器,另外独立于客户端设备部署请求代理,该请代理的功能与上述请求代理中间件类似。也就是说,将请求代理中间件的功能部署于独立的设备或代理服务器上,而不是部署在客户端设备中。需要注意的是,该部署方式中,浏览器和请求代理之间需要建立远程TCP连接。In the third deployment mode, an existing general browser can be deployed in the client device, and a request proxy is deployed independently of the client device. The function of the request proxy is similar to the above-mentioned request proxy middleware. That is to say, the function of the request proxy middleware is deployed on an independent device or proxy server instead of being deployed in the client device. It should be noted that in this deployment method, a remote TCP connection needs to be established between the browser and the request agent.
可选的,该部署方式可以应用于客户端设备无法安装专用浏览器或请求代理中间件的场景,例如,应用于客户端设备为资源受限的IoT节点、代理与上层应用分离的云中心等场景。Optionally, this deployment method can be applied to scenarios where the client device cannot install a dedicated browser or request proxy middleware, for example, the client device is an IoT node with limited resources, or a cloud center where the agent is separated from the upper-layer application, etc. Scenes.
可以理解的,上述三种部署方式仅是示例性的说明,对本申请提供的访问控制方法不构成任何限定。在实际使用时,也可以采用其他部署方式,不予限制。It can be understood that the above three deployment modes are only exemplary descriptions, and do not constitute any limitation to the access control method provided in this application. In actual use, other deployment methods may also be adopted without limitation.
可以理解的是,以上各个实施例中,由各个设备实现的方法和/或步骤,也可以由可用于该设备的部件(例如处理器、芯片、芯片系统、电路、逻辑模块、或软件)实现。It can be understood that, in each of the above embodiments, the methods and/or steps implemented by each device may also be implemented by components (such as processors, chips, chip systems, circuits, logic modules, or software) that can be used in the device .
上述主要从各个设备之间交互的角度对本申请提供的方案进行了介绍。相应的,本申请还提供了通信装置,该通信装置用于实现上述各种方法。The foregoing mainly introduces the solution provided by the present application from the perspective of interaction between various devices. Correspondingly, the present application also provides a communication device, which is used to implement the above various methods.
可以理解的是,为了实现上述实施例中的功能,该通信装置包括了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本申请中所公开的实施例描述的各示例的单元及方法步骤,本申请能够以硬件或硬件和计算机软件相结合的形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用场景和设计约束条件。It can be understood that, in order to realize the functions in the foregoing embodiments, the communication device includes hardware structures and/or software modules corresponding to each function. Those skilled in the art should easily realize that the present application can be implemented in the form of hardware or a combination of hardware and computer software with reference to the units and method steps of the examples described in the embodiments disclosed in the present application. Whether a certain function is executed by hardware or computer software drives the hardware depends on the specific application scenario and design constraints of the technical solution.
图18和图19为本申请的实施例提供的可能的通信装置的结构示意图。这些通信装置可以用于实现上述方法实施例中授权服务器、网关设备、客户端设备、或数据服务器的功能,因此也能实现上述方法实施例所具备的有益效果。在本申请的实施例中,该通信装置可以是如图6a所示的授权服务器、网关设备、客户端设备、或数据服务器,还可以是授权服务器、网关设备、客户端设备、或数据服务器的模块(如芯片)。FIG. 18 and FIG. 19 are schematic structural diagrams of possible communication devices provided by the embodiments of the present application. These communication devices can be used to realize the functions of the authorization server, the gateway device, the client device, or the data server in the above method embodiments, so the beneficial effects of the above method embodiments can also be realized. In the embodiment of the present application, the communication device may be an authorization server, a gateway device, a client device, or a data server as shown in FIG. 6a, and may also be an authorization server, a gateway device, a client device, or a Modules (such as chips).
如图18所示,通信装置180包括处理模块1801和收发模块1802。通信装置180用于实现上述方法实施例中授权服务器、网关设备、客户端设备、或数据服务器的功能。As shown in FIG. 18 , the communication device 180 includes a processing module 1801 and a transceiver module 1802 . The communication device 180 is configured to realize functions of an authorization server, a gateway device, a client device, or a data server in the foregoing method embodiments.
当通信装置180用于实现上述方法实施例中授权服务器的功能时:When the communication device 180 is used to realize the function of the authorization server in the above method embodiment:
收发模块1802,用于接收来自客户端设备的令牌申请信息,该令牌申请信息用于申请目标令牌;A transceiver module 1802, configured to receive token application information from a client device, where the token application information is used to apply for a target token;
处理模块1801,用于根据令牌申请信息,生成目标令牌,目标令牌包括令牌描述和第一授权码,令牌描述包括授权向量,授权向量指示目标信息,第一授权码是根据令牌描述、目标信息、以及密码散列函数生成的;The processing module 1801 is configured to generate a target token according to the token application information, the target token includes a token description and a first authorization code, the token description includes an authorization vector, the authorization vector indicates the target information, and the first authorization code is based on the order card description, target information, and a cryptographic hash function;
收发模块1802,还用于向客户端设备发送目标令牌。The transceiver module 1802 is also configured to send the target token to the client device.
可选的,处理模块1801,用于根据令牌申请信息生成目标令牌,包括:处理模块1801,用于根据令牌申请信息中的请求方描述信息,确定请求方的访问权限;处理模块1801,还用于根据请求方的访问权限,确定授权请求起始符。Optionally, the processing module 1801 is configured to generate the target token according to the token application information, including: the processing module 1801 is configured to determine the access authority of the requester according to the requester description information in the token application information; the processing module 1801 , which is also used to determine the authorization request initiator according to the requester's access rights.
当通信装置180用于实现上述方法实施例中网关设备的功能时:When the communication device 180 is used to implement the functions of the gateway device in the above method embodiments:
收发模块1802,用于接收来自客户端设备的请求报文,该请求报文包括目标令牌和目标信息,目标令牌包括令牌描述和第一授权码,令牌描述包括授权向量,授权向量指示目标信 息;The transceiver module 1802 is configured to receive a request message from a client device, the request message includes a target token and target information, the target token includes a token description and a first authorization code, the token description includes an authorization vector, and the authorization vector Indicate target information;
处理模块1801,用于根据令牌描述、目标信息、以及秘钥散列函数生成第二授权码;A processing module 1801, configured to generate a second authorization code according to the token description, target information, and key hash function;
第二授权码与第一授权码相同时,收发模块1802,还用于网关设备向数据服务器转发请求报文。When the second authorization code is the same as the first authorization code, the transceiver module 1802 is also used for the gateway device to forward the request message to the data server.
可选的,处理模块1801,还用于根据目标令牌的有效期限,确定目标令牌未过期。Optionally, the processing module 1801 is further configured to determine that the target token has not expired according to the validity period of the target token.
可选的,处理模块1801,还用于根据检查策略确定信任目标资源的请求方;或者,处理模块1801,还用于根据检查策略确定不信任目标资源的请求方,并根据排除信息确定请求报文合法。Optionally, the processing module 1801 is further configured to determine the requester of the trusted target resource according to the inspection policy; or, the processing module 1801 is further configured to determine the requester of the untrusted target resource according to the inspection policy, and determine the requester of the requester according to the exclusion information. The text is legal.
可选的,处理模块1801,还用于根据排除信息确定请求报文合法,包括:处理模块1801,还用于在请求报文不携带禁止携带的信息时,确定请求报文合法。Optionally, the processing module 1801 is further configured to determine that the request message is legal according to the exclusion information, including: the processing module 1801 is further configured to determine that the request message is legal when the request message does not carry information prohibited from being carried.
可选的,处理模块1801,还用于根据授权向量,从请求报文中提取目标信息。Optionally, the processing module 1801 is further configured to extract target information from the request message according to the authorization vector.
当通信装置180用于实现上述方法实施例中客户端设备的功能时:When the communication device 180 is used to implement the functions of the client device in the above method embodiments:
收发模块1802,用于向授权服务器发送令牌申请信息,令牌申请信息用于申请目标令牌;Transceiver module 1802, configured to send token application information to the authorization server, where the token application information is used to apply for a target token;
处理模块1801,用于获取目标令牌,目标令牌包括令牌描述和第一授权码,令牌描述包括授权向量,授权向量指示目标信息,第一授权码是根据令牌描述、目标信息、以及密码散列函数生成的;The processing module 1801 is used to acquire a target token, the target token includes a token description and a first authorization code, the token description includes an authorization vector, the authorization vector indicates target information, and the first authorization code is based on the token description, target information, and generated by cryptographic hash functions;
收发模块1802,还用于发送请求报文,请求报文包括目标令牌和目标信息。The transceiver module 1802 is also configured to send a request message, where the request message includes the target token and target information.
可选的,处理模块1801,用于获取目标令牌,包括:处理模块1801,用于根据目标资源对应的授权请求起始符、以及授权请求起始符和令牌的对应关系,查找目标令牌。Optionally, the processing module 1801 is used to obtain the target token, including: the processing module 1801 is used to search for the target token according to the authorization request initiator corresponding to the target resource and the corresponding relationship between the authorization request initiator and the token. Card.
其中,有关上述处理模块1801和收发模块1802更详细的描述可以直接参考图7所示的方法实施例中相关描述直接得到,这里不加赘述。Wherein, more detailed descriptions about the processing module 1801 and the transceiver module 1802 can be directly obtained by referring to the relevant descriptions in the method embodiment shown in FIG. 7 , and will not be repeated here.
如图19所示,通信装置190包括一个或多个处理器1901,通信线路1902,以及至少一个通信接口(图19中仅是示例性的以包括通信接口1904,以及一个处理器1901为例进行说明),可选的,还可以包括存储器1903。As shown in FIG. 19, the communication device 190 includes one or more processors 1901, communication lines 1902, and at least one communication interface (in FIG. description), optionally, a memory 1903 may also be included.
处理器1901,主要用于对通信协议以及通信数据进行处理,以及对整个通信装置进行控制,执行软件程序,处理软件程序的数据。处理器可以是一个通用中央处理器(central processing unit,CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC)。The processor 1901 is mainly used to process communication protocols and communication data, control the entire communication device, execute software programs, and process data of the software programs. The processor can be a general-purpose central processing unit (central processing unit, CPU), a microprocessor, or an application-specific integrated circuit (application-specific integrated circuit, ASIC).
通信线路1902可以用于通信装置190包括的不同组件之间的通信。The communication line 1902 may be used for communication between different components included in the communication device 190 .
通信接口1904可以是收发器、收发机一类的装置;收发器可以包括射频电路和天线,射频电路主要用于基带信号与射频信号的转换以及对射频信号的处理。天线主要用于收发电磁波形式的射频信号。或者,所述通信接口1904可以是位于处理器1901内的收发电路,用以实现处理器的信号输入和信号输出。The communication interface 1904 may be a transceiver or a device such as a transceiver; the transceiver may include a radio frequency circuit and an antenna, and the radio frequency circuit is mainly used for converting baseband signals to radio frequency signals and processing radio frequency signals. Antennas are mainly used to send and receive radio frequency signals in the form of electromagnetic waves. Alternatively, the communication interface 1904 may be a transceiver circuit located in the processor 1901 to realize signal input and signal output of the processor.
存储器1903主要用于存储软件程序和数据。可以是具有存储功能的装置。例如可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过通信线路 1902与处理器相连接。存储器也可以和处理器集成在一起。The memory 1903 is mainly used to store software programs and data. It may be a device with a storage function. For example, it can be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (random access memory, RAM) or other types of memory that can store information and instructions A dynamic storage device can also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage ( including compact discs, laser discs, optical discs, digital versatile discs, blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program code in the form of instructions or data structures and can be stored by a computer Any other medium, but not limited to. The memory may exist independently and be connected to the processor through the communication line 1902. Memory can also be integrated with the processor.
在具体实现中,作为一种实施例,处理器1901可以包括一个或多个CPU,例如图19中的CPU0和CPU1。In a specific implementation, as an example, the processor 1901 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 19 .
在具体实现中,作为一种实施例,通信装置190可以包括多个处理器,例如图19中的处理器1901和处理器1908。这些处理器中的每一个可以是一个单核(single-core)处理器,也可以是一个多核(multi-core)处理器。这里的处理器可以包括但不限于以下至少一种:中央处理单元(central processing unit,CPU)、微处理器、数字信号处理器(DSP)、微控制器(microcontroller unit,MCU)、或人工智能处理器等各类运行软件的计算设备,每种计算设备可包括一个或多个用于执行软件指令以进行运算或处理的核。In a specific implementation, as an embodiment, the communication device 190 may include multiple processors, for example, the processor 1901 and the processor 1908 in FIG. 19 . Each of these processors may be a single-core processor or a multi-core processor. The processor here may include but not limited to at least one of the following: central processing unit (central processing unit, CPU), microprocessor, digital signal processor (DSP), microcontroller (microcontroller unit, MCU), or artificial intelligence Various types of computing devices that run software such as processors, each computing device may include one or more cores for executing software instructions to perform calculations or processing.
在具体实现中,作为一种实施例,通信装置190还可以包括输出设备1905和输入设备1906。输出设备1905和处理器1901通信,可以以多种方式来显示信息。例如,输出设备1905可以是液晶显示器(liquid crystal display,LCD),发光二极管(light emitting diode,LED)显示设备,阴极射线管(cathode ray tube,CRT)显示设备,或投影仪(projector)等。输入设备1906和处理器1901通信,可以以多种方式接收用户的输入。例如,输入设备1906可以是鼠标、键盘、触摸屏设备或传感设备等。In a specific implementation, as an example, the communication device 190 may further include an output device 1905 and an input device 1906 . Output device 1905 is in communication with processor 1901 and can display information in a variety of ways. For example, the output device 1905 may be a liquid crystal display (liquid crystal display, LCD), a light emitting diode (light emitting diode, LED) display device, a cathode ray tube (cathode ray tube, CRT) display device, or a projector (projector), etc. The input device 1906 communicates with the processor 1901 and can receive user input in various ways. For example, the input device 1906 may be a mouse, a keyboard, a touch screen device, or a sensory device, among others.
需要说明的是,图19中示出的组成结构并不构成对该通信装置的限定,除图19所示部件之外,该通信装置可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It should be noted that the composition structure shown in FIG. 19 does not constitute a limitation to the communication device. Except for the components shown in FIG. certain components, or a different arrangement of components. The illustrated components can be realized in hardware, software or a combination of software and hardware.
当通信装置190用于实现图所示的方法实施例时,处理器1901可以用于实现上述处理模块1801的功能,通信接口1904可以用于实现上述收发模块1802的功能。When the communication device 190 is used to implement the method embodiment shown in the figure, the processor 1901 may be used to implement the functions of the processing module 1801 described above, and the communication interface 1904 may be used to implement the functions of the transceiver module 1802 described above.
作为一种示例,图18中的处理模块1801的功能/实现过程可以通过图19所示的处理器1901调用存储器1903中存储的计算机执行指令来实现,图18中的收发模块1802的功能/实现过程可以通过图19所示的通信接口1904来实现。As an example, the function/implementation process of the processing module 1801 in FIG. 18 can be realized by the processor 1901 shown in FIG. The process can be implemented through the communication interface 1904 shown in FIG. 19 .
在一些实施例中,本申请还提供一种通信装置,该通信装置包括处理器,用于实现上述任一方法实施例中的方法。In some embodiments, the present application further provides a communication device, where the communication device includes a processor, configured to implement the method in any one of the foregoing method embodiments.
作为一种可能的实现方式,该通信装置还包括存储器。该存储器,用于保存必要的程序指令和数据,处理器可以调用存储器中存储的程序代码以指令该通信装置执行上述任一方法实施例中的方法。当然,存储器也可以不在该通信装置中。As a possible implementation manner, the communication device further includes a memory. The memory is used to store necessary program instructions and data, and the processor can call the program code stored in the memory to instruct the communication device to execute the method in any one of the above method embodiments. Of course, the memory may not be in the communication device.
作为另一种可能的实现方式,该通信装置还包括接口电路,该接口电路为代码/数据读写接口电路,该接口电路用于接收计算机执行指令(计算机执行指令存储在存储器中,可能直接从存储器读取,或可能经过其他器件)并传输至该处理器。As another possible implementation, the communication device further includes an interface circuit, the interface circuit is a code/data read and write interface circuit, and the interface circuit is used to receive computer-executed instructions (computer-executed instructions are stored in the memory, and may be directly read from memory read, or possibly through other devices) and transferred to the processor.
作为又一种可能的实现方式,该通信装置还包括通信接口,该通信接口用于与该通信装置之外的模块通信。As yet another possible implementation manner, the communication device further includes a communication interface, where the communication interface is used to communicate with modules other than the communication device.
可以理解的是,该通信装置可以是芯片或芯片系统,该通信装置是芯片系统时,可以由芯片构成,也可以包含芯片和其他分立器件,本申请实施例对此不作具体限定。It can be understood that the communication device may be a chip or a system-on-a-chip. When the communication device is a system-on-a-chip, it may consist of a chip, or may include a chip and other discrete devices, which is not specifically limited in this embodiment of the present application.
本申请还提供了一种计算机可读存储介质,其上存储有计算机程序或指令,该计算机程序或指令被计算机执行时实现上述任一方法实施例的功能。The present application also provides a computer-readable storage medium, on which a computer program or instruction is stored, and when the computer program or instruction is executed by a computer, the functions of any one of the above method embodiments are realized.
本申请还提供了一种计算机程序产品,该计算机程序产品被计算机执行时实现上述任一方法实施例的功能。The present application also provides a computer program product, which implements the functions of any one of the above method embodiments when executed by a computer.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件程序实现时,可以全部或部分地以计算机程序产品的形式来实现。该计算机程序产 品包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或者数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可以用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带),光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。本申请实施例中,计算机可以包括前面所述的装置。In the above embodiments, all or part of them may be implemented by software, hardware, firmware or any combination thereof. When implemented using a software program, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application will be generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server, or data center Transmission to another website site, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer, or may be a data storage device including one or more servers, data centers, etc. that can be integrated with the medium. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, or a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (solid state disk, SSD)), etc. In the embodiment of the present application, the computer may include the aforementioned apparatus.
尽管在此结合各实施例对本申请进行了描述,然而,在实施所要求保护的本申请过程中,本领域技术人员通过查看所述附图、公开内容、以及所附权利要求书,可理解并实现所述公开实施例的其他变化。在权利要求中,“包括”(comprising)一词不排除其他组成部分或步骤,“一”或“一个”不排除多个的情况。单个处理器或其他单元可以实现权利要求中列举的若干项功能。相互不同的从属权利要求中记载了某些措施,但这并不表示这些措施不能组合起来产生良好的效果。Although the present application has been described in conjunction with various embodiments here, however, in the process of implementing the claimed application, those skilled in the art can understand and Other variations of the disclosed embodiments are implemented. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude a plurality. A single processor or other unit may fulfill the functions of several items recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that these measures cannot be combined to advantage.
尽管结合具体特征及其实施例对本申请进行了描述,显而易见的,在不脱离本申请的精神和范围的情况下,可对其进行各种修改和组合。相应地,本说明书和附图仅仅是所附权利要求所界定的本申请的示例性说明,且视为已覆盖本申请范围内的任意和所有修改、变化、组合或等同物。显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Although the application has been described in conjunction with specific features and embodiments thereof, it will be apparent that various modifications and combinations can be made thereto without departing from the spirit and scope of the application. Accordingly, the specification and drawings are merely illustrative of the application as defined by the appended claims and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of this application. Obviously, those skilled in the art can make various changes and modifications to the application without departing from the spirit and scope of the application. In this way, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.
Claims (32)
- 一种访问控制方法,其特征在于,所述方法包括:An access control method, characterized in that the method comprises:授权服务器接收来自客户端设备的令牌申请信息,所述令牌申请信息用于申请目标令牌;The authorization server receives token application information from the client device, and the token application information is used to apply for a target token;所述授权服务器根据所述令牌申请信息,生成所述目标令牌,所述目标令牌包括令牌描述和第一授权码,所述令牌描述包括授权向量,所述授权向量指示目标信息,所述第一授权码是根据所述令牌描述、所述目标信息、以及密码散列函数生成的;The authorization server generates the target token according to the token application information, the target token includes a token description and a first authorization code, the token description includes an authorization vector, and the authorization vector indicates the target information , the first authorization code is generated according to the token description, the target information, and a cryptographic hash function;所述授权服务器向所述客户端设备发送所述目标令牌。The authorization server sends the target token to the client device.
- 根据权利要求1所述的方法,其特征在于,所述目标信息为待携带在所述客户端设备的请求报文中的信息。The method according to claim 1, wherein the target information is information to be carried in a request message of the client device.
- 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:The method according to claim 1 or 2, characterized in that the method further comprises:网关设备接收来自所述客户端设备的请求报文,所述请求报文包括所述目标令牌和所述目标信息;The gateway device receives a request message from the client device, where the request message includes the target token and the target information;所述网关设备根据所述令牌描述、所述目标信息、以及秘钥散列函数生成第二授权码;The gateway device generates a second authorization code according to the token description, the target information, and a key hash function;所述第二授权码与所述第一授权码相同时,所述网关设备向数据服务器转发所述请求报文。When the second authorization code is the same as the first authorization code, the gateway device forwards the request message to the data server.
- 根据权利要求1-3任一项所述的方法,其特征在于,所述授权向量包括偏移值和长度信息,所述偏移值指示所述目标信息的起始位置,所述长度信息指示所述目标信息的长度;The method according to any one of claims 1-3, wherein the authorization vector includes an offset value and length information, the offset value indicates the starting position of the target information, and the length information indicates the length of the target message;或者,所述授权向量包括比特位图,所述比特位图指示承载所述目标信息的字段。Alternatively, the authorization vector includes a bitmap, and the bitmap indicates a field carrying the target information.
- 根据权利要求1-4任一项所述的方法,其特征在于,所述目标信息包括以下至少一项:目标资源对应的网络层信息、传输层信息、授权请求起始符、请求结束符、请求方描述信息、或响应方描述信息,所述目标资源为所述客户端设备待访问的资源。The method according to any one of claims 1-4, wherein the target information includes at least one of the following: network layer information corresponding to the target resource, transport layer information, authorization request initiator, request end identifier, The requester description information or the responder description information, the target resource is the resource to be accessed by the client device.
- 根据权利要求5所述的方法,其特征在于,所述授权请求起始符包括请求信息和所述目标资源的部分或全部统一资源定位符URL前缀,所述请求信息指示与所述目标资源相关的操作。The method according to claim 5, wherein the authorization request initiator includes request information and part or all of the Uniform Resource Locator URL prefix of the target resource, and the request information indicates that it is related to the target resource operation.
- 根据权利要求5或6所述的方法,其特征在于,所述网络层信息包括源互联网协议IP地址和目的IP地址;The method according to claim 5 or 6, wherein the network layer information includes a source Internet Protocol IP address and a destination IP address;所述传输层信息包括目的端口,或者,包括目的端口和源端口;The transport layer information includes a destination port, or, includes a destination port and a source port;所述请求方描述信息包括以下至少一项:所述请求方的身份信息、所述请求方的状态信息、所述请求方的组标识、所述请求方的安全等级、或所述请求方所处网络的网络类型;The requester description information includes at least one of the following: the requester's identity information, the requester's status information, the requester's group identifier, the requester's security level, or the requester's the network type of the network;所述响应方描述信息包括以下至少一项:所述响应方的组标识、所述响应方的安全等级、或所述响应方所处网络的网络类型。The responder description information includes at least one of the following: a group identifier of the responder, a security level of the responder, or a network type of a network where the responder is located.
- 根据权利要求2-7任一项所述的方法,其特征在于,所述令牌描述还包括有效期和以下至少一项:检查策略、颁发者标识、密码套件、或排除信息;The method according to any one of claims 2-7, wherein the token description further includes validity period and at least one of the following: checking policy, issuer ID, cipher suite, or exclusion information;其中,所述有效期指示所述目标令牌的有效期限;所述检查策略指示是否信任目标资源的请求方;所述颁发者标识指示颁发所述目标令牌的设备;所述密码套件指示所述密码散列函数的相关信息;所述排除信息指示禁止携带的信息。Wherein, the validity period indicates the validity period of the target token; the check policy indicates whether the requester of the target resource is trusted; the issuer ID indicates the device that issued the target token; the cipher suite indicates the Information related to cryptographic hash functions; the exclusion information indicates information that is prohibited from being carried.
- 根据权利要求8所述的方法,其特征在于,所述请求报文用于请求建立所述目标资源对应的传输控制协议TCP连接时,所述禁止携带的信息为负载;The method according to claim 8, wherein when the request message is used to request establishment of a Transmission Control Protocol TCP connection corresponding to the target resource, the prohibited information is a payload;或者,所述请求报文为完整请求报文的起始分段时,所述禁止携带的信息为请求结束符;Or, when the request message is the initial segment of a complete request message, the prohibited information is the request terminator;或者,所述请求报文为完整请求报文的末尾分段时,所述禁止携带的信息为请求信息;Or, when the request message is a segment at the end of a complete request message, the prohibited information is request information;或者,所述请求报文为完整请求报文的中间分段时,所述禁止携带的信息为请求信息和 请求结束符;Or, when the request message is an intermediate segment of a complete request message, the prohibited information is request information and a request terminator;或者,所述请求报文为完整请求报文时,所述排除信息指示禁止携带多个请求信息和多个请求结束符。Alternatively, when the request message is a complete request message, the exclusion information indicates that it is forbidden to carry multiple request information and multiple request terminators.
- 一种访问控制方法,其特征在于,所述方法包括:An access control method, characterized in that the method comprises:网关设备接收来自客户端设备的请求报文,所述请求报文包括目标令牌和目标信息,所述目标令牌包括令牌描述和第一授权码,所述令牌描述包括授权向量,所述授权向量指示所述目标信息;The gateway device receives a request message from the client device, the request message includes a target token and target information, the target token includes a token description and a first authorization code, the token description includes an authorization vector, and The authorization vector indicates the target information;所述网关设备根据所述令牌描述、所述目标信息、以及秘钥散列函数生成第二授权码;The gateway device generates a second authorization code according to the token description, the target information, and a key hash function;所述第二授权码与所述第一授权码相同时,所述网关设备向数据服务器转发所述请求报文。When the second authorization code is the same as the first authorization code, the gateway device forwards the request message to the data server.
- 根据权利要求10所述的方法,其特征在于,所述授权向量包括偏移值和长度信息,所述偏移值指示所述目标信息的起始位置,所述长度信息指示所述目标信息的长度;The method according to claim 10, wherein the grant vector includes an offset value and length information, the offset value indicates the starting position of the target information, and the length information indicates the length of the target information length;或者,所述授权向量包括比特位图,所述比特位图指示承载所述目标信息的字段。Alternatively, the authorization vector includes a bitmap, and the bitmap indicates a field carrying the target information.
- 根据权利要求10或11所述的方法,其特征在于,所述目标信息包括以下至少一项:目标资源对应的网络层信息、传输层信息、授权请求起始符、请求结束符、请求方描述信息、或响应方描述信息,所述目标资源为所述客户端设备待访问的资源。The method according to claim 10 or 11, wherein the target information includes at least one of the following: network layer information corresponding to the target resource, transport layer information, authorization request initiator, request end identifier, requester description Information, or responder description information, the target resource is the resource to be accessed by the client device.
- 根据权利要求12所述的方法,其特征在于,所述授权请求起始符包括请求信息和所述目标资源的部分或全部统一资源定位符URL前缀,所述请求信息指示与所述目标资源相关的操作。The method according to claim 12, wherein the authorization request initiator includes request information and part or all of the Uniform Resource Locator URL prefix of the target resource, and the request information indicates that it is related to the target resource operation.
- 根据权利要求12或13所述的方法,其特征在于,所述网络层信息包括源互联网协议IP地址和目的IP地址;The method according to claim 12 or 13, wherein the network layer information includes a source Internet Protocol IP address and a destination IP address;所述传输层信息包括目的端口,或者,包括目的端口和源端口;The transport layer information includes a destination port, or, includes a destination port and a source port;所述请求方描述信息包括以下至少一项:所述请求方的身份信息、所述请求方的状态信息、所述请求方的组标识、所述请求方的安全等级、或所述请求方所处网络的网络类型;The requester description information includes at least one of the following: the requester's identity information, the requester's status information, the requester's group identifier, the requester's security level, or the requester's the network type of the network;所述响应方描述信息包括以下至少一项:所述响应方的组标识、所述响应方的安全等级、或所述响应方所处网络的网络类型。The responder description information includes at least one of the following: a group identifier of the responder, a security level of the responder, or a network type of a network where the responder is located.
- 根据权利要求10-14任一项所述的方法,其特征在于,所述令牌描述还包括有效期和以下至少一项:检查策略、颁发者标识、密码套件、或排除信息;The method according to any one of claims 10-14, wherein the token description further includes validity period and at least one of the following: checking policy, issuer ID, cipher suite, or exclusion information;其中,所述有效期指示所述目标令牌的有效期限;所述检查策略指示是否信任目标资源的请求方;所述颁发者标识指示颁发所述目标令牌的设备;所述密码套件指示所述密码散列函数的相关信息;所述排除信息指示禁止携带的信息。Wherein, the validity period indicates the validity period of the target token; the check policy indicates whether the requester of the target resource is trusted; the issuer ID indicates the device that issued the target token; the cipher suite indicates the Information related to cryptographic hash functions; the exclusion information indicates information that is prohibited from being carried.
- 根据权利要求15所述的方法,其特征在于,所述方法还包括:The method according to claim 15, further comprising:所述网关设备根据所述目标令牌的有效期限,确定所述目标令牌未过期。The gateway device determines that the target token has not expired according to the validity period of the target token.
- 根据权利要求15或16所述的方法,其特征在于,所述方法还包括:The method according to claim 15 or 16, wherein the method further comprises:所述网关设备根据所述检查策略确定信任所述目标资源的请求方;The gateway device determines, according to the check policy, the requester that trusts the target resource;或者,所述网关设备根据所述检查策略确定不信任所述目标资源的请求方,并根据所述排除信息确定所述请求报文合法。Alternatively, the gateway device determines that the requester of the target resource is not trusted according to the inspection policy, and determines that the request message is legal according to the exclusion information.
- 根据权利要求17所述的方法,其特征在于,所述网关设备根据所述排除信息确定所述请求报文合法,包括:所述请求报文不携带所述禁止携带的信息时,所述网关设备确定所述请求报文合法。The method according to claim 17, wherein the gateway device determines that the request message is legal according to the exclusion information, comprising: when the request message does not carry the prohibited information, the gateway device The device determines that the request packet is legal.
- 根据权利要求15-18任一项所述的方法,其特征在于,所述排除信息为第一数值时, 所述禁止携带的信息为负载;The method according to any one of claims 15-18, wherein when the exclusion information is a first value, the prohibited information is payload;所述排除信息为第二数值时,所述禁止携带的信息为所述请求结束符;When the exclusion information is the second value, the prohibited information is the request terminator;所述排除信息为第三数值时,所述禁止携带的信息为所述请求信息;When the exclusion information is the third value, the prohibited information is the request information;所述排除信息为第四数值时,所述禁止携带的信息为所述请求信息和所述请求结束符;When the exclusion information is the fourth value, the prohibited information is the request information and the request terminator;所述排除信息为第五数值时,指示禁止携带多个所述请求信息和多个所述请求结束符。When the exclusion information is the fifth value, it indicates that carrying multiple request information and multiple request terminators is prohibited.
- 一种访问控制方法,其特征在于,所述方法包括:An access control method, characterized in that the method comprises:客户端设备向授权服务器发送令牌申请信息,所述令牌申请信息用于申请目标令牌;The client device sends token application information to the authorization server, and the token application information is used to apply for a target token;所述客户端设备获取所述目标令牌,所述目标令牌包括令牌描述和第一授权码,所述令牌描述包括授权向量,所述授权向量指示目标信息,所述第一授权码是根据所述令牌描述、所述目标信息、以及密码散列函数生成的;The client device acquires the target token, the target token includes a token description and a first authorization code, the token description includes an authorization vector, the authorization vector indicates target information, and the first authorization code is generated based on the token description, the target information, and a cryptographic hash function;所述客户端设备发送请求报文,所述请求报文包括所述目标令牌和所述目标信息。The client device sends a request packet, where the request packet includes the target token and the target information.
- 根据权利要求20所述的方法,其特征在于,所述授权向量包括偏移值和长度信息,所述偏移值指示所述目标信息的起始位置,所述长度信息指示所述目标信息的长度;The method according to claim 20, wherein the authorization vector includes an offset value and length information, the offset value indicates the starting position of the target information, and the length information indicates the length of the target information. length;或者,所述授权向量包括比特位图,所述比特位图指示承载所述目标信息的字段。Alternatively, the authorization vector includes a bitmap, and the bitmap indicates a field carrying the target information.
- 根据权利要求20或21所述的方法,其特征在于,所述目标信息包括以下至少一项:目标资源对应的网络层信息、传输层信息、授权请求起始符、请求结束符、请求方描述信息、或响应方描述信息,所述目标资源为所述客户端设备待访问的资源。The method according to claim 20 or 21, wherein the target information includes at least one of the following: network layer information corresponding to the target resource, transport layer information, authorization request initiator, request end identifier, requester description Information, or responder description information, the target resource is the resource to be accessed by the client device.
- 根据权利要求22所述的方法,其特征在于,所述授权请求起始符包括请求信息和所述目标资源的部分或全部统一资源定位符URL前缀,所述请求信息指示与所述目标资源相关的操作。The method according to claim 22, wherein the authorization request initiator includes request information and part or all of the Uniform Resource Locator URL prefix of the target resource, and the request information indicates that it is related to the target resource operation.
- 根据权利要求22或23所述的方法,其特征在于,所述网络层信息包括源互联网协议IP地址和目的IP地址;The method according to claim 22 or 23, wherein the network layer information includes a source Internet Protocol IP address and a destination IP address;所述传输层信息包括目的端口,或者,包括目的端口和源端口;The transport layer information includes a destination port, or, includes a destination port and a source port;所述请求方描述信息包括以下至少一项:所述请求方的身份信息、所述请求方的状态信息、所述请求方的组标识、所述请求方的安全等级、或所述请求方所处网络的网络类型;The requester description information includes at least one of the following: the requester's identity information, the requester's status information, the requester's group identifier, the requester's security level, or the requester's the network type of the network;所述响应方描述信息包括以下至少一项:所述响应方的组标识、所述响应方的安全等级、或所述响应方所处网络的网络类型。The responder description information includes at least one of the following: a group identifier of the responder, a security level of the responder, or a network type of a network where the responder is located.
- 根据权利要求22-24任一项所述的方法,其特征在于,所述客户端设备获取目标令牌,包括:The method according to any one of claims 22-24, wherein the acquiring the target token by the client device comprises:所述客户端设备根据所述目标资源对应的授权请求起始符、以及授权请求起始符和令牌的对应关系,查找所述目标令牌。The client device searches for the target token according to the authorization request initiator corresponding to the target resource and the corresponding relationship between the authorization request initiator and the token.
- 根据权利要求20-25任一项所述的方法,其特征在于,所述令牌描述还包括有效期和以下至少一项:检查策略、颁发者标识、密码套件、或排除信息;The method according to any one of claims 20-25, wherein the token description further includes validity period and at least one of the following: checking policy, issuer ID, cipher suite, or exclusion information;其中,所述有效期指示所述目标令牌的有效期限;所述检查策略指示是否信任目标资源的请求方;所述颁发者标识指示颁发所述目标令牌的设备;所述密码套件指示所述密码散列函数的相关信息;所述排除信息指示禁止携带的信息。Wherein, the validity period indicates the validity period of the target token; the check policy indicates whether the requester of the target resource is trusted; the issuer ID indicates the device that issued the target token; the cipher suite indicates the Information related to cryptographic hash functions; the exclusion information indicates information that is prohibited from being carried.
- 根据权利要求26所述的方法,其特征在于,所述请求报文用于请求建立所述目标资源对应的传输控制协议TCP连接时,所述禁止携带的信息为负载;The method according to claim 26, wherein when the request message is used to request establishment of a Transmission Control Protocol TCP connection corresponding to the target resource, the prohibited information is a payload;或者,所述请求报文为完整请求报文的起始分段时,所述禁止携带的信息为请求结束符;Or, when the request message is the initial segment of a complete request message, the prohibited information is the request terminator;或者,所述请求报文为完整请求报文的末尾分段时,所述禁止携带的信息为请求信息;Or, when the request message is a segment at the end of a complete request message, the prohibited information is request information;或者,所述请求报文为完整请求报文的中间分段时,所述禁止携带的信息为请求信息和 请求结束符;Or, when the request message is an intermediate segment of a complete request message, the prohibited information is request information and a request terminator;或者,所述请求报文为完整请求报文时,所述排除信息指示禁止携带多个请求信息和多个请求结束符。Alternatively, when the request message is a complete request message, the exclusion information indicates that it is forbidden to carry multiple request information and multiple request terminators.
- 根据权利要求20-27任一项所述的方法,其特征在于,所述令牌申请信息包括以下至少一项:目标资源对应的网络层信息、传输层信息、应用层信息、请求方描述信息、或需求信息;所述应用层信息包括以下至少一项:所述目标资源的URL、请求信息、或请求结束符;所述需求信息指示以下至少一项:期望的令牌使用时长、完整请求报文是否分段、是否建立TCP连接。The method according to any one of claims 20-27, wherein the token application information includes at least one of the following: network layer information, transport layer information, application layer information, requester description information corresponding to the target resource , or demand information; the application layer information includes at least one of the following: the URL of the target resource, request information, or request terminator; the demand information indicates at least one of the following: expected token usage time, complete request Whether the packet is segmented and whether a TCP connection is established.
- 一种通信装置,其特征在于,所述通信装置包括:处理器和存储器;A communication device, characterized in that the communication device includes: a processor and a memory;所述存储器,用于存储计算机程序或指令;said memory for storing computer programs or instructions;所述处理器,用于执行所述计算机程序或指令,以实现如权利要求1-9任一项所述的方法,或者,以实现如权利要求10-19任一项所述的方法。The processor is configured to execute the computer program or instruction to implement the method according to any one of claims 1-9, or to implement the method according to any one of claims 10-19.
- 一种通信装置,其特征在于,所述通信装置包括:处理器和存储器;A communication device, characterized in that the communication device includes: a processor and a memory;所述存储器,用于存储计算机程序或指令;said memory for storing computer programs or instructions;所述处理器,用于执行所述计算机程序或指令,以实现如权利要求20-28任一项所述的方法。The processor is configured to execute the computer program or instructions to implement the method according to any one of claims 20-28.
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机程序或指令,当所述计算机程序或指令被通信装置执行时,如权利要求1-9任一项所述的方法被实现,或者,如权利要求10-19任一项所述的方法被实现。A computer-readable storage medium, characterized in that computer programs or instructions are stored in the computer-readable storage medium, and when the computer programs or instructions are executed by a communication device, as claimed in any one of claims 1-9 The method described above is implemented, or, the method described in any one of claims 10-19 is implemented.
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机程序或指令,当所述计算机程序或指令被通信装置执行时,如权利要求20-28任一项所述的方法被实现。A computer-readable storage medium, characterized in that computer programs or instructions are stored in the computer-readable storage medium, and when the computer programs or instructions are executed by a communication device, as claimed in any one of claims 20-28 The method described above is implemented.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111223457.5A CN115996122A (en) | 2021-10-20 | 2021-10-20 | Access control method, device and system |
CN202111223457.5 | 2021-10-20 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023065969A1 true WO2023065969A1 (en) | 2023-04-27 |
Family
ID=85993053
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/120910 WO2023065969A1 (en) | 2021-10-20 | 2022-09-23 | Access control method, apparatus, and system |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN115996122A (en) |
WO (1) | WO2023065969A1 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116684074A (en) * | 2023-07-25 | 2023-09-01 | 杭州海康威视数字技术股份有限公司 | Method and device for driving multi-core scheduling algorithm of hardware password module and electronic equipment |
CN116938598A (en) * | 2023-09-14 | 2023-10-24 | 北京中科智媒融媒体技术有限公司 | Information transmission method, apparatus, electronic device, and computer-readable medium |
CN116992424A (en) * | 2023-09-28 | 2023-11-03 | 杭州行至云起科技有限公司 | Authorization code using method, device and system |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117319096B (en) * | 2023-12-01 | 2024-04-23 | 深圳市丰润达科技有限公司 | Access right management method, access right management device, and readable storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130007846A1 (en) * | 2011-07-01 | 2013-01-03 | Telefonaktiebolaget L M Ericsson (Publ) | Methods and Arrangements for Authorizing and Authentication Interworking |
US20160328707A1 (en) * | 2015-05-07 | 2016-11-10 | Kim R. Wagner | Provisioning of access credentials using device codes |
CN109472151A (en) * | 2018-10-31 | 2019-03-15 | 金蝶软件(中国)有限公司 | A kind of method and server of data access |
WO2019051839A1 (en) * | 2017-09-18 | 2019-03-21 | 华为技术有限公司 | Data processing method and device |
-
2021
- 2021-10-20 CN CN202111223457.5A patent/CN115996122A/en active Pending
-
2022
- 2022-09-23 WO PCT/CN2022/120910 patent/WO2023065969A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130007846A1 (en) * | 2011-07-01 | 2013-01-03 | Telefonaktiebolaget L M Ericsson (Publ) | Methods and Arrangements for Authorizing and Authentication Interworking |
US20160328707A1 (en) * | 2015-05-07 | 2016-11-10 | Kim R. Wagner | Provisioning of access credentials using device codes |
WO2019051839A1 (en) * | 2017-09-18 | 2019-03-21 | 华为技术有限公司 | Data processing method and device |
CN109472151A (en) * | 2018-10-31 | 2019-03-15 | 金蝶软件(中国)有限公司 | A kind of method and server of data access |
Non-Patent Citations (1)
Title |
---|
ASAFETIDA ET AL.: "Research on authentication authorization technology based on OAuth2.0", NETINFO SECURITY, vol. 2016, no. 09, 10 September 2016 (2016-09-10) * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116684074A (en) * | 2023-07-25 | 2023-09-01 | 杭州海康威视数字技术股份有限公司 | Method and device for driving multi-core scheduling algorithm of hardware password module and electronic equipment |
CN116684074B (en) * | 2023-07-25 | 2023-10-20 | 杭州海康威视数字技术股份有限公司 | Method and device for driving multi-core scheduling algorithm of hardware password module and electronic equipment |
CN116938598A (en) * | 2023-09-14 | 2023-10-24 | 北京中科智媒融媒体技术有限公司 | Information transmission method, apparatus, electronic device, and computer-readable medium |
CN116938598B (en) * | 2023-09-14 | 2023-11-24 | 北京中科智媒融媒体技术有限公司 | Information transmission method, apparatus, electronic device, and computer-readable medium |
CN116992424A (en) * | 2023-09-28 | 2023-11-03 | 杭州行至云起科技有限公司 | Authorization code using method, device and system |
CN116992424B (en) * | 2023-09-28 | 2024-02-02 | 杭州行至云起科技有限公司 | Authorization code using method, device and system |
Also Published As
Publication number | Publication date |
---|---|
CN115996122A (en) | 2023-04-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2022095730A1 (en) | Service communication method, system and apparatus, and electronic device | |
WO2023065969A1 (en) | Access control method, apparatus, and system | |
US10298610B2 (en) | Efficient and secure user credential store for credentials enforcement using a firewall | |
US10924465B2 (en) | Split authentication network systems and methods | |
US20240121211A1 (en) | Systems and methods for continuous fingerprinting to detect session hijacking inside zero trust private networks | |
CN107637038B (en) | System, apparatus and method for managing a lifecycle of a secure publish-subscribe system | |
JP6144783B2 (en) | Name / prefix augmentation based on routing protocols with trust anchors in information-centric networks | |
US11394703B2 (en) | Methods for facilitating federated single sign-on (SSO) for internal web applications and devices thereof | |
US8683607B2 (en) | Method of web service and its apparatus | |
CN105812347B (en) | Apparatus and method for facilitating receipt of verified content objects | |
CN112149105A (en) | Data processing system, method, related device and storage medium | |
US11552953B1 (en) | Identity-based authentication and access control mechanism | |
JP7096736B2 (en) | System and data processing method | |
US20230328063A1 (en) | Method for Determining Trusted Terminal and Related Apparatus | |
Ai et al. | A smart collaborative authentication framework for multi-dimensional fine-grained control | |
US11784993B2 (en) | Cross site request forgery (CSRF) protection for web browsers | |
CN115603932A (en) | Access control method, access control system and related equipment | |
Tourani et al. | Towards security-as-a-service in multi-access edge | |
WO2023279782A1 (en) | Access control method, access control system and related device | |
US20230351028A1 (en) | Secure element enforcing a security policy for device peripherals | |
Gao et al. | Bc-aka: Blockchain based asymmetric authentication and key agreement protocol for distributed 5g core network | |
WO2023078106A1 (en) | Access control method, apparatus and system for encrypted traffic | |
CN111866993B (en) | Wireless local area network connection management method, device, software program and storage medium | |
CN117278275A (en) | Access right adjustment method, device and storage medium | |
WO2022267564A1 (en) | Packet processing method and apparatus, device, system, and readable storage medium |
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: 22882580 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: 22882580 Country of ref document: EP Kind code of ref document: A1 |